Would you like to react to this message? Create an account in a few clicks or log in to continue.

You are not connected. Please login or register

SimulIDE 1.0.1 R1055; Tiny85 - No Timer / Timer Interrupt function

2 posters

Go down  Message [Page 1 of 1]



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

#chip  tiny85, 16' mega8, 16
#option Explicit


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

 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

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))



Probably the same issue:

Could not find the solution yet.



Solved at Rev 1078.

You can probably fix it by editing file: data/AVR/tinyx5/tinyx5_regs.xml
Change line 89:
    <register  name="TIMSK"  addr="0x0039" mask="01100000"
to this:
    <register  name="TIMSK"  addr="0x0039" mask="01111110"

Sponsored content

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum