Problem with 16f84 PortA.1

Status
Not open for further replies.

gash_2

Newbie level 2
Joined
Mar 27, 2009
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,294
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:

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
 

Can you post schematic?
 

This is the schematic :

 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…