2010-06-10 01:04 AM
System timer and ADC
2011-05-17 04:54 AM
I think the problem occurs because The time show function has an infinite loop which is while(1), because it is infinite, I cannot go to other functions below it. I need to get the current time and display it using USART and at the same time do other functions like getting data from ADC and outputting high or low from GPIO pins. What is your suggestion for this?
Here is a summary of my code int main() { //configuration set up and others /* Display time in infinite loop */ Time_Show(); //ADC data or any function } void Time_Show(void) { printf(''\n\r''); /* Infinite loop */ while (1) { /* If 1s has paased */ if(TimeDisplay == 1) { /* Display current time */ Time_Display(RTC_GetCounter()); TimeDisplay = 0; } } }