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
Posted: Thu Apr 22, 2004 5:53 am
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
Posted: Thu Apr 22, 2004 8:03 am
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!
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