开云体育

Homebrew SBITX - RTC and SWR Meter board #homebrew #sBitx


 

Hi all -?
?
I've built a board for the RTC module and SWR sensor.? These are the final two modules for the bult.? The RTC module is working great.? The SWR sensor not so much.? ?I posted on an old thread about the issues I'm having with the AtTiny85.? I finallly managed to download the board manager and build and load the firmware onto the Tiny.? It comes up on the bit-bang I2C bus OK and apparently responds to the request for data but the Pi always receives -1 for both Fwd and Ref power.?
?
The RTC and AtTiny are on the same board and I'm confident its wired up correctly.? I've separately built a number of other projects using the AtTiny - including my own stand-alone SWR meter with an OLED display so I'm confident there is no problem with the wiring.? ?I know the directional coupler is working ok because I tested it with my stand-alone meter - and I read about 1.5V FWD on 20 watt CW key down on 40 meters..? To eliminate the A2D entirely I made a test version of the sketch for the Tiny that sends back fixed hard-coded FWD and REF power.? And the only value the Pi ever reads is -1.?
?
I'm puzzled and at a bit of a loss for what else to look for.? ?Looking for any suggestions.
?
73,
Dean
KK4DAS
?
?
?
I even built a simple board with only the AtTiny that plugs directly into the I2C BB header on the Pi Hat.? it exhibits the same behavior.
?


 

This is probably a dumb question but.. Have you build the SWR measuring circuit as well with a coil and diodes?
?
?
?
-JJ


 

On Wed, Jul 17, 2024 at 03:47 PM, JJ - W9JES wrote:
This is probably a dumb question but.. Have you build the SWR measuring circuit as well with a coil and diodes??
Fair question JJ -since the picture I posted doesn't show the board and is disconnected.? ?The measuring circuit is more formally known as a Stockton Bridge or Directional Coupler.? I've built them a number of times.?
?
Here is the directional coupler for the sBitx.? ?I tested it stand-alone and in the rig. It works.? On key-down CW on 40 meters at 20 watts into a dummy load I measure 1.5V DC on the FWD pad which is well within the 3.3V range of the AtoD on the AtTiny.?
?
73,
Dean
KK4DAS
?


 

?datI'm still working on a problem with the homebrew SWR / PWR meter - I've now confirmed that no matter what the AtTiny reads on the FWD and REF pads it always puts 255 (integer -1) on the I2C data bus.? The Rigol is decoding the I2C packets as they come off the AtTiny.
?
The AtTiny in Farhan's design does not have pull-up resistors on the I2C SCL and SDA lines.? It relies on the 3.3K pullups that are on the SI5351 I2C lines which should be enough since both devices are on the I2C bitbang bus.? I'm wondering if I need a smaller / stronger pull-up resistor on the SDA line.? ?
?
It obviously works in the V2 and V3 designs.? I'm curious if anyone with a DE experienced anything like what I am seeing.
?
73,
Dean
KK4DAS
?
For your viewing pleasure - an SWR meter I2C packet captured and decoded on the Rigol scope.? Address 08, data, 255, 255, 255, 255
?
?


 

Hey Dean..?
?
I hope you get it sorted out soon.. Great work so far!
?
?
?
-JJ


 

开云体育

Dean,?
From the scope shot I see the data bits are always one, but the ack bit is always zero. So I would like think the pull resisters are ok. Are you sure your sending valid data. I would change the code to always send back a known data pattern to test the i2c data connection.
Your project is great!!!
-Jerry KN6BJK

On Jul 18, 2024, at 8:52 AM, Dean Souleles <dsouleles@...> wrote:

?datI'm still working on a problem with the homebrew SWR / PWR meter - I've now confirmed that no matter what the AtTiny reads on the FWD and REF pads it always puts 255 (integer -1) on the I2C data bus.? The Rigol is decoding the I2C packets as they come off the AtTiny.
?
The AtTiny in Farhan's design does not have pull-up resistors on the I2C SCL and SDA lines.? It relies on the 3.3K pullups that are on the SI5351 I2C lines which should be enough since both devices are on the I2C bitbang bus.? I'm wondering if I need a smaller / stronger pull-up resistor on the SDA line.? ?
?
It obviously works in the V2 and V3 designs.? I'm curious if anyone with a DE experienced anything like what I am seeing.
?
73,
Dean
KK4DAS
?
For your viewing pleasure - an SWR meter I2C packet captured and decoded on the Rigol scope.? Address 08, data, 255, 255, 255, 255
?
?
<PXL_20240718_145348217.jpg>


 

