Elyments
Junior Member level 3
- Joined
- Apr 11, 2010
- Messages
- 31
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Location
- Cambridge, UK
- Activity points
- 1,493
// Port Expander module connections
sbit SPExpanderRST at RF6_bit;
sbit SPExpanderCS at RA2_bit;
sbit SPExpanderRST_Direction at TRISF6_bit;
sbit SPExpanderCS_Direction at TRISA2_bit;
// End Port Expander module connections
void main() {
CMCON = 0x07; // turn off comparators
ADCON1 = 0x3f; // set analog pins to digital I/O
SPI1_Init();
SPI_Lcd8_Config(0); // Initialize Lcd over SPI interface
SPI_Lcd8_Cmd(_LCD_CLEAR); // Clear display
SPI_Lcd8_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
SPI_Lcd8_Out(1,3, "HELLO"); // Print text to Lcd, 1st row, 3rd column
}
According to the manual, rst and cs pins need to be specified.I'm unsure what you mean.
void Spi_Lcd8_Config(char DeviceAddress, unsigned char * rstport, unsigned char rstpin, unsigned char * csport, unsigned char cspin);
Initializes LCD via SPI interface with pin settings (Reset pin and Chip Select pin) you specify.
// Port Expander module connections
sbit SPExpanderRST at RF6_bit;
sbit SPExpanderCS at RA2_bit;
sbit SPExpanderRST_Direction at TRISF6_bit;
sbit SPExpanderCS_Direction at TRISA2_bit;
// End Port Expander module connections
// Port Expander module connections
sbit SPExpanderRST at RF6_bit;
sbit SPExpanderCS at RA2_bit;
sbit SPExpanderRST_Direction at TRISF6_bit;
sbit SPExpanderCS_Direction at TRISA2_bit;
// End Port Expander module connections
void main() {
CMCON = 0x07; // turn off comparators
ADCON1 = 0x3f; // set analog pins to digital I/O
SPI1_Init();
SPI_Lcd8_Config(0); // Initialize Lcd over SPI interface
SPI_Lcd8_Cmd(_LCD_CLEAR); // Clear display
SPI_Lcd8_Cmd(_LCD_CURSOR_OFF); // Turn cursor off
SPI_Lcd8_Out(1,3, "HELLO"); // Print text to Lcd, 1st row, 3rd column
while(1);
}
Yes, obviously. Thanks for clarifying.I think you are referring to older versions of mikroC.
Are you using an LCD with HD44780 controller?
There is a back light on the display but no text. The demo program for the board is written in assembly so I don't know how I can use this in mikroC.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?