Timer0 not wotking. Any check list to verify if i am doing things right ?

2 posts / 0 new
Last post
yassin.bennaceur
Offline
Last seen:5 years 6 months ago
加入:2015-04-10 15:32
Timer0 not wotking. Any check list to verify if i am doing things right ?

Hello, I am trying to set a Calback function for Timer0 to sample ADC with 9Kh frequency. I followed the example of the use of the PWM but I just dont see it working.

What are the things to check to be sure I am setting every thing right here ?

Device:
yassin.bennaceur
Offline
Last seen:5 years 6 months ago
加入:2015-04-10 15:32
Yes I am doing that. But I

Yes I am doing that. But I guess something is wrong is happening. When I call the timer0_test() function, nothing is working (I am toggling the GPIO_0_pin3) in th callback function.

and if i just make this test in the main loop:
int i = 10;
while(1){
while(i) {
GPIO_SetActive(GPIO_PORT_0, GPIO_PIN_3);
GPIO_SetInactive(GPIO_PORT_0, GPIO_PIN_3);
i--;
}
timer0_test();
}

The PIN toggle for only for the first run of the main loop. which make me conclude that the timer0_test is blocking the loop and maybe watchdog reset is happening.