CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Non black box LCD problem!!! (%u fails)

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
micromouse



Joined: 24 May 2007
Posts: 3

View user's profile Send private message

Non black box LCD problem!!! (%u fails)
PostPosted: Sun Jun 24, 2007 5:14 am     Reply with quote

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
micromouse



Joined: 24 May 2007
Posts: 3

View user's profile Send private message

Futher along the line
PostPosted: Sun Jun 24, 2007 5:27 am     Reply with quote

Have now tried the code on an 887 board with a 16x2 LCD mapped in an identical manner and everything works. it appears that the mapping for an 8x2 is causing an issue????

Wayne
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 24, 2007 1:09 pm     Reply with quote

Post the part number of the PowerTip LCD. I'll look at the memory
map in the data sheet.

In this post, I test several 8x2 LCDs with the "Flex" driver and they
all work.
http://www.ccsinfo.com/forum/viewtopic.php?t=29819&start=3

Flex driver:
http://www.ccsinfo.com/forum/viewtopic.php?t=24661
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group