System timer and ADC
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2010-06-10 1:04 AM
Posted on June 10, 2010 at 10:04
System timer and ADC
This discussion is locked. Please start a new topic to ask your question.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2011-05-17 4:54 AM
Posted on May 17, 2011 at 13:54
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; } } }