FreeEMS Issues - Firmware
View Issue Details
0000185FirmwareAnalogue Inputspublic2011-06-18 17:262011-06-18 17:26
0000185: Investigate moving ADC reading to ISR from continuous
I suspect that continuous reading places excess load on the pin, and drags the voltage outside down as a result, skewing the readings slightly.

It is possible to trigger a reading to be taken, and get an ISR call from the ADC module, in which you could read appropriate registers and populate appropriate variables.

This would require some thought as other readings would need to be taken in a more consistent way, and possibly by the same mechanism, or perhaps there is another? What happens when they overlap?

What happens at HIGH RPM when we ask for more readings than there is time to take, the main loop could starve of CPU time, potentially. Moving to its own ISR would mean shorter decoder ISR runtime but more overhead from entering and leaving ISRs. Needs careful consideration.

Another solution might be to take frequent short readings, and flag that one of them be used for timed values and the rest just get used as is. This would have the disadvantage of inaccuracy in the timing of the reading, but could work well.
No tags attached.

There are no notes attached to this issue.