| 数据搜索系统,热门电子元器件搜索 |
|
AN913 数据表(PDF) 8 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN913 数据表(HTML) 8 Page - STMicroelectronics |
|
8 / 12 page ![]() 8/12 PWM GENERATION WITH THE ST62 16-BIT AUTO-RELOAD TIMER ;*** TIMER Initialisation *** ldi tcr,0ffh ; Load the counter ldi tscr,01001000b ; Restart the timer with input tone ; from input pin which is connected to the ; OVFFLG of ARTIMER. ; The prescaler is 1 ;*** PortA initialisation for PWM and OVF output ldi ddra,0ch ldi ora,0ch ;*** ART16 Initialisation *** ldi SCR2,00h ; CP1 input interrupt disable ldi SCR3,00h ; CP2 and ZEROFLG interrupt disable ; PWM output is run in SET/RESET mode ldi SCR4,0Fh ; OVFPOL=1, Overflow enable, PWMPOL=1, ; PWM enable ldi RLCPH,001h ; 100h for 8 bit of PWM, 77h to have time to ldi RLCPL,077h ; load the CMP register, and to have with ; 8MHz and a prescaler of 1/4 a ; Digital Analog Converter ; sample tone equivalent to 5319hz. ldi MASKH,0FFh ; MASK = 0FFFFh ldi MASKL,0FFh ldi SCR1,0B2h ; prescal by 4 to have a sample tone of 2MHz ; Reload mode ; Runres =1 to start the counter ; No interrupt with overflow ; Toggle mode to give 2000 Hz to the timer ; (with toggle mode it's not necessary to ; reset the OVFFLAG) ;*** GENERAL INTERRUPT *** ldi ior,10h ; Enable all interrupts. ;*************************************************************************** ;*************************** DTMF GENERATION ******************************* DTMF: ;*** calculation of the first tone *** ld a,Lsb_ton1 ; load tone Lsb add a,Lsb_inc1 ; add it to the increment Lsb ld Lsb_ton1,a ; save the result ldi a,0 ; initiate a to 0 for no carry jrnc nocarry1 ; test carry of the previous result ldi a,1 ; if carry a=1 to add 1 to the Msb addition nocarry1: add a,Msb_ton1 ; add the carry to the tone Msb |
|
|
链接网址 |
| 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 |