[SOLVED] GLCD (SSD1306) not initialising unless flashed with MIOS Studio

Hi! So I have my first midibox up and running :slight_smile:

I have the SSD1306 GLCD working fine - but ONLY once I have flashed my program using MIOS Studio, or if I’ve flashed the bootloader app.

If I reset the board with my program flashed, the GLCD does nothing. As soon as program it again from MIOS Studio, it starts working, and then works fine from then on, until I power down the board.

I’m doing 

MIOS32\_LCD\_Init(0);

and then the usual MIOS32_LCD_Clear, MIOS32_LCD_PrintString etc… which all work fine once the display is actually initialised.

Am I missing something?

TIA!

Hi did you configure your bootloader?

< base_url >/topic/20906-oled-shows-noisy-output/?do=embed&embedComment=182012&embedDo=findComment

Best
Bruno

Yes. Went through that procedure using the bootloader app, i.e. set lcd_type etc.

I notice that if once I power the board up, I press the reset button, the LCD then initialises… 

Did you try to change the lcd type in your Makefile?

# $Id: Makefile 1820 2013-09-01 15:44:33Z tk $ ################################################################################ # following setup taken from environment variables ################################################################################ PROCESSOR = $(MIOS32\_PROCESSOR) FAMILY = $(MIOS32\_FAMILY) BOARD = $(MIOS32\_BOARD) #LCD = $(MIOS32\_LCD) # explicitely select the correct LCD driver # KS0108 is supported by the "universal" driver # please configure the bootloader info range accordingly # with the bootloader update application LCD = ssd1306

If not, try it, recompile and upload your app and tell me…

Sorry this module doesn’t exist, the ssd1306 is supported by the ‘universal’ one…
I’d got this issue by the past but I don’t remember how I solved it… :confused:

ah yes I already tried explicitly specifying the universal driver!

# $Id: Makefile 1820 2013-09-01 15:44:33Z tk $ ################################################################################ # following setup taken from environment variables ################################################################################ PROCESSOR = $(MIOS32\_PROCESSOR) FAMILY = $(MIOS32\_FAMILY) BOARD = $(MIOS32\_BOARD) LCD = universal

it’s odd - it works after i’ve re-flashed my program, just not after power-up.

I thought it might be some sort of delay needed before calling MIOS32_LCD_Init() — but I tried a several second delay in code and it made no difference.

22 hours ago, Antichambre said:

I’d got this issue by the past but I don’t remember how I solved it… :confused:

No worries, thanks anyway! i’ll keep trying things :slight_smile:

Which value did you put for the reset cap and resistor?
http://ucapps.de/mbhp/mbhp_lcd_ssd1306_single_mios32.pdf

Maybe the cap takes too much time to load
increase resistor, decrease the cap(or remove it)

10uF and 1k. I’ll give that a try! Maybe the display I have is a bit different spec to the one TK was using…

Many OLEDs depending on the cap/resistor reset line do actually need a power down/power up phase (try unplugging from USB, no MIOS studio needed for correct start). That is because a successful display init depends on the hardware reset mechanism via cap & resistor. For the new LoopA boards, Andy has invented a solution, how the reset switch will also perform a hardware display reset without the need of powering down/up :).

If this was not the problem, please ignore :).

Many greets,
Peter

Yes remove the Cap fist and try.
Could you share the spec and the origin of the one you’ve got? Could be interesting to know…

Just now, Hawkeye said:

Many OLEDs depending on the cap/resistor reset line do actually need a power down/power up phase (try unplugging from USB, no MIOS studio needed for correct start). That is because a successful display init depends on the hardware reset mechanism via cap & resistor. For the new LoopA boards, Andy has invented a solution, how the reset switch will also perform a hardware display reset without the need of powering down/up :).

Ohhh yes I remember this issue now it was for the SSD1322 not SSD1306, and it was the opposite(no init on upload). thx Peter
 

Thanks all for the replies!

I solved it in the end by hooking the RESET pin of the OLED to a GPIO pin of the STM32F4 (J10A pin 7 on the midibox board) and a pull-up resistor, and then pulling the pin low in code for 1s at boot, to ensure the OLED module is reset properly.

I couldn’t get any combination of capacitors and resistors to work. I noticed that I have quite a lot of noise on my 3V rail, caused by some WS2812 LEDs I have - even though they are running off a different 5V supply, I guess there is an issue with the common ground. Don’t know if this was related. Everything else runs fine…

For future reference, I am using these extremely common (and cheap!) 0.96" 128x64 OLED displays, from ebay, such as this: https://www.ebay.co.uk/i/302104546088?chn=ps&var=600918131598