Do you have JP5 connected?
Without JP5 connected you will get strange results.
With JP5 connected A3 will always be high, then when the button is pressed A3 will go low.
Do you have JP5 connected?
Without JP5 connected you will get strange results.
With JP5 connected A3 will always be high, then when the button is pressed A3 will go low.
Dave
Always wear safety glasses while programming.
I don't know what MCU chip you are using but if it has and A/D capability PORT A starts up in Analog mode. If this is the case you can fix the problem by:
1. Avoiding PORTA or
2. Looking up the A/D info in the MCU spec. This is often in the ADCON1 register and PORTA made digital by putting something like
ADCON1 = %00001111
near the beginning of your code. Good luck
Regards Bill Legge
Yes correct the MCU is 16F690.
On the JP5 it is nothing there, just two "soldering holes".
I don't have a "config set"? The posted code is completely everything i have wrote.
Maybe i should try to use some other extern components on a breadboard.
This is what I will bet is happening.
If you have not changed the *.inc file (configs) MCLR is on.
When A3 = 0 causes the LED to go high, then when the switch is pressed A3 goes to a hard LOW resetting the PIC. Something like that.
Yup, move over to a bread board to get started.
Dave
Always wear safety glasses while programming.
Nah i haven't change anything in the *.inc files.
I will try with some resistors, switch and led on a breadboard, will get back here when i have tried.
But so far your eye can see, it isn't anything wrong with the code?
This is my first real program to PBP, but you get my final point what the program should do right?
Led = off and when switch is pressed led = on, when switch released led = off.
Bookmarks