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

18f6720 and two UART

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



Joined: 05 Feb 2007
Posts: 1

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

18f6720 and two UART
PostPosted: Mon Feb 05, 2007 3:40 pm     Reply with quote

Hello,
I have some problems about 18f6720 UARTs. I want to use UART with interrupts. But I can't. Ican send datas but i can't get datas.

Are there anyone who wants help?

Thanks
Ttelmah
Guest







PostPosted: Tue Feb 06, 2007 5:16 am     Reply with quote

The second interrupt, is int_rda2.
Just code a second routine, just like the normal int_rda routine, but with different names for the buffers etc., ung this name, and enable this interrupt.

Best Wishes
meereck



Joined: 09 Nov 2006
Posts: 173

View user's profile Send private message

PostPosted: Tue Feb 06, 2007 6:07 am     Reply with quote

Hello, I have slightly similar question : I am thinking about making an interface for RS485. A PIC18 with 2 RS485 lines connected to 2 MAX485. Do I need a PIC with 2 HW USART ports or mere 1 USART is enough (and the second one will be SW?)?
I would like to build a device which will be a mediator between other 2 RS485 devices (a data flows : dev1<>my_device<>dev2 (i.e 2 different RS485 lines)). Hope I explained it well.
thanks in advance,
BR M.
Ttelmah
Guest







PostPosted: Tue Feb 06, 2007 9:34 am     Reply with quote

You are always better having a separate hardware UART. The problems wth the software UART, are that nothing else must really occur during either transmission or reception of a character, there is no buffering, and you must ensure that the code checks the incoming line wthin less than half a bit time of the character beginning.
Another alternative, is an external SPI UART.

Best Wishes
Donlaser



Joined: 17 Sep 2005
Posts: 12
Location: Trenque Lauquen, Argentina

View user's profile Send private message MSN Messenger

PostPosted: Tue Feb 06, 2007 11:50 am     Reply with quote

Ttelmah wrote:
you must ensure that the code checks the incoming line wthin less than half a bit time of the character beginning.
Another alternative, is an external SPI UART.

Best Wishes



As Ttelmah say, you need check incoming line wthin less than half a bit time of the character beginning.

When need 2 UARTS, i use interrupt driven SW UART to do this in efficient manner.

I use incoming line in INT/RB0 in a pic 16f628a, and trigger a getc() using the interrupt.

Its works for me.

Hernan Guerrero.
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