KF5N Radio Experimentation Site

Return to the home page.


T41-3 Part 6 Building a Better Software Defined Transceiver: Software Concerns

The T41 as originally designed by Al and Jack uses this library to support display functions:

https://github.com/sumotoy/RA8875

This library is included with TeensyDuino. It is not the same as the Adafruit RA8875 library. I tried substituting the Adafruit library, and it was not compatible.

https://github.com/adafruit/Adafruit_RA8875

Note how Adafruit sells displays. The driver board is separate from the display. It is not an integrated module. The Sumotoy library was last updated 11 years ago. That’s not necessarily bad, however, it indicates the library is not being maintained.

As discussed before, it is the display which is holding the project back. The RA8875 is absorbing too much CPU power. The T41 has really cool display features, and we want to preserve that. The path to improved performance is most likely a different display technology. I am currently investigating modules based on the BT817 EVE display driver technology. The prototype is looking good!:

BT817 Driver Libraries

There is a lot of information available on programming the BT817 (and other similar) controllers. This is a primary resource:

https://brtchip.com/wp-content/uploads/2024/08/BRT_AN_033_BT81X-Series-Programming-Guide.pdf

There is an overwhelming pile of information at this page:

https://brtchip.com/software-examples/eve-examples-2/

That page kept me busy for a few days.

PlatformIO

I found a few Arduino based projects using the BT817 modules, and I was able to run them on the Teensy 4.1. However, the really good ones don’t use the Arduino IDE. They use “PlatformIO”:

https://platformio.org/

At first, that seemed like a serious barrier. It’s not. Translating an ordinary Arduino project to PlatformIO is not that difficult:

https://www.youtube.com/watch?v=y5WiFO8-cP8

I was successful in converting T41EEE to PlatformIO almost immediately. There were some build options which required some fiddling, but AI searches fixed those problems quickly.

There is an interesting thing about PlatformIO. All those problems with gathering up and installing libraries go away! The same thing with other configuration like the compilation options. It’s all saved with the project.

Now I don’t intend to publish projects in PlatformIO. I’m pretty sure the reverse conversion back to Arduino IDE should be pretty easy. The project will run out of the regular Arduino IDE everyone is familiar with. Maybe I will publish projects in both???

Libraries

There are several libraries out there for the EVE series of controllers. A lot of these are targetted at various IDE platforms other than Arduino. So that narrowed down the list. Bridgetek publishes an Arduino library, but it is difficult to find! Ultimately I settled on this library:

https://github.com/RudolphRiedel/EmbeddedVideoEngine

Using this library with PlatformIO, it was practically no effort to get things working. And Teensy DMA is included!!! I had a few questions, and the library owner, Rudolf Riedel, was quick to respond and very helpful. Early results with this library and the new display module were really astonishing compared to the usual RA8875 outcome! This library is really good and compatible with the T41 and it has greatly accelerated progress. Good job Rudolf!

The programming style and code is totally different from the RA8875 library. It requires 100% replacement of RA8875 library code. Bummer! But I have been able to translate without difficulty (the current result is in the video linked above).

A couple of code comparisons, RA8875 versus EVE libraries.

Writing a bit of text to the display:

RA8875

tft.setCursor(5, 0);
tft.setTextColor(RA8875_WHITE);
tft.print("Text to display); 

BT817

EVE_color_rgb(BLUE_1);
EVE_cmd_text(10, EVE_VSIZE - 35, 26, 0, "Text to display");

Drawing a line:

RA8875

tft.drawLine(x1 + 3, y1_new, x1 + 3, y2_new, RA8875_YELLOW);

BT817

EVE_color_rgb(RED);
EVE_begin(EVE_LINES);
EVE_vertex2f(0,LAYOUT_Y1-2);
EVE_vertex2f(EVE_HSIZE,LAYOUT_Y1-2);
EVE_end();

Note that the BT817 code looks busier, and that is true for drawing a single line. The BT817 code is “vertex based”, meaning you provide x-y coordinates in the form of vertex2f commands. Two vertices makes a line. Four vertices makes two independent lines, wrapped in the same EVE_begin() and EVE_end() delimiters.

The other thing to note is that in the RA8875 library, anything which needs to change has to be “undrawn”. This is typically done by drawing a black rectangle over the top of the thing which needs to change. None of that is necessary when using the BT817! The entire display is revised every frame. So you don’t erase and replace. You simply replace.

So how do you draw a “polyline”, which is how the RF and audio spectrums are displayed? Here is the code:

EVE_color_rgb(YELLOW);
EVE_begin(EVE_LINE_STRIP);
EVE_vertex2f(0,10);
EVE_vertex2f(20, 30);
EVE_vertex2f(40,8);
EVE_vertex2f(60, 17);
EVE_vertex2f(80, 22);
EVE_end();

Each coordinate of the polyline is defined by the EVE_vertex2f() commands. That is all there is to it! This is easy to embed in a for-loop so that the coordinates can be taken from an array, for example the 512 FFT array of the T41’s DSP code. To use the DMA, the “burst” mode versions of the above commands are used. It is straightforward and easy to implement!

Conclusion

This is the last part and conclusion of the introduction to the high-performance T41-3 platform. I am continuing to develop the software and hardware. I hope to have the first version of the software, which will be called T41EVE, released in a few weeks. Perhaps in March? It depends on how well the rest of the conversion process goes.

With regards to hardware, it is simple enough to hack an EVE module into an existing T41. I will create guidance on how to accomplish that. I’m thinking about a new version of the Main board, which would be compatible with both the RA8875 and BT817 display modules. That is nothing more than an idea for now. I will update on the project as milestones are reached.

– 73 Greg KF5N