PIC16F84A litle stupid problem

Status
Not open for further replies.

ikalogic

Member
hi, i dont know to use the pins RA4 and RB0 on the pic16f84a, those are special finction pins, but i want ot use them normally like other i/o pins...

i used to declare then as inputs and outputs int he ASM like this:

movlw 00000000;

and

movwf PORTB;

but it didin't work, meaning i couldn't send any outputs... was this an error i made somewhere else, meaning the previous piece of code i allreight OR there is something special i need to do (declare or something) to enable the RB0 and RA4


i am using the Microchips' MPLAB IDE...



thx
 
The only 'difficult' pin is RA4, that's because it's an open-collector (or open-drain) output. This means it can only sink current and not source it.

If you want to use RA4 as an output, this usually mean you have to fit a pull-up resistor to make it work.

You also have to set the I/O pins as inputs or outputs by writing to the TRIS registers, are you doing that?. The code you posted is too little to give any information about what you might be doing wrong.
 
okay, would this eventualy work?

status equ 03h ;Address of the STATUS register
portb equ 06h

bsf status,5 ;

bcf portb,0
bsf portb,1
bsf portb,2
bcf portb,3
bcf portb,4
bcf portb,5
bcf portb,6
bcf portb,7

bcf status,5;


then here i send normal outputs to the RB0 without additional setups or configuration?? , just < bsf portb,0 > ??

thx
 
Why define your own register names?, they are ready done in the MicroChip include files.

Try looking at my tutorials for examples of how to do what you want.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…