Jump to content

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


daveee
 Share

Recommended Posts

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

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!

Edited by daveee
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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
 

Link to comment
Share on other sites

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

 

 

Edited by daveee
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...