Jump to content
TCSCOUT

Picaxe & Lcd's

Recommended Posts

Here is the picaxe code from the serial out picaxe.

 

;     In order for the LCD to function correctly, the master processor
;     must send  data in "packets" of nine characters. The first character
;     must be a command; the remaining 8 chars can be text or commands.

;     After each 9-byte packet is sent to the LCD, a brief delay is
;     necessary to allow the LCD enough time to update its display.

; =====================================================================


;=== Constants ===
                    
    symbol abit =  100        ; used to add pause between packets
    
    
;   HD44780 LCD Commands
    symbol D0 =   8            ; display off
    symbol D1 =  12            ; display on (cursor off)
    symbol DC =   1            ; display clear (cursor home)
    symbol C0 =  12            ; cursor off (display on)
    symbol C1 =  14            ; cursor on  (no blink)
    symbol CB =  15            ; cursor blink    
    symbol CH =   2            ; cursor home (display not cleared)
    symbol L1 =  16            ; cursor left  one position
    symbol R1 =  20            ; cursor right one position
    symbol Q1 = 128            ; cursor at position 1 of line 1
    symbol Q2 = 136            ; cursor at position 9 of line 1
    symbol Q3 = 192            ; cursor at position 1 of line 2
    symbol Q4 = 200            ; cursor at position 9 of line 2
    

;=== Directives ===

    #picaxe 14M                ; set compiler mode
    pause 1000
    goto Main:
    Main:
    If input1 = 1 then
goto Message_1
endif
if input2 =1 then
goto Message_2
endif

goto main
;=== Begin Main Program ===============================================

Message_1:

pause 1000                            ; allow time for LCD to initialize
Do
    serout 0,N4800_4,(Q1,"Battery ")
    pause abit
                
    serout 0,N4800_4,(Q2,"12.5 DC ")
    pause abit
    
    serout 0,N4800_4,(Q3,"Pics DT-")
    pause abit
    
    serout 0,N4800_4,(Q4,"4 NT-2")
    pause abit
    
    
inc b2
loop while b2 < 2
    b2 = 0

goto Main

Message_2:

    pause 1000

                            ; allow time for LCD to initialize
Do
    serout 0,N4800_4,(Q1,"HOW CAN  ")
    pause abit
                
    serout 0,N4800_4,(Q2,"I GET   ")
    pause abit
    
    serout 0,N4800_4,(Q3,"THIS TO ")
    pause abit
    
    serout 0,N4800_4,(Q4,"WORK?   ")
    pause abit
    
    
inc b2
loop while b2 < 2
    b2 = 0

goto Main

Share this post


Link to post
Share on other sites
 
 
Thanks TC. Another question, is the LCD and both 14M's running on the same 5 volt power supply?

 

 

I have them both on the same 5 volts, if you want they don't have to be but you will have to tie the negative power from them together for the serial communications to work.

Good Luck, Hopefully I got you guys off to a good start and you will be able to show me some stuff later on :D .

Share this post


Link to post
Share on other sites
 
 

I'm following along with ya TC. I just dont have the spare time to get my LCD's out at the moment. But I'm emjoying reading what your playing with and hopefully I'll get to play soon as well.

Share this post


Link to post
Share on other sites
 

I know BG, take care of the important things. We can get you up to speed with us when your ready. I'll probably have to give my head a break soon :blink: . Wonder if this will fit in my ...... :rolleyes:

Share this post


Link to post
Share on other sites
 
Wonder if this will fit in my ...... :rolleyes:

 

UH OH!!! I hear those wheels spinning again. :o Watch out boys, he is up to something. :D

Share this post


Link to post
Share on other sites
 
. Wonder if this will fit in my ...... :rolleyes:

 

 

I can probably guess where he's going with that one.. Might start with a V and end with a 1 maybe...

Share this post


Link to post
Share on other sites
 
. Wonder if this will fit in my ...... :rolleyes:

 

 

I can probably guess where he's going with that one.. Might start with a V and end with a 1 maybe...

 

:lol: You guessed it, it's got everything else in there :lol: , Don't know if I can find a spot for it? Need to get it to do something first.

Share this post


Link to post
Share on other sites
 

I got my LCD in the mail today. I soldered up a program board using a 20 pin DIP socket so I can program 08M up 20x2 chips and added jumpers so I could connect it to the LCD. Got it all wired up but instead of using a pot for the contrast I just used a 0.47 ohm resistor, I read somewhere in one of the searches I did that using a low value resistor usually works out best or start with the pot turned down to the lowest value. Installed a 14M chip and changed the program Roger posted to make my own message. This is pretty cool.

 

Mypics1437.jpg

 

Mypics1439.jpg

Share this post


Link to post
Share on other sites
 
 
 

Excellent! You sure got it working fast too!

Share this post


Link to post
Share on other sites
 
Mark?

Share this post


Link to post
Share on other sites
 

Ralph, did you do the first one with just one picaxe or the second one that is picaxe to picaxe to LCD?

Share this post


Link to post
Share on other sites
 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×