Has anyone ever used one of these serial displays before? Obviously LCDOUT wont work and neither will SEROUT nor I2CWRITE, etc. There's example code on the Data sheet at the product page, but since I'm a noob and it's not in PICBASIC I don't understand it. The display is a 4 line serial interface:
2* RS* MPU* Register*Select*Signal.**RS=0:*instruction;*RS=1:* data*
3* CSB* MPU* Active*LOW*Chip*Select*signal*
4* SCL* MPU* Serial*clock
5* SI* MPU* Input*data
The included sample code looks pretty intimidating to me I'm just wondering if it would be much smaller In PICBasic or if I should abandon this display for now until I get more experience and go back to the tried and true parallel LCD.
I bought this display on a whim because of its very low current ~1mA and 3 volt supply as my project is battery powered.
I haven't even hooked up the display yet (mostly due to the 1.5mm pitch, connector on order) and tried to make it work so I'm not necessarily looking for code, just advice from the experienced here If this is not worth the effort for a noob.
TIA
Neo
Sample code:
Example*Initialization*Program*
void init()
//initialize the LCD
{
P3 = 1;
P1 = 1;
RST = 0; //RESET
delay(2);
RST = 1; //end reset
delay(20);
Writecom(0x30); //wake up
delay(2);
Call writecom(0x30); //wake up
Call writecom(0x30); //wake up
Call writecom(0x39); //function set
Call writecom(0x14); //internal osc frequency
Call writecom(0x56); //power control
Call writecom(0x6D); //follower control
Call writecom(0x70); //contrast
Call writecom(0x0C); //display on
Call writecom(0x06); //entry mode
Call writecom(0x01); //clear
delay(10);
}
void writecom(int d)
{
CS = 0; //CS
RS = 0; //A0 = Command
for(serialcounter = 1; serialcounter <= 8; serialcounter++) //send 8 bits
{
if((d&0x80)==0x80) //get only the MSB
SI=1; //if 1, then SI=1
else
SI=0; //if 0, then SI=0
d=(d<<1); //shift data byte left
SCL = 0;
SCL = 1;
SCL = 0; //SCL
}
CS = 1;
}
void writedata(int d)
{
CS = 0; //CS
RS = 1; //A0 = Data
for(serialcounter = 1; serialcounter <= 8; serialcounter++) //send 8 bits
{
if((d&0x80)==0x80) //get only the MSB
SI=1; //if 1, then SI=1
else
SI=0; //if 0, then SI=0
d=(d<<1); //shift data byte left
SCL = 0;
SCL = 1;
SCL = 0; //SCL
}
CS = 1;
}
Bookmarks