Single bit to port A4 on 16F628A - HOW
Posted: Fri Oct 09, 2009 2:02 pm
Hi,
Can anyone suggest how I output a hi or lo signal to port A4 on a pic16F628A please?
I have attached an LED to this port and need the code to switch it on or off at various points in the program........in fact it's not an led but an npn transistor base drive but the principal is the same.
I have tried the program on Bit A7 and it works no problem but the PCB's are made now and I need to use A4
I am currently using A0 as input from a switch or trigger signal.....this works fine. A1 and A2 are direct LED drives which also work fine. A3 is the Anode drive via transistor for a 7 seg display and that is fine also. I just can't get A4 to be an output. I have tried another chip which gives the same result so am ruling damage out. I have tried masking, not masking on inputs and outputs etc and nothing lights this led. I have it connected for active high via a 220R resistor to ground. If I connect to +V to A4 (reversed of course), it lights continuously which tells me the port bit is not being toggled within the program - it's permanently LO.
I have attached my code if anyone would like to see what this dimwit has done......or missed.
Thanks in advance
Can anyone suggest how I output a hi or lo signal to port A4 on a pic16F628A please?
I have attached an LED to this port and need the code to switch it on or off at various points in the program........in fact it's not an led but an npn transistor base drive but the principal is the same.
I have tried the program on Bit A7 and it works no problem but the PCB's are made now and I need to use A4
I am currently using A0 as input from a switch or trigger signal.....this works fine. A1 and A2 are direct LED drives which also work fine. A3 is the Anode drive via transistor for a 7 seg display and that is fine also. I just can't get A4 to be an output. I have tried another chip which gives the same result so am ruling damage out. I have tried masking, not masking on inputs and outputs etc and nothing lights this led. I have it connected for active high via a 220R resistor to ground. If I connect to +V to A4 (reversed of course), it lights continuously which tells me the port bit is not being toggled within the program - it's permanently LO.
I have attached my code if anyone would like to see what this dimwit has done......or missed.
Thanks in advance