Receiving and Transmitting over RS232 using interupts
Posted: Thu May 13, 2004 1:11 pm
Hi All,
I am using the standard C commands from the CCS complier to hand my RS232 comms. I am using an RDA_ISR routine to handle incoming bytes and just a standard fputc(data) command to send it. Is there a better way? I see that some example here directly access the registers to perform the transmissions and receptions. Is this a more efficient way? How much more complicated is it? Is the effort required rewarded in an improvement in performance?
Any suggestions to pointers to sources of existing code would be greatly appreciated.
Thanks,
Jason.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu May 13, 2004 1:20 pm
Look at the CCS example files, EX_SISR.C and EX_STISR.C.
You can find these files here: c:\Program Files\Picc\Examples
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
Posted: Fri May 14, 2004 1:33 am
If your processor has an internal hardware UART, than the method you describe is efficient and only a few bytes of ROM can be saved by direct port access. The other examples you have seen probably have added functionality like RTS/CTS flow control, or even more likely are examples of doing serial commnications without a hardware UART.
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