Vizier87
Active Member
Hi guys,
As I started using the LCD further, I'm stuck at the instructions I read from the manual. Basically it says:
1. Display on/off cursor commands
2. Clear display
3. Set display address
4. Display data 0x00 to 0x07
5. Set CGRAM address
6. Enter data to build the character
Basically I'm trying to display the character "lambda" λ.
Here's my code: (My portd pins are reverse to the data pins, sorry
)
I think I'm nearly getting there (displays some rubbish). Anyone can advise on the code?
Also, how do I access the same character again? Is it by entering the same data as defined by the CGRAM?
Thanks everyone.
Vizier87
As I started using the LCD further, I'm stuck at the instructions I read from the manual. Basically it says:
1. Display on/off cursor commands
2. Clear display
3. Set display address
4. Display data 0x00 to 0x07
5. Set CGRAM address
6. Enter data to build the character
Basically I'm trying to display the character "lambda" λ.
Here's my code: (My portd pins are reverse to the data pins, sorry
C:
rs=0;
portd=0x01; //display address 0x00
enter ();
//Entering "garbage bits" for display//
rs=1;
Delay_us(100);
enter();
portd=0x00;
enter ();
portd=0x80;
enter ();
portd=0x40;
enter ();
portd=0xc0;
enter ();
portd=0x20;
enter ();
portd=0xa0;
enter ();
portd=0x60;
enter ();
portd=0xe0;
enter ();
///////////////////////
rs=0;
portd=0x40; // Set CGRAM Address: 0b01AAAAAA
enter ();
// Start defining character /////
rs=1;
portd=0x10; ///
enter (); //
portd=0x10; //
enter (); //
portd=0x20; //
enter (); //
portd=0x20; //
enter (); //
portd=0x60; ///
enter (); /// LAMBDA
portd=0x50; ///
enter (); //
portd=0x50; //
enter (); //
portd=0x88; //
enter (); ///
//////////////////////////////////
I think I'm nearly getting there (displays some rubbish). Anyone can advise on the code?
Also, how do I access the same character again? Is it by entering the same data as defined by the CGRAM?
Thanks everyone.
Vizier87