¿ªÔÆÌåÓý

Date

Re: compile error

 

Thanks to all. I was able to update the ubitx with my Mac. I changed the usb connection from the mac and connected it direct to the Raduino card.

Again, thanks to all.

Now to work on the filters to see if I can get rid of the hash noise

And, Jack, your book came today ;-)
--
Bob
NZ2Z


Re: ubitx #v6 Screen Speed Mod #v6

 

So, whose code is the function?void formatFreq() in the V6?
Recognition to Jack for code size reduction by removal of? sprintf, but where is the correct place to discuss a potential improvement?
IMO, it's also posting 'simple stuff' to this group so active folks can grab it and have a look too.?
I'm not a real c coder, but I have a lot of code that I know has holes when used outside the intended purpose. Much as formatFreq() below 1 MHz.
The real coders are working on bigger issues, but since I was thinking about it:

I scratched out a change that addresses the 'feature' / comments about tuning below 1 MHz. (which is outside of the TX operating range, so IMO nothing to complain about)
Keeping in the spirit, it should actually use less program space.? I don't have a V6 / TFT to test.? It's really just a replacement of an if/else with a for loop.? So yes, it will be slightly slower.
My version will have a 'bug' below 100 Hz.? So the ULF guys will still complain.? This is just hobby stuff for me.? Sometimes longer to write a post than to actually do work.

void formatFreq(long f, char *buff) {
? // tks Jack Purdum W8TEE
? // replaced fsprint commmands by str commands for code size reduction
? // AG5TX
? // resolved issue with format below 1 MHz, there is an issue below 100 Hz but trying to keep code size small and simple
? unsigned int g = strlen(b);
?
? memset(buff, 0, 10);??
? memset(b, 0, sizeof(b)); // b is a global
?
? ultoa(f, b, DEC);
?
? for (unsigned int i = g; i < 8 ; i++){
? ? ?strcat(buff, " ");
? }
?
? strncat(buff, b, g-3);
? strcat(buff, ".");
? strncat(buff, &b[g-3], 2); // set last arg to 2 or 3 for how many digits you want right of the decimal point.
}





Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

Jack, W8TEE
 

This is a classic example of polling versus interrupts. I've used this example here before:

Suppose you're setting up a fire alarm system for the Empire State building. There are 100 sensors per floor. The controller in the basement visits each sensor and reads whether there is a fire (1) or no fire (0). The sensor reading is reported back to the basement after each sensor read. The "round trip" takes 1 second to report from a sensor. When sensor #100 reports, the code reads sensor number 1 on the second floor. This process repeats until all sensors for all 108 floors have been read. The process then starts all over again on the first floor. This is a polling alarm system.

Now suppose your luck is such that sensor #100 on the first floor burst into flame just as you read sensor #1 on the second floor. By the time you re-read sensor #100 on the first floor again, the fire has a 3 hour head start. You'd be surprised how miffed people get when they have to wade through 10 floors of fire on the way to lunch.

Now suppose instead that each sensor has the ability to send a message to the basement the instant it detects a fire. The fire would be known in 1 second. This is how interrupts work. Except for all but the most trivial programs, interrupts will always yield a more responsive system.

