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
Hi, I am using the PICDEM PIC18 Explorer with the PIC18f8722 micro. It connects to its LCM-S01602 DTR/m display via the MCP23S17 port expander. I am using the mikroC PRO compiler for programming.
Here is my code:
When I program my PIC nothing is shown on the LCD, does anyone know why this is happening?
Thanks in advance,
Ely
Here is my code:
Code:
// 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
}
When I program my PIC nothing is shown on the LCD, does anyone know why this is happening?
Thanks in advance,
Ely