By reading the teaching material about programming the LCD board, I know RB0~RB3 is the data transmission lines, RB4 is the line which can control to transmit the data or instruction, RB5 should be lifted and droped down to clock out the data to LCD board. If the information I got is all right, the following code should place a "W" on the LCD board, however, it gave me "u" with two dots above(can't type from keypad) and when I changed the first PORTB to 0x13 and second PORTB to 0x14, it gave me proportional symbol, if I changed those to 0x17 and 0x18, it gave me pi, it seems I can only get the symbol from most right-hand -side column, whose four higher bits is 1111 and their lower 4 bits is controlled by first PORTB which is supposed to select the 4 higher bits of symbol. Can you give me any suggestions or attching some code example to control the LCD board displaying things please? Thank you very much. By the way I just wonder If I can plug the LCD board to other ports of PIC rather than PORTB.
.........
TRISB = 0x00;
PORTB = 0x15; //Higher four bit of W
.........
PORTB = 0x17; //Lower four bit of W
.........
Problem about using the LCD board, help needed really
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Hello Ke
The problem you are having is probably due to the fact that you are writing to the entire port when you put your data on. What you should do is:
The best thing I can advise to learn the LCD functions is to download the demo copy of flowcode.
Within Flowcode do the following to create C code for the LCD
The problem you are having is probably due to the fact that you are writing to the entire port when you put your data on. What you should do is:
Code: Select all
char temp;
temp = PORTB & 0xf0; //Mask out lower 4 bits
PORTB = temp | 0x15; //Write 'W' data onto lower 4 bits
........ ........
temp = PORTB & 0xf0; //Mask out lower 4 bits
PORTB = temp | 0x17; //Write 'W' data onto lower 4 bits
Within Flowcode do the following to create C code for the LCD
- Add an LCD component.
Use a component macro to start the component.
Use a component macro to print out an ascii 'W'
compile the flowchart to C code.
View the C code.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel