Preview

Pwm with Pic 16f84

Best Essays
Open Document
Open Document
426 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Pwm with Pic 16f84
#include

CBLOCK 0X0C BAND
; P_ON CONT P_OFF W_AUX S_AUX TEMP1 TEMP2 ENDC

ORG 0X00 GOTO MAIN ;-------------------INTERRUPÇÃO----------- ORG 0X04

MOVWF W_AUX SWAPF STATUS,W MOVWF S_AUX MOVLW 0XFF XORWF PORTA,1 ;INVERTE A SAIDA

CALL BANDEIRA CALL INVERTE BCF INTCON,2 SWAPF S_AUX,W MOVWF STATUS SWAPF W_AUX,F SWAPF W_AUX,W RETFIE ;-----------------MAIN----------------------
MAIN
BSF STATUS,RP0 BCF TRISA,0 ;SAÍDA PWM BCF TRISB,5 BCF TRISB,4 BSF TRISB,6 ;CONF. RB6 COMO BOTOEIRA 1 BSF TRISB,7 ;CONF. RB7 COMO BOTOEIRA 2 MOVLW 0X05 ;HABILITA PULL-UP,CONF.PRE-ESCALA P/TMR0 MOVWF OPTION_REG ; BCF STATUS,RP0 BSF PORTA,0 MOVLW 0X00 MOVWF BAND MOVLW 0XE8 MOVWF CONT

;-----------------ROTINA PRINCIPAL------------- MOVF CONT,0 MOVWF TMR0 MOVLW B'10100000' MOVWF INTCON BTFSC PORTB,6 ;BT1 PRESSIONADA? GOTO $+3 ;NÃO, CALL BT1_SIM ;SIM, GOTO $-3 CALL BT1_NAO GOTO $-5

;-----------------BT1_NAO---------------
BT1_NAO
BTFSC PORTB,7 ;BT2 PRESSIONADA? RETURN ;NAO,MANTEM CONT CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY

MOVLW 0XD6 XORWF CONT,0 BTFSC STATUS,2 GOTO $+5 BCF PORTB,5 DECF CONT,1 ;SIM,VÁ PARA DIREITA BCF PORTB,4 GOTO $+3 BSF PORTB,4 RETURN CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY RETURN

;----------------BT1_SIM--------------------
BT1_SIM
BTFSC PORTB,7 ;BT2 PRESSIONADA? GOTO $+6 ;NAO,VÁ PARA ESQUERDA BCF PORTB,4 BCF PORTB,5 MOVLW 0XE7 ;SIM,FAÇA CONT=12 MOVWF CONT RETURN

CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY CALL DELAY

