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

about reading from table and interrupts

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







about reading from table and interrupts
PostPosted: Thu Apr 22, 2004 5:44 am     Reply with quote

I have the follow question
When we use in buidt function in compiler like printf("string") in fact
becames read from table. Whether then the compiler disable interrupts or not and if it's not then do you have to manualy do this.
Sory for my bad english :-).
beginner
Guest







PostPosted: Thu Apr 22, 2004 5:53 am     Reply with quote

Continue...
otherwise when reading from a masive that is declarete in ROM
do you must to disable interrupt.
rwyoung



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

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

PostPosted: Thu Apr 22, 2004 8:03 am     Reply with quote

Let me try to restate your question:

You have a printf() statements with constant character strings. These produce code that is a look-up table of bytes to be sent through the serial port.

Are you asking if you should disable interrupts so that the stream is continuous?


Most people on this forum would ask you what PIC you are using, if you are using its hardware UART and what compiler version you are using. They may also ask to see you code.

Here is my answer, not knowing very much about your application:

1) Use a PIC with a built-in UART (PIC16F877a for example).

2) Use the RX and TX interrupts to receive and send data. Look at EX_STISR.C and EX_SISR.C example programs.

3) Don't use printf("abcdef") but instead use printf(myputc,"abcdef") and write a function myputc() that pushes your data into the transmit buffer to take advantage of the TX interrupt. Or don't use printf() at all and just make your own table and myputc().

4) Try and break your large strings up or define a large enough software FIFO (see EX_STISR.C) so that you can load up the transmit buffer once and let it send in the background.

The PIC16 (and probably PIC18) chips only allow interrupts to nest. If your program has several interrupt sources, try VERY HARD to do as little as possible inside the interrupt service routines so that you minimize the chance of missing an interrupt.
_________________
Rob Young
The Screw-Up Fairy may just visit you but he has crashed on my couch for the last month!
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