Thanks Jerry. I already did exactly what you suggested. I made a version of the sketch that sent hard-coded constants instead of the analog read values. The output is still always all ones. I also tested the directional coupler with another circuit that I had built and it's working fine.??
?
The pull-up resistors was a shot in the dark.? Putting 2.2K resistors made no difference.
?
Thank you for the the compliment about my project. It's been a lot of fun.? And I have learned something new from every stage.
?
73, Dean
KK4DAS?


 

I am almost certain that the issue is down to one of two things - a problem with the ATTINY85 Board Manager that I chose or the version of the WIRE protocol that it uses.
?
As ususal, the Internet is full of non-authoritative conflicting observations on what should work, but probably doesn't.
?
There are multiple board managers for the ATTINY85, there are multiple WIRE libraries.? ?If anyone knows and has built the combination that actually works please let me know.
?
I've documented my step by step process on my blog:
?
?
73,
Dean
KK4DAS


 

I use this one:


I made a Makefile using arduino-mk (make for compiling, make ispload for loading the firmware) for use in my Atiny85 firmware for the sbitx:


- Rafael

On 7/19/24 21:05, Dean Souleles wrote:
I am almost certain that the issue is down to one of two things - a problem with the ATTINY85 Board Manager that I chose or the version of the WIRE protocol that it uses.
As ususal, the Internet is full of non-authoritative conflicting observations on what should work, but probably doesn't.
There are multiple board managers for the ATTINY85, there are multiple WIRE libraries.? ?If anyone knows and has built the combination that actually works please let me know.
I've documented my step by step process on my blog:
KK4DAS - Amateur Radio Explorations: Homebrew sBitrx - RTC and Power Meter - ATTINY85 Tale of Woe <>
73,
Dean
KK4DAS


 

开云体育

You can eliminate the ATTiny form the whole thing by pulling it off the board. But i know ot has nothing to do with the display issue because ots not connected to the teensy yet. ? No routines in the teensy code for it to work yet. ??


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 3:05?PM, Dean Souleles <dsouleles@...> wrote:

?
I am almost certain that the issue is down to one of two things - a problem with the ATTINY85 Board Manager that I chose or the version of the WIRE protocol that it uses.
?
As ususal, the Internet is full of non-authoritative conflicting observations on what should work, but probably doesn't.
?
There are multiple board managers for the ATTINY85, there are multiple WIRE libraries.? ?If anyone knows and has built the combination that actually works please let me know.
?
I've documented my step by step process on my blog:
?
?
73,
Dean
KK4DAS


 

On Fri, Jul 19, 2024 at 05:26 PM, Rafael Diniz wrote:
I use this one:
?
Thanks Rafael - the SpenceKonde ATTinyCore doesn't currently load in the Arduino IDE.? When you follow the instructions to install it using the IDE you get certificate errors.? Following? a bunch of posts on the Arduini support forum where there has been much discussion about this for moths, I did manage to load it manually earlier today an got a clean compile.? I wont be back in the shack until Sunday to test.? I also have found a couple of other cores that rely on TinyWireS? instead of wire - so I have plenty to test when I return.
?
What are you trying to accomplish wiht the additional functionality in the ATTYIn.? ?I see you have enabled getting and setting serial numbers and so forth, but I'm not sure why I would want to do that,? ?I don't understand what the ATTiny has do do with CAT control at all.? If you have documented it somewhere I'd be glad to look it over.? ?At the moment I will be happy to get the power readings working.? ?Your makefile for the ino is straightforward - it should be equivalent to what the IDE does.??
?
I admit I had never heard of Rhizomatic or HERMES before today - and was intrigued at the background.? If I understand it you are using the sbitx as to core radios for these rural self-managed communications networks.? ?It sounds like a fascinating project.? It looks like a very worthwhile project.
?
73,
Dean
KK4DAS
?
?
?
?
?


 

