WIP: A320 Triple brake indicator & Chrono
Posted: Sat Apr 17, 2021 9:15 am
Interfaced with FFA320 on XPlane
Now onto 3D printing the servos support and Bezel, and figure the integrated lighting.
Jacques
jph wrote: ↑Sun Apr 25, 2021 8:15 am Yes, certainly the OLED units are excellent for certain uses.
I like what you have done there with the back to back 0.91 units.
If you need more compact units - which I prefer, then there are the I2C 4 pin units available for next to nothing.
Here's one example from my 'bit box'
The PCB isn't much bigger than the display - the actual oled display is certainly identical in size to your unit. However, the PCB is far far smaller. It gives a lot more flexibility in height gap if needed.
Also, the 4 pins for the I2C part of the PCB can be physically cut off so it is level with the display if needed. There are only 4 simple tracks running to the connector so you can chop off the end of the board and simply wire to the tracks that are left (if you want to ), and the units can then be back to back, and take no real spacing in height ! .. They are the same 0.91 OLED blue 128x32 - but I2C not SPI - Choosing which is 'swings and roundabouts' really.
The ones I have - are - https://www.aliexpress.com/item/4001365 ... 4c4dsI7pXQ
Here's one on my bench - oled display 12c.jpg
Really neat and extremely cheap.
As you will have found out, the SPI version needs more pins but has a chip select pin in most cases so the actual address of the unit is irrelevant. When used in I2C mode, the 1306 only has 2 possible I2C slave addresses. Either 0x3C or 0X3D - If it is even adjustable on the PCB. But that is also a physical 1306 limitation.
I really like the I2C version Jacques - due to the size...
To run multiple displays is really easy even though the 1306 address range is limited to 2 choices (IN HARDWARE !!!) . All you need is a 4 way or 8 way I2C Multiplexor unit. (about 50c!) you ONLY need the 2 I2C pins and you can address the MUX to tell which output from 0 to 7 is needed (8 units) by a simply command. You can also add multiple muxs for as many displays as you want all with the same I2C hardware pins on the single arduino. Great fun. . Each TCA9548A multiplexer board is multi address capable via 3 pins so you can cascade them if you so desire.
An example of a really nice MUX (and virtually the same as the ADAfruit one) - is -
https://www.aliexpress.com/item/3290475 ... y2ES6&mp=1
Out of interest, I would recommend that you possibly try the Adafruit 1306 libraries. they are really great. It is probably a personal thing but I was never overly happy with the UG8 library I find it messy, but maybe that is just me
I always found the Adafruit libraries great. Adafruit_SSD1306, which handles the low-level communication with the hardware, and Adafruit_GFX. Really easy to use and so many options. Worth looking at.
You can use the I2C 4 pin module (as in my pic) without a reset pin defined. When you add the mux for multiple displays (up to 8) you can add a single reset if needed, and you only need to send the data to a single I2C address. Addressing the MUX is a piece of piss with no library required.
It is really great having a choice of all these units so you can fit them to the space that you require.
Joe
JackZ wrote: ↑Mon Apr 26, 2021 11:28 am Thank Joe for the input.
I actually chose to go with SPI interface instead of I2C because there was no way to get multiple OLEDs screens working at the same time (my chrono uses 4) with I2C, as for these screens the I2C hardware address is hardwired on the PCB and it can’t be changed. Some models allow to use an alternate hardwired address by soldering a couple of pins on the board, but this raises the total number to 2 screens instead of 4.
So you end up with 4 identical i2C OLEDs screens with the same I2C address and of course you can’t access them individually.
I’ll consider you multiplexer solution though, but I feel it adds up another layer of complexity to my build.
Granted SPI takes mores input wires (5+2)) than I2C (3+2), but at least with those SPI models, there was a CS (chip select) pin that allowed me to address each screen individually. And SPI was faster than I2C, so having 4 OLEDs screens on a Mega (hence 24 wires plus 2 power wires) was not an issue at all.
And I think that I can share some wires between the screens, provided I keep the CS and Reset pins separate for each screen, that would drop down the total number of wires needed down to 13 total for 4 screens (untested though).
The only thing is that these screens need 3.3V to operate properly.
As for the SD 1306 library, I started initially the project with the Adafruit library which was running fine, until I hit a wall when I decided to use a custom font for the display instead of the roughly 3 families font declination that was available. The method to get a custom font to use with Adafruit was overly complicated, and involved compiling from source your own conversion tool using a GNU C using a stripped down version of Linux! Thank you but no thank you.
I then turned to the ug8 lib that allowed me to create my own set of font from a TTF font modified with Fontforge, then converted with the tools provided. Not a straightforward task either but way easier than installing a lot of stuff on my W10 machine just for the sake of creating a font in Adafruit.
Jacques
Hello Jacques,jph wrote: ↑Mon Apr 26, 2021 12:14 pm Hello Jacques.
Absolutely agree.
It is all a matter of what works for you, and, it is really good to have choices.
You may be better considering an Arduino DUE if you use a LOT of screens as it is native 3.3v and HUGE SRAM, however, that can become moot as most of the units - including the one I posted have the 5V to 3.3V converter on board.
As for SRAM- on I2C - as each 1306 128x32 device will use 512 bytes of SRAM !. ((128x32) / 8).
On a DUE, no issue, but on a mega.... Hmmmm... possibly limited to 5 or 6 devices on a MUX. again, swings and roundabouts due to the small amount of SRAM on the MEGA.
The biggest benefit for me is the physical size. The coding is another issue . Using the MUX is pretty simple BUT, again, SRAM limits can be an issue (on the MEGA)
I havent played with custom fonts on the 1306 adafruit library for a few years but I believe it was ok ? . I did a turbo boost gauge with custom fonts and a gauge arc needle pointer on a 128x64 1.3" unit. It was not too bad, but, it is a few years ago...
It is still in my Land Rover Freelander.
If the size fits, then I would certainly use whatever is available, The units you have, I would definitely use if space wasn't an issue. (well, I must confess it also depends on price haha ) .. but, all the units are terrific value so that is also a moot point really.
I am really impressed with the project you are doing. Is the front panel an original ? or a sim specific bought one ?. It is damn good quality !.
Cheers,
Joe
Hope you don't mind me offering my POV Jacques ?