Hello All,
I am having difficulty reading and writing the 10 bit value from ADC into either OCR1C or OCR1D of attiny 261 PWM timer/counter1. I am programming in assembly code.
Initialize Counter:
LDI PWb, 0B00000011
LDI PWa, 0B11111111
OUT TC1H, PWb
OUT OCR1C Pwa
Read ADC and write into Timer/counter1:
IN PWc, ADCL
IN PWd, ADCH
OUT TC1H, Pwd
OUT OCR1D, PWc
I am trying to have a max count of 1024 and a max ADC value of 1024.
Thanks for any help.
I am having difficulty reading and writing the 10 bit value from ADC into either OCR1C or OCR1D of attiny 261 PWM timer/counter1. I am programming in assembly code.
Initialize Counter:
LDI PWb, 0B00000011
LDI PWa, 0B11111111
OUT TC1H, PWb
OUT OCR1C Pwa
Read ADC and write into Timer/counter1:
IN PWc, ADCL
IN PWd, ADCH
OUT TC1H, Pwd
OUT OCR1D, PWc
I am trying to have a max count of 1024 and a max ADC value of 1024.
Thanks for any help.