| Datenblatt-Suchmaschine für elektronische Bauteile |
|
SN8P1602AX Datenblatt(PDF) 55 Page - SONiX Technology Company |
|
|
|||||||||||||||||||||||||||||
SN8P1602AX Datenblatt(HTML) 55 Page - SONiX Technology Company |
|
55 / 94 page ![]() SN8P1600 8-bit micro-controller SONiX TECHNOLOGY CO., LTD Page 55 Revision 1.94 TC0 TIMER OPERATION SEQUENCE The TC0 timer’s sequence of operation may be as following. Set the TC0C initial value to setup the interval time. Set the TC0ENB to be “1” to enable TC0 timer. TC0C is incremented by one after each clock pulse corresponding to TC0M selection. TC0C overflow if TC0C from FFH to 00H. When TC0C overflow occur, the TC0IRQ flag is set to be “1” by hardware. Execute the interrupt service routine. Users reset the TC0C value and resume the TC0 timer operation. Example: Setup the TC0M and TC0C. B0BCLR FTC0IEN ; To disable TC0 interrupt service B0BCLR FTC0ENB ; To disable TC0 timer MOV A,#20H ; B0MOV TC0M,A ; To set TC0 clock = fcpu / 64 MOV A,#74H ; To set TC0C initial value = 74H B0MOV TC0C,A ;(To set TC0 interval = 10 ms) B0BSET FTC0IEN ; To enable TC0 interrupt service B0BCLR FTC0IRQ ; To clear TC0 interrupt request B0BSET FTC0ENB ; To enable TC0 timer Example: TC0 interrupt service routine. ORG 8 ; Interrupt vector JMP INT_SERVICE INT_SERVICE: B0XCH A, ACCBUF ; B0xch instruction do not change C,Z flag B0MOV A, PFLAG B0MOV PFLAGBUF, A B0BTS1 FTC0IRQ ; Check TC0IRQ JMP EXIT_INT ; TC0IRQ = 0, exit interrupt vector B0BCLR FTC0IRQ ; Reset TC0IRQ MOV A,#74H ; Reload TC0C B0MOV TC0C,A . . ; TC0 interrupt service routine . . JMP EXIT_INT ; End of TC0 interrupt service routine and exit interrupt vector . . . . EXIT_INT: B0MOV A, PFLAGBUF B0MOV PFLAG, A B0XCH A, ACCBUF ; Restore ACC value. RETI ; Exit interrupt vector |
|
Link URL |
| War ALLDATASHEET hilfreich? [ DONATE ] |
Über Alldatasheet | Werbung | Kontakt | Privatsphäre und Datenschutz | Link zum Datenblatt | Linktausch | Hersteller All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |