WIP: A320 Triple brake indicator & Chrono

Working on a instrument project or just finished a project? Show it to others!

Moderators: russ, Ralph

Message
Author
JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: WIP: A320 Triple brake indicator & Chrono

#11 Post by JackZ »

@Ralph
I tried the OLEDs for two reasons: their size and price.
The contrast is also a good reason.
I prefered this solution over 7 segments digits which are not available in white and not small enough to fit my chrono, at least in the MAX7319 version. And having to address each segment individually was a NOGO for me, too much wiring...
I have to see if I can vary the brightness of the pixels by the way, via the current library.

But to be fair, the font limitations from the OLEDs libraries are a pain in the ...
You have to create a specific font set each time you want something specific for your application, and for every size.
And the usable space when compared to the actual size of the screen is annoying, with these 0,9 in screen, I am limited to a font size of 24 (31 pixels high).

Hence my weird mounting scheme of two screens side by side in order to have the proper character position, the seconds digits being smaller and offset. Luckily there was a display rotation function in the library!

I am planning to have a try at a 2in LCD screen that would have the size for all the three displays at once and give me more options about font size and positioning.
Another library to tackle, and probably quite slow, but the refresh rate needed for a chrono is obviously once every second, so that should be ok.

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: WIP: A320 Triple brake indicator & Chrono

#12 Post by jph »

JackZ wrote: Wed Apr 28, 2021 8:49 am I have to see if I can vary the brightness of the pixels by the way, via the current library.
Jacques
Hi Jacques.
Not sure about the U*x library, but you can vary the 'brightness' in the adafruit libs by using the following -

Code: Select all

 credit and original work - grzesiekyogi
// for Adafruit_SSD1306.h library
// contr values from 1 to 411
// for i2c and 3.3V VCC works fine

void setContrast(int contr){
    int prech;
    int brigh; 
    switch (contr){
      case 001 ... 255: prech= 0; brigh= contr; break;
      case 256 ... 411: prech=16; brigh= contr-156; break;
      default: prech= 16; brigh= 255; break;}
      
    display.ssd1306_command(SSD1306_SETPRECHARGE);      
    display.ssd1306_command(prech);                            
    display.ssd1306_command(SSD1306_SETCONTRAST);         
    display.ssd1306_command(brigh);
    }
The calls can be seen in the Adafruit_SSD1306.h (example below) - to the register addresses in the 1306 as per datasheet.

Code: Select all

#define SSD1306_MEMORYMODE 0x20          ///< See datasheet
#define SSD1306_COLUMNADDR 0x21          ///< See datasheet
#define SSD1306_PAGEADDR 0x22            ///< See datasheet
#define SSD1306_SETCONTRAST 0x81         ///< See datasheet
#define SSD1306_CHARGEPUMP 0x8D          ///< See datasheet
#define SSD1306_SEGREMAP 0xA0            ///< See datasheet
#define SSD1306_DISPLAYALLON_RESUME 0xA4 ///< See datasheet
#define SSD1306_DISPLAYALLON 0xA5        ///< Not currently used
#define SSD1306_NORMALDISPLAY 0xA6       ///< See datasheet
#define SSD1306_INVERTDISPLAY 0xA7       ///< See datasheet
#define SSD1306_SETMULTIPLEX 0xA8        ///< See datasheet
#define SSD1306_DISPLAYOFF 0xAE          ///< See datasheet
#define SSD1306_DISPLAYON 0xAF           ///< See datasheet
#define SSD1306_COMSCANINC 0xC0          ///< Not currently used
#define SSD1306_COMSCANDEC 0xC8          ///< See datasheet
#define SSD1306_SETDISPLAYOFFSET 0xD3    ///< See datasheet
#define SSD1306_SETDISPLAYCLOCKDIV 0xD5  ///< See datasheet
#define SSD1306_SETPRECHARGE 0xD9        ///< See datasheet
#define SSD1306_SETCOMPINS 0xDA          ///< See datasheet
#define SSD1306_SETVCOMDETECT 0xDB       ///< See datasheet
And as said, correspond to the 1306 datasheet which is needed for reference. -
https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf

I am unsure if a similar thing may exist in the u*x libs ? - but would think so as it is extremely powerful

What we really need is for (relatively) cheap high res OLEDS to be available in larger sizes. - best of both worlds
Joe
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: WIP: A320 Triple brake indicator & Chrono

#13 Post by jph »

