set the B0 after the power reset

For C and ASSEMBLY users to post questions and code snippets for programming in C and ASSEMBLY. And for any other C or ASM course related questions.

Moderators: Benj, Mods

Post Reply
saravana_3
Posts: 61
Joined: Thu Dec 20, 2007 4:23 pm
Location: singapore
Contact:

set the B0 after the power reset

Post by saravana_3 »

Hi friends,
I am using the pic16f84 for programming, I need to get high output at the B0 after the power reset, any one has the idea, how to do it,
thanks
saran
saran

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Post by Benj »

Hello Saran

The best you can do is to do the following at the start of your program.

Write to the TrisB register to configure bit 0 as an output.

trisb = 0x00;

Write to the PortB register to output a 1 to the pin.

portb = 0x01;

You cannot have the pin set to 1 as standard on power on because all I/O pins are configured to be inputs as standard.

Post Reply