??? 09/28/09 00:19 Read: times |
#169207 - Watchdog? Responding to: ???'s previous message |
Do you have a watchdog running and in need of kicking?
Your program should be able to read any number of channels before printing, unless you get a watchdog reset. Another thing. Don't do huge numbers of if statements. Consider using switch or lookup with an array. And in this case, you wouldn't even need any lookup since the channel number of continuous. Right now, you have 20 source lines just to get the correct value to write to the ADC. And also think about your coding style. I don't know if you have done a lot of copy-paste from different sources, but the style is varying. Learn one coding style and follow it. Sometimes you have assigns without any spaces. Sometimes there is space before the equals character. Sometimes after. You write "while" with a space after, but seems to treat "if" as if it was a function call, i.e. no space between "if" and "(". Always writing the code according to an exact pattern will make it easier for you to speed-reading the code. |
Topic | Author | Date |
ADuC848: Trouble of reading all 10 ADC channels, pleas help! | 01/01/70 00:00 | |
Watchdog? | 01/01/70 00:00 | |
Yes, it's watchdog reset problem! | 01/01/70 00:00 | |
Style | 01/01/70 00:00 | |
IF-ELSE problem | 01/01/70 00:00 | |
Re: IF-ELSE problem | 01/01/70 00:00 | |
still rather clunky! | 01/01/70 00:00 | |
Re: still rather clunky! | 01/01/70 00:00 | |
read all 10 ADC channels at once | 01/01/70 00:00 | |
Re: read all 10 ADC channels at once | 01/01/70 00:00 | |
Refresh | 01/01/70 00:00 | |
Re: Refresh | 01/01/70 00:00 | |
That slow? | 01/01/70 00:00 | |
Re: That slow?![]() | 01/01/70 00:00 |