开云体育

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

CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx


Jack Purdum
 

Has anyone else done this? I tried and I couldn't reliably get the 4-byte address written in time. Of course, it could have been the cap I used, the voltage divider...even clones may work slightly differently. Just make sure you test it a bunch of times with your setup.

Jack, W8TEE



From: Nick VK4PLN <nickpullen@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 9:49 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

Another trick I have seen to save EEPROM life:
It is used in an Arduino Antenna Rotator, is to monitor the 12V via a voltage divider and Analog port.
When the voltage drops maybe 1V below "normal", as seen at startup, write settings to eeprom only then.

When you power off the radio the 5volt regulator + input capacitor should hold up the Arduino for just long enough to catch the voltage dropping and write the last used frequency to memory....

73, Nik, VK4PLN



 

I have a 4700uf cap in my junk box, that should work across the? output of the 78l05... hi hi


 

I fear that 4700uF would be an overkill on a tiny 78L05.
?After all the filteration there is needed for RF and if at all some remnant audio on power line. That too for a load current of few mA.
?The demand should be for more like low esr? say 10uF tantalum followed by say 0.47 disc or ployepropelene (box capacitor).

regards
?sarma
?vu3zmv
?

Regards
MVS Sarma
?

On Thu, Feb 8, 2018 at 8:49 AM, Nik VK4PLN <nickpullen@...> wrote:
I have a 4700uf cap in my junk box, that should work across the? output of the 78l05... hi hi



 

Not for RF filtering , but as a "battery" on power off....
73, Nik


John P
 

Here's a trick I used in my smart controller for the old AR-22 rotator. In a VFO application, if the program restarts not remembering the last frequency, it's not a big deal, but in a rotator controller, if it doesn't remember the last azimuth, then the rotator and controller can be way out of sync.

First thing I did was to add a "Run/Update" toggle switch that puts a 10uF cap across the Arduino's reset line when in the "Run" position. This was necessary because the N1MM+ Rotor control program that I was using pulses the DTR line when it starts which tells the Arduino to look for a new software?upload (the DTR signal is routed to the reset line). The cap gobbles up the short pulse and prevents the Arduino from seeing it.

Next a I added a pushbutton between one of the digital pins (I used 18 on a UNO) ?and ground. When the button is pushed, it does a software reset of the Arduino using the "". What you can do with this approach is to do any housekeeping chores that need to be done before a shutdown.

True, you're basically doing a reboot before you turn it off, but it does the job!
--
John - WA2FZW


 

Clark Martin
KK6ISP

On Feb 7, 2018, at 7:19 PM, Nik VK4PLN <nickpullen@...> wrote:

I have a 4700uf cap in my junk box, that should work across the output of the 78l05... hi hi
Don’t put it on the output, put it on the input with a diode isolating it from the RF Board if needed. On the input it only takes around a 0.5V drop before EEROM writes become either unreliable or not possible (I don’t recall now if the Mega series has undervoltage protection). While if it’s on the input it takes a drop of 5.0 volts (12 -> 7) before the regulator cuts stops regulating. That’s roughly 10 times as much time to do what you need.


 

Jack and all

Great!!!?
It matches the code I wrote.
I am still using this method in many industrial sites. Of course, using button batteries and ram is easy to solve.?But consumers not want it because I have to change the battery periodically.
I love this place with this discussion.?We are concerned about eeprom lifetime, data sheet, presentation of various solutions, and it becomes big study.

I use the method Jack uses.It is to understand the behavior of the user.

//Determine if the frequency is changing.?If the frequency is changing, skip.?Because the user is turning the knob.
? if (saveCheckFreq != frequency)
? {
? ? saveCheckTime = millis();
? ? saveCheckFreq = frequency;
? }

? ?//operation has stopped.?Stopping for 10 seconds means that you are constantly listening to something on the frequency.?So save this frequency because it is valid.
? ? if (millis() - saveCheckTime > saveIntervalSec * 1000)
? ? {
? ? ? FrequencyToVFO(1);
? ? }

