We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The following codes are for initializing the LCD display and directly copied from my program, but when those codes under debugging using software simulator, why the line 6 & line 12 always are non-executable code (invalid break points)? What are the possible reasons? void DispInit ( unsigned char maxrows, unsigned char maxcols) { 1. DispInitPort(); 2. DispMaxRows = maxrows; 3. DispMaxCols = maxcols; 4. OS_Delay(100); 5. DispSel(DISP_SEL_CMD_REG); 6. DispDataWr(0x30); 7. OS_Delay (2); 8. DispSel(DISP_SEL_CMD_REG); 9. DispDataWr(0x30); 10. OS_Delay(150); 11. DispSel(DISP_SEL_CMD_REG); 12. DispDataWr(0x30); 13. OS_Delay(2); 14. DispSel(DISP_SEL_CMD_REG); 15. DispDataWr(0x08); 16. OS_Delay(2); 17. DispSel(DISP_SEL_CMD_REG); 18. DispDataWr(0x08); 19. OS_Delay(2); } Please help me, it is time consuming & really killing
Thank you for your responds. The following codes is the DispDataWr() function: static void DispDataWr(unsigned char val) { P21_PIN = 0; // write operation P22_PIN = 1; // give operation start signal _nop_ (); _nop_ (); // wait P1 = val; // write value P22_PIN = 0; P1 = 0xff; // DATA_PORT is input [prevent I/O-Port from demage] } and the OS_Delay function is the following codes: void OS_Delay ( int n ) { int i; while( n --) { for(i == 0; i < 125; i++ ) {;} } }