Learn microcontroller pic16f84a

575 views
409 views

Published on

Introduction to Microcontroller PIC16F84A and how to write program for Microcontroller. The program that i use to write is MikroC. You can download this program by:​http://eelibrary.wordpress.com

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
575
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
13
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Learn microcontroller pic16f84a

  1. 1. មហាវិទ្យាល័យ អគ្គិសនីMicrocontroller PIC16F84A ័បង្រៀនងោយ ហួ ជាវនតឆ្ ាំ ២០១១- ២០១២ ន
  2. 2. etIGVICa Microcontroller ? Microcontroller KWCaRbB½næRtYtBinitümYy manlkçNdUckMuBüÚT½rEdlfitenAkñúgsMbk Chip
  3. 3. rUbPaBbgðajEpñkxagkñúg Microcontroller
  4. 4. karBiBN’naBIeCIg PIC16F84A
  5. 5. karBiBN’naBIeCIg PIC16F84A= RckcUl signal= Rckecj signal= RckcUlk¾)an Rckecjk¾)anEtvaGaRs½yelIkarsresr Code
  6. 6. karBiBN’naBIeCIg PIC16F84ARA0, RA1, RA2, RA3, RA4 RtUv)anehAfa Port ARB0, RB1, RB2, RB3, RB4, RB5, RB6, RB7 RtUv)anehAfa Port BkarehAfa Port A KWsMedAelIeCIgTaMgGs;rbs; Port AkarehAfa Port A Pin 0 KWsMedAelIeCIgrbs; Port A bit 0 ( eCIg RA0 )karehAfa Port A nig Port B manlkçNdUcKñaVdd RbPBviC¢man +5V nigVss RbPBGviC¢man 0V
  7. 7. etIGVICa Reset or Master clear (MCLR) ? Master clear KWCaeCIgmYysRmab;eFIVeGay Microcontroller RtLb;eTAGas½ydæanedImKW 00h
  8. 8. kartP¢ab; Reset or Master clear
  9. 9. kartP¢ab;esoKVIlMeyaledayeRbIRKiHsþal; esoKVIlMeyalCaEpñkmYysMxan;EdlmantYnaTIbegáIteGayman Square Signal
  10. 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. 11. kartP¢ab;GMBUl LED eTAkan; PORTCaFmµtaGMBUl LEDsIucrnþRbEhlBI 8mA eTA16 mA nigtg;süúgRbEhlBI 1.6V eTA 2.4V . ebIGMBUlLEDsIucrnþ 10mA nigtg;süúg 2V
  12. 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. 13. kartP¢ab; Button eTARckcUl( Input )Active High PORT +5V +5V Low Gt;cuc High cucActive Low PORT High Gt;cuc Low cuc
  14. 14. rebobkMnt; PORT Ca Input or OutputTRISx KWCa RegistermYysRmab;kMnt;muxgarrbs; PORTxTRISx = 1PORTx as Input.TRISx = 0PORTx as Output.
  15. 15. karsresrkmµviFIsRmab; PIC16F84A TMrg;TUeTArbs;Pasa C sRmab; Microcontroller void main() { while(1) { program body; } }
  16. 16. karsresrkmµviFIsRmab; PIC16F84Avoid main() CatMbn;sRmab;RbkasGefr{ rWkarkMnt;nUvmuxgarmYycMnYn while(1) { rbs; Microcontroller program body; } dUcCa Trisb = 0; or} Portb = 0; CaedIm .
  17. 17. karsresrkmµviFIsRmab; PIC16F84Avoid main(){ CatMbn;EdlmandMeNIrkarrhUt while(1) { Example: GMBUlmYyebIk program body;} } ehIybiT²CaerogrhUt. eyIgRtUvsresr Code enA kñgtMbn;enH(program body) ú
  18. 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 } }
  19. 19. karKUsesoKVI PIC16F84A
  20. 20. GrKuN

×