14 segment LCD emulation on a 128x32 SSD1306 based OLED display - Page 1
Forum section: electronics / projects

author: djsb
author_rank: Super Contributor
timestamp: July 31, 2022, 05:52:07 pm
content: I'm going to have a go at trying to emulate 5 digit 14 segment alphanumeric display on a SSD1306 based OLED display. The closest example I have found so far is for a 4 digit 7 segment display herehttps://github.com/fizban99/microbit_ssd1306_7segI'm trying to recreate the Display for a Revox B261 FM tuner (see attached schematic) using this displayhttps://www.waveshare.com/wiki/Pico-OLED-2.23I want to use a PI PICO W if possible, but i'll start with a BBC Microbit to try out the above code.Does anyone know of anyone who has done anything similar? Thanks.PS Is there any software I can use to create the image for the display or a youtube video that covers this? Thanks.

author: DavidAlfa
author_rank: Super Contributor
timestamp: July 31, 2022, 07:19:55 pm
content: Pretty easy using u8g2.So a 14 segment display has 7 unique parts:You can make these 7 pictures in paint (enable the grid, set max zoom), then use a XBM converter (ex.this one).If you open a XBM in a text Editor, is a byte array.The you only need to use u8g2_drawXBM().So, each number will be drawn by loading several images.Pretty easy!

author: voltsandjolts
author_rank: Unknown
timestamp: July 31, 2022, 07:33:26 pm
content: https://www.eevblog.com/forum/testgear/hp3548-hp3457-oled-display/https://github.com/xyphro/HP3457-OLED-display

author: tooki
author_rank: Super Contributor
timestamp: August 03, 2022, 06:47:17 pm
content: Just use a graphics library that supports custom fonts and define your font bitmaps.If you use an Arduino-compatible board or MCU, there’s the popular Adafruit graphics library, and there’s an online font editor for it (by a third party).

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 04, 2022, 07:02:36 pm
content: Also you can make your own fonts for u8g2 using the tool "Phony", export as BDF and then use bdfconv to make u8g2 fonts.All included in u8g2 sources, "tools" folder.Here's a guy sharing his fonts:https://forum.dcs.world/topic/226054-skys-fa-18c-simpit/#comment-4180036Video:

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 04, 2022, 08:04:06 pm
content: Well, I tested them, nah, they're pretty bad, non-fixed width...How many digits do you wan to show at once?

author: djsb
author_rank: Super Contributor
timestamp: August 04, 2022, 08:19:00 pm
content: Here's a jpg of the display.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 04, 2022, 08:56:45 pm
content: Edit: Nevermind, it uses a PCE2111 (Datasheet). Much easier now.The driver controls 64 segments, the serial protocol is really easy, but you must find the segment mapping.I'd start by sending data to the driver, enabling only one segment at a time, noting down the segment.Related, the pm3295 also uses the PCE2111:https://www.eevblog.com/forum/testgear/philips-pm3295-and-pm3295a/msg1076760/https://www.eevblog.com/forum/projects/pm3295a-oled-upgrade/What's the problem with the display? Is it dim?You have a potentiometer to adjust the contrast, check R7 at the right bottom corner.

author: MikeK
author_rank: Super Contributor
timestamp: August 04, 2022, 09:21:13 pm
content: You're going to want at least a 128x64. The 128x32, in my opinion, doesn't have enough height to make the digits comfortably readable. See the display I added to my Fluke 8050A here:https://www.eevblog.com/forum/repair/fluke-8050a-amps-jack/msg4253929/#msg4253929It's a 132x64. It's either 132 or 130, I forget, but I think it's 132. It's also driven by the SH1106, which is similar to the SSD1306 but not exactly the same. I think the 132x64 is decent, but I wouldn't go any smaller. The digits I used are 16x32, which fills the entire height of a 128x32 display and leaves no height for anything else. On a x64 display the digits only take up half the height. Too bad they don't make these I2C display is something like 200x64.

