Note that :
1. The UART runs asyncronly in the "background"
and may very well change the "value" of the
rx/tx pins between your read-to-the-buffer and
the write-back of the buffer.
2. The bcf/bsf always read/write 8 bits to/from
the port, so what you are doing is actualy
the same thing, only using more instructions.
3. The design of the B port protects the rx/tx pins
when writing to the PORTB register anyway...
Jan-Erik.
Quentin wrote:
{Quote hidden}> >
> >
> >Will i inject the wrong values into the uart by writing to the port or
> >will the uart ignore my writes to the rx and tx bits (those bits will
> >always be zero in the buffer )?
> >
> Normally, I won't be bothered to find out if it's going to be a problem
> or not. If I am going to use two pins as TX/RX for Uart, I would know
> that, and then I would protect them from the start. So:
> (I don't say it's the best way)
> If I have to move a whole buffer onto PortB, and protect two bits, then
> I would do it bitwise, ie. read bit in buffer, set/clear bit in PortB
> and ignore the bits I want to protect.
> Q..
--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics