TIMERS

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

TIMERS

Postby eriksl » Wed Aug 10, 2016 8:11 pm

Hello All,

I am missing some detailed information about the hardware (!) timers. Sometimes the software timers or the sdk interface are just not enough. Coming from ATMega devices, where the timers are very thorougly documented and easy to use.

This is the information that I gathered, please correct.

Two timers, FRC1 and FRC2 (once called "frame rate counter", but something "fast real-time clock timer" looks more significant?).

FRC1 counts down, 22 bits resolution, frequency is 80 Mhz divided by 1, 16 or 256, even though this line:

Code: Select all

#define  TIMER_CLK_FREQ                              (APB_CLK_FREQ>>8) //divided by 256

says it's always divided by 256???

FRC2 counts up, 32 bits resolution, frequency is ???

I have found some #defines that tell where to load and read the timer current value. I assume there are no "compare values" like on the ATmega, it simply counts down to zero and then, if configured, fires and interrupt?

When I am using os_timer_* functions (not hw_timer, as documented), I find that any interrupt handler attached to FRC1 is not called. This is not documented. Is that correct? When I change the interrupt source for FRC1_NMI, it is called indeed. Can this be explained?

Is there a way to have an interrupt connected to FRC2? What does the SDK code use FRC2 for itself, will it interfere with SDK code when I use it myself?

Also I found that as soon as the FRC1_NMI is used, the pin change interrupts stop working. This is also not documented. Please explain.

Thanks.

pratik

Re: TIMERS

Postby pratik » Fri Aug 12, 2016 10:50 am

Hello,

We will release detailed documentation on the timers soon. The timers are used for timing processes or internal operations, especially in RTOS SDKs and AT firmware code, so it gets a lot more complex than ATmega devices.
Meanwhile, I may try to write an article on this in a couple of days. I will keep the thread updated.

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

Re: TIMERS

Postby eriksl » Sun Aug 14, 2016 3:57 pm

Pratik, if you could shed any light on the most low-level operation of timers, it would be VERY VERY much appreciated!

I understand your concerns, you should know in my case I am using the "bare metal" as much as possible, so there is no RTOS, and no AT code. Also I am moving away from the (non-RTOS) SDK code for PWM, pin change interrupts and timer functions. That would leave little, maybe even none, users of timers outside my own code. I guess that depends on how wlan frames are passed to the SDK code, if that code is using timers and or interrupts.

eriksl
Posts: 159
Joined: Fri May 22, 2015 6:22 pm

Re: TIMERS

Postby eriksl » Mon Oct 10, 2016 9:26 pm

pratik wrote:Hello,

We will release detailed documentation on the timers soon. The timers are used for timing processes or internal operations, especially in RTOS SDKs and AT firmware code, so it gets a lot more complex than ATmega devices.
Meanwhile, I may try to write an article on this in a couple of days. I will keep the thread updated.


Is soon already now? ;-)

pratik

Re: TIMERS

Postby pratik » Thu Oct 13, 2016 11:17 am

Hello,

I have attached the timer register map. This should be useful!
Attachments
8m-esp8266_interface_timer_registers_release_18-11-2014.xlsx
Timers (register map)
(9.71 KiB) Downloaded 2974 times

rajkumar patel
Posts: 12
Joined: Fri Mar 03, 2017 8:20 pm

Re: TIMERS

Postby rajkumar patel » Mon Mar 06, 2017 5:02 pm

hello,
I've gone through hardware timer APIs in 8266 API guide, but still from it and given sample code in hw_timer.c and .h files, i'm not clear about hardware timer's operations. earlier it was mentioned like detailed documents would be released soon. so is there any reference material available for further understanding? or i'm left with that API guide and hw_timer.c and .h, provided in SDK, only?

i'd appreciate your help or advice.

magres
Posts: 2
Joined: Fri Apr 14, 2017 7:44 pm

Re: TIMERS

Postby magres » Sun Apr 16, 2017 2:25 pm

Have someone tried to get hardware timer in non autoload mode on RTOS SDK to work properly?

Who is online

Users browsing this forum: No registered users and 1 guest