¿ªÔÆÌåÓý

Date

Firmware up date!

 

I am going to format my uBitx with the KD8CEC 1.2 firmware, and this is what it is showing in Xloader.
(D:\uBitx V5\uBITX_CEC_V1.200\uBITXV5\UBITXV5_CEC_V1.200_NX_S.hex)?
Because I am doing the Nextion 2.8 screen modification.
And is this the correct firmware?


Re: Different Nano's

 

I downloaded the Nano Every Board setup into the Arduino IDE and tried to compile my firmware sketch.

It failed on digitalPinToPCMskbit() which converts a digital pin ID to the appropriate bit in the output register.

But more severely, it failed on the low level writes that I was using to set up timers:

TCNT2
TCCR2A
WGM21
OCR2A
TIMSK2
CS22 | CS21 | CS20

Doing some online research, it looks like the timer setup is different.

73,
Mark, N8ME


Re: Frequency calibration on a lab #bfo #calibration #frequency

 

Very good HAM setting, used only one instrument, but is not the best for laboratory setting, you not have any referent to the real frequency received; the error is very low, but is possible make something of better in a laboratory.
73 de
--?
IW4AJR Loris


Re: Frequency calibration on a lab #bfo #calibration #frequency

 

I used a frequency counter to tune my uBITx v6 just two days ago.? I set the display to the center of the bands (16600 khz), then entered 'Set Freq...' mode.? Then I adjusted the clk2 frequency at TP12 to as near 45.005 Mhz above the display frequency as I could get (in my case I obtained 61.604939 Mhz when targeting 61.605 Mhz).? ?The tuning adjustment on the screen was 189000 for my radio.? ?After I saved the frequency tuning value, I tuned the radio to WWV on 5000 Khz, and adjusted the BFO by ear.? My final BFO setting was 11.056.8.


Re: WSJT-X 2.2.2

 

Dean,

My code is a little different.

In setup(), it calls Serial.begin() and Serial.flush() like your code.

My CAT handling is done in a Serial.event() function. This is called whenever there is a character available to read (or so says the documentation).?

