What is the name of the Timer 6 count register? TIM6_CNT is what the documentation says but that is an unknown variable to the compiler.
I need a blocking very short time delay.
So I set up Timer 6 to run at 90 MHz, with no interrupts.
I need delays from 0.5 to 30 microseconds for an interface I have to bit-bang.
I was hoping for a simple delay routine like this:
void Timer6_delay(uint16_t clocks)
{
TIM6_CNT = 0;
while (TIM6_CNT < clocks);
}
Except TIM6_CNT is not the right name.
In the documentation: RM0390 it says in Paragraph 19.3.1 Time-base unit it says
The main block of the programmable timer is a 16-bit upcounter with its related auto-reload
register. The counter clock can be divided by a prescaler.
The counter, the auto-reload register and the prescaler register can be written or read by
software. This is true even when the counter is running.
The time-base unit includes:
- Counter Register (TIMx_CNT)
- Prescaler Register (TIMx_PSC)
- Auto-Reload Register (TIMx_ARR)
So I mistakenly thought it was called TIM6_CNT. And if it is, the Compiler does not know about it.
Is it in a special include file I may be missing?
Thanks.
