Hi All,
Got the LCD working perfectly on the PIC16C54C. When I transferred the code to PIC18F4331, apparantly all hell broke loose. Nothing was displayed.
I tried simulating the code on MPLAB and its working fine. Tried to zoom down onto the possible cause. Inserted BSF PORTA,2 / 3 / 4 with LED tied to it.
To my horror, the code stucks at this part:
BSF PORTA,2 BSF PORTA,3
CALL DELAY CALL INITLCD CALL DELAY
BSF PORTA,4
PORTA,4 (LED) never got lit up. Is this a problem of the program stuck or resetting? If so what could attribute to theses? The config code are as follows: CONFIG OSC = XT CONFIG WDTEN = OFF CONFIG PWMPIN = OFF CONFIG PWM4MX = RB5 CONFIG SSPMX = RC7 CONFIG FLTAMX = RC1
By the way, the LED is able to light up as coded if I removed a great amount of subroutines. Don't think it is a stack overflow problem as MPLAB doesn't show such an error. Could it be due to page issues?? or?? I am lost all possibilities just keep flooding me now.....
Thanks ywz