? //below is write eeprom logic (final)
? //compare current frequency with?vfoA_eeprom (vfoA_eeprom has same value with eeprom)
? if (saveType == 0 || saveType == 1) //vfoA
? {
? ? ? if (vfoA != vfoA_eeprom) {
? ? ? ? EEPROM.put(VFO_A, vfoA);
? ? ? ? vfoA_eeprom = vfoA;
? ? ? }

I implemented it this way and avoided the lifetime error of eeprom.
I think that consideration for eeprom lifetime is essential and I think these discussions are quite beneficial.
?
The following video was taken to confirm that the above logic is working properly.

test about frequency write to eeprom


test about mode write to eeprom



2018-02-08 11:56 GMT+09:00 Jack Purdum via Groups.Io <jjpurdum@...>:

I had a situation where I wanted to insure that, when the user restarted their transceiver, it would show the last-used frequency. The problem is you don't know when they are going to turn the rig off. Sure, there are ways to do things after power is removed, but this was a QRP rig where cost was a primary concern. What I did was use one of the Nano's timers to try to determine what the user was doing. If the frequency is changing in short intervals, say once every second, chances are they are tuning around on the band. If they have not changed frequency in the past XX seconds, I updated the EEPROM with that frequency, provided that the EEPROM frequency is different from the current operating frequency. That way, if the user is monitoring a net frequency for an hour or is away doing something but the rig is still on, no EEPROM updates are done. EEPROM reads have no life cycle, so if they are just tuning around or if they are "parked" on a frequency, this approach can extend the lifetime of the EEPROM.

Jack, W8TEE



From: Ian Lee <kd8cec@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 9:08 PM

Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

Thanks for very important information.

The lifetime of the eeprom guaranteed by the vendor is 100,000 write cycle. read cycle is unlimited.
One thing to note is 100,000 times per memory address.
It is not important how many eeprom addresses are used, but how much is written to one eeprom address is important.
There is no problem with using a typical eeprom. 100,000 times more than thought is very large.
Some people say that they have used more than 100,000 through the experiment, but it is better to use the range that the vendor guarantees.

Experience has shown that the eeprom lifetime error is one case.
It is a periodic write to one memory address.
The most vulnerable is to use eeprom in loops like for and while, or to use the eeprom periodically in the timer.

In case of uBITX, cyclic frequency(with mode) storage to eeprom will be a problem to automatically display the frequency that was used previously when the radio is turned on and off.

If you save every 5 seconds, 720 writes occur in 1 hour.?The life of the eeprom guaranteed by the vendor is only 138 hours.?If use it for 2 hours every day, the life time of 70 days is over.
Of course, the actual life of the eeprom is much longer than the number of times it is guaranteed by the business. Because we are not always lucky, i will not discuss it here.

So, I am actively agreeing with ron's important information.

I have put some of safeguards in my firmware to take into account the life of the eeprom.
The first is virtual eeprom.?I created the same variable as eeprom that I had to write periodically and put it in memory.
Compared to the contents of memory before writing to eeprom, I made it write if it changed.
This avoids unnecessarily wasting the write cycle on a periodic basis and preventing the CPU usable
Another was to identify the intent of the user.?In other words, if the frequency is changing rapidly, the user is turning the knob.
That is, if the frequency is changing, it will skip even if the periodic storage time is reached.

Always be careful when using eeprom in loop statements or timers.

Ian KD8CEC

2018-02-08 8:49 GMT+09:00 Ronald Pfeiffer via Groups.Io <w2ctx@...>:
I would be careful since EEPROM has a finite write life!
These nano's are soldered in.

rOn



From: Mike Woods <mhwoods@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 6:27 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

There are 20 memory channels in the latest versions (0.35 and 1.0) and they are stored in EEPROM.

Mike

On Thu, 8 Feb 2018 at 11:14 AM, John P <j.m.price@...> wrote:
Not familiar with your code, but maybe keep the memories in EEPROM.?
--
John - WA2FZW




--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
(my blog)




--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
(my blog)


 

Jack.
I think it is probably due to the big current consuming parts like LCD.
i have heard that a long time ago (20 years ago?) I used to use this method in a low power device.?
I will try to use a super capacitor and a diode later, and I have not tried it until now.

Ian

2018-02-08 12:10 GMT+09:00 Jack Purdum via Groups.Io <jjpurdum@...>:

Has anyone else done this? I tried and I couldn't reliably get the 4-byte address written in time. Of course, it could have been the cap I used, the voltage divider...even clones may work slightly differently. Just make sure you test it a bunch of times with your setup.

Jack, W8TEE



From: Nick VK4PLN <nickpullen@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 9:49 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

Another trick I have seen to save EEPROM life:
It is used in an Arduino Antenna Rotator, is to monitor the 12V via a voltage divider and Analog port.
When the voltage drops maybe 1V below "normal", as seen at startup, write settings to eeprom only then.

When you power off the radio the 5volt regulator + input capacitor should hold up the Arduino for just long enough to catch the voltage dropping and write the last used frequency to memory....

73, Nik, VK4PLN




--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
(my blog)


 

开云体育

I would write some test code that zeros all the EEROM then uses a hardware timer to writes a non-zero value to sequential locations in EEROM at fixed intervals. ?On start up it prints out the number of non-zero locations. ?To use it you power it on then off for several seconds then on again and look to see how many non-zero locations there were. ?This will tell you how long you have to write

Clark Martin
KK6ISP

On Feb 7, 2018, at 7:10 PM, Jack Purdum via Groups.Io <jjpurdum@...> wrote:

Has anyone else done this? I tried and I couldn't reliably get the 4-byte address written in time. Of course, it could have been the cap I used, the voltage divider...even clones may work slightly differently. Just make sure you test it a bunch of times with your setup.



 

开云体育

If you can wire the LCD backlight to be turned on by a transistor controlled by the CPU then on power fail detection you can turn it off to conserve power.

Clark Martin
KK6ISP

On Feb 7, 2018, at 8:22 PM, Ian Lee <kd8cec@...> wrote:

I think it is probably due to the big current consuming parts like LCD.
i have heard that a long time ago (20 years ago?) I used to use this method in a low power device.?
I will try to use a super capacitor and a diode later, and I have not tried it until now.



 

Of course if you de-solder the nano and put in a socket you
can replace the nano for low cost.

rOn




From: Clark Martin <kk6isp@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 11:30 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

If you can wire the LCD backlight to be turned on by a transistor controlled by the CPU then on power fail detection you can turn it off to conserve power.

Clark Martin
KK6ISP

On Feb 7, 2018, at 8:22 PM, Ian Lee <kd8cec@...> wrote:

I think it is probably due to the big current consuming parts like LCD.
i have heard that a long time ago (20 years ago?) I used to use this method in a low power device.?
I will try to use a super capacitor and a diode later, and I have not tried it until now.





 

I have switched to an I2C backpack lcd and it has the ability to turn on and off the backlight via the I2C interface.... Good idea...


 

Clark.

Excellent,?In addition to the backlight, connecting VDD of the LCD to the Transister will block the current before volts drops.

Ian

2018-02-08 13:30 GMT+09:00 Clark Martin <kk6isp@...>:

If you can wire the LCD backlight to be turned on by a transistor controlled by the CPU then on power fail detection you can turn it off to conserve power.

Clark Martin
KK6ISP

On Feb 7, 2018, at 8:22 PM, Ian Lee <kd8cec@...> wrote:

I think it is probably due to the big current consuming parts like LCD.
i have heard that a long time ago (20 years ago?) I used to use this method in a low power device.?
I will try to use a super capacitor and a diode later, and I have not tried it until now.




--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
(my blog)


 

I use a few 1F cap in series with a bleeder resistor in parallel to each
cap to keep the voltage equal.

Yvon nu6i


--
73, Yvon NU6I


 

开云体育



?OK I'll take a look at both yours and the hamlib codebase, maybe I can put together a specific ubitx backend for hamlib that supports the non ft817 memory commands. It would be nice to have a proper hamlib backend anyway so that it doesn't report ft817 functionality that isn't emulated.

-Cheers Max, G7UOZ.

On 08/02/18 00:51, Ian Lee wrote:

Max
I have not used rigctl in command mode.? I'll try the rigctl command if I have a chance.?

In FT-817 compliant CAT control, eeprom read / write is rarely used.?
VFOA / VFOB conversion, get / set cw speed, get / set side tone, and get split status.?
I have run several programs and checking which using protocol with the logic analyzer.
and uBITX emulated only necessary protocols.?So things that are not needed in uBITX like FT-817's output adjustment, antenna connector position, etc. will not be controlled.

Instead I created a new protocol for just uBITX eeprom control.
I made it so simple that it can be applied to all firmware within 20 lines of code.
uBITX Manager uses this protocol.?
uBITX Manager does not use FT-817 protocol but uses uBITX proprietary protocol, so it can not be controlled by general purpose program.


I am happy to get a lot of information while starting amateur radio again.

Ian KD8CEC



 

A similar approach is done in the BitX40 sketch.

Also it is important to note that when you use the EEPROM.put command,
memory cells are only actually updated when the new data is different from
the current cell's content. That also reduces the number of writes.

73 Allard PE1NWL

On Thu, February 8, 2018 03:56, Jack Purdum via Groups.Io wrote:
I had a situation where I wanted to insure that, when the user restarted
their transceiver, it would show the last-used frequency. The problem is
you don't know when they are going to turn the rig off. Sure, there are
ways to do things after power is removed, but this was a QRP rig where
cost was a primary concern. What I did was use one of the Nano's timers to
try to determine what the user was doing. If the frequency is changing in
short intervals, say once every second, chances are they are tuning around
on the band. If they have not changed frequency in the past XX seconds, I
updated the EEPROM with that frequency, provided that the EEPROM frequency
is different from the current operating frequency. That way, if the user
is monitoring a net frequency for an hour or is away doing something but
the rig is still on, no EEPROM updates are done. EEPROM reads have no life
cycle, so if they are just tuning around or if they are "parked" on a
frequency, this approach can extend the lifetime of the EEPROM.
Jack, W8TEE


From: Ian Lee <kd8cec@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 9:08 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release
#ubitx

Thanks for very important information.
The lifetime of the eeprom guaranteed by the vendor is 100,000 write
cycle. read cycle is unlimited.
One thing to note is 100,000 times per memory address.
It is not important how many eeprom addresses are used, but how much is
written to one eeprom address is important.
There is no problem with using a typical eeprom. 100,000 times more than
thought is very large.
Some people say that they have used more than 100,000 through the
experiment, but it is better to use the range that the vendor guarantees.

Experience has shown that the eeprom lifetime error is one case.
It is a periodic write to one memory address.
The most vulnerable is to use eeprom in loops like for and while, or to
use the eeprom periodically in the timer.

In case of uBITX, cyclic frequency(with mode) storage to eeprom will be a
problem to automatically display the frequency that was used previously
when the radio is turned on and off.

If you save every 5 seconds, 720 writes occur in 1 hour.??The life of the
eeprom guaranteed by the vendor is only 138 hours.??If use it for 2 hours
every day, the life time of 70 days is over.
Of course, the actual life of the eeprom is much longer than the number of
times it is guaranteed by the business. Because we are not always lucky, i
will not discuss it here.

So, I am actively agreeing with ron's important information.

I have put some of safeguards in my firmware to take into account the life
of the eeprom.
The first is virtual eeprom.??I created the same variable as eeprom that I
had to write periodically and put it in memory.
Compared to the contents of memory before writing to eeprom, I made it
write if it changed.
This avoids unnecessarily wasting the write cycle on a periodic basis and
preventing the CPU usable
Another was to identify the intent of the user.??In other words, if the
frequency is changing rapidly, the user is turning the knob.
That is, if the frequency is changing, it will skip even if the periodic
storage time is reached.

Always be careful when using eeprom in loop statements or timers.

Ian KD8CEC
2018-02-08 8:49 GMT+09:00 Ronald Pfeiffer via Groups.Io
<w2ctx@...>:

I would be careful since EEPROM has a finite write life!These nano's are
soldered in.
rOn

From: Mike Woods <mhwoods@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 6:27 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release
#ubitx

There are 20 memory channels in the latest versions (0.35 and 1.0) and
they are stored in EEPROM.
Mike
On Thu, 8 Feb 2018 at 11:14 AM, John P <j.m.price@...> wrote:

Not familiar with your code, but maybe keep the memories in EEPROM.??
--
John - WA2FZW





--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
www.hamskey.com??(my blog)



Jack Purdum
 

I'll bet that would work!

Jack, W8TEE



From: Ian Lee <kd8cec@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 11:23 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

Jack.
I think it is probably due to the big current consuming parts like LCD.
i have heard that a long time ago (20 years ago?) I used to use this method in a low power device.?
I will try to use a super capacitor and a diode later, and I have not tried it until now.

Ian

2018-02-08 12:10 GMT+09:00 Jack Purdum via Groups.Io <jjpurdum@...>:
Has anyone else done this? I tried and I couldn't reliably get the 4-byte address written in time. Of course, it could have been the cap I used, the voltage divider...even clones may work slightly differently. Just make sure you test it a bunch of times with your setup.

Jack, W8TEE



From: Nick VK4PLN <nickpullen@...>
To: [email protected]
Sent: Wednesday, February 7, 2018 9:49 PM
Subject: Re: [BITX20] CAT Support uBITX Firmware CEC Version 1.0 Release #ubitx

Another trick I have seen to save EEPROM life:
It is used in an Arduino Antenna Rotator, is to monitor the 12V via a voltage divider and Analog port.
When the voltage drops maybe 1V below "normal", as seen at startup, write settings to eeprom only then.

When you power off the radio the 5volt regulator + input capacitor should hold up the Arduino for just long enough to catch the voltage dropping and write the last used frequency to memory....

73, Nik, VK4PLN




--
Best 73
KD8CEC / Ph.D ian lee
kd8cec@...
(my blog)



 

Clark wrote :?

>If you can wire the LCD backlight to be turned on by a transistor controlled by the CPU then on power fail detection you can turn it off to conserve power.

And there is an added bonus of doing this. It means that you can easily implement a power saving option to turn off the backlight during normal operation.
If the option is selected and the encoder isn't touched for some nominal time period (30 seconds to 1 minute) then the display backlight turns off.?
Then when the encoder switch is depressed or the shaft turned the backlight switches back on. This could be a useful power saving feature for portable operation when operating from battery.?

Cheers

Michael VE3WMB


Pavel Milanes Costa
 

开云体育


El 07/02/18 a las 21:59, Ian Lee escribió:
Since the LCD consumes quite a lot of current

Nope, the LCD is in fact very low power consuming device...

The power how is the beautiful LCD backlight (in my case with a big 4x40 chars was around 1A, the 2x16 ones can move between 100 to 500 mA)

I implemented that in a non ham radio application (PIC not Arduino, but same principle applies), all the bits are in the different answers to the question, I resume them:
  • Cut the feed for the LCD backlight from the +5v for the Arduino (just the backlight will be enough), use another 7805 for that or a simple R divider if you current is not so high.
  • Put a conducting diode in series with the +Vcc (12-16) volts to the Arduino +5 volts regulator.
  • Put a big cap from the Cathode of the diode to GND, this will preserve the +Vcc to the arduino regulator (the 78xx family needs 2.5 volts above the regulated value, so you need to maintain it above 7.5v the time enough to write to the eeprom)
  • Tweak to find the optimum value, in my case I used a PIC18F4550 and a few other low power devices down the +5v line, including a 4x40 LCD..., I was fine with 2200 uF/16V not fine below 1000 uF/16V.
  • I tested a few tricks to detect the power down state, the most effective was a pin change interrupt with a low tech solution:
    • A 1k resistor directly from the +vcc to a 3 silicon diodes (1N4001) in conduction state, decoupled with 100p
    • That 3 diodes raised the pin to a safe 2.1volts wen powered, well beyond the 1.8 volts gray zone of the digital pin.
    • As soon as the power goes down the pin will fall to zero volts, then a interrupt routine will do nothing more than write the settings values to a EXTERNAL 24L08 via I2C...
Cheers, Pavel, CO7WT.