author: Andy Watson
author_rank: Super Contributor
timestamp: August 04, 2022, 09:34:04 pm
content: Quote from: DavidAlfa on August 04, 2022, 08:56:45 pmThe segment mapping is actually on the diagram. The lines between the PC2111 and the display are labelled with the segments they control.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 05, 2022, 03:20:12 am
content: True, didn't zoom so much into the LCD.- Data seems to be sampled in falling clock edge.- Wait for DLEN high, read 35 clocks- Check 1st bit is 0, ignore otherwise.- Check which bank is being accessed in bit 35.- Store and parse bits 2-34.- Update display.From datasheet, clock could reach 100KHz, a bit fast to be sampled by software but should be doable, run that code from ram to avoid cache delays.

author: djsb
author_rank: Super Contributor
timestamp: August 05, 2022, 02:42:15 pm
content: The present LCD has faulty contacts and several of the segments don't work. I've tried putting pressure on the contacts and glass. This works for a while, and then the segments go off again. So, I've bought a spare LCD board. And then I thought, why not try a longer term solution (the OLED display idea) and use this as a learning experience. If I just end up making a test fixture, that will be an achievement.I'm mainly trying to figure out the serial protocol at the moment so that I can make a test module that can exercise the digits on the original display. I've had a very kind contribution of some starter code from Ttelmah on the CCS info forumhttps://www.ccsinfo.com/forum/viewtopic.php?t=59831Code:// Chip definition and fuses added in actual compiled project.This is a snippet from the CCS forum reply.// And a few additional mistakes caught by the compiler etc have been corrected in the actual code.#define DLEN PIN_xx#define DATA PIN_yy#define CLB PIN_zz //set to suit youint32 low32 = 0x1111;int32 high32 = 0x5555; //some suitable test valuesvoid init(voios){//call at start to ensure lines are lowoutput_low(DLEN);output_low(CLB);}#inlinevoid clock(){//generate one bit clockdelay_us(8);output_high(CLB);delay_us(2);output_low(CLB);delay_us(8);}void send(int32 value, int1 lowhigh){int ctr;int32 mask=1; //data is output LSb firstoutput_high(DLEN);delay_us(8);//output 32bit value to either low or high registeroutput_low(DATA);clock(); //first send a 0for (ctr=0;ctr<32;ctr++){if (value & mask)output_high(DATA);elseoutput_low(DATA);clock();mask*=2; //Modern compiler should optimise this to shift}if (lowhigh)output_high(DATA);elseoutput_low(DATA);clock(); //clock out the bit to specify high/low registeroutput_low(DLEN);clock(); //now clock this into the latches.delay_us(8); //do not do anything else for 8uSec}void main(void){init(); //ensure bus is initialiseddelay_us(100)'send(low32, 0); //load the low 32bitssend(high32, 1); //load the high 32bits.}I need to figure out how to add a character array for the specific digits I need to "light" up.Below is a screenshot of the Saleae Logic 2 logic analyser (First gen Logic16 model) session. I've used the master clear pin A5 to trigger the capture of the D5 (GREEN) CLB clock (used pin RB2 on a PIC16F1847) the D6 (BLUE) DATA (on RB1) and then D7 (VIOLET) DLEN (on RB0)I can post further screenshots of close up sections of the waveform if required, just ask. I haven't tried this on the spare display I've got yet.I'll do that later. Just trying to understand the serial protocol first and then get the digits on the original screen counting up and down and /or lighting up in individual segments etc. Thanks everyone for your comments and help so far.

author: DavidAlfa
author_rank: Super Contributor
timestamp: August 05, 2022, 05:56:48 pm
content: Your capture seems noisy, the clock signal is affecting others, ensure the wires are short and you're using a decent ground.As previously said, you already have the segment mapping.Digits are called 1,2,3,4.... And each segment a,b,c,d,e...Driver segment are called S1...S32, BP1 and BP2 multiplex the commons to get the 64 segments.1a, 2f, 3c, means the display digit and segment, mute, store etc are obvious.There're two names per segment, I guess the first one is for BP1 (Bank 1) and the second one for BP2 (Bank 2).ANT seems to use it's own COM pin and it's externally selected.Is that Arduino?