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]

LooseTheGoose



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

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

arcachofo

arcachofo

Probably the same issue:
https://simulide.forumotion.com/t548-simde-ver-100rc2r1007-tiny85-malfunction#2955

Could not find the solution yet.

arcachofo

arcachofo

Solved at Rev 1078.

You can probably fix it by editing file: data/AVR/tinyx5/tinyx5_regs.xml
Change line 89:
Code:
    <register  name="TIMSK"  addr="0x0039" mask="01100000"
to this:
Code:
    <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