When writing ISR's, just make sure that 1) you don't use any functions that themselves use interrupts (no delay() or Serial.print()'s), 2) keep the ISR as short as possible, and 3) declare any globals used in the IRS with the volatile type specifier.

Jack, W8TEE

On Saturday, January 11, 2020, 5:02:40 PM EST, Joel Caulkins/N6ALT <caulktel@...> wrote:


Thanks for explaining your changes Mark, it makes sense now and explains why the display flashes every time the digits change also. All in all, it's working pretty good now.

Joel
N6ALT

--
Jack, W8TEE


Re: #v5 Audio, Ground? #v5

 

Thanks Alan, I figured that from another post, unfortunately, I reduced the solders in that area, placed tape over the chassis screw, still have the issue when the board touches the posts. So I replaced them with plastic posts, that solved the lost audio issue but now I have super loud noise, hissing that reduces a bit once I get a signal, but still makes it hard to operate.
Will keep looking :(
A


On Sat, Jan 11, 2020 at 8:00 PM <nx4j@...> wrote:
I just completed putting a V3 into an amatuerradiokits case with Nextion 2.8 front panel and had this same issue. The problem turned to be the 3 pins that support the volume control connection on the aux board were shorting on the metal left post that supports the front stand on the bottom of the case. To resolve this I located a short little plastic cap and placed over the post which eliminated the short. This is not an issue with the 2 line lcd display as the aux board mounts much higher on the front panel.

Alan
NX4J


Re: #v5 Audio, Ground? #v5

 

I just completed putting a V3 into an amatuerradiokits case with Nextion 2.8 front panel and had this same issue. The problem turned to be the 3 pins that support the volume control connection on the aux board were shorting on the metal left post that supports the front stand on the bottom of the case. To resolve this I located a short little plastic cap and placed over the post which eliminated the short. This is not an issue with the 2 line lcd display as the aux board mounts much higher on the front panel.

Alan
NX4J


Re: Ubitx V6 Nextion 2.8" Display Modification

 

¿ªÔÆÌåÓý

And here is the pic:



On Jan 11, 2020, at 6:19 PM, bill richardson via Groups.Io <ng1p.bill@...> wrote:

?I did this mod to my V6 and with the Nextion display my current draw dropped from 350ma to 250ma (TFT draws 100ma more!) also I wired a on off switch so I could remove 5v from the display. With the display off I¡¯m seeing just 150ma. I will also add the 5v regulator is running much cooler. I like the option of shutting off the display to save on battery life.

One other thing I did differently was instead of using a angled display plug I just simply solder to the back side of the board (keeps the wires out of the way) I also drilled the Nextion mounting holes a little wider so all 4 mounting screws are in place on the front of the display.

73 thanks for the great mod. Bill ng1p?


On Jan 6, 2020, at 5:29 PM, bill richardson via Groups.Io <ng1p.bill@...> wrote:

?Sounds excellent. I may do what you did. I¡¯m looking at ways to save on current and I really like the CDC code. If you remove the 5v from the display I assume the radio will still operate? With your hookup it would be easy to add a switch.


On Jan 6, 2020, at 4:50 PM, wb2cba@... wrote:

?

Hi Bill,

Before the mod I checked each display¡¯s datasheet to compare power consumption and ?both draws around 60 to 65 ma of current.

I didn¡¯t actually measure the current draw on the raduino board 7805 regulator but it does feel hot with both displays, stock and nextion. May be it is a good idea to swap the heatsink with a notch bigger one.

I used the rig continously for almost 3 hours yesterday for qso¡¯s and nothing smoked up so I think it¡¯s surviving the heat ?:)

Barb, WB2CBA


Re: Ubitx V6 Nextion 2.8" Display Modification

 

¿ªÔÆÌåÓý

I did this mod to my V6 and with the Nextion display my current draw dropped from 350ma to 250ma (TFT draws 100ma more!) also I wired a on off switch so I could remove 5v from the display. With the display off I¡¯m seeing just 150ma. I will also add the 5v regulator is running much cooler. I like the option of shutting off the display to save on battery life.

One other thing I did differently was instead of using a angled display plug I just simply solder to the back side of the board (keeps the wires out of the way) I also drilled the Nextion mounting holes a little wider so all 4 mounting screws are in place on the front of the display.

73 thanks for the great mod. Bill ng1p?


On Jan 6, 2020, at 5:29 PM, bill richardson via Groups.Io <ng1p.bill@...> wrote:

?Sounds excellent. I may do what you did. I¡¯m looking at ways to save on current and I really like the CDC code. If you remove the 5v from the display I assume the radio will still operate? With your hookup it would be easy to add a switch.


On Jan 6, 2020, at 4:50 PM, wb2cba@... wrote:

?

Hi Bill,

Before the mod I checked each display¡¯s datasheet to compare power consumption and ?both draws around 60 to 65 ma of current.

I didn¡¯t actually measure the current draw on the raduino board 7805 regulator but it does feel hot with both displays, stock and nextion. May be it is a good idea to swap the heatsink with a notch bigger one.

I used the rig continously for almost 3 hours yesterday for qso¡¯s and nothing smoked up so I think it¡¯s surviving the heat ?:)

