LCD#117

mas11

Member
I recently purchase a 4x20 serial LCD#117 from Modern Devices and am having trouble getting it to read data. The start up screen comes on OK but when it reads the data, all I get is a bunch of X' at random locations on the display. I think I am not writing the code properly. I contacted Mr. Anderson and he refered me to a web page with examples, but that didn't help much. Can anybody show me how to substitute the (254) code with Mr. Anderson's code in the example below. If I can see how the code is then I can understand how to impliment it elsewhere.

How do you make the separate box to put your code in?
Thanks,
MAS11

main:
serin C.1, T2400_4, ("data"), b0,b1,b3
pulsout B.1,100 'flash output led
'serout C.2,N2400,(254,1) 'Use this line if you want to refresh screen constatnly
serout C.2,N2400,(254,128)
serout C.2,N2400,("Humidity ",#b3,"%")
 

srnet

Senior Member
I have REV Eds product, the AXE133Y driving a 20x4 LCD, it works good. Easy to configure and well supported.

As for corrupt characters, are you really sure you have the baus rate set correctly, this is the normal cause of this error.
 

premelec

Senior Member
Perhaps your LCD117 is phanderson.com's LCD serial driver - have you looked at his site and examples? Also check wulfden.org - he sells a board to use the pha chip...
 

mas11

Member
The LCD117 is Mr. Anderson's version with his serial codes. I do have the REV EDs and they work fine. I wanted a blue screen and so I purchased the one from Modern Devices which include the codes from Mr. Anderson. I checked his website and can't seem to understand how to replace the (254) codes with his (?) codes, that's why I included a copy of my code so I could see how to substitute his code. I hope this helps clear up any confusion.

Thanks for the replys,

mas11
 

hippy

Ex-Staff (retired)
I checked his website and can't seem to understand how to replace the (254) codes with his (?) codes, that's why I included a copy of my code so I could see how to substitute his code.
While PICAXE users are likely to understand the codes for Rev-Ed LCD's they will generally be unaware of what codes are required to drive the LCD117 you have - hence the suggestion to provide a link to the website Mr Anderson pointed you to.

I would guess it is this one - http://www.phanderson.com/lcd106/lcd107.html

And if so I would suggest starting with ...

Code:
Symbol LCD_PIN = ?

High LCD_PIN
Pause 5000
SerOut LCD_PIN, T2400, ("?f")
Pause 100
SerOut LCD_PIN, T2400, ( "It works" )
End
 

Captain Haddock

Senior Member
I wanted a blue screen
I got a white text on blue background 20x4 with backlight off ebay for £7 ukp (inc. postage) from china, took a while to arrive but works fine with axe133 serial driver as well as parallel direct from picaxe in 4 bit mode, worth considering if you still have problems.
 

mas11

Member
Thank all of you for the replys and advice. I will try Hippy's code and also check out the other websites. Thanks again for all the suggestions and help.

mas11
 

srnet

Senior Member
I got a white text on blue background 20x4 with backlight off ebay for £7 ukp (inc. postage) from china, took a while to arrive but works fine with axe133 serial driver as well as parallel direct from picaxe in 4 bit mode, worth considering if you still have problems.
Snap!

They are OK indoors, but naff outdoors, for which you need the reflective display.

The AXE133 is highly recommended, its so easy to customise the code and change the way the display works, add your own commands etc ........
 

westaust55

Moderator
@mas11,
Then to hippy's code try appending at the bottom the following line:

SEROUT ldc_pin, T2400, ("?x0?y1this is second line")
SEROUT LCD_pin, T2400, ("?nthis is the next line down")
 
Last edited:

mas11

Member
Tried Hippy's code as well as westaust55 suggestions. Still get random X' on the display. No text appears except on start up. Tried different pin outs, still same results. I don't think its the display but it could be a programming problem with the pic chip. I give up. I'll stick with the axe134y. Much easier to use and program. Thanks for all your support.

mas11
 

westaust55

Moderator
Do you know exactly which PH Anderson controller chip is fitted to the Moden Devices LCD107 serial controller board?

The Wulfden site and datasheet mentions several chips and baud rates.

The Modern Devices website links to http://cdn.shopify.com/s/files/1/0038/9582/files/LCD117_Board_Command_Summary.pdf?1260768875
which states:
reference adopted from http://phanderson.com/lcd106/lcd107.html

The currently shipping chips seem to be LCD117 and LCD118. LCD 117 is a 9600 baud chip that is recommended for Arduino, Basic Stamp and most microcontrollers, which are capable of 9600 bps serial transmission.
Modern Devices website on the same page by pulldown list enables you to select:
MD0365 as 9600 baud kit - $14-00
also
MD0365 as 2400 baud kit - $14-00


From Peter Andersons website: http://phanderson.com/lcd106/lcd107.html

(June, '09). Separate versions of the LCD #117 are now offered for operation at 2400, 4800, 9600 and 19,200 baud.

You may need to change the baud rate to 9600 baud to work with the LCD serial display from Modern Devices.

For whichever PICAXE chip you are using see the SEROUT command in PICAXE manual 2 to determine what clokc frequency will give 9600 baud and then use the SETFREQ command to set that frequency and try again.
 

John West

Senior Member
I've used several of Dr. Anderson's LCD serial chips hand-wired on my own bds, and never had any problems with them. They are pretty easy to use. Between Peter's instructions and the Wolfden (sp?) info, I have no problems figuring things out. But you do have to make sure that everything is configured properly, and the necessary setup timing delays are incorporated for the LCD used.
 

mas11

Member
Thanks for the information. You are correct on the baud rate. I contacted Peter and sent him a video of what the display was doing. He told me that it was the 9600 baud rate. I will follow westaust55 and John West's advice and try the setfreq command and time delays and see if that will work. Will let you know the results. Thanks for being so persuant to help me and others on this forum.

Thanks,

mas11
 

JoeFromOzarks

Senior Member
John West is correct, Dr. Anderson’s circuit works well and is consistently reliable.

Which PICAXE are you using? Which pin of the PICAXE is connected to your LCD117?

What are you using for a 5V power supply for your circuit?

Do you have a stable and common GND (0V) connection between the LCD117, the LCD and the PICAXE?

What speed are you running the PICAXE? (setfreq)

Which LCD117 chip are you using, i.e. the speed? (2400, 4800, 9600 or 19,200 baud) When the display boots, what is displayed (default boot message) on the top line?

Did you properly initialize the LCD controller for the display you’re using? ("?G420" instructs the LCD117 you have a 20x4 LCD) You only have to do this once as the LCD117 remembers!

Are you allowing the LCD to properly initialize? (A “PAUSE 5000” or longer delay may be required in the beginning of your PICAXE program)



Sending text or commands to the LCD117 is very easy! On a 20X2 using c.0 (hserout)
#picaxe 20x2
setfreq m16
HSerSetup B2400_16, %000
HIGH b.0 ‘ send the LCD117 data pin high
PAUSE 7500 ‘ allow LCD to initialize / stabilize
HSerOut 0,("Test Text”)


Other interesting commands to send to the LCD117:
("?c0") ' no cursor on LCD
("?f") ' clear the LCD and home the cursor
("?y0?x00") ‘ position cursor at beginning of row 0
("?y3?x00") ' position cursor at beginning of row 3


:) joe
 
Last edited:

mas11

Member
Thanks Joe for the advice. My main problem is the clock speed. The display is a 9600 and I was running at 2400. I am using a 14m2 to test the display. It is a 20x4 display. I will try the suggestions I have received from the forum and let you know how it all works.

Thanks,

Mas11
 

mas11

Member
Still having problems. Can someone please give me a sample code for a 9600 baud display using a 14m2 chip? Pin, frequency,out, etc.

Thanks,

mas11
 

JoeFromOzarks

Senior Member
Tomorrow, I'll fetch up the goodies and see if I can help with some test code. I know I have the 14M2's, the same display and controller, 9600 too!! I'm sorry if you've already said, but which pin on the 14M2 are you using for the display?

You have a large electrolytic on the +5v power line, bypass caps, etc., correct?

I'm physically unable to do anything tonight. (Bad back!)

:) joe
 

mas11

Member
I give up. Tried everything I could and all the suggestions given in this forum. Had it working one time and then when I tried using a variable nothing but garbage. The OLED by Rev ed. is much eaiser to use. Don't need to use all the baud rate and setfreq junk. Just use the (254, *) and presto, everything works. I have over 20 hours in trying to make this display work. It shouldn't be this hard.

Thanks for the help.

mas11
 

mas11

Member
Thanks Joe. I am using the 14m2 on a breadboard by Peter Anderson. I am using pin C.1 as my serout. I had it working one time then I tried using variables and nothing but garbage again. I used the setfreq to m32 and hsersetup b9600_32. Well here is the code I used.
Symbol LCD_PIN = c.2
main:
High LCD_PIN
setfreq m32
HSerSetup B9600_32, %000
Pause 5000
SerOut LCD_PIN, B9600_32, ("?f")
Pause 100
SerOut LCD_PIN, B9600_32, ("Success!" )
goto main

If you read my last post you can see that I am fustrated and ready to give up.

Thanks,
mas11
 

westaust55

Moderator
@mas11,

your code is mixing hardware HSER related commands/parameters and Firmware based SEROUT parameters.
Partially I think because the example JoefromOzarc gave had a pin number instead of break parameter for the HSEROUT command.
HSerOut c.0, ("Test Text”)




Try this code using the firmware based SEROUT command:
Code:
#PICAXE 14M2
Symbol LCD_PIN =	c.2

Init: 
	HIGH    LCD_PIN
	SETFREQ m16
	PAUSE 4000	; wait approx 1 second for LCD to initialise

Main:
	INC b0 : INC b1
	SEROUT LCD_PIN, T9600_16, ("?f") ; clear screen and move to start of first line
	PAUSE 4000
	SEROUT LCD_PIN, T9600_16, ("Success if see this!" )
	PAUSE 4000
	SEROUT LCD_PIN, T9600_16, ("?x00?y1") ; move to start of second line 
	PAUSE 4000
	SEROUT LCD_PIN, T9600_16, ("b0= ",#b0," & b1= ", #b1) ; move to start of second line	
	PAUSE 20000	; at 16 Mhz this is only 5 seconds
	GOTO Main

Then if the above was successful, you could try using the hardware (HSER) module:
BUT, note that for the HSER hardware system there are fixed pins for the Hardware SerialOut pin is fixed as B.0.


Code:
#PICAXE 14M2

Init: 
	SETFREQ m16
	[COLOR="#0000CD"]HSERSETUP B9600_16, %000  [/COLOR]; LCD must be connected to PICAXE 14M2 pin B.0

	PAUSE 4000	; wait approx 1 second for LCD to initialise

Main:
	INC b0 : INC b1
	[COLOR="#0000CD"]H[/COLOR]SEROUT [COLOR="#0000CD"]0,[/COLOR] ("?f") ; clear screen and move to start of first line
	PAUSE 4000
	[COLOR="#0000CD"]H[/COLOR]SEROUT [COLOR="#0000CD"]0,[/COLOR] ("Success if see this!" )
	PAUSE 4000
	[COLOR="#0000CD"]H[/COLOR]SEROUT [COLOR="#0000CD"]0,[/COLOR] ("?x00?y1") ; move to start of second line 
	PAUSE 4000
	[COLOR="#0000CD"]H[/COLOR]SEROUT [COLOR="#0000CD"]0,[/COLOR] ("b0= ",#b0," & b1= ", #b1) ; move to start of second line	
	PAUSE 20000	; at 16 Mhz this is only 5 seconds
	GOTO Main
 
Last edited:

hippy

Ex-Staff (retired)
I had it working one time then I tried using variables and nothing but garbage again. I used the setfreq to m32 and hsersetup b9600_32 ...

If you read my last post you can see that I am fustrated and ready to give up.
Rather than push onwards and dig yourself further into the mire with the frustration that brings - take a step back to what does work. Then, with the help of the forum, you can get variables working.

If you can get the LCD showing "Hello" with something like ...

SerOut ... "Hello" )

You should be able to get it displaying "HelloXYZ" with something like ..

b1 = "X"
b2 = "Y"
b3 = "Z"
SerOut ... "Hello", b1, b2, b3 )
 

JoeFromOzarks

Senior Member
@mas11,

your code is mixing hardware HSER related commands/parameters and Firmware based SEROUT parameters.
Partially I think because the example JoefromOzarc gave had a pin number instead of break parameter for the HSEROUT command.
Yes, I made a bad error!! I'm sorry. I incorrectly changed (without thinking) HSerOut 0, ("Test Text”) to HSerOut c.0, ("Test Text”) and HSerOut c.0 is incorrect!!

Try this code using the firmware based SEROUT command:
I tested Westaust55's code with the same hardware you have and it works perfectly at 9600. You may want to verify your ("?G420") was sent properly:
Code:
SEROUT LCD_PIN, T9600_16,("?G420" )
If you're still having troubles, I'll buy your display!

:) joe
 
Last edited:

mas11

Member
Thank you guys very much for the help. I finally figured it out last night after many hours of reading the manual. I didn't know how to get baud rate and frequency to work right. Also hardware and software confusion like westaust55 said in his example. I couldn't figure out how to get to T9600. That's when I whet to the manual and started to read about setfreq and hsersetup. Found that in order to get to T9600_*, I had to go to a higher frequency. 8mhz or higher. I tried westaust55's code and it works perfectly. How do you put your code in the separate boxes on the forum? I would like to know so I can post it correctly when I need help. Sorry Joe, I'll keep the display..... Now I can spend more time with the wife...

Thanks again guys,

mas11
 

JoeFromOzarks

Senior Member
I’m really happy you got ‘er working!!

I’m gonna sit on my hands, in the back of the room, quiet as a mouse. :)

