Jump to content

Recommended Posts

Posted (edited)
21 minutes ago, Vinc_Vega said:
U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);

This one is also giving an error.

It passes the verification with this:

U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);

But this time the display is completely off.

I'm using this code:

//F-16 DED for DCS BIOS using 256x64 ER-OLED032-1G from BuyDisplay.com
//Final code by JohnnyChicago,a whole lotta font cred to Fusion's wife, and Wiggles5289 on the DCS Forums
// adapted by Vinc_Vega to work exclusively with the u8g2 library, new font with inverted chars added,
// inverted chars are original ASCII code byte + 100, interprete steering bits (bytes 26 - 29 of each DED line) and plot inverted chars,
// unfortunately at the time not all inverted chars are covered by the steering bits (mostly the inverted asterics (*) is missing and therefore is displayed always inveted)

#define DCSBIOS_IRQ_SERIAL  // for ordinary Arduino chipsets
//#define DCSBIOS_DEFAULT_SERIAL // for ESP32 and other chipsets
//#define DCSBIOS_DISABLE_SERVO
#include "DcsBios.h"
#include <SPI.h>
#include <U8g2lib.h>

/*
for the MEGA 2560 use the following pinout:
MOSI: 51  (SDA) hardware SPI
MISO: 50 hardware SPI
SCK: 52 (SCL) hardware SPI
SS/CS: 53 hardware SPI
DC = 6 (may be changed to any digital pin)
RST = 8 (may be changed to any digital pin)
*/

//U8G2_SH1122_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);				// Enable U8G2_16BIT in u8g2.h
//U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);
U8G2_SSD1322_NHD_256X64_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);

// ----------------------------------------------------------------------------------------
//            Declaration of the variables
// ----------------------------------------------------------------------------------------

String(line1); String(line2); String(line3); String(line4); String(line5);  // create a string object for each line to manipulate the content
/*
// DED lines each have 25 chars plus max 4 additional steering bytes (26 to 29), see below example
//              "12345678901234567890123456789"
String(line1) = "          LIST           "; //(25)
String(line2) = "1DEST 2BNGO 3VIP  RINTG  A"; //(28)
String(line3) = "4NAV  5MAN  6INS  EDLNK  A"; //(28)
String(line4) = "7CMDS 8MODE 9VRP  0MISC  A"; //(28)
String(line5) = "                         "; //(25)
*/


const byte x = 28;         // cursor x is always 28 (first char of a line to print) for a 256x64 display
const byte y = 13;         // cursor y is according to the line number: y = (line number * y) -1) -> first line print at y = 12

// ----------------------------------------------------------------------------------------
//            costume F-16 DED font including inversed chars for the u8g2 library
// ----------------------------------------------------------------------------------------
/*
  Fontname: DEDFontNewInv_01
  Copyright: Vinc_Vega
  Glyphs: 142/195
  BBX Build Mode: 0
*/
const uint8_t u8g2_font_DEDFontNewInv[1755] U8G2_FONT_SECTION("u8g2_font_DEDFontNewInv") = 
  "\216\0\3\4\4\4\3\5\5\10\14\0\377\11\376\11\0\1h\2\315\6\276 \5\0\334\30!\7\222\207"
  "\30L\4\42\14E\255\30\42$\42AB!\0#\17\226\205\70A\261\230\4\305\213IP,\0$\5"
  "\0\334\30%\17\226\205\30c!A$br!\12\11\33&\20\226\205XC%\242b##E!&"
  "#\1'\10B\256\30$\42\0(\12\224\206X\42Er\33\22)\14\224\206\30BcB\62\225\10\1"
  "*\20\270|\30\17$%Q\310\252\221D)y(+\13f\215X\202BL\202B\0,\10B\207\30"
  "$\42\0-\6&\235\30\14.\6\42\207\30\4/\12v\215\270\201br\14\5\60\15\226\205Xb$"
  "Bt\22!\23\2\61\12\224\206XA\42CrA\62\14\226\205\70$H\202\42*\202\14\63\15\226\205"
  "\30\214bb\243D($\0\64\14\226\205\30\42\362\13\233\240\24\0\65\14\226\205\30\216%\206D($"
  "\0\66\15\226\205\70$\210%HD($\0\67\13\226\205\30\214br\224\10\0\70\16\226\205\70$H"
  "($BD($\0\71\16\226\205\70$HD(\205\42%$\0:\7b\227\30\204\4;\11\202\207"
  "\30\204$\42\0<\11\226\205\230br\225\3=\10f\215\30\354\240\14>\12\226\205\30\242r\223#\0"
  "\77\17\226\205\70$HbCc\342`\202B\0@\20\226\205\70$g\202%#!#!($\0A"
  "\15\226\205Xb$HD\17AD\2B\15\226\205\30%H'%BD-\0C\14\226\205\70$H"
  "\204\62\241\220\0D\13\226\205\30E%\362_T\0E\13\226\205\30\216DD\202\202\14F\13\226\205\30"
  "\216DD\202\62\2G\14\226\205\70$H\204\42\225P\12H\13\226\205\30B\224\36\202h\22I\11\226"
  "\205\30L\202rbJ\13\226\205\30L\202r\42\32\3K\17\226\205\30B$(DcD%\42E\2"
  "L\11\226\205\30\202\362\221\1M\13\226\205\30\201C\17At\22N\15\226\205\30aD%%$\225\250"
  "\5O\13\226\205\70$HtB!\1P\14\226\205\30%HD-\202\22\1Q\13\226\205\70$H\264"
  " \221\12R\15\226\205\30%HD'%\62\21\11S\15\226\205\70$\210E\205\202($\0T\12\226"
  "\205\30L\202\362\11\0U\13\226\205\30B\364\11\205\4\0V\16\226\205\30Bt\22\11\12\242&\4\0"
  "W\13\226\205\30Btz\10\32\14X\21\226\205\30BD\42AAdbDQ\204\210\4Y\16\226\205"
  "\30BD\42AAd\202r\2Z\11\226\205\30\214brd[\10\224\206\30JrB\134\7\222\207\30"
  "\17\3]\10\224\206\30HrR^\14U\246XaC!!\42c\1_\6\26\205\30\6`\10B\257"
  "\30$\42\0a\15\226\205Xb$\346\20M\310\204\0o\7\63\265\30$\4{\14\226\205X\202\362d"
  "B&\4\0|\7\222\207\30\17\3}\14\226\205Xb$F\202\362\4\0~\13F\225\70b$\42d"
  "\42\0\204\10\270|\30\377\320\0\205\13\270|\30K\366\344d\264\0\206\20\270|\30IACA$\42"
  "#\42\17\37\14\207\26\270|\30*\42$\42\303#\42$\42$\42\303#\42$\42\12\210\5\0\334\30"
  "\211\22\270|\30i%!\322\202\352\24&\42\22R\226\0\212\23\270|\30k\244CGe!BaB"
  "\42\303c!\11\213\14\270|\30JF'&\17\37\20\214\14\270|\30LeDv:\63R\215\14\270"
  "|\30JfGv\42+b\216\20\270|\30\17$%Q\310\252\221D)y(\217\16\270|\30\17L"
  "F\304\302DF\17\4\220\13\270|\30\77\30\31\235\230\60\221\13\270|\30\37\226\205\37\36\6\222\11\270"
  "|\30\177\70\62Z\223\14\270|\30\17'Fu\62y\70\224\15\270|\30K\205C\362O\203E\13\225"
  "\15\270|\30,FeF\66\25\22*\226\20\270|\30\212\303BBF\243\242C\306\302\11\227\15\270|"
  "\30\311\302F\325\216d\36T\230\22\270|\30IACACACA\303\302E\226\24\231\15\270|\30"
  "\311\222L\207\215d\36T\232\16\270|\30\212\303B\246\303Br\36T\233\14\270|\30\311\302Fu\262"
  "\324\0\234\17\270|\30\212\303B\222\7\207\344<\250\0\235\16\270|\30\212\303Br\36\65\32\35T\236"
  "\15\270|\30\17DF\17GF\17\14\237\16\270|\30\17DF\17GF'&\14\240\12\270|\30M"
  "u\272S\2\241\15\270|\30\17\312\302\17\303\302\17\2\242\12\270|\30Iw\252S\3\243\17\270|\30"
  "\212\303BBedENF\13\244\23\270|\30\212\303\42CFbA\42\221D\42\11\17*\245\16\270"
  "|\30K\205\303Br\226$S\2\246\16\270|\30\251\303BR'\311YT\1\247\16\270|\30\212\303"
  "B\222l\222<\250\0\250\24\270|\30\251\244CACACACACA\243\242\12\251\14\270|\30"
  "\311\222\14)Y\26N\252\14\270|\30\311\222\14)\331\324\0\253\21\270|\30\212\303B\222\214\302\204\302"
  "\204$\217&\254\14\270|\30I\362Y\222\374\224\0\255\14\270|\30\311\302Dv\42\26N\256\14\270|"
  "\30\311\302Dv\42$c\257\22\270|\30I\222\302D\7\311\12I\207\302\204\204\22\260\12\270|\30I"
  "\366\263p\2\261\15\270|\30)$B\222%\311\77%\262\24\270|\30)C\262\5\211\5\11\205\11\205"
  "\11\311i$\1\263\14\270|\30\212\303B\362\237\7\25\264\16\270|\30\251\303Br\26\35\262\324\0\265"
  "\17\270|\30\212\303B\362)L\224\360(\1\266\17\270|\30\251\303Br\235\24\64$S\2\267\17\270"
  "|\30\212\303B\246\244FF\302\203\12\270\13\270|\30\311\302D\366i\1\271\13\270|\30I\362\377y"
  "P\1\272\16\270|\30I\362O#\42\204\204E\13\273\14\270|\30I\362\237%I!I\274\22\270|"
  "\30I\62\215\210\20\26\25\222\210\14\311\224\0\275\16\270|\30I\62\215\210\20\26\331i\1\276\14\270|"
  "\30\311\302Fu\62\26N\277\13\270|\30\212\224\354\221P\1\300\11\270|\30K\366\247\5\301\14\270|"
  "\30\212\204Fv\42$T\302\20\270|\30,f%!DA##\17\17\13\303\10\270|\30\177hN"
  "\304\14\270|\30KF'&\17\37\16\305\15\270|\30K\205\303\17\313\203E\13\323\13\270|\30i%"
  "!e\17\77\337\14\270|\30K\366D<X\264\0\340\11\270|\30K\366\247\5\341\14\270|\30K\205"
  "\303D\366\264\0\342\16\270|\30\37\210\12CD\2\213\36\26\0\0\0\4\377\377\0";


// ----------------------------------------------------------------------------------------
//            DCS.BIOS stuff here
// ----------------------------------------------------------------------------------------
void onDedLine1Change(char* newValue) {
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x450a, onDedLine1Change);

void onDedLine2Change(char* newValue) {
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x4528, onDedLine2Change);

void onDedLine3Change(char* newValue) {
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x4546, onDedLine3Change);

void onDedLine4Change(char* newValue) {
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x4564, onDedLine4Change);

void onDedLine5Change(char* newValue) {
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4582, onDedLine5Change);

// ----------------------------------------------------------------------------------------
//            SETUP Section
// ----------------------------------------------------------------------------------------
void setup() {
	DcsBios::setup();
  delay(100); // time to setup the display
  u8g2.begin();
  u8g2.clear();
  u8g2.setFont(u8g2_font_DEDFontNewInv);
//  u8g2.setContrast(255);  // brightness from 0 to 255
}
// ----------------------------------------------------------------------------------------
//            LOOP Section - Try to keep empty !!!
// ----------------------------------------------------------------------------------------
void loop() {
  DcsBios::loop();
// not all lines are refreshed at the same time, so it sometimes results in missing lines while DED manipulation
// therefore, the page buffer method is used to print all lines at once;
// if using the framebuffer, use -> clearBuffer() to only clear the buffer, clear() clears both buffer and screen which looks blinky
  u8g2.firstPage();
  do {
    u8g2.setCursor(x, y-1);
    u8g2.print(invertChars(line1));
    u8g2.setCursor(x, (2 * y) -1);
    u8g2.print(invertChars(line2));
    u8g2.setCursor(x, (3 * y) -1);
    u8g2.print(invertChars(line3));
    u8g2.setCursor(x, (4 * y) -1);
    u8g2.print(invertChars(line4));
    u8g2.setCursor(x, (5 * y) -1);
    u8g2.print(invertChars(line5));
  } while (u8g2.nextPage());
  u8g2.updateDisplay();
}

// ----------------------------------------------------------------------------------------
//            Supporting functions
// ----------------------------------------------------------------------------------------

String invertChars(String lineX) {                        // create a function, applied on each DED line and returning the manipulated string
  if (lineX.length() > 25) {                              // look for steering bits only if a line has more than 25 chars
    for (int j = 0; j < 4; j++) {                         // go through each of the 4 bytes
      for (int i = 0; i < 8; i++) {                       // go through each of the 8 bits per byte
        if (bitRead(lineX[25 + j], i) == 1) {             // start at char number 26 [string index is 25 !!!]; if steering bit equals 1 we found a to be inverted char
            int inverted = byte(lineX.charAt(j * 8 + i)); // read the byte value of the char from the string object into a local variable
            lineX.setCharAt(j * 8 + i, inverted + 100);   // replace the char by it's inverted version (byte of the char + 100 in the manipulated font)
        }
      }
    }
    lineX.remove(25, 4);                                  // remove the steering bytes from the string (chars 26 to 29) ...
  }														  // ... line is cut to 25 chars, so it passes the next loop without further manipulation (if > 25) 
  return lineX;                                           // function returns the manipulated line
}


 

Regards, CR77

Edited by CR77
Posted (edited)

@CR77

What we need to help you isn't the code already provided but the compiler error messages.

Your display does not show anything because the driver uses only 256 kB instead of the full buffer (2048 kB).

What microcontroller are you using? (UNO, Mega2560, ESP32 ...)

 

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted (edited)

@CR77

there is an u8g2 statement missing within my proposed driver. I corrected the above postings accordingly. Sorry for that!

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 53, /* dc=*/ 6, /* reset=*/ 8);

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

I'm using the Arduino mega 2560 r3 16u2.
I also have the Arduino Nano V3, which I was testing previously, but I gave up for now.

Regards, CR77

Posted (edited)

@CR77

Don't give up. Use the driver statement I proposed above with your Mega2560. An Nano hasn't enough memory to drive that large display.

Have a nice weekend,

Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

I just gave up on NANO, I'll keep trying with MEGA.

I'll go over everything again to see if I missed anything.

 

CR77

Posted (edited)

@Snakedoc

