|
|
View previous topic :: View next topic |
Author |
Message |
Audi80
Joined: 07 Sep 2007 Posts: 41
|
Two uarts with two interrupts |
Posted: Wed Feb 06, 2008 4:14 am |
|
|
Hi there. Im using a PIC16F876A and i´m using two uarts with the following pins
#use rs232(baud=9600, rcv=PIN_A0, ERRORS , STREAM=CARDREADER)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS, STREAM=COMM)
One is for communications and the other one is for a RFID tag reader. The problem is i that i needed to interrupt the communications when a cardreader appear is that possible? Thanks... |
|
|
Ttelmah Guest
|
|
Posted: Wed Feb 06, 2008 6:58 am |
|
|
Simple answer. No.....
To 'interrupt', in the hardware sense, requires that you are connecting to a pin/device, that has this ability. You are not.
Now, if you reversed the streams, you could 'interrupt', since the hardware UART, does support this ability.
The second choice, would be to connect the software UART to pin B0, rather than A0. This pin supports interrupts, so you could potentially have your code called when the line drops at the start of transmission.
You don't say how fast your processor clock is. This will affect the time taken to reach an 'interrupt', and potentially whether characters may be lost when this happens.
Do a search here, where the ability to perform software serial, using hardware interrupts, has been discussed many times.
Best Wishes |
|
|
|
|
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
|