In certain situations, my LCD will not power up.
I am using an Infineon XC-888 micro driving a 16x4 LCD in 4-bit mode.
The LCD is based on the ST7066U IC, the c-code is based on the DAvE structure.
LCD Datasheet: www.sitronix.com.tw/.../ST7066Uv22.pdf
I have been playing around with software delays and timing, but in certain situations, the LCD will power up and others not.
Here are my observations so far:
When I re-program the device, there are no problems, it is always when power is removed... and then re-applied. I have previously tried inserting a really long SW delay to give the lcd time to power up, but that doesn't work.
The "line LCD_init4bit();" is in 2 places in the code below, when the one inside the "while(1){...}" loop is removed, it will not power up when power is applied. When the one outside the while loop is removed/commented out, and the one inside enabled, it works. This also leads me to believe that there is nothing wrong with the function itself, but like I previously said, I have already tried long SW delays to give the LCD time to power up.
I am not sure about reset vectors or the compiler, but any suggestions would be muchly appreciated.
Thanks
void main(void) { // USER CODE BEGIN (MAIN_Main,2) // USER CODE END MAIN_vInit(); // USER CODE BEGIN (MAIN_Main,3) //INT_vDisableAll(); setOutputBits(PASS_LED + FAIL_LED); delay(1000); resetOutputBits(FAIL_LED); delay(100); LCD_init4bit(); //INT_vEnableAll(); // USER CODE END while(1) { // USER CODE BEGIN (MAIN_Main,4) LCD_init4bit(); resetOutputBits(PASS_LED); delay(10000); LCD_instruction4bit(CLEAR_DISPLAY); delay(1); LCD_sendstring4bit("Hello World"); delay(1); setOutputBits(PASS_LED); delay(1); // USER CODE END } } // End of function main