Finally my SSD1322 display arrived from Aliexpress. Nine days from China to Germany, normal shipping, that`s great!

Display arrived the factory style, configured for the 80xx parallel bus.

Like already written here in the posts, to convert it into 4 wire SPI configuration, resistors R5 and R6 had to be swapped.

As this is at zero Ohm, R6 carefully may be snipped off the board and jumper R5 could be bridged by a solder blob.

Connection to the LOLIN ESP32 S2 Mini has been done as already proposed:

OLED -> LOLIN S2 Mini 
 1   -> GND
 2   -> 3.3V
 4   -> 7 CLK hardware SPI
 5   -> 11 MOSI hardware SPI
14   -> 6 DC
15   -> 8 RST (may be changed to any digital pin)
16   -> 12 CS hardware SPI

The display is quick responsive to the F-16 DED with hardware SPI and the driver must read:

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 6, /* reset=*/ 8);

I think that this display may replace that in my CMSP panel, so I did a quick sketch and custome fonts for the A-10C that already looks great.

 

Please find below the adapted F-16 DED sketch for the S2 Mini and SSD1322 display.

Spoiler
//F-16 DED for DCS BIOS using 256x64 SSD1322 OLED connected to a LOLIN ESP32 S2 Mini,
//Final code by JohnnyChicago,a whole lotta font cred to Fusion's wife, and Wiggles5289 on the DCS Forums
// adapted by Vinc_Vega to work exclusively with the u8g2 library, new font with inverted chars added,
// inverted chars are original ASCII code byte + 100, interprete steering bits (bytes 26 - 29 of each DED line) and plot inverted chars,
// unfortunately at the time not all inverted chars are covered by the steering bits (mostly the inverted asterics (*) is missing and therefore is displayed always inveted)

#define DCSBIOS_DEFAULT_SERIAL // for ESP32 and other chipsets
#define DCSBIOS_DISABLE_SERVO // for ESP32 chipsets
#include "DcsBios.h"
#include <SPI.h>
#include <U8g2lib.h>

/* SSD1322 OLED -> LOLIN S2 Mini connections
 1 -> GND
 2 -> 3.3V
 4 -> 7 CLK hardware SPI
 5 -> 11 MOSI hardware SPI
14 -> 6 DC
15 -> 8 RST (may be changed to any digital pin)
16 -> 12 CS hardware SPI

upload in the Arduino IDE: "Tools" -> Board: -> esp32 -> LOLIN S2 Mini  */

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 6, /* reset=*/ 8); // display driver for the hardware SPI

// ----------------------------------------------------------------------------------------
//            Declaration of the variables
// ----------------------------------------------------------------------------------------

String(line1), (line2), (line3), (line4), (line5); // create a string object for each line to manipulate the content of the DED lines
byte brightness = 255; // brightness from 0 to 255
const byte x = 28; // cursor x is always 28 (first char of a line to print) for a 256x64 display
const byte y = 13; // cursor y is according to the line number: y = (line number * y) -1) -> first line print at y = 12
// ----------------------------------------------------------------------------------------
//            costume F-16 DED font including inversed chars for the u8g2 library
// ----------------------------------------------------------------------------------------
/*
  Fontname: DEDFontNewInv_01
  Copyright: Vinc_Vega
  Glyphs: 142/195
  BBX Build Mode: 0
*/
const uint8_t u8g2_font_DEDFontNewInv[1755] U8G2_FONT_SECTION("u8g2_font_DEDFontNewInv") = 
  "\216\0\3\4\4\4\3\5\5\10\14\0\377\11\376\11\0\1h\2\315\6\276 \5\0\334\30!\7\222\207"
  "\30L\4\42\14E\255\30\42$\42AB!\0#\17\226\205\70A\261\230\4\305\213IP,\0$\5"
  "\0\334\30%\17\226\205\30c!A$br!\12\11\33&\20\226\205XC%\242b##E!&"
  "#\1'\10B\256\30$\42\0(\12\224\206X\42Er\33\22)\14\224\206\30BcB\62\225\10\1"
  "*\20\270|\30\17$%Q\310\252\221D)y(+\13f\215X\202BL\202B\0,\10B\207\30"
  "$\42\0-\6&\235\30\14.\6\42\207\30\4/\12v\215\270\201br\14\5\60\15\226\205Xb$"
  "Bt\22!\23\2\61\12\224\206XA\42CrA\62\14\226\205\70$H\202\42*\202\14\63\15\226\205"
  "\30\214bb\243D($\0\64\14\226\205\30\42\362\13\233\240\24\0\65\14\226\205\30\216%\206D($"
  "\0\66\15\226\205\70$\210%HD($\0\67\13\226\205\30\214br\224\10\0\70\16\226\205\70$H"
  "($BD($\0\71\16\226\205\70$HD(\205\42%$\0:\7b\227\30\204\4;\11\202\207"
  "\30\204$\42\0<\11\226\205\230br\225\3=\10f\215\30\354\240\14>\12\226\205\30\242r\223#\0"
  "\77\17\226\205\70$HbCc\342`\202B\0@\20\226\205\70$g\202%#!#!($\0A"
  "\15\226\205Xb$HD\17AD\2B\15\226\205\30%H'%BD-\0C\14\226\205\70$H"
  "\204\62\241\220\0D\13\226\205\30E%\362_T\0E\13\226\205\30\216DD\202\202\14F\13\226\205\30"
  "\216DD\202\62\2G\14\226\205\70$H\204\42\225P\12H\13\226\205\30B\224\36\202h\22I\11\226"
  "\205\30L\202rbJ\13\226\205\30L\202r\42\32\3K\17\226\205\30B$(DcD%\42E\2"
  "L\11\226\205\30\202\362\221\1M\13\226\205\30\201C\17At\22N\15\226\205\30aD%%$\225\250"
  "\5O\13\226\205\70$HtB!\1P\14\226\205\30%HD-\202\22\1Q\13\226\205\70$H\264"
  " \221\12R\15\226\205\30%HD'%\62\21\11S\15\226\205\70$\210E\205\202($\0T\12\226"
  "\205\30L\202\362\11\0U\13\226\205\30B\364\11\205\4\0V\16\226\205\30Bt\22\11\12\242&\4\0"
  "W\13\226\205\30Btz\10\32\14X\21\226\205\30BD\42AAdbDQ\204\210\4Y\16\226\205"
  "\30BD\42AAd\202r\2Z\11\226\205\30\214brd[\10\224\206\30JrB\134\7\222\207\30"
  "\17\3]\10\224\206\30HrR^\14U\246XaC!!\42c\1_\6\26\205\30\6`\10B\257"
  "\30$\42\0a\15\226\205Xb$\346\20M\310\204\0o\7\63\265\30$\4{\14\226\205X\202\362d"
  "B&\4\0|\7\222\207\30\17\3}\14\226\205Xb$F\202\362\4\0~\13F\225\70b$\42d"
  "\42\0\204\10\270|\30\377\320\0\205\13\270|\30K\366\344d\264\0\206\20\270|\30IACA$\42"
  "#\42\17\37\14\207\26\270|\30*\42$\42\303#\42$\42$\42\303#\42$\42\12\210\5\0\334\30"
  "\211\22\270|\30i%!\322\202\352\24&\42\22R\226\0\212\23\270|\30k\244CGe!BaB"
  "\42\303c!\11\213\14\270|\30JF'&\17\37\20\214\14\270|\30LeDv:\63R\215\14\270"
  "|\30JfGv\42+b\216\20\270|\30\17$%Q\310\252\221D)y(\217\16\270|\30\17L"
  "F\304\302DF\17\4\220\13\270|\30\77\30\31\235\230\60\221\13\270|\30\37\226\205\37\36\6\222\11\270"
  "|\30\177\70\62Z\223\14\270|\30\17'Fu\62y\70\224\15\270|\30K\205C\362O\203E\13\225"
  "\15\270|\30,FeF\66\25\22*\226\20\270|\30\212\303BBF\243\242C\306\302\11\227\15\270|"
  "\30\311\302F\325\216d\36T\230\22\270|\30IACACACA\303\302E\226\24\231\15\270|\30"
  "\311\222L\207\215d\36T\232\16\270|\30\212\303B\246\303Br\36T\233\14\270|\30\311\302Fu\262"
  "\324\0\234\17\270|\30\212\303B\222\7\207\344<\250\0\235\16\270|\30\212\303Br\36\65\32\35T\236"
  "\15\270|\30\17DF\17GF\17\14\237\16\270|\30\17DF\17GF'&\14\240\12\270|\30M"
  "u\272S\2\241\15\270|\30\17\312\302\17\303\302\17\2\242\12\270|\30Iw\252S\3\243\17\270|\30"
  "\212\303BBedENF\13\244\23\270|\30\212\303\42CFbA\42\221D\42\11\17*\245\16\270"
  "|\30K\205\303Br\226$S\2\246\16\270|\30\251\303BR'\311YT\1\247\16\270|\30\212\303"
  "B\222l\222<\250\0\250\24\270|\30\251\244CACACACACA\243\242\12\251\14\270|\30"
  "\311\222\14)Y\26N\252\14\270|\30\311\222\14)\331\324\0\253\21\270|\30\212\303B\222\214\302\204\302"
  "\204$\217&\254\14\270|\30I\362Y\222\374\224\0\255\14\270|\30\311\302Dv\42\26N\256\14\270|"
  "\30\311\302Dv\42$c\257\22\270|\30I\222\302D\7\311\12I\207\302\204\204\22\260\12\270|\30I"
  "\366\263p\2\261\15\270|\30)$B\222%\311\77%\262\24\270|\30)C\262\5\211\5\11\205\11\205"
  "\11\311i$\1\263\14\270|\30\212\303B\362\237\7\25\264\16\270|\30\251\303Br\26\35\262\324\0\265"
  "\17\270|\30\212\303B\362)L\224\360(\1\266\17\270|\30\251\303Br\235\24\64$S\2\267\17\270"
  "|\30\212\303B\246\244FF\302\203\12\270\13\270|\30\311\302D\366i\1\271\13\270|\30I\362\377y"
  "P\1\272\16\270|\30I\362O#\42\204\204E\13\273\14\270|\30I\362\237%I!I\274\22\270|"
  "\30I\62\215\210\20\26\25\222\210\14\311\224\0\275\16\270|\30I\62\215\210\20\26\331i\1\276\14\270|"
  "\30\311\302Fu\62\26N\277\13\270|\30\212\224\354\221P\1\300\11\270|\30K\366\247\5\301\14\270|"
  "\30\212\204Fv\42$T\302\20\270|\30,f%!DA##\17\17\13\303\10\270|\30\177hN"
  "\304\14\270|\30KF'&\17\37\16\305\15\270|\30K\205\303\17\313\203E\13\323\13\270|\30i%"
  "!e\17\77\337\14\270|\30K\366D<X\264\0\340\11\270|\30K\366\247\5\341\14\270|\30K\205"
  "\303D\366\264\0\342\16\270|\30\37\210\12CD\2\213\36\26\0\0\0\4\377\377\0";

// ----------------------------------------------------------------------------------------
//            DCS.BIOS stuff here
// ----------------------------------------------------------------------------------------
void onDedLine1Change(char* newValue) {
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x450a, onDedLine1Change);

void onDedLine2Change(char* newValue) {
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x4528, onDedLine2Change);

void onDedLine3Change(char* newValue) {
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x4546, onDedLine3Change);

void onDedLine4Change(char* newValue) {
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x4564, onDedLine4Change);

void onDedLine5Change(char* newValue) {
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4582, onDedLine5Change);

// ----------------------------------------------------------------------------------------
//            SETUP Section
// ----------------------------------------------------------------------------------------
void setup() {
 DcsBios::setup();
 delay(100); // time to setup the display
 u8g2.begin();
 u8g2.clear();
 u8g2.setContrast(brightness);
 u8g2.setFont(u8g2_font_DEDFontNewInv);
}

// ----------------------------------------------------------------------------------------
//            LOOP Section - Try to keep empty !!!
// ----------------------------------------------------------------------------------------
void loop() {
 DcsBios::loop();
 u8g2.firstPage();
 do {
    u8g2.clearBuffer();
    u8g2.setCursor(x, y-1);
    u8g2.print(invertChars(line1));
    u8g2.setCursor(x, (2 * y) -1);
    u8g2.print(invertChars(line2));
    u8g2.setCursor(x, (3 * y) -1);
    u8g2.print(invertChars(line3));
    u8g2.setCursor(x, (4 * y) -1);
    u8g2.print(invertChars(line4));
    u8g2.setCursor(x, (5 * y) -1);
    u8g2.print(invertChars(line5));
  } while (u8g2.nextPage());
  u8g2.updateDisplay();
}

// ----------------------------------------------------------------------------------------
//            Supporting functions
// ----------------------------------------------------------------------------------------
String invertChars(String lineX) { // create a function, applied on each DED line and returning the manipulated string
  if (lineX.length() > 25) { // look for steering bits only if a line has more than 25 chars
    for (int j = 0; j < 4; j++) { // go through each of the 4 bytes
      for (int i = 0; i < 8; i++) { // go through each of the 8 bits per byte
        if (bitRead(lineX[25 + j], i) == 1) { // start at char number 26 [string index is 25 !!!]; if steering bit equals 1 we found a to be inverted char
            int inverted = byte(lineX.charAt(j * 8 + i)); // read the byte value of the char from the string object into a local variable
            lineX.setCharAt(j * 8 + i, inverted + 100); // replace the char by it's inverted version (byte of the char + 100 in the manipulated font)
        }
      }
    }
    lineX.remove(25, 4); // remove the steering bytes from the string (chars 26 to 29) ...
  } // ... line is cut to 25 chars, so it passes the next loop without further manipulation (if > 25) 
  return lineX; // function returns the manipulated line
}

 

Regards, Vinc

Edited by Vinc_Vega
  • Like 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

@Vinc_Vega 

 

Success! 

The display now works with pretty much 0 latency! Thank you very much for your help, greatly appreciate it!

PS: you don't know by any chance if there's a way to use this code for the PFL display? I looked into Bort but couldn't find any snippets for that display, only the DED

ASUS ROG STRIX Z490 F-GAMING | i7-10700K | RTX3090 TUF OC | 32GB DDR4 3200Mhz | Windows 10 64bit | Acer Predator X34P | TrackIR 5 | TM Warthog | TM T.Flight Rudder Pedals

A-10C | A-10C II | F/A-18C | F-16C | FC3 | PG | Syria | SC

