I have a project I have started with the PIC10f320 micro controller. I want to just get a simple program running setting Pin1 and GP0 as an input (eventually I want to set it as an Analog input). The problem I am having is that the PIC appears to be driving the pin low, even though I have assigned it to an input. The input right now is being fed by a power supply through a 10k ohm resistor and a 1uf filter cap (tied between signal and Gnd). I checked and the maximum recommended input impedance to be 10kohm. When I apply the analog voltage directly to the PIC instead of through the resistor/cap I get the correct voltage and even the analog reads work correctly but it does pull significant current. This is why I believe I am just not setting the pin up correctly as an input but I have tried setting the PORTA, LATA, TRISA, ports all to the settings I believe they should be. Any help would be great.
PORTA = 0x01;
LATA = 0x00;
ANSELA = 0x01;
TRISA = 0x01;
WPUA = 0x00;
ADCON = 0b10000001;
while (1)
{
}
}
ralpok
Joined: 21 Dec 2005 Posts: 25
Posted: Wed Feb 20, 2013 10:45 am
I solved this problem myself but figured I would post the solution in case it helps anybody else. On this PIC the GP0 pin is shared as the ICSP data pin. I was using the CCSLoad to load and run the program but left the programmer plugged in while I was doing the "running". It appears that this was the issue and the programmer was pulling this PIN low during this operation.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum