0% found this document useful (0 votes)
133 views3 pages

PROTON Serial LCD Circuit PDF

This document demonstrates changing baud rates on a serial LCD using a PICmicro microcontroller. It first sends messages at 9600 baud, then changes to 4800 baud and 1200 baud, sending messages at each rate and verifying communication by receiving an acknowledgement byte. It clears the LCD between messages.

Uploaded by

Koky HS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
133 views3 pages

PROTON Serial LCD Circuit PDF

This document demonstrates changing baud rates on a serial LCD using a PICmicro microcontroller. It first sends messages at 9600 baud, then changes to 4800 baud and 1200 baud, sending messages at each rate and verifying communication by receiving an acknowledgement byte. It clears the LCD between messages.

Uploaded by

Koky HS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

A demonstration program showing the use of baud rate changes is shown below.

' Negotiate three baud rates on the PROTON Serial LCD


' Using a 12F675 8-pin PICmicro
Device = 12F675
XTAL = 4
Dim ACK_BYTE as Byte
Symbol T1200 = 813
Symbol T4800 = 188
Symbol T9600 = 84
Delayms 500
' Wait for PICmicro to stabilise
ANSEL = 0
' Set pins to digital mode
CMCON = 7
' Disable ADCs
Serout GPIO.2, T9600,[Cls,"HELLO THERE"]
Serout GPIO.2, T9600,[254,192,"AT 9600 BAUD"]
Delayms 500
' Display for 500ms
Serout GPIO.2, T9600,[254,253,"4800",13]
' Set BAUD rate to 4800
' Receive the ACK byte
TRY_AGAIN_FOR_4800:
Serin GPIO.2, T9600,1000,TRY_AGAIN_FOR_4800,[ACK_BYTE]
If ACK_BYTE <> "O" Then TRY_AGAIN_FOR_4800 : Else : Delayms 100
Serout GPIO.2,T4800,[Cls,"HELLO AGAIN"]
Serout GPIO.2,T4800,[254,192,"AT 4800 BAUD"]
Delayms 500
' Display for 500ms
Serout GPIO.2,T4800,[254,253,"1200",13] ' Set BAUD rate to 1200
' Receive the ACK byte
TRY_AGAIN_FOR_1200:
Serin GPIO.2,T4800,1000,TRY_AGAIN_FOR_1200,[ACK_BYTE]
If ACK_BYTE <> "O" Then TRY_AGAIN_FOR_1200 : Else : Delayms 100
Serout GPIO.2,T1200,[Cls,"HELLO AGAIN"]
Serout GPIO.2,T1200,[254,192,"AT 1200 BAUD"]
Stop

A demonstration program showing the general use of the Serial LCD is listed
below. The code is for use with an 8-pin 12F675 device.
' Write the text 'HELLO WORLD' on the LCD
' Using a 12F675 8-pin PICmicro
Device = 12F675
XTAL = 4
RSOUT_PIN = GPIO.2
RSOUT_MODE = TRUE
SERIAL_BAUD = 9600
RSOUT_PACE = 1

'
'
'
'

Serial out pin


Set TRUE mode
Baud rate of 9600
1ms delay between characters

Dim COUNT_VARIABLE as DWord


Delayms 500
ANSEL = 0
CMCON = 7
Rsout Cls

'
'
'
'

Wait for PICmicro to stabilise


Set pins to digital mode
Disable ADCs
Clear the LCD

Rsout "HELLO WORLD"


' Write the text
AGAIN:
For COUNT_VARIABLE = 0 to 2000000
Rsout at 2,1,DEC COUNT_VARIABLE,"
Delayms 200
Next
Goto AGAIN

"

PROTON Serial LCD Circuit.


+5V

R/W
RS
Vo
Vdd
Vss

T1
BC847 R6
1k

From
RB5

C5
100nF

+5V

RB2

RB1

RA3 - RA0

DB0
EN

DB1

DB3
DB2

DB5
DB4

DB7
DB6

ALPHANUMERIC LCD
MODULE

R5
100

Optional
Backlight
Control

+5V
14

VDD RB7
RB6
MCLR
RB5
RB4
RB3
RB2
OSC1
RB1
RB0

13

RA4
15
OSC2
RA3
C2
RA2
22pf
RA1
VSS RA0

VPP

8MHz
Crystal

16

PIC16F84A

C1
22pf

12
11
10

SDATA

9
8
7
6

2
1
18
17

+5V
R8
100 J3

SCLK
BACKLIGHT

RS
EN

R2
100

+5V
R4
150k
J2

D7
D6
D5
D4

LCD
Data Lines

SERIAL IN

R3
100

R7
150k

+5V

NC

RB3

RB0

GND

RA0/Serial In

R1
1K

C4
100nF

10

D1
1N4148

VPP

+5V

RB7

RB6

GND

C3
100nF

Optional
RESET
Switch

You might also like