Sign in to follow this  
Followers 0
daveee

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

13 posts in this topic

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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...

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
22 hours ago, Antichambre said:

I'd got this issue by the past but I don't remember how I solved it... :/

No worries, thanks anyway! i'll keep trying things :)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
 

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0