Barb, WB2CBA


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

Hi Smitty.
Just tried your version, much nicer to tune.
Philip G7JUR


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

Thanks for explaining your changes Mark, it makes sense now and explains why the display flashes every time the digits change also. All in all, it's working pretty good now.

Joel
N6ALT


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

¿ªÔÆÌåÓý

I'm not entirely sure which you meant, so let me answer the question you MIGHT have been asking in case others are similarly confused.? :-)

Does it work with the existing encoder wheel hardware?? Yes.? No hardware mods are required.? This is a software-only mod that improves the responsiveness of the encoder wheel.? Instead of the code saying "I want to know what the user is doing with the encoder, let me sit here and spend 200ms watching the encoder wheel to see whether it's turning, and not doing anything else."?? Instead, it uses hardware interrupts.? Every time the state of one of the pins changes, the program pauses and runs my function instead, called an Interrupt Service Routine, or ISR.? All the ISR does is look at the current state of the pins and compares it to the previous state of the pins, figures out which way you turned the knob, and either adds 1 or subtracts 1 from a counter.? Then, when the program says "what's the encoder doing?" instead of waiting around 200ms to count, it just returns the existing counter and sets it to zero.?? So the program no longer has that 200ms pause every time it wants to see what the encoder is doing.

Does it work on the stock software, or does it require Reed's display mods?? It'll work on the stock software, but the merge requires a bit of work.? Reed's changes changed some code my code also changed, so I had to manually merge them.? It's not a HARD merge, but it's also not automatic.

If someone wants a branch that uses this code against Farhan's stock code, I can produce that too.

-Mark

On 1/11/20 1:05 PM, Joel Caulkins/N6ALT wrote:

Forget that last question, I loaded up Marks's code and the encoder works great. Thanks to those who know how to code we are getting closer everyday to a usable V6 UBITX.

Joel
N6ALT


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

Forget that last question, I loaded up Marks's code and the encoder works great. Thanks to those who know how to code we are getting closer everyday to a usable V6 UBITX.

Joel
N6ALT


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

So Mark, just to be clear, this code will work with the existing stock encoder also?

Joel
N6ALT


Re: ubitx #v6 Screen Speed Mod, and interrupt driven encoder wheel mod #v6

 

¿ªÔÆÌåÓý

Here's my fork of your code with my changes applied:

In whole, the goal was to improve the responsiveness of the UI, and I think the combination of your graphics work and my encoder work, it is top notch right now.

Known problems:
  • My code no longer waits 100ms or 200ms or whatever it was to count the number of encoder ticks, there-by greatly improving the responsiveness.? The problem is that we almost always only count a single tick, maybe two or three if you really spin the knob.? So the acceleration that Farhan built in doesn't do anything. The knob is entirely linear. I've got some ideas to measure the tick rate in doTuning() instead, but haven't implemented them.
