Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Locations to solder for the battery remaining display! #19

Open
Sarah-C opened this issue Sep 16, 2024 · 36 comments
Open

Locations to solder for the battery remaining display! #19

Sarah-C opened this issue Sep 16, 2024 · 36 comments

Comments

@Sarah-C
Copy link

Sarah-C commented Sep 16, 2024

STOP! ATS 20+ users!

The below isn't needed!
G8PTN has pointed out that it HAS the needed resistors already on the A1 pin of the device...
Please follow his advice, and leave your soldering iron alone!

If we solder to the negative and positive of the battery, there's always some current used even when the device is off.
So I looked on the board for a suitable spot to use that's part of the circuit within the on/off switch control.

I found the 5V pad shown in the screenshots was straight from the battery through the power switch.
So I heat shrank (to avoid any shorts from the resistor bare wire legs) two 10Kh resistors and soldered one to this pad, and one to the ground pin of the Arduino Nano - simply because it's easy to solder to.

Erm.... a mistake! I cut the resistor leg a bit short for the 5v pin resistor, so the yellow wire you see from A2 curving around is to correct the short resistor leg! It's just soldered at the point between the two resistors that are joined.

To be fair though, it works out a bit better as soldering a single solid wire to A2 is easier than two resistor legs twisted together. It leaves room on either side.

I hope someone finds the pictures useful, and perhaps Vincent will put them in some instructions somewhere?

loc1

loc2

loc2b

96% battery left! YAY! It works.
Additionally the voltage divider is turned off by the power switch so there's no power draw when it's off.

loc3

@G8PTN
Copy link

G8PTN commented Sep 17, 2024

Hi,
For information, on the ATS-20+, you should not need to make any hardware changes for the battery monitoring.
The switched “V_BAT” is connected to pin “A1” via a potential divider.
Update the defs.h file and then recompile and upload the code to the ATS-20+
Change from: #define BATTERY_VOLTAGE_PIN A2
Change to: #define BATTERY_VOLTAGE_PIN A1
73, Dave

image

@Sarah-C
Copy link
Author

Sarah-C commented Sep 19, 2024

Blimey! That's good advice Dave!

I think I'll recompile, and remove the extra soldering. Thanks for letting everyone here know!

@Sarah-C
Copy link
Author

Sarah-C commented Sep 19, 2024

Update!

My soldering has been taken out, and the potential divider on pin A1 is working fine.

Arduino IDE - Making the changes to the program....
As Vincent said - if you have Visual Studio, load the .SLN file.....
If you have the Arduino IDE, simply goto File/Open/and find the ATS_EX.ino file in the project you download.
The other files will appear in several other tabs.
Click on the defs.h tab, and make the changes David G8PTN talks about.

It'll give some warnings about ANSI C++ data type conversions when you compile it, but they can be ignored.

It'll upload just fine, and the battery display will show the power left! Much less work than soldering.

@kirbimir
Copy link

kirbimir commented Sep 19, 2024

Hi,
I follow for last few days your topic and collect info about upgrading ATS-20+ which should arrive to me within nex 10 days or so. I have never flashed to ATS radio and I familiarized myelf with all info I could so procedures are relatively clear to me . I prepared all files from ARDUINO IDE v 2.3.3 (nightly build) - photo of files is here.
However, can you by means of photo (screen capture) or so ? Any advice is welcome!
I am afraid I will enter data incorrectly and ruin the ATS-20+ .
Thank you in advance, with best regards Zarko

prepared files

@Sarah-C
Copy link
Author

Sarah-C commented Sep 19, 2024

Ahhhh! I used the older Arduino 1.8.19.......

I have one question kirbimir- the folders you have.... did you install them into your Arduino IDE?

The convention is to open the "Library Manager" in the Arduino IDE, and search for the libraries in there. You won't see the folders themselves.
To me it looks like you've downloaded the folders directly - this should be fine when you build (when the folders are all in the right place!) It'll still work - but you won't get the benefit of the libraries auto-updating for bug fixes and new features.

You can click the "Tick" button, to see if it compiles... you don't need to have the device yet!
If you can't get the compile and you get errors for missing libraries - it's best to go the library manager and search for them, and download them in there. The Arduino IDE will link all the libraries it's managing up to the compiled Radio program you're making. You don't need to fiddle with getting compile paths correct.

