kerplatz 0 Posted March 5, 2013 Share Posted March 5, 2013 I used the example code for the LCD - Hello World. I set up my LCD with the correct wires connected the the port 2 pins. RS // P2.0EN // P2.1D7 // P2.5D6 // P2.4D5 // P2.3D4 // P2.2 Everything works fine. I now leave the LCD wired and create code in CCS 5.3 using the same pins and added this also. I attached the code. #define LCM_DIR P2DIR#define LCM_OUT P2OUT Now the display is blank. I had my code and the LCD working in CCS using other pins on port 1. You will see them in the comments. I need to move the LCD to port 2 since I am using Port 1 for SPI to read and write to an SD card which is not included in the code because I need to move the LCD to port 2 first.. There must be a way to make this work in CCS since it works in Energia. Any help would be appreciated. Thanks. main.c Quote Link to post Share on other sites
roadrunner84 466 Posted March 5, 2013 Share Posted March 5, 2013 Your code assumes your D4,,5,6,7 pins are on Px.4,5,6,7 in line 164 and 188 you use these lines LCM_OUT |= (ByteToSend & 0xF0); LCM_OUT |= ((ByteToSend & 0x0F) << 4); which is only valid if you're writing to Px.4,5,6,7. Would you want to write to Px.2,3,4,5 the code wold change to LCM_OUT |= (ByteToSend & 0xF0) >> 2; LCM_OUT |= ((ByteToSend & 0x0F) << 2); There may be other assumptions about the pin mapping, but these stood out for me. I didn't look for more errors. In line 311 this assignment uses the same assumption: LCM_OUT = 0x20; That would become LCM_OUT = 0x20 >> 2; or LCM_OUT = 0x08; kerplatz 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.