This document provides information about the microcontroller PIC16F84A, including:
1) It describes what a microcontroller is and introduces the PIC16F84A microcontroller.
2) It lists the ports and pins available on the PIC16F84A, including Port A and Port B pins for input/output.
3) It provides examples of using ports as inputs to read buttons or switches, and as outputs to control LEDs.
6. karBiBN’naBIeCIg PIC16F84A
RA0, RA1, RA2, RA3, RA4 RtUv)anehAfa Port A
RB0, RB1, RB2, RB3, RB4, RB5, RB6, RB7 RtUv)anehAfa Port B
karehAfa Port A KWsMedAelIeCIgTaMgGs;rbs; Port A
karehAfa Port A Pin 0 KWsMedAelIeCIgrbs; Port A bit 0 ( eCIg RA0 )
karehAfa Port A nig Port B manlkçNdUcKña
Vdd RbPBviC¢man +5V nigVss RbPBGviC¢man 0V
10. kareRbIR)as; PORT CaRckecj( Output )
ral;eCIgnimYy²rbs; PORT A, PORT B
mantémøcrnþGtibrma 25 mA TaMgcrnþviC¢man
nigcrnþGviC¢man ( Source Current and Sink Current)
11. kartP¢ab;GMBUl LED eTAkan; PORT
CaFmµtaGMBUl LED
sIucrnþRbEhlBI 8mA eTA
16 mA nigtg;süúgRbEhl
BI 1.6V eTA 2.4V .
ebIGMBUlLEDsIucrnþ
10mA nigtg;süúg 2V
12. kareRbIR)as; PORT CaRckcUl( Input )
témøtg;süúgEdlcUleTAkan;eCIg PORT
ebItg;süúgcUlmantémøBI
2V~5V tMNageGayHigh
ebItg;süúgcUlmantémøBI
0V~0.8V tMNageGayLow
13. kartP¢ab; Button eTARckcUl( Input )
Active High PORT
+5V +5V
Low
Gt;cuc
High
cuc
Active Low PORT
High
Gt;cuc
Low
cuc
14. rebobkMnt; PORT Ca Input or Output
TRISx KWCa Register
mYysRmab;kMnt;muxgar
rbs; PORTx
TRISx = 1
PORTx as Input.
TRISx = 0
PORTx as Output.
18. sresrkmµviFIeGayGMBUlmYyebIkehIybiT²CaerogrhUt
void main()
{
Trisb = 0b00000000; // Config PortB all pin as output
Portb = 0b00000000; // Send data low to all pin of PortB
while(1)
{
Portb = 0b00000001; // Send data High to bit 0 of PortB
delay_ms(1000); // Wait 1 second
Portb =0b00000000; // Send data low to all pin of PortB
delay_ms(1000); // Wait 1 second
}
}