can count register be incremented manually?

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am using the attiny85 and I am trying to manually increment the counter timmer by using TCNT0 = TCNT0 +1; and it does not seem to be working. This register is read and write so this should be possiblem, but for some reason I am not hitting the compare register value and getting my interrupt. I want to count for both rising and falling edge, which isnt an option, so I am using a pin change interrupt to interrupt and count on any pin change and then attmepting to increment the count register. this doesent work, but if I toggle a pin in the pin change interrupt subroutine and use that pin as an input to T0 I get an output. I know this is a super round about way to do this, but I want to use the attiny and I want to be able to count on both rising and falling edge. 

 

 

This topic has a solution.
Last Edited: Tue. Aug 15, 2017 - 10:15 PM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

okay the datasheet says

 

Writing to the TCNT0 Register blocks (removes) the Compare Match on the following timer clock. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 2

a clock doubler can be made with an xor gate and an rc circuit