Questions About Port E in PIC16F877.

Started by farroos February 21, 2003
Hi everyone,

The schematic for the PIC16F877 shows that port E is represented
with only 3 pins. How can I write a specific value (example '001')to
these 3 pins (as output) ? Can I just give it the hex value "01"?
Also, when I copy the the value of the port to the W register whould
the rest of the register (4-7) get set to zeros?

Another question, may sound silly but i'm learning here. Is there an
easy way to set a single bit (to '1' or '0') in the W register or one
of the ports (without doing a logical AND operation on the whole
byte)? Thanks in Advance
Fares Al-Osaimi




>The schematic for the PIC16F877 shows that port E is represented
>with only 3 pins. How can I write a specific value (example '001')to
>these 3 pins (as output) ? Can I just give it the hex value "01"?
>Also, when I copy the the value of the port to the W register whould
>the rest of the register (4-7) get set to zeros?
>Another question, may sound silly but i'm learning here. Is there an
>easy way to set a single bit (to '1' or '0') in the W register or one
>of the ports (without doing a logical AND operation on the whole
>byte)?

Might I suggest you download the data sheet for the chip you are interested
in and then READ IT. Instructions for testing, setting and clearing
individual BITS are clearly explained in the Microchip documentation.


On Fri, 21 Feb 2003, farroos wrote:

>
> NOTE: The author of this message has chosen not to reveal an email
> address. You won't be able to reply to the author directly. >
> Hi every,
>
> The schematic for the PIC16F877 shows that port E is represented
> with only 3 pins. How can I write a specific value (example '001')to
> these 3 pins (as output) ? Can I just give it the hex value "01"?
> Also, when I copy the the value of the port to the W register whould
> the rest of the register (4-7) get set to zeros?
>
> Another question, may sound silly but i'm learning here. Is there an
> easy way to set a single bit (to '1' or '0') in the W register or one
> of the ports (without doing a logical AND operation on the whole
> byte)?

for the ports: set the port direction as output using the tris register
then bsf or bcf that port pin
for any register: bsf/bcf register, bit position

Why don't you try Jal first ?

Vasile