Hello.
This little programm for the ATTiny85 (GC-Basic) shows no function for the Timers nor the corresponding Overflow-Interrupts monitored in the MCU-Monitor.
Same progam compiled for an ATMega8 works perfectly.
The ATTiny85 version also works like a charm on SimulIDE 0.4.15 SR9.
Kind regards
Phil
This little programm for the ATTiny85 (GC-Basic) shows no function for the Timers nor the corresponding Overflow-Interrupts monitored in the MCU-Monitor.
Same progam compiled for an ATMega8 works perfectly.
The ATTiny85 version also works like a charm on SimulIDE 0.4.15 SR9.
Kind regards
Phil
- Code:
#chip tiny85, 16' mega8, 16
#option Explicit
Start:
DIM CounterValue_0 as Byte
DIM CounterValue_1 as Byte
Dim t1 as Byte
Dim t2 as Byte
On Interrupt Timer0Overflow Call IncCounter_0
On Interrupt Timer1Overflow Call IncCounter_1
IntOn 'enable Interrupts
InitTimer0 Osc, PS_0_1
StartTimer 0
SetTimer 0, 128
InitTimer1 Osc, PS_1_64
StartTimer 1
SetTimer 1, 6
Main:
do forever
t1 = Timer0
t2 = Timer1
if CounterValue_0 > 128 then Set PORTB.0 = 1
if CounterValue_0 < 128 then Set PORTB.0 = 0
if CounterValue_1 > 128 then Set PORTB.1 = 1
if CounterValue_1 < 128 then Set PORTB.1 = 0
loop
Sub IncCounter_0
SetTimer 0, 128
CounterValue_0 ++
End Sub
Sub IncCounter_1
SetTimer 1, 6
CounterValue_1 ++
End Sub
Last edited by arcachofo on Mon Apr 18, 2022 4:32 am; edited 1 time in total (Reason for editing : Mark as solved (green color))