Home made F-16C simulator
Forum Thread: DCS World forum - The Viper Project - Home Cockpits Instagram: 1583142 copia.jpg The Viper Project YouTube youtube-icon-512x512-874lspju.png The Viper Project - Youtube channel

Posted (edited)

@Snakedoc

Thanks for the feedback 👍

Sorry, I'm not so familiar with the F-16. I have the module but for the DED display just re-wrote the code to make it compatible with the u8g2 graphics library, built a new font and put in the logic to decode the inverted characters.

If the PFD (primary flight display?) has no DcsBios support (e.g. you can't find it in Bort), there is no good chance to write code for it at the time.

Regards, Vinc 

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

@Vinc_Vega

PFL = Pilot Fault List

is another 5 lines 24 rows display just like the DED that is above the caution panel on the right hand console.

it’s shows codes of various faults / BIT test that the pilot can acknowledge/cancel.

in DCS at the moment it only displays very few info (I suppose it’s still WIP) but maybe it will be more complete in the future. 
 

it looks like it uses the same characters as the DED, so hopefully it will be supported by DCS bios and then it should be as “easy” as changing the snippets codes / addresses for it in your code 🙂 

ASUS ROG STRIX Z490 F-GAMING | i7-10700K | RTX3090 TUF OC | 32GB DDR4 3200Mhz | Windows 10 64bit | Acer Predator X34P | TrackIR 5 | TM Warthog | TM T.Flight Rudder Pedals

A-10C | A-10C II | F/A-18C | F-16C | FC3 | PG | Syria | SC

Home made F-16C simulator
Forum Thread: DCS World forum - The Viper Project - Home Cockpits Instagram: 1583142 copia.jpg The Viper Project YouTube youtube-icon-512x512-874lspju.png The Viper Project - Youtube channel

Posted (edited)
12 hours ago, Snakedoc said:

@Vinc_Vega

... PS: you don't know by any chance if there's a way to use this code for the PFL display? ...

 

@Snakedoc

The ultimate answer is: Yes, I know. But there's no way at the time.

After looking into the respective DCS folder for the PFLD, your impression of a "still WIP" status unfortunately may be true, because of it seems to be implemented more or less as placeholder yet.

But the real problem is, that the "export translation file" for DcsBios (F-16C_50.lua) even does not list the PFLD at the time.

As the DED code within that lua-file alone comprises of almost 1.360 lines of code, it probably makes no sense to implement the PFLD in the current status (WIP).

Nevertheless, you may ask for support in the developer's Discord channel and tell us their answer  🙂

 

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
On 12/6/2024 at 7:08 PM, CR77 said:

I'm using the Arduino mega 2560 r3 16u2.
I also have the Arduino Nano V3, which I was testing previously, but I gave up for now.

Regards, CR77

Hello everyone!
I tested with Arduino NANO, Arduino MEGA and the latest Esp32 devkit V1. The results are the same.

Or the display has some problem, even though it works with the "Hello World" test.

nullimage.png

Or the DCS Bios I use has some wrong configuration.

About the DCS-Bios, do you use a "BORT" interface?

image.png

Regards, CR77

Posted
On 12/10/2024 at 3:33 AM, Vinc_Vega said:

@Snakedoc

Finally my SSD1322 display arrived from Aliexpress. Nine days from China to Germany, normal shipping, that`s great!

Display arrived the factory style, configured for the 80xx parallel bus.

Like already written here in the posts, to convert it into 4 wire SPI configuration, resistors R5 and R6 had to be swapped.

As this is at zero Ohm, R6 carefully may be snipped off the board and jumper R5 could be bridged by a solder blob.

Connection to the LOLIN ESP32 S2 Mini has been done as already proposed:

OLED -> LOLIN S2 Mini 
 1   -> GND
 2   -> 3.3V
 4   -> 7 CLK hardware SPI
 5   -> 11 MOSI hardware SPI
14   -> 6 DC
15   -> 8 RST (may be changed to any digital pin)
16   -> 12 CS hardware SPI

The display is quick responsive to the F-16 DED with hardware SPI and the driver must read:

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 6, /* reset=*/ 8);

I think that this display may replace that in my CMSP panel, so I did a quick sketch and custome fonts for the A-10C that already looks great.

 

Please find below the adapted F-16 DED sketch for the S2 Mini and SSD1322 display.

  Reveal hidden contents
//F-16 DED for DCS BIOS using 256x64 SSD1322 OLED connected to a LOLIN ESP32 S2 Mini,
//Final code by JohnnyChicago,a whole lotta font cred to Fusion's wife, and Wiggles5289 on the DCS Forums
// adapted by Vinc_Vega to work exclusively with the u8g2 library, new font with inverted chars added,
// inverted chars are original ASCII code byte + 100, interprete steering bits (bytes 26 - 29 of each DED line) and plot inverted chars,
// unfortunately at the time not all inverted chars are covered by the steering bits (mostly the inverted asterics (*) is missing and therefore is displayed always inveted)

#define DCSBIOS_DEFAULT_SERIAL // for ESP32 and other chipsets
#define DCSBIOS_DISABLE_SERVO // for ESP32 chipsets
#include "DcsBios.h"
#include <SPI.h>
#include <U8g2lib.h>

/* SSD1322 OLED -> LOLIN S2 Mini connections
 1 -> GND
 2 -> 3.3V
 4 -> 7 CLK hardware SPI
 5 -> 11 MOSI hardware SPI
14 -> 6 DC
15 -> 8 RST (may be changed to any digital pin)
16 -> 12 CS hardware SPI

upload in the Arduino IDE: "Tools" -> Board: -> esp32 -> LOLIN S2 Mini  */

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 6, /* reset=*/ 8); // display driver for the hardware SPI

// ----------------------------------------------------------------------------------------
//            Declaration of the variables
// ----------------------------------------------------------------------------------------

String(line1), (line2), (line3), (line4), (line5); // create a string object for each line to manipulate the content of the DED lines
byte brightness = 255; // brightness from 0 to 255
const byte x = 28; // cursor x is always 28 (first char of a line to print) for a 256x64 display
const byte y = 13; // cursor y is according to the line number: y = (line number * y) -1) -> first line print at y = 12
// ----------------------------------------------------------------------------------------
//            costume F-16 DED font including inversed chars for the u8g2 library
// ----------------------------------------------------------------------------------------
/*
  Fontname: DEDFontNewInv_01
  Copyright: Vinc_Vega
  Glyphs: 142/195
  BBX Build Mode: 0
*/
const uint8_t u8g2_font_DEDFontNewInv[1755] U8G2_FONT_SECTION("u8g2_font_DEDFontNewInv") = 
  "\216\0\3\4\4\4\3\5\5\10\14\0\377\11\376\11\0\1h\2\315\6\276 \5\0\334\30!\7\222\207"
  "\30L\4\42\14E\255\30\42$\42AB!\0#\17\226\205\70A\261\230\4\305\213IP,\0$\5"
  "\0\334\30%\17\226\205\30c!A$br!\12\11\33&\20\226\205XC%\242b##E!&"
  "#\1'\10B\256\30$\42\0(\12\224\206X\42Er\33\22)\14\224\206\30BcB\62\225\10\1"
  "*\20\270|\30\17$%Q\310\252\221D)y(+\13f\215X\202BL\202B\0,\10B\207\30"
  "$\42\0-\6&\235\30\14.\6\42\207\30\4/\12v\215\270\201br\14\5\60\15\226\205Xb$"
  "Bt\22!\23\2\61\12\224\206XA\42CrA\62\14\226\205\70$H\202\42*\202\14\63\15\226\205"
  "\30\214bb\243D($\0\64\14\226\205\30\42\362\13\233\240\24\0\65\14\226\205\30\216%\206D($"
  "\0\66\15\226\205\70$\210%HD($\0\67\13\226\205\30\214br\224\10\0\70\16\226\205\70$H"
  "($BD($\0\71\16\226\205\70$HD(\205\42%$\0:\7b\227\30\204\4;\11\202\207"
  "\30\204$\42\0<\11\226\205\230br\225\3=\10f\215\30\354\240\14>\12\226\205\30\242r\223#\0"
  "\77\17\226\205\70$HbCc\342`\202B\0@\20\226\205\70$g\202%#!#!($\0A"
  "\15\226\205Xb$HD\17AD\2B\15\226\205\30%H'%BD-\0C\14\226\205\70$H"
  "\204\62\241\220\0D\13\226\205\30E%\362_T\0E\13\226\205\30\216DD\202\202\14F\13\226\205\30"
  "\216DD\202\62\2G\14\226\205\70$H\204\42\225P\12H\13\226\205\30B\224\36\202h\22I\11\226"
  "\205\30L\202rbJ\13\226\205\30L\202r\42\32\3K\17\226\205\30B$(DcD%\42E\2"
  "L\11\226\205\30\202\362\221\1M\13\226\205\30\201C\17At\22N\15\226\205\30aD%%$\225\250"
  "\5O\13\226\205\70$HtB!\1P\14\226\205\30%HD-\202\22\1Q\13\226\205\70$H\264"
  " \221\12R\15\226\205\30%HD'%\62\21\11S\15\226\205\70$\210E\205\202($\0T\12\226"
  "\205\30L\202\362\11\0U\13\226\205\30B\364\11\205\4\0V\16\226\205\30Bt\22\11\12\242&\4\0"
  "W\13\226\205\30Btz\10\32\14X\21\226\205\30BD\42AAdbDQ\204\210\4Y\16\226\205"
  "\30BD\42AAd\202r\2Z\11\226\205\30\214brd[\10\224\206\30JrB\134\7\222\207\30"
  "\17\3]\10\224\206\30HrR^\14U\246XaC!!\42c\1_\6\26\205\30\6`\10B\257"
  "\30$\42\0a\15\226\205Xb$\346\20M\310\204\0o\7\63\265\30$\4{\14\226\205X\202\362d"
  "B&\4\0|\7\222\207\30\17\3}\14\226\205Xb$F\202\362\4\0~\13F\225\70b$\42d"
  "\42\0\204\10\270|\30\377\320\0\205\13\270|\30K\366\344d\264\0\206\20\270|\30IACA$\42"
  "#\42\17\37\14\207\26\270|\30*\42$\42\303#\42$\42$\42\303#\42$\42\12\210\5\0\334\30"
  "\211\22\270|\30i%!\322\202\352\24&\42\22R\226\0\212\23\270|\30k\244CGe!BaB"
  "\42\303c!\11\213\14\270|\30JF'&\17\37\20\214\14\270|\30LeDv:\63R\215\14\270"
  "|\30JfGv\42+b\216\20\270|\30\17$%Q\310\252\221D)y(\217\16\270|\30\17L"
  "F\304\302DF\17\4\220\13\270|\30\77\30\31\235\230\60\221\13\270|\30\37\226\205\37\36\6\222\11\270"
  "|\30\177\70\62Z\223\14\270|\30\17'Fu\62y\70\224\15\270|\30K\205C\362O\203E\13\225"
  "\15\270|\30,FeF\66\25\22*\226\20\270|\30\212\303BBF\243\242C\306\302\11\227\15\270|"
  "\30\311\302F\325\216d\36T\230\22\270|\30IACACACA\303\302E\226\24\231\15\270|\30"
  "\311\222L\207\215d\36T\232\16\270|\30\212\303B\246\303Br\36T\233\14\270|\30\311\302Fu\262"
  "\324\0\234\17\270|\30\212\303B\222\7\207\344<\250\0\235\16\270|\30\212\303Br\36\65\32\35T\236"
  "\15\270|\30\17DF\17GF\17\14\237\16\270|\30\17DF\17GF'&\14\240\12\270|\30M"
  "u\272S\2\241\15\270|\30\17\312\302\17\303\302\17\2\242\12\270|\30Iw\252S\3\243\17\270|\30"
  "\212\303BBedENF\13\244\23\270|\30\212\303\42CFbA\42\221D\42\11\17*\245\16\270"
  "|\30K\205\303Br\226$S\2\246\16\270|\30\251\303BR'\311YT\1\247\16\270|\30\212\303"
  "B\222l\222<\250\0\250\24\270|\30\251\244CACACACACA\243\242\12\251\14\270|\30"
  "\311\222\14)Y\26N\252\14\270|\30\311\222\14)\331\324\0\253\21\270|\30\212\303B\222\214\302\204\302"
  "\204$\217&\254\14\270|\30I\362Y\222\374\224\0\255\14\270|\30\311\302Dv\42\26N\256\14\270|"
  "\30\311\302Dv\42$c\257\22\270|\30I\222\302D\7\311\12I\207\302\204\204\22\260\12\270|\30I"
  "\366\263p\2\261\15\270|\30)$B\222%\311\77%\262\24\270|\30)C\262\5\211\5\11\205\11\205"
  "\11\311i$\1\263\14\270|\30\212\303B\362\237\7\25\264\16\270|\30\251\303Br\26\35\262\324\0\265"
  "\17\270|\30\212\303B\362)L\224\360(\1\266\17\270|\30\251\303Br\235\24\64$S\2\267\17\270"
  "|\30\212\303B\246\244FF\302\203\12\270\13\270|\30\311\302D\366i\1\271\13\270|\30I\362\377y"
  "P\1\272\16\270|\30I\362O#\42\204\204E\13\273\14\270|\30I\362\237%I!I\274\22\270|"
  "\30I\62\215\210\20\26\25\222\210\14\311\224\0\275\16\270|\30I\62\215\210\20\26\331i\1\276\14\270|"
  "\30\311\302Fu\62\26N\277\13\270|\30\212\224\354\221P\1\300\11\270|\30K\366\247\5\301\14\270|"
  "\30\212\204Fv\42$T\302\20\270|\30,f%!DA##\17\17\13\303\10\270|\30\177hN"
  "\304\14\270|\30KF'&\17\37\16\305\15\270|\30K\205\303\17\313\203E\13\323\13\270|\30i%"
  "!e\17\77\337\14\270|\30K\366D<X\264\0\340\11\270|\30K\366\247\5\341\14\270|\30K\205"
  "\303D\366\264\0\342\16\270|\30\37\210\12CD\2\213\36\26\0\0\0\4\377\377\0";

// ----------------------------------------------------------------------------------------
//            DCS.BIOS stuff here
// ----------------------------------------------------------------------------------------
void onDedLine1Change(char* newValue) {
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(0x450a, onDedLine1Change);

void onDedLine2Change(char* newValue) {
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(0x4528, onDedLine2Change);

void onDedLine3Change(char* newValue) {
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(0x4546, onDedLine3Change);

void onDedLine4Change(char* newValue) {
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(0x4564, onDedLine4Change);

void onDedLine5Change(char* newValue) {
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(0x4582, onDedLine5Change);

// ----------------------------------------------------------------------------------------
//            SETUP Section
// ----------------------------------------------------------------------------------------
void setup() {
 DcsBios::setup();
 delay(100); // time to setup the display
 u8g2.begin();
 u8g2.clear();
 u8g2.setContrast(brightness);
 u8g2.setFont(u8g2_font_DEDFontNewInv);
}

// ----------------------------------------------------------------------------------------
//            LOOP Section - Try to keep empty !!!
// ----------------------------------------------------------------------------------------
void loop() {
 DcsBios::loop();
 u8g2.firstPage();
 do {
    u8g2.clearBuffer();
    u8g2.setCursor(x, y-1);
    u8g2.print(invertChars(line1));
    u8g2.setCursor(x, (2 * y) -1);
    u8g2.print(invertChars(line2));
    u8g2.setCursor(x, (3 * y) -1);
    u8g2.print(invertChars(line3));
    u8g2.setCursor(x, (4 * y) -1);
    u8g2.print(invertChars(line4));
    u8g2.setCursor(x, (5 * y) -1);
    u8g2.print(invertChars(line5));
  } while (u8g2.nextPage());
  u8g2.updateDisplay();
}

// ----------------------------------------------------------------------------------------
//            Supporting functions
// ----------------------------------------------------------------------------------------
String invertChars(String lineX) { // create a function, applied on each DED line and returning the manipulated string
  if (lineX.length() > 25) { // look for steering bits only if a line has more than 25 chars
    for (int j = 0; j < 4; j++) { // go through each of the 4 bytes
      for (int i = 0; i < 8; i++) { // go through each of the 8 bits per byte
        if (bitRead(lineX[25 + j], i) == 1) { // start at char number 26 [string index is 25 !!!]; if steering bit equals 1 we found a to be inverted char
            int inverted = byte(lineX.charAt(j * 8 + i)); // read the byte value of the char from the string object into a local variable
            lineX.setCharAt(j * 8 + i, inverted + 100); // replace the char by it's inverted version (byte of the char + 100 in the manipulated font)
        }
      }
    }
    lineX.remove(25, 4); // remove the steering bytes from the string (chars 26 to 29) ...
  } // ... line is cut to 25 chars, so it passes the next loop without further manipulation (if > 25) 
  return lineX; // function returns the manipulated line
}

 

Regards, Vinc

Hi Vinc,

I've read through this thread a couple of times as there's a lot of info and it obviously evolved considerably from start to finish. Huge hats off to you for all the work you've done on this and the help you've provided the community. 

I'm thinking about building one of these in the new year and am wondering, if you were advising someone at this early stage - would you go for the WeMos S2 Mini and the SSD1322 screen combo? Sounds like the ESP32 S2 mini might be more capable than the older Arduino Nano / Mega / etc.

Is there an SSD1322 screen in particular that you could recommend (which one did you buy)?

Thanks!

Posted

@OldFlyer

An ESP32 is much more powerful than a Mega but can only be connected by USB. The Mega may work with the RS485 bus (see other posts). A Nano hasn't the memory to serve the 256x64 pixel display.

For the display itself a cheap one from AliExpress will do it after conversion to 4 wire SPI bus.

Regards, Vinc 

  • Thanks 1

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted
3 hours ago, Vinc_Vega said:

@OldFlyer

An ESP32 is much more powerful than a Mega but can only be connected by USB. The Mega may work with the RS485 bus (see other posts). A Nano hasn't the memory to serve the 256x64 pixel display.

For the display itself a cheap one from AliExpress will do it after conversion to 4 wire SPI bus.

Regards, Vinc 

Thanks!

  • 1 month later...
Posted

Hello, thank you for this awesome project.

I'm having issues with my ESP32 and DCS BIOS (which with I'm new) : no data from DCS are being displayed.

I can print a splash screen during setup but nothing more than that - It's like nothing gets interpreted.

My DCS-BIOS console shows good communication both from DCS itself and from my ESP32 (using a serial print as a debug).

Here is the code I'm using :

// #define V_SPI_D 23   
// #define V_SPI_CLK 18 
#define V_SPI_CS0 5  
#define SPI_DC 27    
#define SPI_RESET 26 
  
#define DEBUG
#define DCSBIOS_DISABLE_SERVO

#include <DcsBios.h>

#include <Arduino.h>
#include <U8g2lib.h>
#include <U8glib.h>
#include <SPI.h>

// ----------------------------------------------------------------------------------------
//            costume F-16 DED font including inversed chars for the u8g2 library
// ----------------------------------------------------------------------------------------
/*
  Fontname: DEDFontNewInv_01
  Copyright: Vinc_Vega
  Glyphs: 142/195
  BBX Build Mode: 0
*/
const uint8_t u8g2_font_DEDFontNewInv[1755] U8G2_FONT_SECTION("u8g2_font_DEDFontNewInv") = 
  "\216\0\3\4\4\4\3\5\5\10\14\0\377\11\376\11\0\1h\2\315\6\276 \5\0\334\30!\7\222\207"
  "\30L\4\42\14E\255\30\42$\42AB!\0#\17\226\205\70A\261\230\4\305\213IP,\0$\5"
  "\0\334\30%\17\226\205\30c!A$br!\12\11\33&\20\226\205XC%\242b##E!&"
  "#\1'\10B\256\30$\42\0(\12\224\206X\42Er\33\22)\14\224\206\30BcB\62\225\10\1"
  "*\20\270|\30\17$%Q\310\252\221D)y(+\13f\215X\202BL\202B\0,\10B\207\30"
  "$\42\0-\6&\235\30\14.\6\42\207\30\4/\12v\215\270\201br\14\5\60\15\226\205Xb$"
  "Bt\22!\23\2\61\12\224\206XA\42CrA\62\14\226\205\70$H\202\42*\202\14\63\15\226\205"
  "\30\214bb\243D($\0\64\14\226\205\30\42\362\13\233\240\24\0\65\14\226\205\30\216%\206D($"
  "\0\66\15\226\205\70$\210%HD($\0\67\13\226\205\30\214br\224\10\0\70\16\226\205\70$H"
  "($BD($\0\71\16\226\205\70$HD(\205\42%$\0:\7b\227\30\204\4;\11\202\207"
  "\30\204$\42\0<\11\226\205\230br\225\3=\10f\215\30\354\240\14>\12\226\205\30\242r\223#\0"
  "\77\17\226\205\70$HbCc\342`\202B\0@\20\226\205\70$g\202%#!#!($\0A"
  "\15\226\205Xb$HD\17AD\2B\15\226\205\30%H'%BD-\0C\14\226\205\70$H"
  "\204\62\241\220\0D\13\226\205\30E%\362_T\0E\13\226\205\30\216DD\202\202\14F\13\226\205\30"
  "\216DD\202\62\2G\14\226\205\70$H\204\42\225P\12H\13\226\205\30B\224\36\202h\22I\11\226"
  "\205\30L\202rbJ\13\226\205\30L\202r\42\32\3K\17\226\205\30B$(DcD%\42E\2"
  "L\11\226\205\30\202\362\221\1M\13\226\205\30\201C\17At\22N\15\226\205\30aD%%$\225\250"
  "\5O\13\226\205\70$HtB!\1P\14\226\205\30%HD-\202\22\1Q\13\226\205\70$H\264"
  " \221\12R\15\226\205\30%HD'%\62\21\11S\15\226\205\70$\210E\205\202($\0T\12\226"
  "\205\30L\202\362\11\0U\13\226\205\30B\364\11\205\4\0V\16\226\205\30Bt\22\11\12\242&\4\0"
  "W\13\226\205\30Btz\10\32\14X\21\226\205\30BD\42AAdbDQ\204\210\4Y\16\226\205"
  "\30BD\42AAd\202r\2Z\11\226\205\30\214brd[\10\224\206\30JrB\134\7\222\207\30"
  "\17\3]\10\224\206\30HrR^\14U\246XaC!!\42c\1_\6\26\205\30\6`\10B\257"
  "\30$\42\0a\15\226\205Xb$\346\20M\310\204\0o\7\63\265\30$\4{\14\226\205X\202\362d"
  "B&\4\0|\7\222\207\30\17\3}\14\226\205Xb$F\202\362\4\0~\13F\225\70b$\42d"
  "\42\0\204\10\270|\30\377\320\0\205\13\270|\30K\366\344d\264\0\206\20\270|\30IACA$\42"
  "#\42\17\37\14\207\26\270|\30*\42$\42\303#\42$\42$\42\303#\42$\42\12\210\5\0\334\30"
  "\211\22\270|\30i%!\322\202\352\24&\42\22R\226\0\212\23\270|\30k\244CGe!BaB"
  "\42\303c!\11\213\14\270|\30JF'&\17\37\20\214\14\270|\30LeDv:\63R\215\14\270"
  "|\30JfGv\42+b\216\20\270|\30\17$%Q\310\252\221D)y(\217\16\270|\30\17L"
  "F\304\302DF\17\4\220\13\270|\30\77\30\31\235\230\60\221\13\270|\30\37\226\205\37\36\6\222\11\270"
  "|\30\177\70\62Z\223\14\270|\30\17'Fu\62y\70\224\15\270|\30K\205C\362O\203E\13\225"
  "\15\270|\30,FeF\66\25\22*\226\20\270|\30\212\303BBF\243\242C\306\302\11\227\15\270|"
  "\30\311\302F\325\216d\36T\230\22\270|\30IACACACA\303\302E\226\24\231\15\270|\30"
  "\311\222L\207\215d\36T\232\16\270|\30\212\303B\246\303Br\36T\233\14\270|\30\311\302Fu\262"
  "\324\0\234\17\270|\30\212\303B\222\7\207\344<\250\0\235\16\270|\30\212\303Br\36\65\32\35T\236"
  "\15\270|\30\17DF\17GF\17\14\237\16\270|\30\17DF\17GF'&\14\240\12\270|\30M"
  "u\272S\2\241\15\270|\30\17\312\302\17\303\302\17\2\242\12\270|\30Iw\252S\3\243\17\270|\30"
  "\212\303BBedENF\13\244\23\270|\30\212\303\42CFbA\42\221D\42\11\17*\245\16\270"
  "|\30K\205\303Br\226$S\2\246\16\270|\30\251\303BR'\311YT\1\247\16\270|\30\212\303"
  "B\222l\222<\250\0\250\24\270|\30\251\244CACACACACA\243\242\12\251\14\270|\30"
  "\311\222\14)Y\26N\252\14\270|\30\311\222\14)\331\324\0\253\21\270|\30\212\303B\222\214\302\204\302"
  "\204$\217&\254\14\270|\30I\362Y\222\374\224\0\255\14\270|\30\311\302Dv\42\26N\256\14\270|"
  "\30\311\302Dv\42$c\257\22\270|\30I\222\302D\7\311\12I\207\302\204\204\22\260\12\270|\30I"
  "\366\263p\2\261\15\270|\30)$B\222%\311\77%\262\24\270|\30)C\262\5\211\5\11\205\11\205"
  "\11\311i$\1\263\14\270|\30\212\303B\362\237\7\25\264\16\270|\30\251\303Br\26\35\262\324\0\265"
  "\17\270|\30\212\303B\362)L\224\360(\1\266\17\270|\30\251\303Br\235\24\64$S\2\267\17\270"
  "|\30\212\303B\246\244FF\302\203\12\270\13\270|\30\311\302D\366i\1\271\13\270|\30I\362\377y"
  "P\1\272\16\270|\30I\362O#\42\204\204E\13\273\14\270|\30I\362\237%I!I\274\22\270|"
  "\30I\62\215\210\20\26\25\222\210\14\311\224\0\275\16\270|\30I\62\215\210\20\26\331i\1\276\14\270|"
  "\30\311\302Fu\62\26N\277\13\270|\30\212\224\354\221P\1\300\11\270|\30K\366\247\5\301\14\270|"
  "\30\212\204Fv\42$T\302\20\270|\30,f%!DA##\17\17\13\303\10\270|\30\177hN"
  "\304\14\270|\30KF'&\17\37\16\305\15\270|\30K\205\303\17\313\203E\13\323\13\270|\30i%"
  "!e\17\77\337\14\270|\30K\366D<X\264\0\340\11\270|\30K\366\247\5\341\14\270|\30K\205"
  "\303D\366\264\0\342\16\270|\30\37\210\12CD\2\213\36\26\0\0\0\4\377\377\0";

U8G2_SSD1322_NHD_256X64_F_4W_HW_SPI u8g2(U8G2_R2, V_SPI_CS0, SPI_DC, SPI_RESET);

String(line1); String(line2); String(line3); String(line4); String(line5);  // create a string object for each line to manipulate the content
const byte x = 28;         // cursor x is always 28 (first char of a line to print) for a 256x64 display
const byte y = 13;         // cursor y is according to the line number: y = (line number * y) -1) -> first line print at y = 12

void splashScreen()
{
  Serial.println("SPLASH SCREEN");
  u8g2.clearBuffer();
  u8g2.drawStr(30, (y -1),       " _______________________ ");
  u8g2.drawStr(30, ((2 * y) -1), "|                       |");
  u8g2.drawStr(30, ((3 * y) -1), "|        F16 DED        |");
  u8g2.drawStr(30, ((4 * y) -1), "|         V0.1          |");
  u8g2.drawStr(30, ((5 * y) -1), "|_______________________|");
  u8g2.sendBuffer();
}

String invertChars(String lineX) {                        // create a function, applied on each DED line and returning the manipulated string
  if (lineX.length() > 25) {                              // look for steering bits only if a line has more than 25 chars
    for (int j = 0; j < 4; j++) {                         // go through each of the 4 bytes
      for (int i = 0; i < 8; i++) {                       // go through each of the 8 bits per byte
        if (bitRead(lineX[25 + j], i) == 1) {             // start at char number 26 [string index is 25 !!!]; if steering bit equals 1 we found a to be inverted char
            int inverted = byte(lineX.charAt(j * 8 + i)); // read the byte value of the char from the string object into a local variable
            lineX.setCharAt(j * 8 + i, inverted + 100);   // replace the char by it's inverted version (byte of the char + 100 in the manipulated font)
        }
      }
    }
    lineX.remove(25, 4);                                  // remove the steering bytes from the string (chars 26 to 29) ...
  } // ... line is cut to 25 chars, so it passes the next loop without further manipulation (see: if lineX.length > 25) 
  return lineX;                                           // function returns the manipulated line
}

void onDedLine1Change(char* newValue)
{
  line1 = newValue;
}
DcsBios::StringBuffer<29> dedLine1Buffer(F_16C_50_DED_LINE_1_A, onDedLine1Change);

void onDedLine2Change(char* newValue)
{
  line2 = newValue;
}
DcsBios::StringBuffer<29> dedLine2Buffer(F_16C_50_DED_LINE_2_A, onDedLine2Change);

void onDedLine3Change(char* newValue)
{
  line3 = newValue;
}
DcsBios::StringBuffer<29> dedLine3Buffer(F_16C_50_DED_LINE_3_A, onDedLine3Change);

void onDedLine4Change(char* newValue)
{
  line4 = newValue;
}
DcsBios::StringBuffer<29> dedLine4Buffer(F_16C_50_DED_LINE_4_A, onDedLine4Change);

void onDedLine5Change(char* newValue)
{
  line5 = newValue;
}
DcsBios::StringBuffer<29> dedLine5Buffer(F_16C_50_DED_LINE_5_A, onDedLine5Change);

void setup()
{
  DcsBios::setup();
  Serial.begin(115200);
  u8g2.begin();
  u8g2.setFont(u8g2_font_DEDFontNewInv);
  splashScreen();
  delay(3 * 1000);
}

void loop()
{
  DcsBios::loop();
  #ifdef DEBUG
      Serial.println("LISTING...");
  #endif
  u8g2.firstPage();
  do {
    u8g2.setCursor(x, y-1);
    u8g2.print(invertChars(line1));
    u8g2.setCursor(x, (2 * y) -1);
    u8g2.print(invertChars(line2));
    u8g2.setCursor(x, (3 * y) -1);
    u8g2.print(invertChars(line3));
    u8g2.setCursor(x, (4 * y) -1);
    u8g2.print(invertChars(line4));
    u8g2.setCursor(x, (5 * y) -1);
    u8g2.print(invertChars(line5));
  } while (u8g2.nextPage());
  u8g2.updateDisplay();
}

Snapshot of DCS-BIOS console :

.....f................< 2025/01/24 19:15:59.000460229  length=22 from=3498 to=3519
......f...............< 2025/01/24 19:15:59.000483297  length=22 from=3520 to=3541
.....f................< 2025/01/24 19:15:59.000506357  length=22 from=3542 to=3563
.....f.....~..........< 2025/01/24 19:15:59.000529364  length=22 from=3564 to=3585
.....f.....~..........< 2025/01/24 19:15:59.000552467  length=22 from=3586 to=3607
......f...............< 2025/01/24 19:15:59.000575321  length=22 from=3608 to=3629
.....f................< 2025/01/24 19:15:59.000598421  length=22 from=3630 to=3651
...........~..........> 2025/01/24 19:15:59.000601707  length=118 from=0 to=117
UUUU....    "....J2.......n.>.\b.68   47 L...*..D\b.U...".U..D.....D\f..w........)Y.D..r...T}.D.....D....^Z.o...W..4'.E.....E..9y.E...L$.\a.......< 2025/01/24 19:16:00.000307263  length=22 from=4290 to=4311
......f...............> 2025/01/24 19:16:00.000320188  length=110 from=4598 to=4707
UUUU
...  ....    "...dI2.......n.J.....ND..V....D\b..........D.....D.....D..$Y.D.....D
.]Z.o...V...E..8y......> 2025/01/24 19:16:00.000330128  length=118 from=4708 to=4825
UUUU....    "...dI2.......n.B... 47 L......D\b..........D.....D
.........$Y.D.....D\f.]Z.o...V..2'.E..8y.E...L!.\b.......< 2025/01/24 19:16:00.000339662  length=22 from=4312 to=4333
....>f................< 2025/01/24 19:16:00.000345837  length=22 from=4334 to=4355
.....f.....~..........> 2025/01/24 19:16:00.000356106  length=124 from=4826 to=4949
UUUU\f...  ..
.    N*.
.H2.......n.J...2.RD.......D\b.....e....D.....D.....D.. Y.D..U}.D.....D\f.B.\\Z.o...V...D.....E..6y......> 2025/01/24 19:16:00.000365709  length=138 from=4950 to=5087
UUUU....F-....  "....H2.......n.F.\b...\\\f..2..D\b.....e....D.....D...w...D.. YJ.Uy.D..U}.D.....D..B.\\Z.o...V..0'.E.....E..6y.E...Lk.........< 2025/01/24 19:16:00.000377420  length=22 from=4356 to=4377
.....f.....~..........< 2025/01/24 19:16:00.000392371  length=22 from=4378 to=4399
......................> 2025/01/24 19:16:00.000396821  length=116 from=5088 to=5203
UUUU....  ....N*.
.G2...z...n.J...6.VD.......D
...6.....6..D.....D.....D...Y.D..\b..D\f.h.\\Z.o...V...D.....E..5y......> 2025/01/24 19:16:00.000406969  length=130 from=5204 to=5333
UUUU....16C_"....G2...z...n.J.....6..D
...6.....6..D.....D...w...D
..YJ.Uy.....D..\b..D..h.\\Z.o...V...'.E.....E..5y.E...L$.........< 2025/01/24 19:16:00.000416884  length=22 from=4400 to=4421
......f...............> 2025/01/24 19:16:00.000431968  length=172 from=5334 to=5505
UUUU....  "...<G10202...Z...n.J...9.&D..@@ZD...#...D\b..........D.....D.....D...Y.D.. .u.\f..D\f...[Z.o...Vz..D.....E\f.     VHF   O E..127.JE..127.jE..    |E.. 127.E..4y......> 2025/01/24 19:16:00.000445289  length=196 from=5506 to=5701
UUUU....50. "...<G1020 550..&.E.Z.\r.n.L...9. 1.0(D.....D\b..........D.....D.....D...Y.D.......D.. .u.\f..D....[Z.o...Vz.-'.E.....E\f.     VHF   O*E..127.TE..127.tE..    .E.. 127.E..4y.E...Lk.........< 2025/01/24 19:16:00.000464859  length=44 from=4422 to=4465
.....f......................f...............> 2025/01/24 19:16:00.000467176  length=108 from=5702 to=5809
UUUU....  ".
..F1020 5512...9...n.J...=.^D.......D\b.|...I.|..D.....D...Y.D..T}.D..0..D\b..o...Vr..E..2y......> 2025/01/24 19:16:00.000475501  length=132 from=5810 to=5941
UUUU
...    "....F*...51..'.E.9.\v.n.L.
.=. 1.00.00.D\b.|...I.|..D...w...D...Y.D
.....r...T}.D..0..D
..o...Vr.+'.E..2y.E...L#.........< 2025/01/24 19:16:00.000487093  length=22 from=4466 to=4487
......................> 2025/01/24 19:16:00.000498911  length=122 from=5942 to=6063
UUUU....  "....E*...51..&.E.....n.J...@.bD..U....D\b.&.....&..D.....D.....D...YJ.Ry.D..D..D\f...ZZ.o...Vj..D.....E..1y......> 2025/01/24 19:16:00.000508245  length=138 from=6064 to=6201
UUUU....    "....E2.....
.n.L...@.V...34-0.D\b.&.....&..D.....D...w...D...YJ.Ry.D..r....D..D..D....ZZ.o...Vj.)'.E.....E..1y.E...M .........< 2025/01/24 19:16:00.000519986  length=22 from=4488 to=4509
...........~..........< 2025/01/24 19:16:00.000532734  length=22 from=4510 to=4531
.....f................> 2025/01/24 19:16:00.000538114  length=118 from=6202 to=6319
UUUU....  "..."E..
.&.E.....n.J...D.&D...@fD.......D\b..........D.....D..
YJ.?y.D..a..D\f...YZ.o...V`..D.....E..0y......> 2025/01/24 19:16:00.000547312  length=136 from=6320 to=6455
UUUU....    "..."E2.....        .n.L...D.Z....005(D.....D\b..........D.....D..
YJ.?y.D..T}...D..a..D....YZ.o...V`.''.E.....E..0y.E..\rMl.........< 2025/01/24 19:16:00.000559110  length=22 from=4532 to=4553
...........~..........> 2025/01/24 19:16:00.000573430  length=88 from=6456 to=6543
UUUU....F-"...rD2.......n.J...G.jD.......D\b.i...6.i..D.....D...Y.D..~..D\b..o...VW.......> 2025/01/24 19:16:00.000580280  length=114 from=6544 to=6657
UUUU....F-....  "...rD2.....\a.n.L...G.^...0.00.D\b.i...6.i..D.....D...Y.D
.........~..D
..o...VW.&'.E...M".........< 2025/01/24 19:16:00.000590538  length=22 from=4554 to=4575
......f...............< 2025/01/24 19:16:00.000602659  length=22 from=4576 to=4597
......................> 2025/01/24 19:16:00.000608641  length=116 from=6658 to=6773
UUUU....16"....C2.\b.....n.19J...K.nD.......D\b.\f.....\f..D.....D...Y.D..y..D....u.\v..D\f...XZ.o...VM..D.....E...y......> 2025/01/24 19:16:00.000618221  length=134 from=6774 to=6907
UUUU....16C_"....C2.......n.L...K.b...04h..D\b.\f.....\f..D...w...D...Y.D..y..D
.......u.\v..D....XZ.o...VM.$'.E.....E...y.E...Mj.........< 2025/01/24 19:16:00.000629545  length=22 from=4598 to=4619
......f...............> 2025/01/24 19:16:00.000645542  length=116 from=6908 to=7023
UUUU....C_"...\bC2.\f.{...n.19:05.J...O.rD.......D\b.....{....D.....D...X.D..z..D.....D\f.%.WZ.o...VC..D.....E..-y......> 2025/01/24 19:16:00.000655526  length=128 from=7024 to=7151
UUUU....50. ....0.8."...\bC2...{...n.L...O..D\b.....{....D...w...D...X.D..z..D....u..D..%.WZ.o...VC."'.E.....E..-y.E...M".........< 2025/01/24 19:16:00.000665601  length=22 from=4620 to=4641
.....f................< 2025/01/24 19:16:00.000672324  length=22 from=4642 to=4663
.....f................> 2025/01/24 19:16:00.000690013  length=116 from=7152 to=7267
UUUU....50"...>B2.......n.>...   4J...S.vD.......D\b.G.....G..D.....D...X.D....x..D\f.K.VZ.o...V7..D..c....E..+y......> 2025/01/24 19:16:00.000699249  length=128 from=7268 to=7395
UUUU
...    ....3 Ne"...>B2.......n.L...S..D\b.G.....G..D...w...D...X.D\b...x.\v....D..K.VZ.o...V7. '.E..c....E..+y.E..#M..........< 2025/01/24 19:16:00.000708916  length=22 from=4664 to=4685
...........~..........> 2025/01/24 19:16:00.000718109  length=106 from=7396 to=7501
UUUU\b.... "....A2...|...n.B.
.7...\\\f..V.zD....h..D\b..........D.....D...X.D.......D
.UZ.o...V-..E..*y......> 2025/01/24 19:16:00.000726320  length=120 from=7502 to=7621
UUUU....    \b...w ca"....A2...|...n.L...V..D\b..........D.....D...X.D......\v.......ffK.UZ.o...V-..'.E..*y.E..)Mh.........< 2025/01/24 19:16:00.000734823  length=22 from=4686 to=4707
...........~..........< 2025/01/24 19:16:00.000742529  length=22 from=4708 to=4729
....................8.> 2025/01/24 19:16:00.000755008  length=104 from=7622 to=7725
UUUU
...  "....@2...N...n.F...\\\f..Z.~D.......D\b.....Y....D.....D...X.D.......D\f.q.TZ.o...V$..E..)y......> 2025/01/24 19:16:00.000763188  length=118 from=7726 to=7843
UUUU....    \f...llsi"....@2...N...n.L...Z..D\b.....Y....D...w...D...X.D.......D..ffq.TZ.o...V$..'.E..)y.E../M#.........< 2025/01/24 19:16:00.000771676  length=22 from=4730 to=4751
...........~..........< 2025/01/24 19:16:00.000789020  length=22 from=4752 to=4773
.....f................> 2025/01/24 19:16:00.000794702  length=122 from=7844 to=7965
UUUU\f...  ....0."...
@2...c...n.J...^..D..........$.....$..D\f...O..........D...X.D..\b....D\f...SZ.o...V...D.....E..'y......> 2025/01/24 19:16:00.000804036  length=134 from=7966 to=8099
UUUU....F-....  ....gn  "...
@2...c...n.L...^..D\b.$.....$..D\f...O......w...D...X.D..\b....D....SZ.o...V...'.E.....E..'y.E..6M .........< 2025/01/24 19:16:00.000814918  length=22 from=4774 to=4795
...........~..........> 2025/01/24 19:16:00.000832101  length=120 from=8100 to=8219
UUUU....  ....10.0"...c?2.......n.J...a..D\f..............D\f.\b.O..........D...X.D..%....D\f...RZ.o..xV...D.....E..&y......> 2025/01/24 19:16:00.000841901  length=130 from=8220 to=8349
UUUU....16C_....    "...c?2.......n.L...a..D\b..........D\f.\b.O......w...D...X.D..%....D....RZ.o..xV...'.E.....E..&y.E..9M .........< 2025/01/24 19:16:00.000852621  length=22 from=4796 to=4817
......................< 2025/01/24 19:16:00.000858853  length=22 from=4818 to=4839
......f...............> 2025/01/24 19:16:00.000867575  length=116 from=8350 to=8465
UUUU....  ....New "....>2.......o.J...e.&D.. @.D
...k...8.k..D\f.\v.O..........D...X.D..;....D
.QZ.o..nV\a..E..$y......> 2025/01/24 19:16:00.000875863  length=130 from=8466 to=8595
UUUU....50. ....    "....>2.......o.L...e.(D...@.D
...k...8.k..D\f.\v.O......w...D...X.D..;....D\f.QZ.o..nV\a..'.E..$y.E..?M..........< 2025/01/24 19:16:00.000885867  length=22 from=4840 to=4861
......f...............> 2025/01/24 19:16:00.000902151  length=170 from=8596 to=8765
UUUU....
...call"....=,.\f...&.E.....o.J...h..D\b..........D\f...O..........D...X.D..I....D\f...PZ.o..fV...D.....E\f. UHF     MAI E..305.JE..305.jE.. TOD|E.. 305.E..#y......> 2025/01/24 19:16:00.000915781  length=180 from=8766 to=8945
UUUU
...    ..\b.  N*.
.=2.......o.L...h..D\b..........D\f...O......w...D...X.D..I....D....PZ.o..fV...'.)...E.....E\f. UHF     MAI*E..305.TE..305.tE.. TOD.E.. 305.E..#y.E..FMh.........< 2025/01/24 19:16:00.000929620  length=44 from=4862 to=4905
............................................> 2025/01/24 19:16:00.000937214  length=120 from=8946 to=9065
UUUU....  ....sign"...G=2.......o.J...l..D\f..........6e..D\f...O..........D...X.D..T....D\f.\b.PZ.o..^V...D.....E.."y......> 2025/01/24 19:16:00.000946131  length=132 from=9066 to=9197
UUUU....     ....
G=2.......o.L...l..D\b..........D\f...O......w...D...X.D..T....D..\b.PZ.o..^V...'.).......E.....E.."y.E..LM".........< 2025/01/24 19:16:00.000955794  length=22 from=4906 to=4927
......f...............> 2025/01/24 19:16:00.000970899  length=110 from=9198 to=9307
UUUU....  ....    "....<2...{...o\bJ...o..D..\\...).\\..6e.e.33....O......D...X.D.....D..\\....D
.OZ.o..WV........> 2025/01/24 19:16:00.000979169  length=122 from=9308 to=9429
UUUU....    "....<10202...{...o\bL...o..D\b.\\...).\\..D\b...O......D...X.D.....D..\\....D\f.OZ.o..WV...'.D..2.2..E..OMi.........< 2025/01/24 19:16:00.000988560  length=22 from=4928 to=4949
.....f................< 2025/01/24 19:16:00.000998916  length=22 from=4950 to=4971
.....f.....~..........> 2025/01/24 19:16:01.000008630  length=120 from=9430 to=9549
UUUU....F-....    "....;2...Z...o\fJ...s.&D...@.D\b..........D.......D.....D...X.D..a....D\f...OZ.o..NV...D.....E.. y......> 2025/01/24 19:16:01.000017548  length=132 from=9550 to=9681
...........~..........< 2025/01/24 19:16:01.000418812  length=22 from=5346 to=5367
...........~..........< 2025/01/24 19:16:01.000441838  length=22 from=5368 to=5389
.....f................< 2025/01/24 19:16:01.000464997  length=22 from=5390 to=5411

