soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
odd number of ram variables hangs lcd.c on pic33 |
Posted: Wed Apr 27, 2011 9:51 am |
|
|
I'm using a PIC33FJ128GP804 with a standard 2-line LCD and the CCS lcd.c driver. It has been working fine during initial code setup/test/development, there are no hardware issues.
As I add code to my application, I find that startup sometimes hangs inside the lcd init routine.
Looking closely at the compiled assembler instructions in the lcd routines, I have found that if there is an odd number of 8-bit variables declared in my code (which appear before the include statement for lcd.c) , then routines inside lcd.c will hang. If I declare one additional (unused) int8 variable to push everything up 1 byte, then lcd.c works fine again.
As I add code and variables I must comment/uncomment the added int8 variable to ensure the lcd.c routines will run.
Not having looked any closer yet, my intuition thinks that part of the compiler is still "thinking 8-bit" even though I'm using a 16-bit part.
Am I doing something wrong, or does this sound like a compiler bug?
Thank you for your time,
Jim |
|