Does a model for a 20x4 OLED or LCD exist?

profbill

New Member
Can anybody help with a VSM model (if one exists) of a 20x4 display that might work in the VSM simulator!!
I have tried to get the Milford 4x20-BKP model working but have failed!
I can simulate and visualise a 4x20 panel in the PICAXE Prog. Editor but not the Milford 4x20 as most of the commands are not recognised

At this point in time I just need a demonstration of a 20x4 Display working in the VSM simulator.
I have a 20x4 OLED and AXE132 Driver Kit working in the built system which is part of a Test Panel in my Flight Simulator Articulated Platform (Retirement Project).
The complete test panel is simulated in VSM except for the display which is what interests people!

Any help or pointing in the right direction would be much appreciated!

Bill.
 
Last edited:

tiscando

Senior Member
In the pick devices window, go to Optoelectronics category. If you want a parallel LCD, go to the Alphanumeric LCDs sub-category. Serial LCDs are in the serial LCDs category. Then pick the 20x4 display.

See the LCD section of Picaxe manual 3 for help on interfacing with the serial (option 2 - more info in option 1) or parallel LCD (option 3).

T
 

profbill

New Member
In the pick devices window, go to Optoelectronics category. If you want a parallel LCD, go to the Alphanumeric LCDs sub-category. Serial LCDs are in the serial LCDs category. Then pick the 20x4 display.

See the LCD section of Picaxe manual 3 for help on interfacing with the serial (option 2 - more info in option 1) or parallel LCD (option 3).

T
Many thanks for your reply!
I am using a serial Milford 4x20 LCD BPK+ part no. 6-143 also identified as the BPP-420 and the WINSTAR WH2004l 20x4. Chosen for its large character flexibility.
I have now decided to abandon it as it's commands do no seem to be supported by PICAXE Prog. EDITOR or VSM but was I able to write a basic program that works well!
I have now decided to install and use an AXE I32 4x20 OLED (serial) as its replacement which is an excellent device and works well in the test panel! The code was written using Prog. EDITOR.
I have something like 23 LCDs 2x20 and 7 LCDs/OLEDs 4x20 driven by various types of PICAXEs working well in this project hence interfacing is not a problem!

In VSM the "two line" serial LCDs work well but the "Four line" serial does not!
You have to be carefull about using T2400 and N2400 with some parts.
If anybody has any success in getting a 4x20 line serial LCD in the optoelectronics library working in VSM generating "hello" on lines 1,2,3 and 4 I would indeed be very intrested as I could possibly conclude that I have either a bad model or some self inflicted problem in my VSM!
Thanks for your help and patience,
Bill.
 

profbill

New Member
On 20x4 LCDs, the third and fourth lines are continuations of the first and second. Do they work if you address those lines with 148 and 212?
Thanks Nick!

The following simple test program works for a 4x20 display in Prog. EDIT based on a PICAXE28X.
but will not work in VSM as is, or modified!
To make it run quicker one could REM out all the servo commands!
Does it work for you or anybody else if it is not too much trouble to try first in Prog. EDIT to convince oneself and then in VSM
Thanks,
Bill.


main:
serout 7,N2400,(254,1) 'clear screen
pause 30 'mandatory pause
serout 7,N2400,(254,128) 'OLED first line set
serout 7,N2400,("Platform Test 1")
serout 7,N2400,(254,192) 'OLED second line set
serout 7,N2400,("Pitch = Cycling")
serout 7,N2400,(254,148) 'OLED third line set
serout 7,N2400,("Roll = Stationary")
serout 7,N2400,(254,212) 'OLED fourth line set
serout 7,N2400,("60-140-220-140-60 ")
servo 2,60
pause 500
servo 2,140
pause 500
servo 2,220
pause 500
servo 2,140
pause 500
goto main
 

nick12ab

Senior Member
It works fine in Programming Editor. I don't yet own a real 20x4 LCD to test though.



When posting code, please use [code][/code] tags in order to retain white spacing:
Code:
main:
    serout 7,N2400,(254,1) 'clear screen
    pause 30 'mandatory pause
    serout 7,N2400,(254,128) 'OLED first line set
    serout 7,N2400,("Platform Test 1")
    serout 7,N2400,(254,192) 'OLED second line set
    serout 7,N2400,("Pitch = Cycling")
    serout 7,N2400,(254,148) 'OLED third line set
    serout 7,N2400,("Roll = Stationary")
    serout 7,N2400,(254,212) 'OLED fourth line set
    serout 7,N2400,("60-140-220-140-60 ")
    servo 2,60
    pause 500
    servo 2,140
    pause 500
    servo 2,220
    pause 500
    servo 2,140
    pause 500
    goto main
It's also good practice to use the #picaxe directive at the beginning of programs e.g.
Code:
#picaxe 28x
 

profbill

New Member
Nick,
Thank you very much for confirming this - you see exactly what I see!
Is there any possibility that you or anybody could try the code in VSM using a 28X model driving out from pin 7 any 4x20 LCD (serial) in the VSM library as that is where I encounter the failure getting a series of random "Xs" actively moving on all four lines in the simulation!
Thank you for your tip on code!
Bill.
 

Technical

Technical Support
Staff member
Nick,
...that is where I encounter the failure getting a series of random "Xs" actively moving on all four lines in the simulation!
We get random Xs displayed when the baud of the 20x4 model is at the 9600 setting, but works as we would expect with PICAXE T2400 commands at baud setting 2400. Try changing the Milford model's baud rate?

Right click over the 20x4 model - Edit properties - change baud to 2400

Code:
    serout 6,t2400,(254,128,"Test")
    serout 6,t2400,(254,192,"Hello")
    serout 6,t2400,(254,148,"Professor")
    serout 6,t2400,(254,212,"Bill")
 

Attachments

Last edited:

Technical

Technical Support
Staff member
One useful tip to swap between the t2400 (simulation) and n2400 (real life) in your program is to use this:

Code:
; symbol baud = n2400 ; use for real chip
symbol baud = t2400 ; use for simulation

    serout 6,baud,(254,128,"Test")
    serout 6,baud,(254,192,"Hello")
    serout 6,baud,(254,148,"Professor")
    serout 6,baud,(254,212,"Bill")
 

profbill

New Member
Many thanks indeed for the above information!
Everything works just fine!

I am getting careless as I should have checked the "baud rate" in the model and changed it!
I had realised the implications of using T2400 and N2400 but neglected editing the model.

Many thanks also to all those who tried to help!

Bill.
 
Top