| 数据搜索系统,热门电子元器件搜索 |
|
HT83F40P 数据表(PDF) 22 Page - Holtek Semiconductor Inc |
|
|
|||||||||||||||||||||||||||||
HT83F40P 数据表(HTML) 22 Page - Holtek Semiconductor Inc |
|
22 / 61 page ![]() HT83FXX Rev. 1.00 22 May 12, 2009 Timer Program Example The following example program section is based on the HT83F60 device, which contain two 8-bit timers. Programming the timer for other devices is conducted in a very similar way. The program shows how the timer registers are setup along with how the interrupts are enabled and managed. Points to note in the example are how, for the 8-bit timer. Note how the timer is turned on by setting bit 4 of the respective timer control register. The timer can be turned off in a similar way by clearing the same bit. This example program sets the timer to be in the timer mode which uses the internal fsys as their clock source, and produce a timer 0 interrupt per 1ms. #include HT83F60.inc jmp begin : org 04h ; time base vector reti org 08h ; timer 0 interrupt vector jmp tmr0int ; jump here when timer 0 overflows every 1ms org 0Ch reti org 10h reti org 14h reti : ; internal timer 0 interrupt routine Tmr0int: : ; timer 0 main program placed here : reti : begin: ; setup timer 0 registers mov a,06h ; setup timer 0 low byte mov tmr0,a ; flow byte must be setup before high byte mov a,094 ; setup timer 0 control register mov tmr0c,a ; setup timer mode and clock source is fsys/32 prescaler ; setup interrupt register mov a,05h ; enable global interrupt mov intc,a ; enable timer 0 interrupt |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 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 |