void?serialEvent(void)?{
??long?frequency;
??byte?temp1,?temp2;
??int?c?=?Serial.read();
??if?(c?>?-1)?{
????cmd_buffer[cmd_byte_ct++]?=?(byte)?c;
??}
??if?(cmd_byte_ct?==?5)?{
????cmd_byte_ct?=?0;
?

Then process the command. cmd_buffer is a 5 element byte array. cmd_byte_ct is a global variable initially set to 0.

My original code was like yours in that it assumed that if Serial.available() returned 5 or more that Serial.read would always be able to read 5 bytes (I actually used Serial.readbytes(buffer, 5), but the way my program behaved, I'm not sure that was a valid assumption.? With a few hours testing WSJT-X versions 2.1.2 and 2.2.2 and with FLDigi (using hamlib) it seems to work, after a firmware upload or after a power cycle.? It was a little less reliable until I added the Serial.flush() in setup(). Thank you for that idea.

73,
Mark, N8ME

73,
Mark, N8ME


Re: WSJT-X 2.2.2

 

On Mon, Jan 4, 2021 at 03:36 PM, Gary Anderson wrote:
Is it possibly a delay time difference between when DTR is asserted and when the CAT program(s) start trying to communicate and/or expects a response/ACK between these different CAT programs/versions?
Hi Gary - DTR reset is an issue.? When I start Ham Radio Deluxe the Arduino resets and and HRD tries twice to get the frequency - but the timing is such that it always works the second time.? WSJTX doesn't expose timeout and retry intervals.?

And it doesn't explain why after a fresh boot of the Arduino -? meaning I plug it into to the USB port, it powers up and the sketch starts running.? ?So no bootloader is involved.? This happens:

  • Start WSJTX - when WSJTX opens the port (without asserting DTR) and starts sending no data is received by the Arduino - Serial.Available consistently returns 0 bytes even though the sending program gets no error on Tx.
  • Same behavior with rigctl - the command line interface for hamlib
  • Then open a putty session (the Arduino resets) - and shut it down without entering anything in the terminal and then WSJTX communicates just fine - same thing as when I run it after running HRD.
I don't know enough to know how to remove the bootloader overhead.? What would the process be?

73,
Dean
KK4DAS


Re: WSJT-X 2.2.2

 

Hi Mark -

Glad you got it working.? Mine still won't connect from a clean boot.? ?Curious what you did - can you post the extract of your serial code....

This is mine...

in setup...
void ft857d::begin(long br, int mode) {
? ? Serial.begin(br, mode);
? ? Serial.flush();
}

from the main loop...

void ft857d::check() {
? ? // do nothing if it was disabled by software
? ? if (!enabled) return;
?
? ? // first check if we have at least 5 bytes waiting on the buffer
? ? byte i = Serial.available();
? ? if (i < 5) return;
?
? ? // if you got here then there is at least 5 bytes waiting: get it.
? ? for (i=0; i<5; i++) {
? ? ? ? nullPad[i] = Serial.read();
? ? }
? ?// do something useful...
? ?// and eventually...
? ?Serial.write(ACK);
}

That is it.? Is yours any different?

Thanks,
Dean
KK4DAS



Re: WSJT-X 2.2.2

 

I found a bug in my code based on a misunderstanding of the Arduino Serial library. I rewrote my code to take that into account and it looks like WSJT-X 2.2.2 (with the newer Hamlib) is working. That's when I choose the FT857 setup. I still have an issue when I use the FT817 with rigctl-wsjtx that it doesn't seem to send any messages or commands to the radio.

73,
Mark, N8ME


Re: Different Nano's

 

I looked on Amazon and found a cable that looks similar to the one that comes with the v6 kit, except for micro instead of mini. The female end came with a panel mount bracket with screws at 28 mm separation, the same as what I measure on the v6 mini connector.

73,
Mark, N8ME


Re: Frequency calibration on a lab #bfo #calibration #frequency

 

Thanks Loris,

You explained very clearly! I have access to some laboratory equipment on a limited basis, so knowing in advance which method will be better suited grants me the better use of them!

73 de PU1OWL
Rafael


Re: Different Nano's

 

Mark - that's right - I forgot about the connector - as you can see I don't have that problem with my homebrew rig - hi, hi!

?

Not sure what the port on the V6 looks like from the inside - what I did on my V5 (which did not come with a case) is just cut a patch cable in half and connected up the TX, RX, 5V and GND to the back side of a USB 2 jack.? Search ebay for "usb micro to a female panel mount" and a bunch come up.

Dean
KK4DAS

Dean
KK4DAS


Re: Frequency calibration on a lab #bfo #calibration #frequency

 

P.S. Rafael,?
the laboratory measurement of the BFO is a little more complex operation, you consider that CLK2 is fixed to receive the USB, so it must be 1.5 KHz lower than the center frequency of the quartz filter, considering again that it is impossible obtain perfect filters using a Ladder Filter with quartzes that have the same frequency and fixed capacitors, for the reason that the quartzes are slightly different from each to other and the capacitors have a factory tolerance, so the quartz filters will be different for each ?BITX sold,
A laboratory measurement method is to firsth obtain the attenuation curve of the filter using a network analyzer (using the two connectors for the additional CW filter) and find the two attenuation frequencies at -3dB; calculate the bandwidth and find the frequenzy of center of your filter; turn on the ?BITX and measure the CLK2 with a good frequency meter, calibrate the BFO frequency by fixing it as exactly as possible at a frequency equal to -1.5KHz with respect to the central frequency of the filter.
This should be the measurement method theoretically, but I have not used it, so I cannot guarantee the final effect of the sound in the loudspeaker, when you listen to a signal on the antenna.
73 de

IW4AJR Loris


Re: Frequency calibration on a lab #bfo #calibration #frequency

 

Hi Rafael
Pay attention to USB and LSB, in the ?BITX-V6 the CLK2 is fixed, while the CLK1 switches from about 57 MHz to about 37MHz according to the selection of the side band used.
The documentation released for the tarutures, not surprisingly (albeit a bit impirically) is based on the measurement of the BF to calibrate the BFO and on the zero beat for the calibration of the VFO.
If you have RF instrumentation, the BF measurement method is certainly valid for VFO calibration, therefore, set the frequency of the RF oscillator to exactly 10MHz, in the TEST menu choose the VFO calibration, do the zero beat with the VFO, move the RF oscillator at 10.001,500 KHz, read the output frequency from the speaker with a good frequency meter and correct the calibration to read exactly 1,500 Hz (I managed to center the frequency of the VFO within +/- 0.01-0 , 02 Hz) exit calibration and turn off the ?BITX, turn it back on and follow the instructions in the documentation to calibrate the BFO (to center the quartz filter) ... that's it.
73 de
IW4AJR Loris

On Mon, Jan 4, 2021 at 03:58 PM, <rafaelgcpp@...> wrote:
Hi folks,

Assuming I have RF laboratory instruments available, what could be an ideal scenario to calibrate ubitx frequencies ?

Would it work to set a RF generator to 10,000,500Hz and expect to receive 500Hz when the ubitx is tuned at 10MHz?

Or would it be better to measure the clk2 frequency with a counter?

73

Rafael Pinto - PU1OWL

?
--


Re: Different Nano's

 

I just noticed that the Every has a USB micro connector as opposed to the mini on the Nano. That means that the extension cable that brings the USB from the Arduino out to the back panel of the uBITX 6 won't work. Does anyone have a source for a similar extension cable for the micro connector?

For those unfamiliar with the uBITX 6, it comes with a USB mini male to mini female extension cable that mounts to the rear panel of the enclosure.

73,
Mark, N8ME


Re: Different Nano's

 

Dean,

Thanks for the info.? I see that the Every has 48k of flash vs 32k in the plain Nano. Did that equate to 16k more program space?

The documentation from Arduino says that it's pin for pin compatible.? I'm using my own interrupt code for the rotary encoder, so it shouldn't be too different to adapt.

73,
Mark, N8ME


Re: WSJT-X 2.2.2

 

The Python script was something quick & dirty. It's attached.

73,
Mark, N8ME


Re: WSJT-X 2.2.2

 

Is it possibly a delay time difference between when DTR is asserted and when the CAT program(s) start trying to communicate and/or expects a response/ACK between these different CAT programs/versions?
Assert DTR and reset is pulsed low (asserted) through a capacitively coupled circuit.
The Arduino goes into bootloader/programming mode when Reset is negated, it doesn't go into "application" mode until after the bootloader timeout.

When you upload a new sketch and stay powered-up, the Nano is in application mode. When you have your Python serial port snooper running, the Nano is in application mode.
Opening up the Arduino IDE serial monitor also resets the Arduino.? It also resets when you close the serial monitor. (I expect most terminal programs assert DTR by default when started)

One possible way to help debug the idea / problem is to remove the bootloader overhead. (if your CAT programs(s) don't have an obvious time out variable / setting)

With a bootloader in place,? It takes ~ 1 second to go from reset negate to user code running.? ?I get past One MISSISSIPPI after negating reset to LED on for the Blink Demo.

Rgds,
Gary



Re: Different Nano's

 

Hi Mark -

I haven't tried it in the uBitx - I have my own non-bitx homebrew rig that I used it in and it was a drop-in physical replacement. That is one of the reasons I went to it - so I didn't need to change my controller board.? After I changed the interrupt code everything worked.? My build uses an SI-5351 and rotary encoder just like the uBitx.? I have run it with an LCD display, a TFT and a Nextion.? ?I don't see any reason it wouldn't work in the Raduino if you fix the interrupt code,? but I haven't tried it.

The way my sketch is setup right now it wok work with either the Nano or the Nano Every with no code changes.

Dean
KK4DAs


Re: WSJT-X 2.2.2

 

Mark,

I hadn't seen the that WSJTX supplied it. That's great because it will be built of the same library version as the WSJTX suite

rigctl-wsjtx.exe -m 1022 -r com4 -P RIG -D NONE -s 38400 -vvvvv

-m is the hamlib rig number.? 1022 is for the FT-857D (1020 is the FT-817)? - that is with the latest hamlib - they were previously 122 and 120.?
-vvvvv is the super debug option that shows you everything.? My CAT control library is built off the FT-857 specs but I think the command architecture between the 817 and the 857 is identical.??

I just tested it with my build.? It works the same as I described before.? First run rigctl "thinks" it is sending, but the the Arduino doesn't see any data and rigctl reports a timeout.? Open and close the serial monitor and it works fine business.? And then after it is working with rigctl I can run WSJTX, FLRIG or FLDIGI and they work fine.? Interestingly the Arduino does not reset on rigctl connecting.

Fascinating that one program running and exiting affects the state of the com port for the next program.

Where are the Windows USB gurus?

Would you car to share your Python monitoring script?

73,
Dean
KK4DAS




Is there a way to configure rigctl to sit between WSJT-X and the uBITX and monitor the communications or do you have to enter Hamlib commands into rigctl directly?

I don't think so - rigctrl is a command line interface -? here is how I run it -

cd "C:\Program Files (x86)\hamlib-w64-3.3\bin"
?


Re: WSJT-X 2.2.2

 

¿ªÔÆÌåÓý

Dean,

?

WSJT-X is running on Windows.

?

Thanks for the pointer on rigctl. I see ?a rigctl-wsjtx executable file in the WSJT-X installation. I guess it does the same thing.? Is there a way to configure rigctl to sit between WSJT-X and the uBITX and monitor the communications or do you have to enter Hamlib commands into rigctl directly?

?

I wrote my own Python script to monitor the communication. I create a virtual serial port pair. I point WSJT-X to one half of the virtual pair. The Python script connect to the other half of the virtual pair and to the hardware port connected to the uBITX. The program copies everything it gets on one port to the other and to the screen. It does a little decoding so that it can display commands it knows about in text rather than just hex which is the default.

?

I¡¯ve seen an issue with WSJT-X not communicating unless I upload a script. I suspect that opening and closing the serial monitor does the same thing to the serial port that makes it work. Communications works fine with my Python script in the middle, but I see the uBITX screen flash when I start the script, so I think the script toggles DTR behind the scenes.

?

I wish I knew what¡¯s in the DTR reset that makes the serial port on the Nano work. I would think that there would be a way to reset the serial port when a sketch starts up.

?

I¡¯d be glad to collaborate. FWIW, currently my CAT is having problems with FLDIGI, even when I have FLDIGI configured to use Hamlib.

?

73,

Mark, N8ME

?

From: Dean Souleles
Sent: Monday, January 4, 2021 12:48 PM
To: [email protected]
Subject: Re: [BITX20] WSJT-X 2.2.2

?

Hi Mark -?

Chasing down a similar (same) problem over here -?[email protected] | Arduino, PC, Serial Communications / CAT

What platform are you running WSKTX on Windows or Linux???

If you don't already know about it there is a command line program in the Hamlib distribution called "rigctl"? I find it very useful - in it's verbose debug mode it shows you every byte it sends and receives.? ? My observations is that it thinks it is sending but nothing arrives at the Arduino - unless I open and close the Arduino IDE serial monitor before running the program - then it all works fine - including WSJTX (with DTR un-checked).

I am Interested in collaborating on this - it would be good to get Arduino / Hamlib communications to be reliable.

73,
Dean

?