You need to log in to create posts and topics.

Issue with Timer counter register

When I use Timer1 for ATTiny85, the counter register TCNT1 is always 0. The same behaviour is observed for Timer0. I checked the same firmware hex in Proteus, and everything worked properly. Could someone help me fix this issue? It would be helpful for debugging. Thank you!

Hi.

I can't reproduce the issue.
Can you share an example with the problem to test it?

This is example: File_explorer->Examples->Micro->Avr->tiny85->tiny85_T1

I guess I've found a workaround. If you set up the timer and use an empty loop, then TCNT1 is empty. But if you read TCNT1 value periodically, then all works as expected;

Btw I use MacOS ver. 1.1.0-SR1 at Rev 2061. However, thank you very much for awesome software!

int main(){

  TCCR1 = 0;
  TCCR1 |= (1 << CS10);

  while (1)
  {     
    // uint8_t data = TCNT1;    
  }
  
  return 0;
}

No read timer counter

Read Timer count

Thanks, now I see what is the problem.

belpyro has reacted to this post.
belpyro

Hi.
I think this should be solved in last tester build for 1.1.0:
https://simulide.com/p/testers/