- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello:
Is there any examples on how to define/use ISRs in WICED for microsecond level sampling? This has been asked many times in the forum, but the only answer is to use the rtos_delay_microseconds() function. This method wont work for fixed sampling rate applications as there is a chance that function takes much longer than the passed time to return.
app info: every 5 usec I want to do a spi read to take an adc sample to achieve a sampling rate of 100khz. Im lloking for an example that defines a timer interrupt and how to use it. Thanks.
Solved! Go to Solution.
- Labels:
-
ADC
-
Interrupts
-
SPI
-
WICED Studio
-
Wireless MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The timer in 43907 can only get a millisecond interrupt. There isn't API to access the low level timer settings.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Which device are you using? Could you try the API wiced_result_t wiced_rtos_init_timer( wiced_timer_t* timer, uint32_t time_ms, timer_handler_t function, void* arg ).
And there is some demo code under snip/bluetooth/serial_gatt_service.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey OwenZ_26:
Thanks for the reply. For our device we are targeting the CYW43907 chip. I've checked out the rtos_timer function as you mentioned, but the time isn't granular enough. To support 100kHz we would need a timer of 5 usec - way smaller than a msec.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry, there isn't a microsecond timer interrupt for this device.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is there a way I could make one? Im imaging that there is a register that is incremented at each clock cycle, and when it hits a certain number (whatever corresponds to 1 or 5 or even 10 usec) I execute my ISR.
What is the shortest timer interrupt available on the 43907?
I see that the rtos_timer calls a threadx function _txe_timer_create - is there a lower bound on the amount of time this can watch for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The timer in 43907 can only get a millisecond interrupt. There isn't API to access the low level timer settings.