20x4 LCD with axe033

rjandsam

Member
I have a 20x4 lcd connected through an axe033 and i can get information onto the display but after 12 characters are displayed on the first line it starts to duplicate characters 13 to 20 at the start of the next line for example

pause 500

serout 4,n2400, (254,1)
pause 30
serout 4,n2400, (254,128,"abcdefghijklmnopqrst")

shows up on the 20x4 as:

abcdefghijklmnopqrst
mnopqrst


i am very new at all of this but i am enjoying learning how all of this works and would appreciate some advice. THANKS
 

Chavaquiah

Senior Member
Perhaps you're running against a buffer limit. Did you try to send the text as two separate (and smaller) strings, with a small pause between them?

Code:
serout 4,n2400, (254,1)
pause 30
serout 4,n2400, (254,128,"abcdefghij")
pause 30
serout 4,n2400, (254,128,"klmnopqrst")
 

rjandsam

Member
Hi no joy im afraid it just wrote klmnopqrst to line one on the display it is strange that it copies the last eight characters of line one to the begining of line two, if i start line two at 192 it starts in the middle of line two.

Thanks for the reply though.
 

Chavaquiah

Senior Member
Sorry, with the copy&paste'ing I forgot the control codes. The "254, 128," should have been removed from the last serout.
 

eclectic

Moderator
I've just tried your code,
using a 4 x 20 LCD c/w the serial firmware chip FRM010.

I then tried using the simulator.

In both cases, all the characters were on the top line.

How have you got your 033 / LCD wired?

e
 

Attachments

Chavaquiah

Senior Member
is there a command to tell the axe033 that it is a 20x4 display?
I don't think there is one (meaning I don't know) but one is not needed anyway. The only difference is that the command to move the cursor is slightly altered: ($FE +) 128 and 192 should work as expected but, for lines 3 and 4, the values should be 160 and 224.
 

rjandsam

Member
I have just connected a different 20x4 display and it works fine but it is to large for the project i am working on. the display i am having problems with is a http://www.lcd-module.de/eng/pdf/doma/dip204-4e.pdf

i really dont know what could be wrong i have four of the above displays and they all do the same.

the pinout for these displays is exactly the same as my other 20x4 display yet it has this strange problem.
 

hippy

Technical Support
Staff member
There's no reason I know of why a character written to one position of the display should appear in another. I can only guess there is some fault with the AXE033 or LCD, perhaps a lose connection giving multiple character writes.

How does the AXE033 behave with the supplied 16x2 display fitted ?
 

hippy

Technical Support
Staff member
Looking at that datasheet I'm not sure if the display is compatible with the AXE033. I don't really understand the comment on contrast adjustment but the circuit is not as normally used for HD44780 ( which also uses 0V ). The "Tabel of command" [sic] refers to IE=High and also references RE in the list. This is also different to HD44780 so control commands from the AXE033 controller to the display may be interpreted differently.
 

Chavaquiah

Senior Member
No, indeed. The KS0073 is described as being "near 100% compatible to HD 44780." Guess "near" is not near enough.

From the datasheet it becomes clear that to display more than 12 chars per line an extension driver must be used. Turns out the column addresses controlled by the extension driver are the same as for the 8 left most chars on the line. This explains beautifully what is happening... but does nothing to help solve the problem. :(

Sorry, rjandsam, as it seems you can't use the AXE033.

On the other hand most Picaxes (with enough outputs and programming space) will be able to drive the KS0073 directly. I'm almost sure I've seen in this forum examples of such programming. Probably for a different driver but you could probably adapt a few things...
 

hippy

Technical Support
Staff member
The Post #8 datasheet indicates an SPI mode is available. If it is, this could be used instead of SEROUT / AXE033 to drive the LCD directly.
 

rjandsam

Member
i have had no experiance with spi do you have any pointers and how would this link to the picaxe in this mode?

Thanks for all the advice and help everybody.:)
 

papaof2

Senior Member
I have just connected a different 20x4 display and it works fine but it is to large for the project i am working on. the display i am having problems with is a http://www.lcd-module.de/eng/pdf/doma/dip204-4e.pdf
Between that datasheet (note about the 4/8 jumper being changed to switch to serial mode) and the datasheet that is linked to
http://www.lcd-module.de/eng/pdf/zubehoer/ks0073.pdf the following leads are used for SPI:

RS/CS - low for chip select