On Fri, Jul 19, 2024 at 05:30 PM, K9HZ wrote:
You can eliminate the ATTiny form the whole thing by pulling it off the board.
Gee - why didn't think of that!? :)
?
Reminds of a joke:
?
I went to the doctor and said:
?
"Doc, it hurts when I go like this...'"
?
The doctor replied:
?
"Don't go like this."
?
?


 

开云体育

The ATTiny85 has NOTHING to do with anything except turning the radio on and off. ?I used ot instead of a few flipflops. ?Easier and cheaper. ?Nothing communicates with the ATTiny except two lines from the teensy. ?One digital input and one digital output. ? The code for the ATYiny is on my gitbub (has “state machine” in the file name) and acts like a set of flipflops and a delay. ?Thats it. ?You cant talk to it. ?


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 7:43?PM, Dean Souleles <dsouleles@...> wrote:

?
On Fri, Jul 19, 2024 at 05:26 PM, Rafael Diniz wrote:
I use this one:
?
Thanks Rafael - the SpenceKonde ATTinyCore doesn't currently load in the Arduino IDE.? When you follow the instructions to install it using the IDE you get certificate errors.? Following? a bunch of posts on the Arduini support forum where there has been much discussion about this for moths, I did manage to load it manually earlier today an got a clean compile.? I wont be back in the shack until Sunday to test.? I also have found a couple of other cores that rely on TinyWireS? instead of wire - so I have plenty to test when I return.
?
What are you trying to accomplish wiht the additional functionality in the ATTYIn.? ?I see you have enabled getting and setting serial numbers and so forth, but I'm not sure why I would want to do that,? ?I don't understand what the ATTiny has do do with CAT control at all.? If you have documented it somewhere I'd be glad to look it over.? ?At the moment I will be happy to get the power readings working.? ?Your makefile for the ino is straightforward - it should be equivalent to what the IDE does.??
?
I admit I had never heard of Rhizomatic or HERMES before today - and was intrigued at the background.? If I understand it you are using the sbitx as to core radios for these rural self-managed communications networks.? ?It sounds like a fascinating project.? It looks like a very worthwhile project.
?
73,
Dean
KK4DAS
?
?
?
?
?


 

开云体育

Now you will have to toggle the pin that addresses the fet high and low to turn the radio on and off if you do that. ?


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 7:45?PM, Dean Souleles <dsouleles@...> wrote:

?
On Fri, Jul 19, 2024 at 05:30 PM, K9HZ wrote:
You can eliminate the ATTiny form the whole thing by pulling it off the board.
Gee - why didn't think of that!? :)
?
Reminds of a joke:
?
I went to the doctor and said:
?
"Doc, it hurts when I go like this...'"
?
The doctor replied:
?
"Don't go like this."
?
?


 

开云体育

Sorry wrong forum! ? Please ignore!


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 7:59?PM, K9HZ <bill@...> wrote:

?The ATTiny85 has NOTHING to do with anything except turning the radio on and off. ?I used ot instead of a few flipflops. ?Easier and cheaper. ?Nothing communicates with the ATTiny except two lines from the teensy. ?One digital input and one digital output. ? The code for the ATYiny is on my gitbub (has “state machine” in the file name) and acts like a set of flipflops and a delay. ?Thats it. ?You cant talk to it. ?


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 7:43?PM, Dean Souleles <dsouleles@...> wrote:

?
On Fri, Jul 19, 2024 at 05:26 PM, Rafael Diniz wrote:
I use this one:
?
Thanks Rafael - the SpenceKonde ATTinyCore doesn't currently load in the Arduino IDE.? When you follow the instructions to install it using the IDE you get certificate errors.? Following? a bunch of posts on the Arduini support forum where there has been much discussion about this for moths, I did manage to load it manually earlier today an got a clean compile.? I wont be back in the shack until Sunday to test.? I also have found a couple of other cores that rely on TinyWireS? instead of wire - so I have plenty to test when I return.
?
What are you trying to accomplish wiht the additional functionality in the ATTYIn.? ?I see you have enabled getting and setting serial numbers and so forth, but I'm not sure why I would want to do that,? ?I don't understand what the ATTiny has do do with CAT control at all.? If you have documented it somewhere I'd be glad to look it over.? ?At the moment I will be happy to get the power readings working.? ?Your makefile for the ino is straightforward - it should be equivalent to what the IDE does.??
?
I admit I had never heard of Rhizomatic or HERMES before today - and was intrigued at the background.? If I understand it you are using the sbitx as to core radios for these rural self-managed communications networks.? ?It sounds like a fascinating project.? It looks like a very worthwhile project.
?
73,
Dean
KK4DAS
?
?
?
?
?


 

On Fri, Jul 19, 2024 at 09:01 PM, K9HZ wrote:
Sorry wrong forum! ? Please ignore!
Ah, makes sense now. Different radio, different discussion. :)
?
No worries and thanks for clarifying.
?
Thank you.


 

开云体育

Yeah sorry to all. ?Im away from home and using my phone. ?Total operator mess up.


Dr.?William J. Schmidt - K9HZ J68HZ 8P6HK ZF2HZ PJ4/K9HZ VP5/K9HZ PJ2/K9HZ

?

Owner - Operator

Big Signal Ranch – K9ZC

Staunton, Illinois

?

Owner – Operator

Villa Grand Piton - J68HZ

Soufriere, St. Lucia W.I.

Rent it: www.VillaGrandPiton.com


email:??bill@...

?


On Jul 19, 2024, at 8:58?PM, Dean Souleles <dsouleles@...> wrote:

?
On Fri, Jul 19, 2024 at 09:01 PM, K9HZ wrote:
Sorry wrong forum! ? Please ignore!
Ah, makes sense now. Different radio, different discussion. :)
?
No worries and thanks for clarifying.
?
Thank you.


 

Hi Dean,

You can just use the Makefile and the ATTinyCore I mention to compile the "stock" firmware (just swap the .ino to Farhan's). I don't use the Arduino IDE, which I hate tbh.
: )

ATtiny has 512 bytes of non-volatile memory, so this is useful for our project, for example, to hold the radio serial number, so user can swap the SD card while retaining all specific board setup and calibration.

Btw, more info about HERMES here:


I also uploaded a couple of SD card images of our HERMES system for the sBitx:


Cheers,
Rafael

On 7/20/24 01:43, Dean Souleles wrote:
On Fri, Jul 19, 2024 at 05:26 PM, Rafael Diniz wrote:

I use this one:

Thanks Rafael - the SpenceKonde ATTinyCore doesn't currently load in the Arduino IDE.? When you follow the instructions to install it using the IDE you get certificate errors.? Following a bunch of posts on the Arduini support forum where there has been much discussion about this for moths, I did manage to load it manually earlier today an got a clean compile.? I wont be back in the shack until Sunday to test.? I also have found a couple of other cores that rely on TinyWireS? instead of wire - so I have plenty to test when I return.
What are you trying to accomplish wiht the additional functionality in the ATTYIn.? ?I see you have enabled getting and setting serial numbers and so forth, but I'm not sure why I would want to do that,? ?I don't understand what the ATTiny has do do with CAT control at all.? If you have documented it somewhere I'd be glad to look it over.? ?At the moment I will be happy to get the power readings working.? ?Your makefile for the ino is straightforward - it should be equivalent to what the IDE does.
I admit I had never heard of Rhizomatic or HERMES before today - and was intrigued at the background.? If I understand it you are using the sbitx as to core radios for these rural self-managed communications networks.? ?It sounds like a fascinating project.? It looks like a very worthwhile project.
73,
Dean
KK4DAS


 

On Sat, Jul 20, 2024 at 09:52 AM, Rafael Diniz wrote:
You can just use the Makefile and the ATTinyCore I mention to compile the "stock" firmware (just swap the .ino to Farhan's). I don't use the Arduino IDE, which I hate tbh.
: )
Rafael,
?
No argument there about the IDE. I normally use visual studio. But this sketch is so small, it doesn't really matter. Looks like your build environment is on Linux.? Mine is on Windows.?
?
73,
Dean
KK4DAS?


 

Victory is at hand.? PWR / SWR Meter is working.
?
?
As I have suspected for a while the problem turned out to be the some combination of the Arduino board and the Wire library.? As Rafael suggested I loaded the ATTinyCore from Spence Konde 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, (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:
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 hear back from Farhan 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.
?
73 and thanks for following along.
?
Dean
KK4DAS