|
Introduction to Microcontroller Programming * Course Index * Introduction * About the Author * About this Course * Feedback * Course Navigation * Quick Course Navigation * How to use this Course * Acronyms Used and Course Conventions About PICmicro Chips * What is a PICmicro? * Microcontrollers * Digital versus Analogue * Inputs and Outputs * Memory * Programming * 16F1937 Architecture ## PORT A ## PORT B ## PORT C ## PORT D ## PORT E ## Memory in the 16F1937 ## ALU ## Timer 1 ## Timer 0 ## RB0 Interrupt ## Port B Interrupt ## A/D Conversion ## Busses Clocking Your PICmicro Devices * Introduction * The Clock Circuit * Clock Settings * Clock Confusion E-Blocks * Introduction to E-blocks * Using E-blocks * E-blocks Boards Flowcode Step By Step * Introduction to Flowcode * Basic Flowcode Functions * Digital Outputs * Digital Inputs * Basic Loops * The LCD Display * Binary Numbers * Decisions * Goto (Connection Point) * 7-Segment Displays * Software Macro * Strings and Memory * A Simple Hi-Fi PICmicro Projects * Introduction to PICmicro Projects * Construction Methods * Choosing a Power Source * Adding Inputs * Input Conditioning * Adding Outputs * Adding Drivers Labs * Introduction and Lesson Plan * 1. Output * 2. Delay * 3. Connection Point * 4. Calculations * 5. Loop * 6. Input * 7. Decision * 8. LCD * 9. Keypad * 10. Analogue + EEPROM * 11. Software Macro * 12. External Interrupt * 13. Timer Interrupt |
(:Summary:Contains the 'action' links (like Browse, Edit, History, etc.), placed at the top of the page, see site page actions:) (:comment This page can be somewhat complex to figure out the first time you see it. Its contents are documented at PmWiki.SitePageActions if you need help. :) * Print (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) * %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) * Login Timer 0<^< Timer 1 | Course Index | RB0 Interrupt >^>(:nl:) Largely simplified block schematic to demonstrate where the 'Timer 0' ('TMR0') is located in the PIC 16F1937 Architecture: ![]() TMR0:* This timer interrupt is used to provide the PICmicro with exact timing info. * It is clocked by the system clock or by an external clock on RA4. * This system clock runs exactly 4 times slower than the external oscillator clock. * Either the external clock or the system clock can be divided by 1, 2, 4 or 8, 16, 32, 64, 128, or by 256 by configuring the Prescaler of TMR0 in Flowcode. * This divided clock triggers TMR0 to increment the TMR0 register. * This TMR0 register is an 8-bit register and will have an overflow when it reaches 256. * On the exact moment when this overflow occurs, TMR0 generates an interrupt and the TMR0 register is set back to 0. * This TMR0 Interrupt will stop the main program immediately and start up the TMR0 Macro. * After the TMR0 Macro is finished, the main program goes further where it had left before. Example:
Conclusion: In this situation, TMR0 will interrupt the main program and execute the TMR0 macro 75 times per second. (:nl:)(:table style="clear:both":)
| |
(:Summary: Website page footer:)
Print - (:comment (:if group Site,SiteAdmin,Cookbook,Profiles,PmWiki*:) (:comment delete if and ifend to enable backlinks:) %item rel=nofollow class=backlinks accesskey='$[ak_backlinks]'% [[{*$Name}?action=search&q=link={*$FullName} | $[Backlinks] ]] (:ifend:) :) Search - Login
Page last modified on May 14, 2013, at 08:11 AM