Any suggestions on what I could be doing wrong please?

Thanks!

Posted (edited)

You just deleted to much from the root sketch. Put the following line in front of the DCSBIOS_DISABLE_ SERVO definition:

#define DCSBIOS_DEFAULT_SERIAL

As the Serial port is used by DcsBios, you furthermore may uncomment the DEBUG definitions and Serial statements in your sketch to unblock communication.

 

Regards, Vinc

Edited by Vinc_Vega

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

My bad, I forgot to mention that I'm using PlatformIO, DCSBIOS_DEFAULT_SERIAL is already declared in my .ini file.

You were right about the serial statements, they block communication, thank you!

Although I'm now facing another problem, it's as if the received data is wrong most of the time. The lines are trunked and random characters are displayed.
Please see video.

Any ideas please?

Posted

Strange! 

Please tell us more in detail what microcontroller and display driver are in use and if you modified the hardware.

Regards, Vinc

Regards, Vinc

real life: Royal Bavarian Airforce

online: VJS-GermanKnights.de

[sIGPIC][/sIGPIC]

Posted

Well, it looks like my DCS BIOS library from Skunkworks got corrupted in my project...

After rebuilding everything from scratch it works fine.
I still get random characters briefly displayed on the very first data received, but I cannot complain.

Thanks again for pointing me in the right direction, I can now complet my deskpit 🙂

  • 3 weeks later...
