开云体育

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

Re: swr_bridge.ino


 

Steve,
The i2c bus is bit banged out in our own. As such it is used for si5351, the real time clock and the swr bridge.
The rtc is read just once at the begining of the program. The si5351 is written only when you change the frequency and the swr bridge is read only during transmit.?
The clash between the si5351 and swr is highly unlikely. But a flag to show it is busy is a worthwhile addition all the same.
- f

On Tue, May 2, 2023, 6:43 PM Steve Beckman <n3sb@...> wrote:
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 [email protected] to automatically receive all group messages.