micromouse
Joined: 24 May 2007 Posts: 3
|
Non black box LCD problem!!! (%u fails) |
Posted: Sun Jun 24, 2007 5:14 am |
|
|
I'm using CCS with MPLAB 7.5 on an ICD2 programming a simple 8x2 POWERTIP LCD.
The following code works, but when I try to print using anything else than %X I get blank lines and the code fails. I have looked at timing issues, check all connections, am now wondering if there is something really strange going on.
Code that works
Code: |
#include <16F648A.h>
#device ICD=TRUE
#fuses INTRC,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4MHz)
#include <lcd.c>
void main()
{
int value;
lcd_init();
delay_ms(1000);
value=1;
while (1)
{
printf(lcd_putc,"\fX:%X %X\n",value,value);
printf(lcd_putc,"H: %X",value);
delay_ms(500);
value=value+1;
}
}
|
The result of this code is
X:56 56
H: 56
and the values count up as they should.
However if I change the %X to %u I get the following
X:1 1
and nothing else.
Any ideas? Have tried both the CCS and the flex LCD drivers with the same result.
Wayne |
|