Ralph wrote: Wed Apr 28, 2021 8:25 am That sounds like a good reason. Certainly also the view angle. Those small screens usually don't have a great viewing angle.
Agreed, the trouble with 'normal' lcd screens is that they are ALL 'polarised' for a specific limited range view angle at the factory for the appropriate user usage viewing angle. This is done prior to the glass overlay. A standard laptop screen, for example, is horrendous when viewed from non 'normal' angles (like if placed behind a panel at the non optimal viewing angle.... Also, things like IPS technology have not filtered down to pixel addressable small lcd displays (and may not be possible in non video type use). We are a little stuck with very limited viewing angles for standard small digital lcd panels.

Here is a classic example of a custom LCD that was produced for a company that I worked as a freelance programmer for in 2011+ .
(It was programmed with a PIC Micro for a 52mm round instrument cluster meter)
Notice the horrendous viewing angle - but not much different to TN laptop screens - or even tft - - (second page of PDF). the '6 oclock' - which translates to 45 degrees from the lower half. Ie - it needs to be tilted to the viewer by 45 degrees for the optimal viewing angle. this was / is a very successful and profitable UK company in the yachting accessory business. The owner ordered 1000's without realising how polarity of viewing angles worked. !. so despite complaints he wanted it to go ahead - hell ;) , ok by me I still got paid for all my many invoices despite warnings of the incorrect product being ordered by him :D ;) .... so, he ended up with an excellent product as far as coding functionality goes, but a totally crap product when viewed in a vertical panel.
LCD custom TF3926PA1.pdf
(367.71 KiB) Downloaded 184 times
Joe
Last edited by jph on Wed Apr 28, 2021 10:05 am, edited 1 time in total.
Joe. CISSP, MSc.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: WIP: A320 Triple brake indicator & Chrono

#14 Post by JackZ »

Thanks for the input.
I am investigating and it seems that the ug82 library also has some sort of contrast control for the 1306, though one has to play with the voltage regulator and precharge registry to get the full range of contrast. Not sure it’s worth the hassle though.

https://github.com/olikraus/u8g2/issues/636

Jacques
Last edited by JackZ on Wed Apr 28, 2021 10:10 am, edited 1 time in total.
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: WIP: A320 Triple brake indicator & Chrono

#15 Post by jph »

JackZ wrote: Wed Apr 28, 2021 10:04 am Thanks for the input.
I am investigating and it seems that the ug82 library also has some sort of contrast control for the 1306, though one has to play with the voltage regulator registry to get the full range of contrast. Not sure it’s worth the hassle though.

Jacques
If it corresponds to the datasheet as per the adafruit stuff, it is probably fairly straightforward. If not, then it may be difficult, The U*x lib covers so many devices.. in theory, any LCD you buy (non custom) should still be programable with the same lib - which I thought was it's strength.
Looking forward to the normal graphic LCD product but I think you may well be disappointed with viewing angles ... but.. 'proof is in the pudding' (old English saying)
However, it may well be worth looking at the adafruit lib again perhaps ? - I know it is more hassle, but changing to a new display also is. :cry:
Joe
Last edited by jph on Wed Apr 28, 2021 10:21 am, edited 1 time in total.
Joe. CISSP, MSc.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: WIP: A320 Triple brake indicator & Chrono

#16 Post by JackZ »

For the TFT I am investigating a screen with an ILI 9225 controller, hence another different library.
https://github.com/Nkawu/TFT_22_ILI9225 ... dard-fonts
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: WIP: A320 Triple brake indicator & Chrono

#17 Post by jph »

JackZ wrote: Wed Apr 28, 2021 10:18 am For the TFT I am investigating a screen with an ILI 9225 controller, hence another different library.
https://github.com/Nkawu/TFT_22_ILI9225 ... dard-fonts
Hmm, interesting -
May be supported here ? --- or certainly closer types with same family controllers - the higher number types seem to use a parallel bus though..
There are several supported modules though.
https://github.com/adafruit/TFTLCD-Library

I also found a link to a 9225 and it had a 6 o-clock view angle also ................... :cry:

May not be an exact match - but page 3 quote a 45 degree offset view angle.. (6 O-Clock)
https://docs.rs-online.com/fe9c/0900766b8120b21e.pdf
Joe
Joe. CISSP, MSc.

User avatar
jph
Posts: 2846
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: WIP: A320 Triple brake indicator & Chrono

#18 Post by jph »

Jacques,
I have 'bitten the bullet' on this OLED display - not the cheapest - but has potential. I thought it was 'worth a punt' (Brit slang ;) )
https://www.aliexpress.com/item/1005001 ... 4c4dvn9HGf

It looks to have potential. It can be set to various modes, - such as 3 or 4 wire SPI, or parallel interface. There are a few libraries around but tend to be old - but that doesn't mean they aren't great. It was probably more to do with the fact that, a few years ago, the display was probably 4 times the price - or more.
I will let you know when it arrives and I have time to play.
Also, regarding the ILI9225 - SPI units. - I opted for another 'punt' on an ILI9341, (same chipset derivation (same libs))
https://www.aliexpress.com/item/4001135 ... 4c4dYf8SMn
There is confusion as to the viewing angles labelled, but hell, lets give it a try. ! :roll: ;)
I have also been looking into the speed of update of the display(s). This is mostly limited by the speed of the SPI bus transfer. The datasheet for most of the ILI type units tend to indicate 10MHZ. HOWEVER, it seems that, with a suitable uP then the SPI can be increased to 2, 3 or even 4 times the quoted speed. It takes an appropriate Arduino or similar, and also, a display that is suitable. But it seems the ILI units are quite supportive of SPI speed increase - especially as we are writing only in 99.9% of cases.
I considered an Arduino DUE to provide the horsepower, but it is a waste of a DUE really, so, I am going to give it a go with an ESP32 - as much as I am not keen on these - only due to lack of decent ADC inputs, they are 'effing quick ! - and relatively cheap. Probably the best bang per buck. Obviously message port only. But hey ////
Will let you know when they arrive. I am hoping the OLED turns out to be 'a keeper' (more Brit slang) ;)

Apologies for use of brit slang, but it's appropriate and you can give ATC some hell haha... (joking....) :mrgreen:

ps: - also ordered the larger version of the 1.3" oled (the 1.8") just for Sh!ts and Giggles. - well, we need to experiment eh ? :o
https://www.aliexpress.com/item/3297695 ... 4c4dtTIML3
Joe. CISSP, MSc.

JackZ
Posts: 2262
Joined: Mon Feb 22, 2016 1:02 pm

Re: WIP: A320 Triple brake indicator & Chrono

#19 Post by JackZ »

Good find! Looking forward to hearing from your experiments

Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ

Post Reply