gash_2
Newbie level 2
Hi all,
I am trying to design a circuit which tests a relay. To do this, i arranged the circuit in this manner;
Pic (RB3) -------Relay-----Resistor-----Pic (RA1) (RA1 and RB3 in on same pic16f84a)
So, if i energize the relay and set RB3 then i suppose to read logic 1 from Ra1. But pic always reads zero from RA1. I know that relay is working and RB3 is at 5VDC. And it seems that when i energize the circuit RA1 and VSS is shorted somehow (checked it with multimeter) but they are not shorted when the power is off. Other pins of pic are connected the same(RB2->Relay->Res->RA0 for instance), they are working. So please help me understand this issue.
Code i am using:
By the way, sorry for bad english
I am trying to design a circuit which tests a relay. To do this, i arranged the circuit in this manner;
Pic (RB3) -------Relay-----Resistor-----Pic (RA1) (RA1 and RB3 in on same pic16f84a)
So, if i energize the relay and set RB3 then i suppose to read logic 1 from Ra1. But pic always reads zero from RA1. I know that relay is working and RB3 is at 5VDC. And it seems that when i energize the circuit RA1 and VSS is shorted somehow (checked it with multimeter) but they are not shorted when the power is off. Other pins of pic are connected the same(RB2->Relay->Res->RA0 for instance), they are working. So please help me understand this issue.
Code i am using:
Code:
org 0000h
CLRF INTCON
CLRF PCLATH
CLRF PORTA
CLRF PORTB
BSF STATUS,5
MOVLW B'00011111'
MOVWF TRISA
MOVLW B'00100000'
MOVWF TRISB
BCF STATUS,5
...
BSF PORTB,3 ; PORTB.3 = 1
CALL DELAY25 ; 250 delay
BTFSS PORTA,1
GOTO RELAYFAULT
...
By the way, sorry for bad english