Serial LCD

Introduction.

Another ten days memory loss !. During that time I must have produced a serial LCD for the children's project, got it working, took a photo of it and now it is working no more !.

I have to do it again, and this time this page is my record of what I have to do and what I did about it !

What am I trying to do ?. Well,  I need a serial 16 x 2 LCD to use with the new Amicus compiler training board. The idea is to keep the children's programming side of things as simple as possible. Ie ...  "RSOUT at 1, 1, "Hello World".  To make this possible the Amicus defaults must be used to simplify programming, so let's look at the defaults ...

Print defaults.

Declare

Default

   
LCD_TYPE  0, 1 or 2 Hitachi Alphanumeric LCD (common type)
LCD_DTPIN B.4
LCD_ENPIN B.2
LCD_RSPIN B.3
LCD_INTERFACE 4 lines.
LCD_LINES 2 lines.

 

RSOUT Defaults.

Declare

Default

   
RSOUT_PIN B.0
RSOUT_MODE 1 or 0 Inverted
SERIAL_BAUD 9600
RSOUT_PACE No delay

 

Conclusions.

1.    The defaults have been designed to enable items to be printed on a standard 16 x 2 LCD, without making any declares, by simply including a command line such as "RSOUT at 1, 5, Hello World" .... and it will do just that !.

2.   I am using the Training board to send the serial data to the LCD via an adaptor board that has a 16F628 PIC that converts the serial data back to parallel form, with four data lines into the LCD.

   

3.    I started off testing at 2400 baud, so that I could use the Junior LCD for substitution checks. The working sender program was ....

'RSOUT

'This program works at 2400 baud with Picaxe LCD

'Works with a bootloader as well.

Device = 18F25K22

Xtal = 64

DelayMS 100

Declare Serial_Baud 2400

Declare Rsout_Pin PORTB.7    'Transmitter !

Declare Rsout_Mode 1            'Use mode 1 for Crownhill LCD

'Declare Rsout_Pace 20

Main:

        RSOut At 1,1," Hello"

        RSOut At 2,1," World"

GoTo Main

End

 

4.   The above works OK with the Senior LCD 16F628 programmed chip at 4 Mhz, copied from the master. The problem is I never documented this program and have no idea of what I did. So far, all attempts to rewrite the LCD program have failed. Task 1 is to get a working program together. Note the Crownhill serial LCD also works with Mode 1.

5.   The final task is to get the combination working together at 9600 baud. For this, I may have to move to a 20 Mhz 16F628 running at 16 Mhz (no 20 Mhz xtals!).

6.   The octal driver invertors work OK at 64 Mhz on the 18F25K22 board !.

7.   I am wondering if a timing problem exists above 2400 baud, except that the Crownhill LCD works at 9600 ?. Have changed both xtal and xtal caps on LCD board

 

Latest 27th March 2011.

It seemed like a simple enough project, one that I had done many times before, which made it all the more confusing, when everything I tried failed !. It was subsequently found that the DS30 bootloader was operating intermittently. I have covered the symptoms in detail under "Bootloaders". The end result was that often the bootloader seemed to be working, but failed to perform the download.  I have posted the symptoms to the DS30 authors web site, but so far there has been no response.