Let’s face it, hardware is expensive, and the price increases and shortages over the last year haven’t helped. Once I totaled up the cost to build CTR2 I was a little surprised.
One way to reduce the cost in the near term is to use the display simulator in the Nextion IDE to replace the hardware display and enclosure. For the cost of the HMI and the Auxiliary – Option 1 board you can have a fully functioning CTR2 system for one radio.
There are several drawbacks to using the Nextion IDE simulator. First, the IDE only works in Windows. To use it you have to boot your PC, load the IDE, load the display firmware file, and start the simulator. Finally, you can’t turn the diagnostic displays off. They continually stream data to and from the display. Because of these issues I only use the simulator for debugging the display code. The lead photo shows an example of the simulator in action.
NOTE: Nextion is pretty clear that this is only a simulation of the actual display, not an emulation. Things don’t always work the way you would expect.
To use the simulator you must connect the RS232 TD, RD, and Ground pins on the HMI‘s Display RJ45 jack to a serial port on your PC. This can easily be done using a perf-board. You can also mount the encoder on the perf-board. The drawing below shows the wiring details. Make sure you identify which standard your CAT5 cable is wired to. Most use the TIA-568B standard but TIA-568A cables are around. If you’re not sure how your cable is wired use an ohmmeter to check it.
Once you have the adapter built, plug the CAT5 cable into the DISPLAY RJ45 jack on the front of the HMI (next to the 3.5mm jacks) and plug the DB9 cable into a suitable USB serial adapter on your PC. Use the Windows Device Manager (right-click on the Start menu) to find out which serial port is assigned to your USB serial adapter if you don’t already know.
Next, start the Nextion IDE and load the CTR2_5-0.hmi file to simulate the 5″ display, or you can load CTR2_3-5.hmi for the 3.5″ display.
Next, click the Debug button on the button bar (5th button from the left). This will compile the program and open the simulator shown in the lead photo. To start the simulator running on your serial port click the User MCU Input radio button in the bottom left corner. Set the Com Port to the PC’s serial port assigned to your USB serial adapter, set the Baud to 115200 and click Start. Lastly, turn the HMI on. After a short time the display will flash a couple of times then start running the program.
NOTE: Do not select the serial port created for the Teensy micro-USB connection. This port is used to program the Teensy and provides a CAT port to 3rd party applications and is functional while you’re simulating the display. Also, use a quality FTDI based USB serial adapter. I stay away from Prolific adapters after having several problems with them.
That’s all there is to it. You can do everything from the simulator that you can do on a physical display, except touch-screen. Your mouse is used instead of your finger.
If you’ve installed the encoder on the perf-board it should also be functional. Turning it will change the frequency and pressing it down will step through the encoder menu. If the direction of the encoder is reversed, simply swap the A and B leads. If it doesn’t work at all, check the pins to make sure you don’t have a solder bridge shorting them out.
I’ve thought about creating a stand-alone program to replace the simulator that just presents the HMI display on your PC. While this is certainly possible, it becomes yet another code base to maintain. It’s already a challenge keeping the 3.5″ and 5″ displays and the Teensy code bases in sync. Any change in one usually needs to be applied to the others, and that is a pain. At the end of the day, I think you’ll find that the small remote display sitting next to your keyboard the best solution.