On Thu, 13 Nov 1997 08:46:52 +1100 Patrick Hanson
writes:
>A couple of quick questions to the PIC Guru's on the list.
>
>(1) Is it possible to operate 2 PIC16C84's on the same pcb from
>one
>crystal ? (XT mode). The data sheet shows how to use an external clock
>input
>but I am uncertain how to obtain this clock from the other PIC without
>loading the oscillator circuit.
Yes, this works, though not recommended by Microchip. One PIC chip has
the crystal connected the usual way and does the oscillator function.
The X2 pin of this chip connects to the X1 pin of the other PIC. Leave
the X2 pin on the other PIC open. Locate the PICs close together on the
board so the oscillator signal doesn't have to travel a long way. Also
you may need to reduce the capacitor connected from X2 on the first PIC
to ground to compensate for the extra capacitance from the second PIC and
the wiring.
It may work a little better to couple the signal through a relatively
large (0.01 uF) capacitor between the PICs. This lets the second PIC
bias itself to its proper DC threshold. If both PICs are the same type
and supply voltage (and lot number most likely), it shouldn't be
necessary.
>
I am having difficulty in
>enabling
>the RS485 driver from a standard PC RS232 port while transmitting and
>then
>disabling the driver and still be able to listen for a reply on the
>PC port.
>
Build a box which has a RS-232 transceiver (2RX, 1TX) and a RS-485
transceiver. Use the RTS line from the PC to enable (or maybe disable)
the RS-485 driver. Most likely this exists already in pre-built form.
The RTS line is controlled by one of the bits in the 16550 chip so the PC
can turn the driver on and off. I don't think there's any hooks though
to coordinate the RTS control with the actual sending of data though, so
it may get a little dicey synchronizing the software with the hardware
buffers. It may be best to not use them.