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

18F software uart interferes with hardware uart

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



Joined: 18 Oct 2003
Posts: 35
Location: Brisbane, Australia

View user's profile Send private message Send e-mail Visit poster's website

18F software uart interferes with hardware uart
PostPosted: Mon May 23, 2005 6:46 am     Reply with quote

Here's and interesting one. I recently made the change from a 16F877 to 18F452. With a little help from this forum, a few port address changes and my whole program ported accross nicely.

However, I have a comms problem on the 18F that doesn't exist on my 16F processor. Too many printf statements stops comms on my hardware uart. I use the onboard hardware uart, with a 485 bus that connects to a bunch of other devices in a vending machine. It is interrupt driven.

Occaissionally, I need to print a receipt. I do this by calling a print receipt function, which uses the #use statement to reassign printif statements to a pin on porta. I have a printer hooked up to this pin. I print the req info to the printer, do another #use statement to put control back to the hardware uart and continue.

As I said this works fine on my 16f877, on many projects. On my 18F452 I can use 21 printf statements and all is fine, if I use 22 or more, my hardare uart doesn't function, from the start. I don't even call the print receipt function once???


Any clues without me posting the code (huge!)? I use pch 3.156.

thanks
_________________
This is the last code change until its ready....
rwyoung



Joined: 12 Nov 2003
Posts: 563
Location: Lawrence, KS USA

View user's profile Send private message Send e-mail

PostPosted: Mon May 23, 2005 7:25 am     Reply with quote

Have you tried using named streams instead of fooling around with extra #use statements?
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
burnsy



Joined: 18 Oct 2003
Posts: 35
Location: Brisbane, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue May 24, 2005 6:51 am     Reply with quote

After your suggestion, I tried streams. I like that idea better (than the multiple #use statements), but didn't change anything. Add one too many printf statements and no comms.. damn it..

I was also able to crash comms by removing some printf statements. ??

thanks for your suggestions
_________________
This is the last code change until its ready....
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Tue May 24, 2005 11:04 am     Reply with quote

Maybe its not the number of printf's causing the problem but a particular one.
burnsy



Joined: 18 Oct 2003
Posts: 35
Location: Brisbane, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Wed May 25, 2005 2:37 am     Reply with quote

Turned out to be the compiler Mark. 3.209 works perfectly Smile

now is there anysuggestions about I2C (grin)...
_________________
This is the last code change until its ready....
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