![]() | ![]() | ![]() |
| | |||||||
| 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? |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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. | |
| |
| | (permalink) |
| 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 | |
| |
| | (permalink) |
| 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. | |
| |