Reply
Posts: 19
Registered: ‎03-06-2017

Clocking Timer 3 w/ Timer 4 Overflows

Hi,

       I'm using a EFM8 Laser Bee with the SLSTK2030A starter kit. I'm working with the Hardware Configurator in Simplicity Studio. In one portion of my program I need the device to stay awake for a period of 3-5 min while sampling the ADC. My plan was to use the system clock at 72 MHz because I need a high sampling frequency for my data collection. I was then going to run Timer 3 using the LFOSC/8 and run Timer 4 using Timer 3 overflows. By setting the initial value of Timer 4 correctly I was thinking I could generate an interrupt on Timer 4 overflow to tell the device to go back to sleep.

 

My problem: when I try and set Timer 4 to use Timer 3 interrupts as the clock source the frequency of the timer is displayed as 0 Hz and I get an error stating that the chosen clock source frequency is too low. Is there a way to fix this?

 

If not, would the best thing be to drive one of the CLU units from a timer to track a certain number of counts? Thanks!

<a href="http://community.silabs.com/t5/Welcome-and-Announcements/Community-Ranking-System-and-Recognition-Program/m-p/140490#U140490"><font color="#000000"><font size="2">Hero</font></font> </a> jmg
Posts: 1,154
Registered: ‎04-27-2004

Re: Clocking Timer 3 w/ Timer 4 Overflows

[ Edited ]

... Hardware Configurator in Simplicity ...My problem: when I try and set Timer 4 to use Timer 3 interrupts as the clock source the frequency of the timer is displayed as 0 Hz and I get an error stating that the chosen clock source frequency is too low. Is there a way to fix this?


That sounds like maybe a Hardware Configurator bug/issue.

 


 My plan was to use the system clock at 72 MHz because I need a high sampling frequency for my data collection. I was then going to run Timer 3 using the LFOSC/8 and run Timer 4 using Timer 3 overflows. By setting the initial value of Timer 4 correctly I was thinking I could generate an interrupt on Timer 4 overflow to tell the device to go back to sleep.... 

If not, would the best thing be to drive one of the CLU units from a timer to track a certain number of counts? 


You should not need to complicate with CLU.

If the Hardware Configurator stumbles, you may need to do this manually.

Run the Hardware Configurator, then check the output.

Check the timer data, and the TMR3CN0 , TMR4CN0, TMR4CN1 settings.

(& watch out for SFR page settings !) 

 

My reading is TMR3 can clock from SysCLK/12, in 8 or 16b modes.

TMR4 can CLK from TMR3, giving a possible longest timing chain of 

12*2^16*2^16/72M/60  = 11.930 minutes.

 

So you look to be ok to hit your 3~5 mins, (no intermediate interrupts) by initial preload of the upper bits.

Carry from T4L to T4H I make every  12*2^16*2^8/72M = 2.796 seconds.

Posts: 324
Registered: ‎09-22-2009

Re: Clocking Timer 3 w/ Timer 4 Overflows

Definitely looks like a Configurator bug. I'll put in a bug report with the Tools team.

Posts: 324
Registered: ‎09-22-2009

Re: Clocking Timer 3 w/ Timer 4 Overflows

Can you provide your .hwconf file that shows the error? The Configurator developer needs this to expedite the bug fix.

Posts: 2,079
Registered: ‎10-14-2014

Re: Clocking Timer 3 w/ Timer 4 Overflows

[ Edited ]

@labeardslee

I think you are trying to use the timer3 overflow as the timer4 clock source (but my understanding of the subject of the post is that you use timer4 overflow as timer3 clock source), am I right?

I did not reproduce your issue on my side.

Do you enable the LFOSC0 when you try to use LFOSC0/8 as the timer3 clock source.

I attached my configurator file.

WeiguoLu
Posts: 19
Registered: ‎03-06-2017

Re: Clocking Timer 3 w/ Timer 4 Overflows

Hi,

          Attached is my HW configuration file. I attached it as a text file because I got an error when I tried to post it with the HWCONF extension. If you look in the states called "Data_Collection" or "Sleep" I get an error when I use the Timer 4 clock sources at Timer 3 overflows with the Timer 3 clock at LFOSC/8. Thanks!

Posts: 2,079
Registered: ‎10-14-2014

Re: Clocking Timer 3 w/ Timer 4 Overflows

It looks like you did not configure the overflow frequency for the Timer3.

Here after I configure it and I see no error.

I upload the modified file. maybe you need change the "clock source" for TIMER4 to others and then back to Timer 3 overflows to refresh and suppress the error.

 

WeiguoLu
Posts: 451
Registered: ‎02-21-2014

Re: Clocking Timer 3 w/ Timer 4 Overflows

It looks like the Timer 3 overflow frequency value in Timer 4 wasn't updating when Timer 3 was updating. I'll get that fixed and pushed to Studio soon.