How do we know that you connected lcd correctly?
Does your lcd even have spi capability?
In my limited experience cheap/common 2x16 lcd do not have spi capability.
Hello there
I have PIC16F767 and one 2x16 LCD and I want to lat PIC write any thing to the LCD but in vain, and help in sample code for MPLAB XC8?
View attachment 137461 View attachment 137462
I did a quick look on Ebay. They now sell 2 board kit. First board is the regular 40? year old design parallel 8 bit 2x16 lcd. Second board is the i2c/spi to 8 bit parallel translator board. Kinda interesting if you can stack the two boards on top of each other.Extremely poor detail in the TS's post but I assume the chart posted is the pinout for the LCD display. Very odd that it would have 20 pins for SPI. What on earth would be the purpose of all of those extra pins.
hi,Hello there
I have PIC16F767 and one 2x16 LCD and I want to lat PIC write any thing to the LCD but in vain, and help in sample code for MPLAB XC8?
View attachment 137461 View attachment 137462
// -------------------spi bus master setup------------------
CKP=0; //0=idle clock state is low
SSPSTAT.CKE=1; //0=Data transmitted on falling edge of SCK
SSPSTAT.SMP=1; //1=SPI mode-Input data sampled at end of data output time
SSPCON.SSPM3=0; //FOSC/4
SSPCON.SSPM2=0; //FOSC/4
SSPCON.SSPM1=0; //FOSC/64
SSPCON.SSPM0=1; //FOSC/4 1=/16
//SSPIE=1; no need for xmit
SSPCON.SSPEN=1; // enable
//----------------------------------------------
PEIE=1; // Enable peripheral int.
GIE=1; // Global int. enable
/================ send byte to SPI bus ==============
void Xt_SPI(unsigned char byte)
{
SSPCON.WCOL=0; // clear collision bit
while(SSPSTAT.BF);
{
SSPBUF =byte;
__delay_us(100); // wait time depending on pic/SPI & clock chip speed
}
}
dear mates,
excuse me for lack of information in my post, this LCD is from HP Laser Jet 4500, I found some good information about it in this link:
https://kbiva.wordpress.com/2012/12/30/hp-laserjet-4500-front-panel/
he interface it with Arduino by the information that I sent in the table, the information say that we are facing a SPI serial LCD, if you see any thing different just tell me, all I want is how to make a simple code that can talk to this LCD by PIC16F767..
Any help
by the way thanks to Picbuster for the code..
Are you sure you are getting SPI out of the Pic?
That is the first step.