I thought I might have burnt out my PIC so I started trying very basic commands to test it out. Just output a voltage high on one pin when there's a voltage high on the input pin. This is the code I used:
DEFINE OSC 8
TRISA.1 = 1
TRISA.2 = 0
LOOP:
IF PORTA.1 = 1 THEN HIGH PORTA.2
GOTO LOOP
END
I used a VDD of 5V and got an output of 5V at A.2 but sometimes it will suddenly drop to 0 volts without me adjusting anything. I remove the pic from the circuit and then put it straight back in and the output is at 5V again. Sometimes the voltage stays for a while sometimes it goes away rapidly. Does it sound like my PIC might be faulty? or is there a problem in my code. Also if the PIC is outputing a high and I remove the high input I would expect the output to drop as well, but it doesn't. Do I need to include a second IF, THEN statement to achieve this result?
Bookmarks