Teach Yourself PIC Microcontrollers | www.electronicspk.com | 142
When in fact one row, of 32 are on at a time. This is due to persistence of vision.
Displaying
Characters
As you have seen that, you can play with these bits, to show anything you want. Text characters are
similarly not a big problem. However you will need to make a
table
or list of character maps, that you will send to the display.
Most characters can be easily mapped in 5 x 7 array. However
for simplicity of our work, we will design them as an 8 x 8
matrix. Selecting this matrix, will also be helpful in making
some other more feature rich graphics. Lets see how to work Up.
We are going to design letter ‘A’.
The adjacent fig shows the character map.
The numbers in gray
column, are in hexadecimal, equivalent. 1 for Off and 0 for On.
Now we can store this character in bytes of memory. EEPROM
on microcontroller is a good place to keep such maps, which
once defined, have to be read in by the program. We have used
EData command to store the codes for each row byte for the letter in EEPROM.
The size of table which
can be stored will depend upon the EEPROM of your microcontroller. If a larger table is required you can
use an external EEPROM. The loop fills in the appropriate bytes of display memory by reading the
associated bitmap image from EEPROM.
The index of letters to be displayed are stored in
an array z[4]. Number 0 is for letter ‘A’ as it is
defined in position 0 in EEPROM, and number
1 is for ‘B’ as it is in position 1 in EEPROM.
Notice how the
position of first byte is
calculated.
E3
DD
DD
DD
C1
DD
DD
DD
Chia sẻ với bạn bè của bạn: