AVR Timer operation mode and timebase correlation

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


Dear all,

 

As we all know there are only 4 x Timers on ATmega 1284p MCU. Currently in my setup,  two of those 4 Timers are used for control of the 2 engines.

These engine control timers are running Phase Correct PWM, in 8bit mode.

 

 

 

The yellow highlighted mode is used for Engines.

 

Is there any chance to make a timebase from this already running timers, and not setup yet another Timer for a timebase.

Can I use the TCNT1 register to create a timebase which can then be used for time.

 

Thanks in advance

work in progress...

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


Sure, just enable the timer overflow interrupt and place your timing code there.

You should have a diagram like this in your DS:

This one is from the M328 DS, yours should be similar.

Jim

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Fri. Aug 9, 2019 - 06:03 PM