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 CCS Technical Support

putc() timing problem with large char buffers

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







putc() timing problem with large char buffers
PostPosted: Fri Feb 13, 2004 8:06 am     Reply with quote

Hi,
I have some code that amongst other things is outputing some AT commands to a Siemens phone via putc().
I'm using a picf16lf876. I have a large character array (45 characters) defined and various other variables and everything works fine, however when I try and define a second array of 40 chars, putc() no longer operates reliably.
Examining the output on a scope shows bit widths larger than they should be which results in extra 0's or 1's being seen when there are 3 or more of them in a row.
I'm nowhere near exausting the RAM (these guys have 368 bytes and I have the 16 bit pointers enabled), memory usage is about 50% at worse case.
Even weirder is that I can increase the size of my original array to 85 chars with no ill effects on putc.
Literally commenting/uncommenting the declaration of this second character array makes putc() work/not work.
Anyone have any idea what's going on, how can an extra character array be affecting the bit timing in putc()?
Cian
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Feb 13, 2004 12:51 pm     Reply with quote

Quote:
I'm using a picf16lf876. I have a large character array (45 characters) defined and various other variables and everything works fine, however when I try and define a second array of 40 chars, putc() no longer operates reliably.
Examining the output on a scope shows bit widths larger than they should be which results in extra 0's or 1's being seen when there are 3 or more of them in a row.


The implication is that you're using a software USART for this.
Is that true ?
The 16LF876 has a hardware USART. Can you use that instead ?

Can you create and post a small program that shows the problem ?
What is the version of your compiler ?
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