Don't worry about "bricking" your radio doing this........ the Arduino Nano has a small program in it that doesn't change. The "Bootloader"...... this ALWAYS checks to see if some PC program is trying to update the device software before the device runs your program. It only pauses for a fraction of a second to check.....
Importantly!
Your program you upload WONT overwrite the bootloader, so if the sketch for some reason doesn't work, you'll always get to upload again, perhaps a different sketch. But it should go fine.

If you have problems, you can use the AVRDUDESS with the ready-compiled HEX file. It'll upload the pre-compiled code without the Arduino/Visual Studio IDE needed.

I've included a picture of what you should see for the libraries.......
image

Image showing the tab that contains the #Definition what needs editing.
image

@kirbimir
Copy link

Hi,
Thank you sso much for your detailed explanations. I got what is in my directory by clicking "install" in Library Manager in ARDUINO IDE. Do not know are these usefull or not. However , I found one .hex file ATS_EX_v 1.18.hex by someone giving youtube video of update instructions. Is this the file to use in AVRDUDESS ?
Anyway, I will study your comments to get better understanding.
Thank you again, Zarko

@G8PTN
Copy link

G8PTN commented Sep 19, 2024

Hi,
I also used Arduino IDE 1.8.19, primarily because it allows for a portable installation, which keeps everything in a known area on the PC. Yes, there are several compile warnings in Arduino IDE, but everything seems to work okay.

A couple of minor points:

  • Uploading the hex file using the ISP interface will erase the flash (including the bootloader area), so it is best to do the updates via the USB interface as stated by Sarah, since the bootloader will be maintained.
  • When using the USB interface, it is best to isolate the 5V connection if possible, since this can conflict with the 3V3 that is feeding the Arduino Nano (see link).
    ATS20+ #7 (comment)

73, Dave

@kirbimir
Copy link

kirbimir commented Sep 20, 2024

I studied in details ARDUINO IDE v.2.3.3 user instructions they have put on, and tried several examples and procedures. I think it is quite clear now to me how to do upgrade on my coming ATS-20+ box. When I do the upgrade using procedure decribed in intruction I wil post the photos of upgraded box. Thank you all for your king comments!
One thing I do not understand : how to isolate v5 described here ? I cannot see from photo what it is . Can you give more detalis? Thank you.
Best regards
Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 20, 2024

Hi,
To isolate the VBUS (5V) on the USB interface, others have just cut the 5V wire in the USB cable.

I built a small isolator breadboard with USB-A and Micro-USB sockets that I had available.
The GND, D+ and D- are connected between the associated pins on the two sockets.
The VBUS (5V) is connected between the two sockets via a break link.

To isolate the VBUS (5V), I remove the link and use two un-modified USB cables.
Cable 1: USB-A from PC to Micro-USB on isolator board.
Cable 2: USB-A from isolator board to Mini-USB on ATS-20+.

I hope that helps.
73, Dave

image

image

@kirbimir
Copy link

Hi Dave,

Thanks for additional explanation. However, could you post a picture of complete connection or diagram how to connect this gadget to laptop and AT-20+ ?

Looks to me it needs some miniature soldering activity.

I must confess it is not quite clear to me,

Thank you
Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 21, 2024

Hi Kirbimir,
There is no miniature soldering required, the USB breakout boards are all on 0.1 inch (2.5mm) pitch.
As stated previously, others have just cut a cable in half and joined all the wires apart from the 5V. This is the easiest option.
Others have not even isolated the 5V, and in most cases it still works, but there is a risk that something could be damaged.
Comments from other groups attached.
https://groups.io/g/si47xx/message/625
73, Dave

image

@kirbimir
Copy link

Thank you Dave for additional information. What I see on the photo the micro female port on ATS-20+ must be connected to 5V box and home wall to give pover to the device or to laptop ?
Therefore , mini USB port with cut 5V cable in the cable itself is only for data transfer. Do I get this corectly?
Regards, Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 21, 2024

Hi Kirbimir,
Nearly right.

