Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

serial 4 x 20 lcd

Status
Not open for further replies.
Im not sure who wrote that. Its a good example but using Oshonsoft Basic was a bad idea since most dont use it. (in my opinion) Most people use C or ASM for 16F Pics. I know nothing about that compiler so i cant help much but you can try this:

Code:
Proc send_lcd_char()
    Select Case char
        Case 0
            'do nothing
        Case 1
            Lcdcmdout LcdHome
            Lcdcmdout LcdClear
        Case 2
            Lcdcmdout LcdLine2Home
            Lcdcmdout LcdLine2Clear    
        Case 3
            Lcdcmdout LcdLine3Home
            Lcdcmdout LcdLine3Clear    
        Case 4
            Lcdcmdout LcdLine4Home
            Lcdcmdout LcdLine4Clear       
        Case Else
            Lcdout char
    EndSelect
End Proc

Thats what i would have written since it would allow you to simply send a Line Number then the ASCII...
 
atom the case 13 the 13 is a serial command for carriage return 27 is new line that's why he did it that way

only bad thing is not all serial software works the same sending data from the pc to the pic
 
It would if you define 0 as X command, 1 as XX command and so on

But the thing I have run into is that not all serial programs send commands the same like If you send line feed it should be

^j but some send #LF and some #10 and some maybe ^10

It's crazy no real standard


Line feed should test as 0x5E4A Or if byte 0x5E and next byte 0x4A then we have a line feed

Or 0b1011110 01001010
 

Attachments

  • ASCII Characters.JPG
    ASCII Characters.JPG
    91.8 KB · Views: 144
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top