(I need to find the [boo-boo] [/boo-boo] code box, maybe it's next to the #!)

:) joe



Thank you guys very much for the help. I finally figured it out last night after many hours of reading the manual. I didn't know how to get baud rate and frequency to work right. Also hardware and software confusion like westaust55 said in his example. I couldn't figure out how to get to T9600. That's when I whet to the manual and started to read about setfreq and hsersetup. Found that in order to get to T9600_*, I had to go to a higher frequency. 8mhz or higher. I tried westaust55's code and it works perfectly. How do you put your code in the separate boxes on the forum? I would like to know so I can post it correctly when I need help. Sorry Joe, I'll keep the display..... Now I can spend more time with the wife...

Thanks again guys,

mas11
 

westaust55

Moderator
Putting the program listing in the code markers/tags has advantages including overcoming the situaiton where, when you copy and paste a program or any text with indents into the body of a post, the forum software (VBulletin) strips off the leading spaces. This does not occur when a code sub winow is uded.


To add the [code] and [/code] tags there are several ways:

If the code is available in the PE:
  1. Within the Program Editor select the code and then from the toolbar use Edit/Copy for Forum, or
  2. Within the Program Editor select the code and then right click and select "Copy for Forum"
If you have otherwise typed or cut and paste the program code into the forum post window, then:
  1. Just type the [code] and [/code] tags in
  2. Click on the "Go Advanced" at bottom left of the post window, then select all the program code, finally click on the hash (#) icon on the post window toolbar (top row right hand side)
 
Last edited:
Top