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

Interrupt Driven Two Communication Port

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



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

Interrupt Driven Two Communication Port
PostPosted: Mon Mar 01, 2004 8:47 pm     Reply with quote

Hi,

I have an application that will use two communication port for a PIC18F452 at 20MHz clock.

for an interrupt driven system I use #int_rda & #int_tbe for the PIC COM1 port --> this use for my RS485 Network and the COM2 port use the #int_ext2 for receiving commands from a PC Host Server. My problem really is how can I use #int_ext1 for an interrupt driven COM2 transmission?

I need your help on this? suggestions, comments and sample snippets will help with my project.

Thanx
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon Mar 01, 2004 9:18 pm     Reply with quote

You want to do a software based interupt driven transmition? You would be best off if you were to do transmition from within main for the software port. You can run the baud as fast as posiable to the PC to limit the time spent performing transmitions. Also start transmtions between packets on the 485 network.
ritchie



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

PostPosted: Mon Mar 01, 2004 9:45 pm     Reply with quote

Neutone wrote:
You would be best off if you were to do transmition from within main for the software port. You can run the baud as fast as posiable to the PC to limit the time spent performing transmitions. Also start transmtions between packets on the 485 network.


What do you mean by the statement above? Can you re-phrase it? Is it possible to use interrupt software-based transmission? If I am going to fprintf at higher baud rate will this helps with my application?

Need comments??

Thanx
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Mon Mar 01, 2004 10:14 pm     Reply with quote

While you are transmitting on a serial port you can not do any other task. That means you want to perform the transmition as quickly as posiable. If you make the transmition to the PC a timed task you can expect to have you best performance.
http://home.houston.rr.com/neutone/Flow.pdf
I'm just playin round with some web hosting space. Does that link work right?
ritchie



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

PostPosted: Mon Mar 01, 2004 10:58 pm     Reply with quote

Neutone wrote:
While you are transmitting on a serial port you can not do any other task. That means you want to perform the transmition as quickly as posiable. If you make the transmition to the PC a timed task you can expect to have you best performance.
http://home.houston.rr.com/neutone/Flow.pdf
I'm just playin round with some web hosting space. Does that link work right?


The link is OK.. I can view the flow chart...
Quote:

If you make the transmition to the PC a timed task you can expect to have you best performance.


How can this be done on a PIC18F452?
Ttelmah
Guest







Re: Interrupt Driven Two Communication Port
PostPosted: Tue Mar 02, 2004 4:58 am     Reply with quote

ritchie wrote:
Hi,

I have an application that will use two communication port for a PIC18F452 at 20MHz clock.

for an interrupt driven system I use #int_rda & #int_tbe for the PIC COM1 port --> this use for my RS485 Network and the COM2 port use the #int_ext2 for receiving commands from a PC Host Server. My problem really is how can I use #int_ext1 for an interrupt driven COM2 transmission?

I need your help on this? suggestions, comments and sample snippets will help with my project.

Thanx

Seriously, a lot depends on the rates involved, and the nature of the comms. The software UART, is fine, _provided_ you either use it at high speed, to send small amounts of data, with the system interrupts disabled while sending (if you look back through the archives, I posted a method of 'encasing' the actual putc, that disabled the interrupts on a per character basis, to keep responses for other things reasonable), or it is used at a very slow rate, and the interrupt handlers for everything else are kept really short. If there is a reasonable volume of data, and timings don't fall into one of these classes, then you should consider 'looking elsewhere' for a solution.
I have a serial interface board, that translates between a packet based RS485 network, and a simple serial link, using the 18F452, and I used the MAX3110, to solve exactly this problem. This is a really useful chip, giving a complete SPI driven UART, and the RS232 level translators/buffers all in one package. It has a number of characters of buffering (allowing me to run the serial at really high rates without problems), and a single pin 'interrupt' output, which can be connected to an interrupt input on the target chip.
You need to look at the timings of the streams involved.

Best Wishes
ritchie



Joined: 13 Sep 2003
Posts: 87

View user's profile Send private message

Re: Interrupt Driven Two Communication Port
PostPosted: Tue Mar 02, 2004 7:45 am     Reply with quote

Quote:
Seriously, a lot depends on the rates involved, and the nature of the comms. The software UART, is fine, _provided_ you either use it at high speed, to send small amounts of data, with the system interrupts disabled while sending


I got your point here...

Quote:
(if you look back through the archives, I posted a method of 'encasing' the actual putc, that disabled the interrupts on a per character basis, to keep responses for other things reasonable),


Can you provide me the link for the method you mention above? I'd love to have it and check if it applies for my project.

Quote:
or it is used at a very slow rate, and the interrupt handlers for everything else are kept really short. If there is a reasonable volume of data, and timings don't fall into one of these classes, then you should consider 'looking elsewhere' for a solution.


I agree with your statement...

Quote:
I have a serial interface board, that translates between a packet based RS485 network, and a simple serial link, using the 18F452, and I used the MAX3110, to solve exactly this problem.

This is a really useful chip, giving a complete SPI driven UART, and the RS232 level translators/buffers all in one package. It has a number of characters of buffering (allowing me to run the serial at really high rates without problems), and a single pin 'interrupt' output, which can be connected to an interrupt input on the target chip.
You need to look at the timings of the streams involved.


Would it be possible if you can share information on the statement. I'll appreciate for a sample snippet and a schematics to use this one.

Thank you.
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