View previous topic :: View next topic |
Author |
Message |
yantel37
Joined: 24 May 2009 Posts: 5
|
Posted: Mon Feb 09, 2015 4:06 pm Post subject: 10-bit High Speed Timer/Counter4 (64MHz) |
|
|
Dear Colleagues,
I would like to know if anyone knows how to use the Timer / Counter4 of ATMEGA32U4?
BASCOM-AVR does not provide instruction to configure and use this device.
Would appreciate help on this topic.
(BASCOM-AVR version : 2.0.7.8 ) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Mon Feb 09, 2015 8:21 pm Post subject: |
|
|
Looks like Timer4 is a quite complex timer, which isn't supported by Bascom's Config ...
You always can configure AVR's periphery by writing directly to the registers. If you need help, better specify exactly, what you want to use the timer for.
Otherwise - the data sheet explains it in detail. |
|
Back to top |
|
|
yantel37
Joined: 24 May 2009 Posts: 5
|
Posted: Tue Feb 10, 2015 2:18 pm Post subject: |
|
|
The aim is to use the High Speed Asynchronous counter for measuring time and frequency. On the other hand I can not find the input pin and the necessary configuration (may be too complicated ...) |
|
Back to top |
|
|
MWS
Joined: 22 Aug 2009 Posts: 2262
|
Posted: Tue Feb 10, 2015 6:18 pm Post subject: |
|
|
yantel37 wrote: | On the other hand I can not find the input pin and the necessary configuration (may be too complicated ...) |
Understandable, as there is no T4 external input pin.
This timer looks suitable with it's dead time generator for motor control, respectively H-bridges.
But neither the T4 has an input capture unit, nor does it allow for external clocking.
You can easily find that out by checking the prescaler bits for T4 in TCCR4B, you'll find also a table with all possible CS43..40 combinations.
Compare that with T1, you won't find a setting that allows for external clock on T4. |
|
Back to top |
|
|
yantel37
Joined: 24 May 2009 Posts: 5
|
Posted: Wed Feb 11, 2015 10:32 am Post subject: |
|
|
MWS Thanks for your reply. But it is a shame to have such a potent peripheral and not to use it, with the number of applications that could be implemented ... |
|
Back to top |
|
|
|