Showing posts with label ATTINY85. Show all posts
Showing posts with label ATTINY85. Show all posts

Wednesday, July 24, 2024

Arduino Nano as ISP programmer for ATTINY85

 


My breadboard ISP programmer started falling apart, and I would often bend the pins on the ATTINY85 plugging and unplugging repeatedly while working a project.  I took an hour this morning and soldered up a permanent programmer circuit.   There are number of good online tutorials for how to do this.  Here is one I used as a refernce:  Hao's Blog - Programming ATtiny85 with Arduino Nano  (Note: for the sBitx SWR Bridge we use a different board manager core than the one Hao demonstrates.  See my blog post KK4DAS - Amateur Radio Explorations: Homebrew sBitx - Power and SWR Meter Working for details.)  The official Arduino document for using an Arduino as a programmer is here: Arduino as ISP and Arduino Bootloaders | Arduino Documentation

This worked straight away - its great to have a soldered up board - and with the zero insertion force socket - no more bent pins.

73 from Great Falls

Dean

KK4DAS





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