Noobie - 40x2 serout to GLCD???

darosu

New Member
Hi all, I wondered if you can help me??

I have just dipped my toe into the world of PICAXE but am strugling a bit.


I have set up a 40x2 on a breadboard with an 8Mhz resonator (so running at 32Mhz I believe). It is connected to the LED042 GLCD module.

I have managed to control the GLCD via hardware serial out :

setfreq 32
hsersetup B2400_32, %000
hserout 0,(BackLight,1)
pause 3000
hserout 0,(printImage,1,0)
(when GLCD connected to the Hserout pin of the PIC)

However i cannot get it to work from a software serial port...
is it possible to do software serial with a clock of 32Mhz? It doesn't like

serout A.1,T2400_32,(BackLight,1) ( it can only do up to T2400_16)

if i try

setfreq m4
serout A.4,T2400_4,(BackLight,1)

I get nothing from the display.

Anybody know what I am doing wrong? I don;t wish to use the hardware to control it as that will be used at a baud of 9600 for pulling some info off another PIC (RFID data)

Thanks in advance

Darosu the confused(!)
 

westaust55

Moderator
Darosu, firstly welcome to the PICAXE forum.

Can you provide a link to the datasheet for the particular gLCD module that you are using.

There are quite a number out there and some have even used gLCDs ex mobile phones.
 

darosu

New Member
Hi westaust55.

The GLCD i am using is the one avaiable form the UK picaxe website shop with built in serial decoder PIC... a generic data sheet for the decoder can be found here:

http://www.rev-ed.co.uk/docs/LED042.pdf

I can interface with it perfectly when using hardware serial, but can't get even the backlight to turn on from a software serial output.

I have tried putting my software pin to high before sending my first command and all possible options i can think of with chip speed ie setfreq 4, 8, 32....

See my first post for a discription of the code i have tried.

Thanks

Darosu
 

hippy

Ex-Staff (retired)
It should work, SEROUT serial is really just the same as HSEROUT serial at the signal level. I note that in post #1 you refer to "it doesn't like ... serout A.1 ... if i try ... serout A.4"; make sure you are using the correct pin and have the gLCD wired to that pin.
 

darosu

New Member
Sorry yes, that was jsut a typo, me trying all possible options...

I have it connected to pin A.4 and all code refers to that...

If i check the serial simulation window I get identical output from my hardware and software serial code, but only h/w works???

Darosu
 

hippy

Ex-Staff (retired)
The following is what I'd expect to work ...

#Picaxe 40X2
#No_Table
High A.4
Pause 1000
SerOut A.4, T2400_8, ( BackLight, 1 )

Does the gLCD require any hardware reset signal ? One thing which is always worth trying is programming the chip, then turning the PICAXE and gLCD off and back on.
 

darosu

New Member
magic!

it now works...

what I was doing wrong was three things!

1). i put port A.4 high, but in my code accidently put it low again before sending my first serial command
2). i think the jack socket being in to the computer messes up the communication?
3). i need to to a complete power down and up again after programming so everyhting starts off on the same foot.


Thank you for your input.

Just a couple more questions then...

Is it possilbe to do software serial on an 40X2 running at 32Mhz? The serout command doesn't seem to support it? Is there a way round this, i don;t really want to slow the whoel chip down...

Can software serial be done one any port?

Thanks again

Darosu (not so confised any more, perhaps a little bemused)
 
Top