If I use getc() my program works but the timed_getc() always return the 0xff that I have defined. I got this example right out of the help files. I am already using the interrupt driven uart for another function and this is a simple 1 byte receive from pin_a5. I get the data once a second. I don't want to get hung-up with getc(). I've tried longer delays but it always times out.
timed_getc works if I put it in-line and do not call it as a subroutine.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu Jul 01, 2004 1:09 pm
I don't see that you're using "streams" to identify the two different
USARTS (soft and hard) that you have in your program.
So, you must be using the method where all code associated with
one USART is placed after the #use rs232() statement for that USART.
I suspect that you were using an #include statement to include the
timed_getc() function in your program. Where was that #include
statement placed ? If it was placed in your program just after the
line for the hardware USART, then the compiler would generate code
for the hardware USART for getc() in that function. (Instead of for
the soft USART, as you desired).
When you placed the timed_getc() function inline, I assume you copied
it from the file and pasted it into your program. You probably put
it after the #use statement for the soft USART. That's why it worked.
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