Right now, this is a fork from your code (Reed's pdq_gfx_update branch) because I wanted to build it on top of yours.? When Farhan pulls yours into the master branch, I'll re-fork, cherry-pick my commits, and submit a PR.? In the mean time, I'd love feedback on my changes.

73 de KR6ZY
-Mark

On 1/7/20 6:58 PM, Reed N wrote:

Hi Mark,

I'm reluctant to accept PRs into the pdq_gfx_update branch until Ashhar gets it merged into his master, since it's usually best practice to keep each PR focused on a single change, but I'd be very interested in seeing your interrupt-based encoder branch, and definitely would recommend you create a PR for it to be merged into Ashhar's master after the pdq_gfx_update is merged in.


Reed


Re: Relative Power indication on Nextion display

 

Hi Mike, I am building now a SWR Bridge from Kits and Parts to display the output power on LCD and I have the same issue, on RX voltage on A7 is indicated on my 16x2 as expected, on TX there is no indication regardless of the potential of A7. I am looking into the code but I am a little overwhelmed, but I don't loose hope just yet. Maybe someone could help us. Thank you!


Re: Relative Power indication on Nextion display

 

Is anyone using the Nextion meter for relative power and not just S-meter function? ?I¡¯m not seeing a place in the code to disable it during transmit, but even with voltage on A7 not getting any deflection.

Thank you.

Mike


Re: compile error

Jack, W8TEE
 

See my latest post...

Jack, W8TEE

On Saturday, January 11, 2020, 2:46:25 AM EST, Reed N <greenkid336600+groupsio@...> wrote:


Bob, I don't see a complier error for you either.
Sketch uses 27840 bytes (90%) of program storage space. Maximum is 30720 bytes. Global variables use 1074 bytes (52%) of dynamic memory, leaving 974 bytes for local variables. Maximum is 2048 bytes.

However, yours does show a failure to upload the program to the nano:
avrdude: ser_open(): can't open device "/dev/cu.usbserial-1430": No such file or directory
Is there another serial port you can try?


Reed

--
Jack, W8TEE


Re: compile error

Jack, W8TEE
 

Also, if it's a clone, make sure you have the CH340 driver installed. If not, search "CH340 Device Driver Download" and download/install.

Jack, W8TEE

On Saturday, January 11, 2020, 3:45:14 AM EST, Reed N <greenkid336600+groupsio@...> wrote:


Bob,

That log also shows a successful compile, but unsuccessful upload to the nano. Try changing the serial port the IDE is using.


Reed

--
Jack, W8TEE


Re: compile error

Jack, W8TEE
 

I think I see a problem...perhaps not THE problem, but a problem.

EVERYONE:

??? Whatever is the project's INO primary file name (e.g., ubitx_v6.3_code.ino),
??? which is the file that contains setup() and loop(), MUST be used for the project's
??? directory name, too.

So, if you have the project in a directory named MyProjects on drive C, the directory structure MUST look like:

??? C:\MyProjects\MyFirstProgram??????????????????????????? // Example of a previous project you tried
???????????????? \MySecondProgram????? ???????????????????? // Another example project you fried
???????????????? \ubitx_v6.3_code\morse_reader.ino????????? // Farhan's project code
???????????????????????????????? \tft_gui.ino
???????????????????????????????? \ubitx_cat.ino
???????????????????????????????? \ubitx_factory_alignment.ino
???????????????????????????????? \ubitx_font2.h
???????????????????????????????? \ubitx_keyer.ino
???????????????????????????????? \ubitx_si5351.ino
???????????????????????????????? \ubitx_ui.ino
???????????????????????????????? \ubitx_v6.3_code.ino?????? // This file holds setup() and loop()

Many of you do NOT remove the "master" part of the ZIP file name from the file when it is extracted. If you do not set things up this way, it will not work. (Farhan: This is another reason why I only have one INO file in a project with all the rest being cpp (i.e.,. C Plus Plus) or h (header) files. Plus you get the HUGE advantage of incremental compiles!)

I know everyone can't go back through two bazillion prior posts to find this stuff, but I'm sure I've posted this warning at least a half-dozen times, so I am not picking on Bob. And, truthfully, most Arduino tutorials are single-file project examples so the reader doesn't know about this. However, if you see the word "master" anywhere in a warning or error message from the compiler, the project's organization on the disk drive is the first thing to check.

Jack, W8TEE
??????????????????????????????

On Friday, January 10, 2020, 11:01:27 PM EST, Bob Bennett via Groups.Io <bobsmacbox@...> wrote:


Here is the compile from the Mac
--
Bob
NZ2Z

--
Jack, W8TEE


Re: compile error

Jack, W8TEE
 

I don't understand. What is the Raspberry Pi for?? Also, what is "Arduino 2.1.0.5+dfsg2-4.1". If you are compiling on a Mac, what is the emulator program?

Jack, W8TEE

On Friday, January 10, 2020, 11:00:19 PM EST, Bob Bennett via Groups.Io <bobsmacbox@...> wrote:


Jack,
Raspberry Pi 4
Arduino 2.1.0.5+dfsg2-4.1
All of the files are in /home/pi/ubitx6 (these are what I downloaded from Farhan on github)
Attached is the file from this attempt

I will send the compile error from my Mac next
--
Bob
NZ2Z

--
Jack, W8TEE


Re: compile error

 

Bob,

That log also shows a successful compile, but unsuccessful upload to the nano. Try changing the serial port the IDE is using.


Reed