Sunday, November 29, 2009

Taxi Driver Qualifications Raleigh

16F628A LCD LDR

Here's a simple tutorial on creating new characters or symbols on alphanumeric displays.
These LCDs usually have a driver or HD44780 compatible and are composed of an array of 5 horizontal pixels by 8 vertical in nature. In its report CGRAM can store up to 8 new characters.

Application of symbols is used to create animations or status indicators, as might be the triangle to Play, Stop-square, battery icon, etc ...
pictures
This matrix will help us calculate the bytes required to create a new character or symbol.

colored black squares are added horizontally to form a line,
and each line is added independently.
Now we only need to send information to the microcontroller as follows:

LCDOUT 254, 64, 30, 18, 18, 28, 20, 18, 17, 0

LCDOUT Where is the instruction that controls the LCD. Sending
254 or $ FE the LCD will indicate who is to receive a command. 64
command instructs the LCD is the first character CGRAM memory . Data
30, 18, 18, 28, 20, 18, 17, 0 Bytes represent the new character.

Once done so, the new character is already stored in memory LCD CGRAM, but not displayed until you use it as follows:

LCDOUT 0

LCDOUT Where is the instruction that controls the LCD. And
0 is the first character CGRAM memory we previously recorded in the command 64.

To add more characters to the CGRAM memory have to add 8 to command, in this case is 64 + 8 = 72 and so on.
In this example we can see the 8 command and Bytes calculated with the new characters.

LCDOUT 254, 64 , 4,10,10,4,4,6,4,6 ; Wash POSITION "0"
LCDOUT 254, 72 , 4,14,31,21,31,31,27,27
, House position 1
LCDOUT 254, 80 , 4,14,10,10,10,10,10,14 ; Battery POSITION "2"
LCDOUT 254, 88 , 0,10,31,31,31,14,4,0 ; Heart POSITION "3"
LCDOUT 254, 96, 10.21, 0,10,0,21,17,14 ; Smile POSITION "4"
LCDOUT 254, 104 , 0,0,0, 4,2,31,2,4 Right Arrow POSITION "5 "
LCDOUT 254, 112 , 4,14,14,14,14,14,21,21
; Rocket POSITION" 6 "
LCDOUT 254, 120 , 0,14,21,21,23,17,14,0 ; clock position "7"

Once done this, to see them just need to type the location where they were recorded.

LCDOUT 0, 1, 2, 3, 4, 5, 6, 7

LCDOUT Where is the instruction that controls the LCD. And
0 corresponds to the character stored in the command 64.
The 1 corresponds to the character stored in the command 72 and so on.
For this tutorial we used a PIC 16F628A microcontroller and Powertip1602-G lcd alphanumeric 2 rows of 16 characters each. Configuration
pins 4bits LCD will use the predefined by the compiler pbp
is the ports A1, A2, A3, A4 will be the data and are connected to the LCD to pin D4, D5, D6, D7. The port pin A4 corresponds to R / S of the LCD and the port B3 to pin E. As in the following figure:



is written in Basic language, specifically the PicBasic Pro 2.46C (PBP). PAUSE

500 ; Time to start the LCD

LCDOUT 254.64, 4, 10, 10 , 4, 4, 6, 4, 6 ; position 0 (key)
LCDOUT 254.72, 4, 14, 31, 21, 31, 31, 27, 27
; position 1 (home)
LCDOUT 254.80, 0, 14, 27, 31, 3, 31, 14, 0 ; position 2 (drums)
LCDOUT 254.88, 0, 10, 31, 31, 31, 14, 4, 0 ; position 3 (heart) PAUSE 200

LCDOUT $ FE, 1
, clear screen
LCDOUT "infotronikblog " ; Print screen characters
$ LCDOUT FE, $ C0,
" " , 0,1,2,3 ; recorded on the LCD CGRAM
END


Table with normal characters on the LCD.

0 comments:

Post a Comment