| Zakładka z wyszukiwarką danych komponentów |
|
AN590 Arkusz danych(PDF) 5 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN590 Arkusz danych(HTML) 5 Page - STMicroelectronics |
|
5 / 7 page ![]() 5/7 PWM GENERATION WITH ST62 AUTO-RELOAD TIMER Program example A .def 0FFh,0FFh,0FFh ;Accumulator ;************** Port Register Set ************************************ PA .def 0C0h,0FFh,0FFh ;Data Register Port A PADIR .def 0C4h,0FFh,0FFh ;Data Direction Reg. Port A PAOPT .def 0CCh,0FFh,0FFh ;Option Register Port A ;**************** Timer Register Set ********************************* RC .def 0D9h,0FFh,0FFh ;reload capture register CP .def 0DAh,0FFh,0FFh ;compare Register MC .def 0D5h,0FFh,0FFh ;mode control register SC0 .def 0D6h,0FFh,0FFh ;status control register 0 SC1 .def 0D7h,0FFh,0FFh ;status control register 1 LR .def 0DBh,0FFh,0FFh ;load register ;********************* ADC Register Set ****************************** ADCC .def 0D1h,0FFh,0FFh ;adc control register ADC .def 0D0h,0FFh,0FFh ;adc result Register ;********************* MAIN ******************************************* ;port A must be an IOP3 type (port with analog input mode): ldi PADIR,000h ldi PAOPT,001h ;PA0 is the analog input ldi PA, 001h ;PA1..PA7 are input with pull-up ldi SC1,00000000b ;PSC divides by 1 ldi CP,080h ;compare register = 128d ;(initial duty = 50%) ldi RC,000h ;reload register = 0 ;(count up from 0 to 255) ldi MC,11100000b ;auto-reload mode,interrupt disabled ;PWMOUT enabled, start timer with ;duty cycle 50% at start-up adc_loop ldi ADCC,030h ;start A/D conversion wt_eoc jrr 6,ADCC,wt_eoc ;wait for end-of-conversion ld A,ADC ;save result into Accumulator ld CP,A ;copy it into CP register jp adc_loop ;do it again |
|
|
Link URL |
| Czy Alldatasheet okazała się pomocna? [ DONATE ] |
O Alldatasheet | Reklama | Kontakt | Polityka prywatności | Link do karty katalogowej | Linki | Lista producentów 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 |