Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20709

BASCOM-AVR : Timers configuration problem, Atmega88 : REPLY

$
0
0
Hi Bart, you will not be able to create a 100KHz frequency with a timer via an interrupt. This is due to the required register saving before and reloading after the interrupt. That requires around 110 cycles. A free running square output is easily done via hardware with the CTC mode. You configure it like this: Config Timer0 = Timer , Prescale = 1 , Clear_timer = 1 , Compare_a = Toggle Compare0a = 39 The timer will count from 0 to 39 (40 steps). At that point it will toggle the output and start from 0 again. With 8MHz frequency you will get 100KHz output signal at OC0A (PD.6).

Viewing all articles
Browse latest Browse all 20709

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>