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

BASCOM-AVR : ATTINY2313, how can i set a regular interrupt, say 250ms : REPLY

$
0
0
As [b:ced44de1da]i.dobson[/b:ced44de1da] said, you have to use the interrupt "Compare1a", not "Timer1". Also, you need not reload Compare1a value. [code:1:ced44de1da]$regfile = "attiny2313.dat" $crystal = 1000000 $hwstack = 32 $swstack = 16 $framesize = 16 $baud = 9600 ' timer1, CTC mode 4, top = OCR1A Config Timer1 = Timer , Prescale = 8 , Clear Timer = 1 On Compare1a Tim1_compa_isr Enable Compare1a Compare1a = 31250 ' 0.25 sec Ddrb.1 = 1 Enable Interrupts Do Loop End Tim1_compa_isr: Toggle Portb.1 ' toggle Led Return [/code:1:ced44de1da]

Viewing all articles
Browse latest Browse all 20615

Trending Articles



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