Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > General Electronics Chat


General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion?

Reply
 
LinkBack Thread Tools Display Modes
Old 6th February 2005, 11:59 AM   (permalink)
Default PIC16F84A litle stupid problem

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
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline  
Old 6th February 2005, 12:12 PM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 6th February 2005, 12:48 PM   (permalink)
Default

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
__________________
Ibrahim Kamal
check my electronics and robotics page: http://www.ikalogic.com/
ikalogic is offline  
Old 6th February 2005, 04:28 PM   (permalink)
Default

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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 03:53 PM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker