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

lcd_symbols function doesn't take 16-bit in PIC16F1946!!

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



Joined: 02 Aug 2011
Posts: 10

View user's profile Send private message

lcd_symbols function doesn't take 16-bit in PIC16F1946!!
PostPosted: Sun Sep 04, 2011 11:44 pm     Reply with quote

Hi,

In the help file, it says that the lcd_symbols function take 8-bit or 16-bit symbol.
My code didn't work when I had:
Code:

int16 const Digit_Map[10] =
//  0       1       2       3       4       5       6       7       8       9
{0xFC00, 0x6020, 0xDB00, 0xF100, 0x0700, 0xB700, 0xBF00, 0x8028, 0xFF00, 0xE700};
 

It works perfectly when I had:
Code:

int8 cons Digit_Map[10]
{0xFC,0x60,0xDB,0xF3,0x67,0xB7,0xBF,0xE0,0xFF,0xE7};

// CHAR1 is 14-segment character
lcd_symbol( Digit_Map[i], CHAR1 );

What else can I do?

Thanks,
Juin
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Sep 05, 2011 12:07 am     Reply with quote

There was a similar problem in the past. This thread has a work-around
for it by using 8-bit data tables instead of 16-bit. You have to do two calls
to lcd_symbol() for each lcd digit:
http://www.ccsinfo.com/forum/viewtopic.php?t=33377&start=9
juinhooley



Joined: 02 Aug 2011
Posts: 10

View user's profile Send private message

PostPosted: Mon Sep 05, 2011 12:57 am     Reply with quote

Thanks. That's great!

I found another problem.
In the PIC16f1946.h file the constants for the commons are
COM0 0
COM1 24
COM2 48
COM3 72

Since this micrcontroller has 46segments, shouldn't the numbers be 0, 46, 92 & 138?
I tried to write my own constants to overwrite this but CCS was turning on wrong segments. Any idea how to fix this one?

Thank you!
juinhooley



Joined: 02 Aug 2011
Posts: 10

View user's profile Send private message

LCD problems with PIC16F1946
PostPosted: Tue Sep 06, 2011 12:04 am     Reply with quote

PCM programmer wrote:
There was a similar problem in the past. This thread has a work-around
for it by using 8-bit data tables instead of 16-bit. You have to do two calls
to lcd_symbol() for each lcd digit:
http://www.ccsinfo.com/forum/viewtopic.php?t=33377&start=9


Hi, just wondering if anyone has used ccs version 4.124 to compile code for PIC16F1946 with the LCD driver function. It doesn't work?!!

Problem 1:
It thinks that it has only up to 24 segments. Hence the constant for COM0, COM1, COM2 and COM3 are wrong. Even when manually input the correct address number as the 2nd arg of the lcd_symbol function it still compile the code as if it has only 24 segments.

Problem 2:
Then I tried to write code manually and check the WA (write allow) bit before writting to the LCDDATAx registers. It turned out that the WA bit code never go low... so I can't write to the register.

Problems after problems... can someone help please?!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 06, 2011 12:27 pm     Reply with quote

If the CCS functions don't work for the PIC you have, then you can:

1. Report the bugs and CCS may fix them in the future. But maybe not
soon enough to help you.

2. Or, you can write your own LCD functions.

3. Or, you can write directly to the LCD control registers to setup the
LCD module.
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