Hi, as the 877 only has one USART I need to share it. I need to have it recieving data from my GPS feed and sending data to a Serial LCD display, these do not need to communicate at the same time but I will need to isolate the GPS while writing to the LCD as I could corrupt the programable memory in the GPS.
Any ideas on how I can do this?
Thanks,
JP.
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
At 11:04 10/29/2001 +0000, JP wrote:
>Hi, as the 877 only has one USART I need to share it. I need to have it
>recieving data from my GPS feed and sending data to a Serial LCD display,
>these do not need to communicate at the same time but I will need to
>isolate the GPS while writing to the LCD as I could corrupt the
>programable memory in the GPS.
This has been here a few days ago... you can use a number of options,
depending on what hardware you have around. If you use separate line
drivers, you can use two gates for the send lines and open always only one.
Or you can use CMOS switches. Or you can use some kind of transistor logic
to hold the inactive tx line -- which may also allow you to go with only
one line driver. Best choice depends on your preferences, what line driver
you use and the rest of the circuit...
ge
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
On Mon, Oct 29, 2001 at 11:04:40AM -0000, JP wrote:
> Hi, as the 877 only has one USART I need to share it. I need to have it
> recieving data from my GPS feed and sending data to a Serial LCD display,
> these do not need to communicate at the same time but I will need to isolate
> the GPS while writing to the LCD as I could corrupt the programable memory
> in the GPS.
>
> Any ideas on how I can do this?
I do have one question: Are both units operating at the same bit rate?
The first idea that came to mind is to simply use a 74HC08 AND gate to
gate the USART signal. For example with transmitting take Tx and tie it
to the inputs of two AND gates. Then take two other PIC I/O pins and tie them
to the other gate inputs. The two PIC pins can then gate Tx on by setting the
I/O pin high and block Tx by setting it low.
Hope this helps,
BAJ
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> Hi, as the 877 only has one USART I need to share it. I need to have
> it recieving data from my GPS feed and sending data to a Serial LCD
> display, these do not need to communicate at the same time but I will
> need to isolate the GPS while writing to the LCD as I could corrupt
> the programable memory in the GPS.
Are you ONLY receiving from the GPS, and ONLY transmitting to the LCD? If
so you have a no-brainer, just connect TxD to the LCD and RxD to the GPS,
assuming both can operate at the same bit rate. Just a thought.
Dale
--
Hallo, this is Linus Torvalds and I pronounce Linux as Leennuks.
Hallo, this is Bill Gates and I pronounce 'crap' as 'Windows'.
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
I believe you would want to use an OR gate instead of an AND gate,
as you want the output of the gate to be Marking HIGH when it
is disabled. I posted a GIF of this setup on 10/23/01. The
control signal is LOW to enable, HIGH to disable (force Marking
High on output).
If you want to get really cheap, or you want to save board space,
or simply don't want to use another IC, you can make an OR gate
from two diodes and a resistor. Connect the cathodes together to
form the output. Add a pullDOWN resistor (1k works well) to
GROUND from the joined cathodes. The two anodes become the OR
gate's inputs. Whenever either input is HIGH, the output will
go high. Thus, if the "control" input is held high, the
outputs is forced HIGH, which is the Marking state. If the
"control" input is held LOW, then the output follows the
state of the other input, which is the "data" input.
Two of these OR gates can be connected so that the two
data lines are both connected to the TX line. Each control
line goes to its own PIC i/o pin. The two outputs will
follow the TX line if their respective control line is
LOW. Otherwise they will be Marking HIGH.
> On Mon, Oct 29, 2001 at 11:04:40AM -0000, JP wrote:
> > Hi, as the 877 only has one USART I need to share it. I need to have it
> > recieving data from my GPS feed and sending data to a Serial LCD
display,
> > these do not need to communicate at the same time but I will need to
isolate
> > the GPS while writing to the LCD as I could corrupt the programable
memory
> > in the GPS.
> >
> > Any ideas on how I can do this?
>
> I do have one question: Are both units operating at the same bit rate?
>
> The first idea that came to mind is to simply use a 74HC08 AND gate to
> gate the USART signal. For example with transmitting take Tx and tie it
> to the inputs of two AND gates. Then take two other PIC I/O pins and tie
them
> to the other gate inputs. The two PIC pins can then gate Tx on by setting
the {Quote hidden}
> I/O pin high and block Tx by setting it low.
>
> Hope this helps,
>
> BAJ
>
> --
> http://www.piclist.com hint: PICList Posts must start with ONE topic:
> [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
>
>
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
On Mon, Oct 29, 2001 at 09:43:44AM -0500, Thomas McGahee wrote:
> I believe you would want to use an OR gate instead of an AND gate,
> as you want the output of the gate to be Marking HIGH when it
> is disabled.
You know what's sad Fr. Thom? I'd written the message with it reversed (OR
instead of AND) and then I though the myself "Whoops! I got it backwards."
and changed it.
Just a reminder to go with one's first thought because it's usually right.
BAJ
-- http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
> suppose I could do that but it would mean calculating the hedating to
> waypoint calculations and distance to waypoint calculations on the PIC.
Oh... I must have missed something in your original post, I thought you
were just receiving data from the GPS and sending it to the LCD. So you
really need to send *and* receive to one or both devices? Where would the
distance and heading calculations be happening now?
> > On Mon, 29 Oct 2001, JP wrote:
> >
> > > Hi, as the 877 only has one USART I need to share it. I need to have
> > > it recieving data from my GPS feed and sending data to a Serial LCD
> > > display, these do not need to communicate at the same time but I will
> > > need to isolate the GPS while writing to the LCD as I could corrupt
> > > the programable memory in the GPS.
> >
> > Are you ONLY receiving from the GPS, and ONLY transmitting to the LCD? If
> > so you have a no-brainer, just connect TxD to the LCD and RxD to the GPS,
> > assuming both can operate at the same bit rate. Just a thought.
Sorry I was not too clear.
Send and recieve from the GPS and send only to the LCD. The calc are done
within the GPS unit. I have decided to use the solution posted by Doug Wood
as it seems the best way around the problem.
I have not seen all the previous posts an maybe someone has already
suggested the following (please accept my apology if this is a repeat of
someone's previous post).
I would use the onboard UART to receive NMEA string data from the GPS head
(you can set your code to detect only required strings ($RMC etc).
The TX port of the UART can be used for configuring the GPS and sending it
initial coordinates for quicker TTF. (Time to Fix)
Then I would bit-bash any of the other pins on the micro for controlling the
LCD.
> I have not seen all the previous posts an maybe someone has already
> suggested the following (please accept my apology if this is a repeat of
> someone's previous post).
>
> I would use the onboard UART to receive NMEA string data from the GPS head
> (you can set your code to detect only required strings ($RMC etc).
> The TX port of the UART can be used for configuring the GPS and sending it
> initial coordinates for quicker TTF. (Time to Fix)
>
> Then I would bit-bash any of the other pins on the micro for controlling
the {Quote hidden}