Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 17:23 19 May 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICAXE Display on Micromite

Author Message
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 232
Posted: 01:30pm 03 Feb 2016
Copy link to clipboard 
Print this post

Having had great success with PICAXE projects over several years I have now started with MMBasic and the various associated PICS. Micromite is simply splendid and I have had no trouble patching in ILI9341 LCD displays etc., together with the touch features - really super. I have, however, a number of PICAXE displays (AXE133Y Serial OLED) devices and I appear to be having some difficulty in getting my "serial syntax" right. Could someone advise me please?

I have connected the OLED power supply onto my Micromite board and the unit displays the start-up banner. I have the OLED serial data lead connected to pin 21 on the PIC32MX170. My understanding is the that the AXE133Y needs 2400 baud, inverted and with two stop bits. Therefore I am opening the serial port with;
OPEN "COM1:2400, INV, S2" as #1
pause 100

I have then tried;
Print #1,chr$(254);chr$(1)
pause 100
Print #1,chr$(254); chr$(128);"hello"

This being my interpretation of the PICAXE Basic;
serout B.7,N2400,(254,1) ; clear display
serout B.7,N2400,(254,128) ; move to start of first line
serout B.7,N2400,("hello") ; output text

Sometimes, on running the code 'ello' appears somewhere on the screen, but not where it should be and the 'h' is missing...but not always.

Can anyone give me some direction please to help me solve this dilemma?

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9083
Posted: 04:19pm 03 Feb 2016
Copy link to clipboard 
Print this post


serout B.7,N2400,(254,1) ; clear display
serout B.7,N2400,(254,128) ; move to start of first line
serout B.7,N2400,("hello") ; output text


Most of what you wrote looks OK to me, so I would just try putting the last line as a seperate print statement, just like the PICAXE code:


Print #1,chr$(254) + chr$(128)
Print #1,"Hello"


Can you link to the PDF for the PICAXE LCD module?
I don't have one of those, and it would probably give insights to how to code for it.

I would THINK that the commands would be on a seperate line(based on the example PICAXE code), but I might well be wrong - that is where the PDF would come in handy.


Smoke makes things work. When the smoke gets out, it stops!
 
CircuitGizmos

Guru

Joined: 08/09/2011
Location: United States
Posts: 1421
Posted: 04:55pm 03 Feb 2016
Copy link to clipboard 
Print this post

  Grogster said  

serout B.7,N2400,(254,1) ; clear display
serout B.7,N2400,(254,128) ; move to start of first line
serout B.7,N2400,("hello") ; output text


Most of what you wrote looks OK to me, so I would just try putting the last line as a seperate print statement, just like the PICAXE code:


Print #1,chr$(254) + chr$(128)
Print #1,"Hello"




Perhaps with a small delay between those lines. Could be that the positioning/movement command's execution takes a while and the h is showing up before things are settled.


Micromites and Maximites! - Beginning Maximite
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 225
Posted: 04:56pm 03 Feb 2016
Copy link to clipboard 
Print this post

Hi Circuit

Just tried Grogster's code on a picaxe 134Y 4 line OLED display'
I could write to all lines OK

You have to suppress the LF and CR that is generated by the print command
as these upset the 18m2.

[code]
OPEN "COM1:2400, INV, S2" as #1
pause 30
Print #1,chr$(254) + chr$(1);
pause 30
Print #1,chr$(254) + chr$(128); ' or 192 for line 2
Print #1,"Hello world ";
[/code]


BillEdited by Bill.b 2016-02-05
In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
Jarubell
Newbie

Joined: 15/12/2009
Location: Canada
Posts: 4
Posted: 01:37pm 17 Feb 2016
Copy link to clipboard 
Print this post

A small delay is required after a clear command as per the manual
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024