开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

swr_bridge.ino


 

Hi Farhan;

Looks like you are tweaking on the swr_bridge.ino program that lives in the attiny85. It looks like there could be a possibility that the message[] variable assignments, which occur in a fast loop, could get interrupted mid-stream by an i2c request from the pi, which would corrupt the forward and reverse power readings that are sent back to the pi.

You may want to set a flag in the requestEvent() function, which is then used in the main loop to get an update from the ADC channels, make the message[] variable assignments, then clear that flag and just wait for the next i2c read request to come in.

An alternative would be to block interrupts while making the message[] variable assignments, but this could impact the i2c code.

Note: I haven't built the Power/SWR sensor circuit for my DE, but I am collecting the parts.

73; Steve, N3SB

Join BITX20@groups.io to automatically receive all group messages.