Skip to content

Channel Change Improvements

Compare
Choose a tag to compare
@CedarGroveStudios CedarGroveStudios released this 14 Jan 20:18
· 27 commits to main since this release

Two issues were addressed in this release.

The first was ghosting of unread data left in the device data register after changing channels making it appear that the data was coming from the newly selected channel.

The second was a change to how the Cycle Ready (CR) flag is monitored after a channel change. The channel change process takes at least five conversion cycles (approximately 500ms) to fully prepare the ADC with channel offset and calibration settings. When switching from channel two to channel one, the CR flag will indicate that the channel switch settling had elapsed but is still in progress. Clearing the data buffer prior to changing channels fixes this issue, but the flag monitoring logic was set to only return from the channel change function when the CR flag indicated completion, creating a potential endless loop if timing isn't perfect. The CR check now times out after one second and returns False if the CR flag wasn't set.

Tested on a Clue and PyPortal Titano with the CedarGrove dual-channel NAU7802 wing as well as the Adafruit NAU7802 Stemma breakout.