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

Software UART - hex printing

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



Joined: 20 Apr 2012
Posts: 9

View user's profile Send private message

Software UART - hex printing
PostPosted: Fri Apr 20, 2012 12:04 pm     Reply with quote

Hi,

I'm using PIC24HJ with a software UART (can't use any hardware - due to spec). The fprintf sends hex sometimes correctly and sometimes it sends the hex and lots of zeros

289a0000000000... (and a lot more)

However using %lu prints the decimal correctly. Have you ever had similar problem? I'm using the FTDI chip as well (FT232RQ).
The CCS version is 4.126d. The UART baud rate is 57600 (tried increasing, no difference).
I think it could be something with the variable being global and declared in another file not main.
Thanks
Battery David



Joined: 01 Feb 2010
Posts: 25

View user's profile Send private message

PostPosted: Fri Apr 20, 2012 2:57 pm     Reply with quote

Please see this post first:
http://www.ccsinfo.com/forum/viewtopic.php?t=47549
koofelek



Joined: 20 Apr 2012
Posts: 9

View user's profile Send private message

PostPosted: Sat Apr 21, 2012 5:45 am     Reply with quote

I think I posted most of these points apart from a sample code. Since it's quite a big code at the moment it was hard to find that specific thing. Nevertheless, it took me all day chopping it down and checking bit by bit. I found the reason to be the RAM memory. One of my global variables storing data from GSM module was quite a big array 3kB. The compiler did not complain at all about that size but reducing it to 2.5kB seems to work.

Just to show you what exactly was going on with 3kB here's message from debug:

"CRC received: 5f8300000000000........"

And here's message from debug with a 2.5kB:

CRC received: 5f83
CRC found: 5f83

With 2.5kB the RAM usage is between 69% - 73%.
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