News:

Let's find out together what makes a PIC Tick!

Main Menu

Serial Lcd

Started by Dolci, Aug 20, 2025, 03:52 PM

Previous topic - Next topic

Dolci

Hello,

How to print in specific location on a 4x20 serial LCD using SerOut command.

Ex. Print At 2,5,"Hello World"

Dolci

RGV250

Hi,
You should have the instructions of the serial display, there will be a position cursor command which you do first.

This is the code I have for one of my serial displays https://shop.pimoroni.com/products/sparkfun-20x4-serlcd-rgb-backlight-qwiic  to position the cursor.
'Position the cursor, Line starts at 1, column starts at 0.       
Proc SetCursor(pData1 As Byte, pData2 As Byte) 
Dim LinePos As Byte
Dim ColumnPos As Byte
Dim TempByte As Byte
LinePos = pData1
ColumnPos = pData2

If LinePos = 1 Then LinePos = 0
If LinePos = 2 Then LinePos = 64
If LinePos = 3 Then LinePos = 20
If LinePos = 4 Then LinePos = 84

TempByte = (128 + LinePos + ColumnPos)      '128 (Change position command) + Line position + Column position)

        HRSOut2 254                          'Command character
        HRSOut2 TempByte 
EndProc 

And this is how it is used.
'Set the cursor position   
        SetCursor(1,0)
'Send Humidity data to display         
        HSerOut2 ["Humidity ", Dec2 Humidity] 
    '  delayms 1000
'Set the cursor position           
        SetCursor(2,0)   
'Send Temperature data to display                   
        HSerOut2 ["Temperature ", Dec2 Temperature]         
    '    delayms 100
'Set the cursor position           
        SetCursor(4,0)   
'Send the status data bits to display                   
        HSerOut2 ["Status ", Bin8 AHT_Data_0]       

Regards,
Bob

Dolci

thank you Bob. Now i have an idea how it use to be.

Dolci

Dolci

#3
I manage to run the serial LCD as per instruction of Bob, but i consume more codes to accomplish it. I came across to Les serial LCD and really it is like you just print normally using Hserout1 command. I use 16F628 as slave and 16f876 as master. All working as intended, I just want to know how to use Serout instead of Hserout1. I am already using the Usart (TX) of 16F876 on another communication, that is why I needed the Serout Command.

Example:
  Hserout1 At 1,3,Myvar
  What is the correct execution for Serout using the example above

Here is the code from Les
https://protoncompiler.com/index.php/topic,2116.msg16269.html#msg16269

Dolci