parraller LCD

eitan

Member
HEllo

I work with 28x2 chip.
I need to connect parallel LCD to my controller but I see only serial LCD support.
Please advice .

what to do?
Eitan
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

Two things to do; read PICAXE Manual 3 where there are examples of how to do this, and search the forum for previous discussions on the same topic!
 

eitan

Member
Hi
Thanks for the reply.
I will be more clear.

I want to use LCDOUT command.
does the logicator support the lcdout command?

I need small and simple code
 

hippy

Technical Support
Staff member
There is no LCDOUT command supported by the Basic language nor by Logicator.
 

nick12ab

Senior Member
The Logicator has an LCD command... for serial LCDs.

You can use code in a BASIC cell. Hippy has 4-bit code examples here which use a 4-bit interface and uses 6 pins. Also, there's 8-bit mode which uses 10 pins but less code.

8-bit example:
Code:
'this bit only needs to be done once on power-up
symbol rs = C.1'whatever pin you want
symbol enable = C.0'whatever pin you want
symbol lcddata = pinsB
symbol loopcounter = b27
symbol readvar = b26
    dirsB = 255
    low rs
    output enable
    lcddata = %00000110 : pulsout enable,100
    lcddata = %00001100 : pulsout enable,100
    lcddata = %00111011 : pulsout enable,100
    lcddata = %00000001 : pulsout enable,100
'end of bit that only needs to be done once
    low rs
    lcddata = 128 : pulsout enable,1
    high rs
    for loopcounter = 0 to 15
        lookup loopcounter,("16 CHARS LINE 1 "),readvar
        lcddata = readvar
        pulsout enable,1
    next loopcounter
    low rs
    lcddata = 192: pulsout enable,1
    high rs
    for loopcounter = 0 to 15
        lookup loopcounter,("16 CHARS LINE 2 "),readvar
        lcddata = readvar
        pulsout enable,1
    next loopcounter
 

eitan

Member
Hi Nick12ab

Thanks for the reply.
I new to the PICAXE but I hope to make it work by coppy the 4 bit example.
I need to read the ADC1 and print it on the LCD.

Thanks for your help

Eitan
 

eitan

Member
Hi

I wrote a small program to print some messegeson LCD using PICBASIC pro and it is so small anf it works(-:
I use the LCDOUT command and it so easy.

now
IS there any way to use PICBASIC_PRO with LOGICATOR?

BR
Eitan b
 

nick12ab

Senior Member
IS there any way to use PICBASIC_PRO with LOGICATOR?
Do you mean the Logicator software, or PICAXE? In the case of PICAXE, you just put the PICAXE chip in the programmer and program it with PICBASIC_PRO, but you won't be able to use it with Logicaor again.
 

eitan

Member
I want to use picaxe with logicator, but use a small text box (basic box) to write the LCD program part with PICBASIC PRO.
can we do that?
 

nick12ab

Senior Member
I want to use picaxe with logicator, but use a small text box (basic box) to write the LCD program part with PICBASIC PRO.
can we do that?
Not with the LCDOUT command as it doesn't exist in PICAXE Basic but you can use Hippy's routines for 4-bit mode and mine for 8-bit mode.
 

eitan

Member
I use the example to show 10-14 kids how it easy and your code is to big for those kids (-:
I must not use so much code and use only\ more graphical.
 

nick12ab

Senior Member
I use the example to show 10-14 kids how it easy and your code is to big for those kids (-:
I must not use so much code and use only\ more graphical.
So you're teaching your pupils how to drive a parallel LCD with a PICAXE and they can't comprehend the code.

1. I'll break my code down into subsections to see if it is clearer - the lookups don't have to be used.
This is the symbols definitions which apply alias names to variables and pins in order to make the pin functions memorable and to allow fast changing of pins if desired by simply changing the pin numbers. It is put at the beginning of the code.
Code:
symbol rs = C.1'whatever pin you want
 symbol enable = C.0'whatever pin you want
 symbol lcddata = pinsB
 symbol loopcounter = b27
 symbol readvar = b26
This sets portB and the pins defined for rs and enable to outputs. It only needs to be done once on power-on.
Code:
    dirsB = 255
     low rs
     output enable
This bit initiaizes the LCD display. It only needs to be done once per power-up. It is also compatible with the Winstar OLED displays sold at Techsupplies in case you want to upgrade.
Code:
    lcddata = 000110 : pulsout enable,100
     lcddata = 001100 : pulsout enable,100
     lcddata = 111011 : pulsout enable,100
     lcddata = 000001 : pulsout enable,100
To send an instruction to the LCD simply use this ('low rs' can be removed if it is already low). Instructions used after initialization will be mainly just to set the location to print the text on the LCD so 128 is the beginning of line 1 and 192 is the beginning of line 2.
Code:
    low rs
     lcddata = [I]instruction[/I] : pulsout enable,1
To send a data byte to the LCD simply use this. Data will be loaded into the LCD SRAM location that was set by an instruction so a data byte could be a character to appear on the LCD or data to define parts of the CGRAM.
Code:
    high rs
     lcddata = [I]data[/I] : pulsout enable,1
If you only have a small amount of consecutive data bytes to send then multiple instances of the above ('high rs' doesn't need to be repeated) can be sent but if you have a lot of data to send then you might prefer to use a loop. In this example, the loop sends the data in the brackets to the LCD. The number that follows 'for loopcounter = 0 to ' is the number of bytes minus one.
Code:
    low rs
     lcddata = 192: pulsout enable,1
     high rs
     for loopcounter = 0 to 15
         lookup loopcounter,("16 CHARS LINE 2 "),readvar
         lcddata = readvar
         pulsout enable,1
     next loopcounter

2. You can replicate the function of the code with flowchart symbols however it could look messy.
 

nick12ab

Senior Member
When using the initialization sequence, please put a % symbol before each number lcddata is being set to as the forum is playing up and won't let me put them in properly.
 

eitan

Member
Dear Nick12ab

thanks a lot for your effort.
I meet them today, so I will try to show them your code.
if it be heavy, I will build a serial LCD with the open source code chip.

Thanks a LOT
Eitan B
 
Top