SPI Serial LCD Adapter and using the same SPI for comms

General discussion on mikroC PRO for PIC.
Post Reply
Author
Message
HowardJ
Posts: 79
Joined: 31 Jan 2010 04:44

SPI Serial LCD Adapter and using the same SPI for comms

#1 Post by HowardJ » 22 Aug 2020 11:51

Is it possible to connect an mE LCD/GLCD Serial Adapter to SPI1 and still use the same SPI1 as PIC to PIC communications?
Problems..
The Adapter does not have a controllable SS, as far as I can see. SS is connected to RC1, and the Library may control it. I don't know.
PIC to PIC can work with SS to RA5.
The device is a 45K22. 2 SPI and 2 I2C.
The I2C module is engaged with an RTC, and many pins are common, so SPI2 is out.
The way I see it, I can use two SPI, two I2C, or one of each.
I have made SPI comms work, and I have made SPI Serial LCD work, but not at the same time. (NOT the exact same time, just in the same program.)
E.G. I can get Data over from the PIC Slave and display it on a Port, but I can't display it on the Serial LCD.
I can post some code, if it's thought that this is quite possible.

Thank you'
Howard.
Howard

paulfjujo
Posts: 1558
Joined: 24 Jun 2007 19:27
Location: 01800 St Maurice de Gourdans France
Contact:

Re: SPI Serial LCD Adapter and using the same SPI for comms

#2 Post by paulfjujo » 22 Aug 2020 12:17

hello,

Maybe with one SPI hardware for com
and another SPI software bit bang for LCD

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: SPI Serial LCD Adapter and using the same SPI for comms

#3 Post by filip » 24 Aug 2020 09:11

Hi,

The SPI LCD adapter uses RST and CS (besides the SPI communication pins) they are declared in the code, something like this :

Code: Select all

// Port Expander module connections
sbit  SPExpanderRST at LATC0_bit;
sbit  SPExpanderCS  at LATC1_bit;
sbit  SPExpanderRST_Direction at TRISC0_bit;
sbit  SPExpanderCS_Direction  at TRISC1_bit;
// End Port Expander module connections
Basically, you should be able to use the same SPI module for other purposes, just the CS and RST will be different for the other device.

Regards,
Filip.

HowardJ
Posts: 79
Joined: 31 Jan 2010 04:44

Re: SPI Serial LCD Adapter and using the same SPI for comms

#4 Post by HowardJ » 24 Aug 2020 09:20

Yes, I see the CS on the LCD.
If it's possible, I'll figure it out.
Howard

Post Reply

Return to “mikroC PRO for PIC General”