OLED component code change

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

OLED component code change

Post by howard123 »

Hello
I am trying to find a way to modify the OLED component start sequence code in FC6 such that it becomes a 4*20 display using 0x32, 0x28, 0x0C, 0x06, 0x02, 0x01,, for example. For the life of me I cannot find a reference to this. Probably missing something fundamental.
Regards

Howard
FC6.0.9

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED component code change

Post by Benj »

Hello Howard,

I've created a new component with the init codes you specified.
LCDAdafruitOLED4x20.fcpx
(25.68 KiB) Downloaded 249 times
Let me know how you get on with it, if it's looking ok then I'll add the component to the build.

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: OLED component code change

Post by howard123 »

Thanks Ben
Will let you know if this works
regards
Howard

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: OLED component code change

Post by howard123 »

Hi Ben
This code does work however I thought I should let you know about some odd hardware behavior regarding my Newhaven NHD0420 OLED display which uses the WS0010 chip. This device only initializes from a power-down reset and resetting the processor MCLR pin causes unpredictable behavior. This seems to happen because of the OLED device waking in 8 bit mode and then being set to 4 bit mode, by the initialization segment. If then the OLED is not powered down, It remains in 4 bit mode and subsequently the same initialization segment is interpreted incorrectly, resulting in an erroneous display.
LCD displays do not have this behavior .
Regards
Howard

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: OLED component code change

Post by Benj »

Hi Howard,

That's interesting, I wonder if the easiest way around the issue would be to use say a PNP transistor controlled from the micro to supply the power to the LCD. This way you could force a power reset for the LCD even if the Micro only gets a MCLR reset.

It might be possible to create an alt startup macro which does all commands in 4-bit mode and called instead of the standard startup macro if the power on reset bit is set in the micros status register. If you fancy this option then let me know and I'll try and add it in to the component for you.

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: OLED component code change

Post by howard123 »

Hi Ben
Thanks for the offer but I have used a FET to power the OLED, this being enabled after a short delay after the processor starts. Seems to work so far.
regards
Howard

Post Reply