Sunday, July 21, 2024

Homebrew sBitx - Power and SWR Meter Working

 

KK4DAS sBitx Screen in Tx PWR and SWR Meter

Victory is at hand.  In my previous post I described the Tale of Woe regarding the power and swr meter sensor

As I have suspected for a while the problem turned out to be the some combination of the Arduino board and the Wire library.  Rafael Diniz, from the groups.io BITX20 forum suggested I load the ATTinyCore from Spence Konde which I did, but the problem remained - always -1 returned for FWD and REF power.  Perusing the Arduino support forum I was pointed to an alternative to the Wire library called TinyWire.  I loaded that and changed all the references from Wire to TinyWire and that worked.  Here are the details.
 
1. IDE: Arduino IDE 2.3.2
2. Board Manager: ATtinyCore by Spence Konde, GitHub - SpenceKonde/ATTinyCore: Arduino core for ATtiny 1634, 828, x313, x4, x41, x5, x61, x7 and x8 (NOTE - because of SSL certificate errors it doesn't currently load using the Arduino IDE board manager.  I had to search for a procedure to manually install it.)
3. Board Selected:  ATtinyCore -> ATtiny25/45/85 (No Bootloader)
4. Chip Selected:  ATtiny85
5. Programmer: Arduino as ISP  (I built a programmer using a spare Arduino Nano)
6. Install the the TinyWire library: GitHub - lucullusTheOnly/TinyWire: Composite Master and Slave I2C library for Atmels ATTiny microcontrollers
7. In swr_bridge.ino change all referencs to Wire to TinyWire and change:  

TinyWire.write(message, 4);

to

TinyWire.send(message, 4);
 
Compile, upload and be happy for the rest of the afternoon.
 
I can't explain why ATtinyCore and Wire worked for Rafael.  I never did learn what the original build environment for the SWR bridge was.  The comments in the code refer to DIYTiny - I searched and found that one - it didn't work for me either.
 
The Arduino ecosystem is terrific - unfortunately thre are so many people contributing board managers and libraries - some are great quality - some are marginal - but there is no authoritative place to go to find what works.

Now, finally on to final calibration and packaging!
 
73 from Great Falls,
 
Dean
KK4DAS

No comments:

Post a Comment