Posted

I am using a ELEGOO 3PCS ESP-32 Development Board USB-C, 2.4GHz Dual Mode WiFi+Bluetooth Dual Core Microcontroller for Arduino IDE, Support AP/STA/AP+STA, CP2102 Chip and 3.12 inch OLED Display Module 256 * 64 OLED Display Module 7-Pin SPI Interface SSD1322.  My computer does not recognize the ESP32 as a com port but as a CP2102 USB to UART Bridge Controller, so I cannot load the code from Arduino IDE.  Read thru this entire blog and still confused.  Not sure I have the right code and not sure if I have the right pin connections.  Any help would be greatly appreciated.

 

  • 2 weeks later...
Posted

Hello, after reading the whole thread, I'm left wondering which hardware to use for both the microcontroller and the display, as I'm thinking about making a DED for DCS. Also, although I saw that it's enough to copy and paste the sketch, is there anything that needs to be done with DCS BIOS?

You've done a great job!

  • 1 month later...
Posted

Sorry to bothering here again about the same question.

I'd bought another SSD1322(16pin) to test again. The situation is the same:

1.I use the same pin setting and code from vinc for ESP32 S2 mini and SSD1322.

2.The HW SPI mode just never work (black), the SW SPI mode work but EXTREMELY SLOW. I guess the code and pin is correct but some other thing wrong.

The result this time is same as before. I guess I must have some problem on ESP32 or driver, could anyone successful make it work give me some more detail about using it?like the drive you use, the setting in arduino IDE for board, etc...Thanks in advanced.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...