The Nano was designed to operate from 5V, but on the ATS-20+ the interface to other devices needs to be 3.3V, so they obviously decided to run the Nano from the 3V3. This is okay until you connect a USB cable from a PC. The diode that is in the VBUS (5V) path on the Nano will try and pull the internal supply voltage above 3.3V, which could cause other devices on the ATS-20+ to be damaged.

By cutting the 5V from the PC to the ATS-20 USB port, it prevents this from happening. You do need to have the ATS-20+ switched ON when downloading via the USB interface.

The ATS-20+ could have been designed to have level translation on the internal signals and there would have been no issues on the 5V from the USB connector.

You are correct that the USB connector is now only be used for data transfer, which needs "D+", "D-" and "GND" connections.
73, Dave

@kirbimir
Copy link

Hi Dave,
Thanks for explanation. Now,simply : do I connect both cables namely, micro port USB to laptop and also mini USB with cut wire 5V ?

Thanks for reply , Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 21, 2024

Hi Kirbimir,
No, if you cut the wire in the Mini-USB cable, you only need to use that cable.
I only built the adapter so that I could use standard unmodified cables.
73, Dave

@kirbimir
Copy link

Hi,
to-day I recieved AT-20+ box . No problems I detected . I post few photos. Now, I ask : what to do next ? I see on desplay V3.0.4. I prepared mini data cable as per Dave's instructions namely cutting v5 red wire - photo.
Does box need any update via ARDUINO IDE v 2.3.3 and how to proceed? Thanks for advice!
Anyway , I wouild like to soldied 2x 10 kOhm resistores as per Dave's photo to get battery showing use. Any additional advice on this issue?
Thank you ,
Kirbimir

1727448771895
1727451971912
1727451972046
1727451972072
IMG020240927_174946

@G8PTN
Copy link

G8PTN commented Sep 27, 2024

Hi Kirbimir,
You have two options. Both can be done via the “Mini-USB” connector on the back of the ATS-20+ receiver.
Option 1: Upload the hex file using AVRDUDESS.
Option 2: Modify the code in the Arduino IDE.

I hope this helps you,
73, Dave

OPTION 1
If you are not confident using “Option 2”, I have created an updated hex file with the “A2” to “A1” pin swap.
This may be the easiest option for you.
ATS_EX_v1.18.hex Original. Needs hardware modification to connect potential divider to Nano "A2" pin.
ATS_EX_v1_18_A1.hex “A2” to “A1” swap. No hardware change required.
I have put both of these hex files in the attached ATX_EX_hex.zip.
ATX_EX_hex.zip

• Install and run AVRDUDESS.
• Under the “Presets” option select “Arduino Nano (ATmega328P)".
• Set the "Baud rate" to 115200.
• Power on the ATS-20+ and connect the modified USB cable to the computer.
• Select the appropriate COM port.
• In the “Flash” option, select the hex file.
• Select the “Program!” tab. The hex file will be uploaded.
• The ATS-20+ should reboot. You may need to do an EEPROM reset after upload (see below).

Notes:

  • The ATS_EX_v1_18_A1.hex only applies to the ATS-20+ which has the connection to the "A1" pin of the Nano.
  • Do not upload this file via the ISP connector, it will override the bootloader. The file is for the "ATmega328P".
  • To reset the EEPROM, hold the rotary encoder pushed whilst turning on the ATS-20+
  • Example AVRDUDESS screenshot below with ATS_EX_v1_18_A1.hex selected.

image

OPTION 2
The method of compiling the code in Arduino IDE 2.x was covered in previous messages from Sarah.
I did not use IDE 2.x, but these are the basic steps.

• Run the Arduino IDE
• Install the following libraries using the “Library Manager”.
PU2CLR_SI4735
Tiny4kOLED
TinyOLED-Fonts
• From File/Open select the ATS_EX.ino file,
• This should load the sketch and all associated files.
• In the defs.h
Change from: #define BATTERY_VOLTAGE_PIN A2
Change to: #define BATTERY_VOLTAGE_PIN A1
• In the “Tools” option, check the "Board" and "Processor" settings.
Board: Arduino Nano
Processor: ATmega328P
• From the “Sketch” option, select “Verify/Compile”.
There may be some warnings, as identified by Sarah, but these should not cause a problem.
• Power on the ATS-20+ and connect the modified USB cable to the computer.
• From the “Tools” option, check that the Port is set correctly.
• From the “Sketch” option, select the “Upload” option and the sketch will Verify/Compile and upload to the ATS-20+
• The ATS-20+ should reboot, You may need to do an EEPROM reset after upload (see below).

Notes:

  • The change only applies to the ATS-20+ which has the connection to the "A1" pin of the Nano.
  • To reset the EEPROM, hold the rotary encoder pushed whilst turning on the ATS-20+

@kirbimir
Copy link

Hi Dave,
Thank you for detailed explenations. However, I have 2 problems:
Option 1 :

  • I have Arduino nano but in your AVRDUDESS screenshot is stated Uno
  • Will upload of ATS_EX_v1_18_A1.hex using modified mini USB
    cable override the bootloader ?
    Option 2 :
    I did everything as stated but :
    in Arduino IDE From File/Open I cannot select the ATS_EX.ino file . It does not show in "libraries" . Only :
    PU2CLR_SI4735
    Tiny4kOLED
    TinyOLED-Fonts
    show.
    How to proceed ?

Questions :
Will simply soldering resistors without Options 1 or 2 to the box as it is now give the result ?
Can I simply soldier in the box as it is now as per :

BATTERY LEVEL SHOW4

or

BATTERY LEVEL SHOW-new1

I do not understand : " The ATS_EX_v1_18_A1.hex only applies to the ATS-20+ which has the connection to the "A1" pin of the Nano."

I appologize for constant questioning !

Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

Hi Kirbimir,
Option 1:
I had already updated the instructions to select the Arduino Nano.
You just have to remember to set the baud rate to 115200 as shown in the instructions.
If you upload via the USB Mini-USB connector on the ATS-20+, it will NOT override the bootloader.
If you use the ATS_EX_v1_18_A1.hex file, you do NOT need to make any hardware changes.
There is already a connection on the ATS-20+ PCB from the switched battery via potential divider resistors to Nano pin “A1”.
image

Option 2:
You do not use the hex file directly with the IDE. You need to compile the sketch and then use the “Upload” option as stated in the instructions.

Questions :
Will simply soldering resistors without Options 1 or 2 to the box as it is now give the result ?

Option 1: ATS_EX_v1_18.hex WOULD require the resistors and wiring.
Option 1: ATS_EX_v1_18_A1.hex does NOT require the resistors or wires.
Option 2: Does NOT require hardware changes.

Can I simply soldier in the box as it is now as per :
No, not without uploading the hex file.
If you can upload via AVRDUDESS, you might as well use the ATS_EX_v1_18_A1.hex, since you do not need to make hardware changes as well.

@kirbimir
Copy link

kirbimir commented Sep 28, 2024

Hi Dave,

I get this :
image

Is nthis ok to pusdh Program! ?

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

Hi Kirbimir,
Not sure why you see the "red" message. All the settings look correct.
Give it a try, it should not break anything.
image

73, Dave

@kirbimir
Copy link

kirbimir commented Sep 28, 2024

Hi Dave,Ž
At that time field EEPROM was filled with data from "Flash" . Do nok know how I entered this. When comparing with your sample I noticed it should be empty. So I deleted contend and now it is showing blue. Obviously my mistake.
I will now push Program!
Kirbimir

@kirbimir
Copy link

image

No success.
How to solve this ?

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

Hi Kirbimir,
It looks like it is not seeing the radio.
Did you check that COM port is correct in device manager?
Is the radio turned ON?

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

When you modified the cable, did you check that all connections are okay, apart from the 5V?

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

You should see something like this in device manager.
image

@kirbimir
Copy link

kirbimir commented Sep 28, 2024

Well, I checked the cable . It should be OK .
I device Mngr shows :

image
image

device is powered

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

You should not need to change the speed, AVRDUDESS will make the setting.
What is the device on COM3?
Are you sure the radio is COM4?
If the radio is COM3, you may need to get the CH340 driver.
73, Dave

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

Hi Kirbimir,
Unfortunately, I will be off-line until later.
Hopefully you will be able to get the COM port working, and then it should upload correctly.
I will check in later.
73, Dave

@kirbimir
Copy link

I pulled out mini usb and in Device mngr COM4 dissapeared. I inserted mini cable COM 4 appeared. So I judge box in on COM4.

@kirbimir
Copy link

