- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Cypress Team,
I want to configure timer in my project with 1 Micro second .
i used timer function block , set the clk at 2 MHz and count is 2, so it is showing 1us .
but i want to reconfigure timer in my state machine many times with different time configuration (1,3,20us and 125us).
so in the ISR , written code
CY_ISR(Timer_ISR)
{
Timer_ISR_ClearPending();
//Timer_1ms_ClearFIFO();
BottomTemperatureControl();
}
void BottomTemperatureControl(void)
{
//here am calling reload timer function with different timer time configuration.
ReloadTimer(Number of us timer configuration);
}
void ReloadTimer(int nTimerInMicroSeconds)
{
Timer_1ms_Stop();
nTimerInMicroSeconds = nTimerInMicroSeconds * 2;
Timer_1ms_WritePeriod(nTimerInMicroSeconds);
Timer_1ms_Start();
}
if i want to set 3us timer, then i will pass 3 to the reloadTimer function and calculate the period count value inside the reload functon.
for 2 counts, 1us timer
for 3 us, 2*3 = Count value(6).
if high set this value for 100us ,50us its working fine but for 3us timer , getting 40us pulse.
kindly help me in this.
I am not able to configure 16, 24 ,32 bit resolution for the attached timer function block .
it is showing error if I select 16,24 bit resolution.
please find the attached images for timer configuration.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your function BottomTemperatureControl() consumes some more time than just a few µs. Or do you want to have a ms timer? having one million interrupts per second will bust any CPU.
Bob