You May Also Find These Documents Helpful

  • Satisfactory Essays

    W08 Quiz1

    • 1008 Words
    • 13 Pages

    Don has prepared a budget for himself. His expenses are greater than his income. Which of the following expenses would you suggest would be easiest for him to reduce his spending on?…

    • 1008 Words
    • 13 Pages
    Satisfactory Essays
  • Good Essays

    Assign 2 Adm2304 W15

    • 1186 Words
    • 5 Pages

    Due Date & Time: Must be Uploaded by Wednesday, March 4, 2015 by 23:59 hrs.…

    • 1186 Words
    • 5 Pages
    Good Essays
  • Powerful Essays

    IT299 Unit 8 Project

    • 2529 Words
    • 7 Pages

    Network topology refers to the physical layout of a network. The chosen layout directly impacts how each node on a given network communicates with another. There are multiple types of topologies that can be used based on the need of the project. The ultimate goal is to provide multiple lines of data communication which will increase fault tolerance on the network and reduce or eliminate a complete disruption of service.…

    • 2529 Words
    • 7 Pages
    Powerful Essays
  • Good Essays

    Nt2460 Unit 1 Assignment

    • 762 Words
    • 4 Pages

    These addresses are commonly used for home, office, and enterprise local area networks (LANs), when globally routable addresses are not mandatory, or are not available for the intended network applications. Under IPv4, the private IP address spaces were originally defined in an effort to delay IPv4 address exhaustion, but they are also a feature of IPv6, the next generation Internet Protocol.…

    • 762 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Ww1 Unit 4

    • 4634 Words
    • 19 Pages

    What response did the United States take in the following weeks along the West Coast?…

    • 4634 Words
    • 19 Pages
    Powerful Essays
  • Good Essays

    11 16

    • 776 Words
    • 2 Pages

    1) The interval level of measurement used in this demograpic are age, income ($), length of labor (hrs), return to work (wks), number of hours working per week.…

    • 776 Words
    • 2 Pages
    Good Essays
  • Good Essays

    *Line waiting- This little button usually will flash/beep or even both when there is a call waiting.…

    • 2522 Words
    • 11 Pages
    Good Essays
  • Satisfactory Essays

    Loudspeaker- This is so myself and others around me can hear what the clients have to say, coming through the phone rather than a headset.…

    • 1003 Words
    • 5 Pages
    Satisfactory Essays
  • Powerful Essays

    unit 8 p2 &p3

    • 2966 Words
    • 9 Pages

    ‘The Zone’ A report about all the different types of therapies of which will be used…

    • 2966 Words
    • 9 Pages
    Powerful Essays
  • Powerful Essays

    Unit 8 P1 and M1

    • 1566 Words
    • 11 Pages

    I certify that the work submitted for this assignment is my own. I have clearly referenced any sources used in the work. I understand that false declaration is a form of malpractice.…

    • 1566 Words
    • 11 Pages
    Powerful Essays
  • Satisfactory Essays

    helps make relationships between manager and worker depending on how feedback was given and received…

    • 513 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    The New England and Chesapeake colonies were both settled by English colonists. Most colonists moving from Great Britain to New England were families searching for religious salvation, rather than mostly the single men that traveled to the Chesapeake area in search of wealth. The immigrants of the Chesapeake area were greeted with a climate and soil that were perfect for cultivating tobacco, cotton, indigo, and rice. Those settling in New England could not rely on farming to support themselves because of the rocky soil in the north. While the majority of the Chesapeake colonists were not as cohesive due to the great distance from farms to these towns, New England had close-knit church events, meetings, and schools. Although, the New England and Chesapeake colonies were both settled by people at English origin, by 1700 the regions had evolved into two distinct societies because of motives, environment, and towns/communities.…

    • 1064 Words
    • 5 Pages
    Good Essays
  • Good Essays

    Dd101 Tma02

    • 1059 Words
    • 3 Pages

    What we are going to see next is the social division in a consumer society:…

    • 1059 Words
    • 3 Pages
    Good Essays
  • Satisfactory Essays

    Netw360 w4 ilab

    • 383 Words
    • 2 Pages

    Having cultural competence is something that is gained through experience with other cultures other than your own. This means understanding that different cultures do in fact exist and one must be aware that we are all different with different cultures. For me a time that I connected with a different culture in a work environment was a few years back when I was working as a driver and my assistant was an African man, very nice man, who was new to the job and I had to train him by showing him how things get done properly. When we would communicate it wasn’t that bad since he had studied the English language back home he only had some words that he couldn’t pronounce, so I would help him.…

    • 383 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    TMA01 E108

    • 748 Words
    • 2 Pages

    Scott and Jean’s Icebreaker activities serve several different purposes, the first of which being to encourage the group to come together as a whole and get to know one another. The initial activity did a fabulous job of encouraging the youngsters to introduce themselves to their peers in a fun and non intimidating way. It ‘broke the ice’ (LGBT Youth Scotland clips 2-6). If the introductions had been done with a greater amount of formality, i.e sat around a table, the young people probably would not have responded in the same way. The laughing and body language demonstrated suggests they were obviously relaxed and at ease with themselves and other members of the group but what they evidently didn’t realise was that the activity was encouraging them to practise how to communicate with each other and also listen to and remember what each other had to say. They were practising active listening. ‘It’s putting skills across, but actually not maybe the young people realising they’re actually starting those skill sets already, right from the beginning’. (LGBT Youth Scotland clips 2-6). Encouraging the young people to work together as a large group in this way ensured that everyone was involved. They weren’t all acquainted prior to this activity but communicating in this way helps them build relationships in a positive way both with the other group members but also with Scott and Jean. No-one will feel like they are excluded because they are not already part of an estalished friendship group.…

    • 748 Words
    • 2 Pages
    Good Essays