kirbimir commented Sep 28, 2024

Hi Dave,

I succeded to make flash under settings :

image

However, after some errors it was done . I presed rotary knob and powered device .
Now it shows new display I give pictures:

1727528023928

1727528023908

1727528023947

At the bottom right it shows now 92% . Is that battery indicator ?

I found out that FM AM changes with Rotary knob and not with switch on the back.
I was playing with it for last hour and descovered some features. However , In settings I do not know much to do . Do you have some instructions what settings items represent and how to make them ?
at least I found that COM 4 is working .
I am impressed with your software !

Thanks
Kirbimir

@G8PTN
Copy link

G8PTN commented Sep 28, 2024

Hi Kirbimir,
Excellent, well done.

It looks like your ATS-20+ had a slightly different bootloader.
Some are set for a baud rate of 115200 and others 57600, so it it not a problem.

  • Yes, the indicator on the bottom right hand side of the display is the battery indicator.

  • You will still need to move the switch at the back to FM/AM(SSB) depending on the frequency you are tuned to, since it selects the Antenna input on the SI4732 receiver chip.

  • This is not my software, I am just one of the many users of it.

  • There are lots of features and they are all covered on the main GitHub page.
    https://github.com/goshante/ats20_ats_ex?tab=readme-ov-file#user-manual

I hope you have fun with the ATS-20+
73, Dave

@kirbimir
Copy link

kirbimir commented Oct 4, 2024

Hi Dave,
First I want to thank you again for your help. AT-20+ works very fine and I have lots of fun with it.
Now I ask you if perhaps you can figure out what is wrong with my ham radio Anytone AT778uv . It can not communicate with CHIRP or Annytone factory program application . I was thinking perhaps Prolific chip program cable I got with radio was to blame so I made my own cable . Both cables are visible in Program Manger . However, my cable shpws a bit different. Error messeges I get are " no initial response from radio" & "cennot comunicate " , " read data failed ". It is my first such radio and I do not know how to solve this. I tried to find solutions on internet but all solutions are about cable not visible in Device Mngr. and similar.
If you can perhaps give me some opinion is this error something to do with radio itself,perhaps?
I enclose some photos.
Thanks in advance
Kirbimir

1728043314281
1728043314297
1728049383785
1728049595811
DEVICE MNGR
PROGRAM CABLE ANYTON -3

@G8PTN
Copy link

G8PTN commented Oct 4, 2024

Hi Kirbimir,
The information you have shown appears to be for the AT-779UV not the AT-778UV.
I have never owned either of these, but looking at information on-line, it seems that the serial data interface for the AT-778UV is a 1-wire type, where the TX and RX data is shared.
If your radio is the AT-778UV, you could perhaps try the attached circuit, where a diode is used to combine the TXD and RXD signals on the USB to Serial adapter.
https://on3jt.byze.be/programming-cable-for-anytone-at-778uv
73, Dave

@kirbimir
Copy link

kirbimir commented Oct 6, 2024

Hi Dave,
Thank you for excellent advice ! I made new interface according to schech you attached in your last reply (photos I apologice for big unedited photos).
Obviouisly trick is in installing a diode from RX pin to TX pin ! BUT I only succeded in download radio data using both Anytobe software & CHIRP after experimenting with COM4 advanced configurations (succesful configuration is as per photos) .
Result file from CHIRP is empty beacuse I prior download radio data made Reset all in radio so it is empty. Now I need to uploda new data from some template in CHIRP.
Perhaps this solution will be of help to many users of AT778uv because searching on internet I find many "how to" questions on this.
Thank you very much again!
With best regards,
Kirbimir
1728199141524
1728199141533
1728199141542
1728199141560
1728199387630
1728199387637
1728199616129
1728199616137
1728199616146
1728199616153
IMG020241006_092856

@G8PTN
Copy link

G8PTN commented Oct 6, 2024

Hi Kirbimir,
I am pleased it now seems to be working.
Yes, ideally there should be an open-drain or open-collector buffer, but the diode does a close to equivalent job, although the logic ‘0’ will be a diode drop above GND.
ICOM use a similar 1-wire interface called “CI-V”.
Perhaps you should put the information on one of the Anytone specific forums, so that it is more readily available to users.
73, Dave

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants