Hey guys, after some headaches and programming hours I thought I should share some code that works. This Program reads UART characters and prints them into an LCD. 
|
Hi, its great to see you
visiting our forum. Why not try Proton Compiler for FREE?
Download the FREE version
of Proton Compiler, Its called Amicus18
and its available from HERE
|
Code:
Device 16F88
Xtal = 8
Hserial_Baud = 38400
Hserial_RCSTA = 010000
Hserial_TXSTA = 100100
Hserial_Clear = On
All_Digital true
DelayMS 2000 'Some time to let it sattle
Hserial_SPBRG = 12'
Declare LCD_Type 0 ' Type of LCD Used is Alpha
Declare LCD_DTPin PORTA.0 ' The control bits B0,B1,B2,B3
Declare LCD_RSPin PORTB.0 ' RS pin on B4
Declare LCD_ENPin PORTB.1 ' E pin on B5
Declare LCD_Interface 4 ' Interface method is 4 bit
Declare LCD_Lines 2
Cls
Print At 2,1,"Hola"
Output PORTB
Input PORTB.2
Dim VAR1 As Byte
Dim COL As Byte
Dim ROW As Byte
COL = 0
ROW = 0
infinite:
PORTB.3 = 0
HSerIn [VAR1]
Print At 1,COL,VAR1
Inc COL
If COL = 17 Then COL = 0
GoTo infinite
End