We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
8051
Does anyone have a way or a suggestion on how to approach this issue. I don't want my ADC line to lock the code if the busy line never returns, I'd like to add a timeout to ensure that if after X interations of busy not responding that a trappable error can be generated and sent in replacement of the adc data.
This problem has been an issue in the past but I can't get my head around how to do this. The transistion time for EOC is around 9uS but could be longer or shorter depending upon temperature module is in.
Any thoughts or snippet of code that could be modeled?
Thanks
I am not getting correctly ur Problem "I'd like to add a timeout†For these, why don’t you use timer. Implement such way that specify response time(conversion time ) and use some variable as a flag. Put initially flag is false. Before checking EOC bit, start the Timer .Then you have two cases: 1) Conversion is completed with in the Time: in this case simply stop or Disable the timer and put the flag in true. 2) Conversion is not completed within the time: In these case, in Timer interrupt Routine simply make the flag is False and make EOL is High (if possible or use another Method).
Check the Flag According to Flag status do further step
Yes that makes sense to have two objects act on single variable. Timer and EOC clear flag is what I was thinking, just need to implement.
To the other poster regarding conductance and time......I know the difference, slip of case.