RW/SID - serial data in

E/SCLK - serial clock in

DB0/SOD - serial data out

DB1-DB7 should not be connected

There's a lot of detail in the ks0073 datasheet - 80 pages worth...

I've not (yet) used an SPI interface, so I won't suggest code or circuitry.

John
 

westaust55

Moderator
The LCD that rjandsam is using is not really compatible with the HD 44780 chip.
Just look at the initialization phase.
The KS0073 chip requires some added commands for the extension chip to complete the initialization.


Once properly initialised then the addressing will likely be right.


The datasheet referenced in post 8 states the Addressing as:
1st. line $00..$13
2nd. line $20..$33
3rd. line $40..$53
4th. line $60..$73


If intending to try the SPI method note the comment in the datasheet:
Alternatively module can be programmes with serial data stream.
For that solder link 4/8 has to be opened and closed to SPI side.
 

Attachments

rjandsam

Member
Thanks for everybody’s help I have just connected the display to an old Milford instruments serial convertor and sent it the following code for initialization from the manual and its working great, it was worth the three hours less sleep and also means that I have found you guys. one again thanks.

http://i809.photobucket.com/albums/zz18/normsk/IMGP1158.jpg



setfreq em16
serout 4,n2400_16,(254,$34)
pause 1
serout 4,n2400_16,(254,$09)
pause 1
serout 4,n2400_16,(254,$30)
pause 1
serout 4,n2400_16,(254,$0f)
pause 1
serout 4,n2400_16,(254,$01)
pause 1
serout 4,n2400_16,(254,128,"abcdefghijklmnopqrst")
Pause 1
serout 4,n2400_16,(254,160,"1x2x3x4x5x6x7x8x9x0x")
pause 1
serout 4,n2400_16,(254,192,"zyxwvutsrqponmlkjihg")
pause 1
serout 4,n2400_16,(254,224,"00000000000000000000")
 

hippy

Technical Support
Staff member
That's quite a neat trick of letting the interface initialise the display then explicitly initialise again so it's correct. That technique should also work with the AXE033.
 

rjandsam

Member
In order to get this display to work with the AXE033 you need to put it into 4-bit mode and then the following initialisation will work. i was really annoyed that the same code did not work with the AXE033 so i just had to play and get it to. i hope that this will help somone in the future.

i have also tried the same code with the sparkfun backpack that arrived yesterday and it works great. i have put both versions below.

All testing was done an a picaxe 28x1.

AXE033

setfreq em16
pause 800
serout 4,n2400_16,(254,$24)
pause 1
serout 4,n2400_16,(254,$09)
pause 1
serout 4,n2400_16,(254,$20)
pause 1
serout 4,n2400_16,(254,$0f)
pause 1
serout 4,n2400_16,(254,$01)
pause 1
serout 4,n2400_16,(254,128,"abcdefghijklmnopqrst")
Pause 1
serout 4,n2400_16,(254,160,"1x2x3x4x5x6x7x8x9x0x")
pause 1
serout 4,n2400_16,(254,192,"zyxwvutsrqponmlkjihg")
pause 1
serout 4,n2400_16,(254,224,"00000000000000000000")



Sparkfun Backpack

setfreq em16
pause 800
serout 4,T9600_16,(254,$24)
pause 1
serout 4,T9600_16,(254,$09)
pause 1
serout 4,T9600_16,(254,$20)
pause 1
serout 4,T9600_16,(254,$0f)
pause 1
serout 4,T9600_16,(254,$01)
pause 1
serout 4,T9600_16,(254,128,"abcdefghijklmnopqrst")
Pause 1
serout 4,T9600_16,(254,148,"1x2x3x4x5x6x7x8x9x0x")
pause 1
serout 4,T9600_16,(254,192,"zyxwvutsrqponmlkjihg")
pause 1
serout 4,T9600_16,(254,212,"00000000000000000000")
 

westaust55

Moderator
@rjandsam,

well done on sorting your dilema out.

As a sugegstion, it would be a good idea to wrap up the information an post in the completed projects / audio and visual section.
http://www.picaxeforum.co.uk/forumdisplay.php?f=36

Here in the main forum area it will soon get lost.

Provide the new post with a descriptive link
eg "Using xyz LCD with AXE033 or Sparkfun abc"

Include:
the make/model and a link to the LCD module you used,
a brief summary of the problem found, and
then the two program code segments you have provided above.
 
Top