Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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.

Latest threads

New Articles From Microcontroller Tips

Back
Top