Searching \ for '[pic]: port buffer' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=port
Search entire site for: 'port buffer'.

Exact match. Not showing close matches.
PICList Thread
'[pic]: port buffer'
2003\08\06@154916 by John De Villiers

flavicon
face
16F628 with uart active

I need to buffer writes to portB. Normal procedure is to write all
values to a buffer and then move the entire buffer to the port.

The port in question also services the uart ( send and receive )

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 )?

John

--
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

2003\08\06@161515 by

picon face
If you check the diagrams on page
36 and 37 of DS40300B (the 16F62X
data sheet), you'll see that there is
a multiplexer (near the top) controlled
by the "PORT/PERIPHERIAL" signal, that
effectivily disables the output from the
"Data Latch".

So it would be "safe" to write any
value to the PORTB register (the Data Latch),
as far as I can see.

Jan-Erik.

John De Villiers  wrote:

> 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 )?

--
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

2003\08\06@162346 by Jason Harper

picon face
John wrote:
> I need to buffer writes to portB. Normal procedure is to write all
> values to a buffer and then move the entire buffer to the port.
>
> The port in question also services the uart ( send and receive )
>
> 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 )?

EVERY write to an I/O port (including BSF and BCF) actually writes all 8
bits.  If the problem you fear actually existed, then you would not be able
to safely use any of the other pins on the same port while the UART is
active.

The pin schematics in the datasheet will confirm that the UART completely
bypasses the port register while it is active.
       Jason Harper

--
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

2003\08\06@181847 by Quentin

flavicon
face
>
>
>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

2003\08\06@183129 by
picon face
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}

--
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

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...