LCD Display basics

Anonym

Member
Hi everyone!

First of all, this is my first thread here, so pretty please excuse my inexperience. Also, feel free to correct me if something is wrong. Thanks a bunch!


So, I have soldered an LCD display to my 20M2 PICAXE using the diagram found at the bottom of page 36, manual 3 (direct connection). This means pin 2 on the diagram is connected to my B.2, pin 3 to B.3 and so on. Now I would like to test if the circuit works, but the code fo operating a display seems really complicated. I tried looking up forum posts about it, but every one of those seems to be using different things, so it's hard to get a picture of what is going on. Is there any chance one of you could post a really basic program for the direct connected LCD, say one that simply prints out "Hello"? I am hoping I would be able to understand how it works thanks to it. Or help me get to that point at least...

Thank you.
 

lbenson

Senior Member
Welcome to the forum.

The code is irreducibly complex, because with only 4 lines to transmits 8 bits of data or control information, bytes must be sent in "nybble" format--4 bits at a time. To my mind, the best source is hippy's code for the 14M, post 4, here:
Should work for you with the pins appropriately designated.

If that doesn't solve it for you, ask again.
 

Anonym

Member
Thank you, I'll try it out! Though you said "only 4 lines to transmit 8 bits of data" - is that implying that there is a way to connect all the 8 lines? I do not need to limit myself to the 20M2, I can change my circuit as well... I only need my serial lines for something else, so I can't use them for the display. Thanks again!
 

inglewoodpete

Senior Member
A few years ago, I shared your frustration with connecting a PICAXE to an alphanumeric LCD. I developed a solution and posted a thread on a simple interface that, apart from a few definitions for pins, provided a reliable method of getting an LCD to work quickly with all but the smallest PICAXE. Have a look at this code.
 

Anonym

Member
So, I have been exploring both programs recommended to me, and it seems they are indeed quite hard to understand. This lead me to a thought: Is possible to program any of the C pins as a serial output? As I stated above, I need my default serial output for something else. If I could use another pin as a serioul output, that'd make things so much easier!
 

marks

Senior Member
Hi Anonym,
I don't have a 20m2 at the moment
but I did write this bit of code for a lcd shield to try with one some time ago.
 

inglewoodpete

Senior Member
So, I have been exploring both programs recommended to me, and it seems they are indeed quite hard to understand.
The beauty of the code that I posted in the link in my post #4, above, is that you don't have to fully understand the code: just allocate 6 pins with Symbol statements according to your wiring between the PICAXE and LCD.
This lead me to a thought: Is possible to program any of the C pins as a serial output? As I stated above, I need my default serial output for something else. If I could use another pin as a serioul output, that'd make things so much easier!
It depends on what you mean by "Serial Output".

If you want to reallocate the SerialOut pin (specifically used for programming the PICAXE, SerTxd or Debug commands), then the answer is NO.

If you want to set a pin on Port C up to output serial data for your application, then YES, easy: have a look at the SerOut command.
 

hippy

Technical Support
Staff member
Attached is my latest generic code for interfacing an LCD in 4-bit mode, which can have pins allocated however one wants, non-sequentially and even across ports.

Written for the 18M2, and should run on the AXE133 unchanged, and should work with any PICAXE with the pin definitions adjusted as appropriate.
 

Attachments

Top