feat: I2C sensor support (config packet + data protocol) #50
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wait-to-fix
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
daru/PICsense#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Support low-power I2C sensors that don't require a warm-up period (this rules out most VOC/chemical sensors).
Hardware I2C conflicts with the TX on this rev. The MSSP1 I2C peripheral is fixed to RA1 (SCL) + RA2 (SDA) — there is no APFCON pin selection for I2C. RA2 is currently the TX DATA pin, so hardware I2C cannot run alongside the TX without moving the TX. Decision: bit-bang I2C (master-only) on any 2 GPIOs, which sidesteps the fixed-pin conflict and matches the rewire.
Bit-banged I2C details:
TX-sleep invariant (firmware): I2C SDA idles high. The RF TX wakes and transmits when DATA is held high longer than tOFFT. So if an I2C pin ever shares a TX pin, DATA must be held low otherwise the TX wakes and transmits the SDA line. With the planned hardware MUX (next rev), the TX is physically isolated when not in use. The firmware must track TX asleep/awake as state.
Two parts:
Open questions:
MS8607 will likely be the first targeted sensor.