So far we have been using app_timer_set to be called periodically. It works fine except that the highest frequency is 100hz.
我们需要calle方式d at about 10Khz and I understand we have to use the timer interrupts
.
Can you provide me an example of how it is done and which drivers we have to include?
Thks
Thu, 2014-11-20 11:13
#1
Timer interrupts
I am as well looking for using timer0 with 10Khz ? any answer for this.
Hi Yassin, can you describe a little bit more about what you want to acheive and I will have one of the team take a look at the best way to achieve. BR JE_Dialog
I want to measure ADC with a 10Kh frequency using a timer0 interrupt.
I fallowed the PWM example and changed the core of the callback function to do so ... but after several trials I failed to do so.
The thing is that the call back function is never called though I registered ut the way the example does ... I suppose I am missing something here and I just dont know what ?
Hi Yassin, I am looking into your question and will get back to you as soon as possible.
Best regards, RvA
Thank you for your support and effort.
Hi Yassin,
In the SDK are some functions you can work with to implement the wanted behavior. The picture below shows the functions that generate the interrupt and the handling of the interrupt:
In the picture below the timing of this is shown:
Best regards, RvA
Thanks you very Much RvA,
This is so helpful,
I used a temporary solution (the sysTick interrupt handler) For now, it work But i will try using your implementation for Timer0 interrupt.
thanks again for your help and support.
So I run your code ... But It did not manage to trigger the interrupt at all...
I was wondering if there is something else I should be configuring ... like no sleep mode or any thing else.
你能请吗the code for periph_init() function ?