Try CMCON=7 instead of 1.
Do you have a pull-up of around 470 from MCLR to VDD?
Try CMCON=7 instead of 1.
Do you have a pull-up of around 470 from MCLR to VDD?
Dave
Always wear safety glasses while programming.
Dave,
Thanks for the input.
When I said that the lower 3 bits of CMCON were set = 1
I SHOULD have said that Each of the lower 3 bits is set to 1
which makes CMCON = %00000111 which = 7.
I do have a 1K pullup to +5 on MCLR.
I have also discovered that if I set the config bits for the 16F877A
to turn the Brownout reset = OFF the code I have been running in
the 16F877 now also runs perfectly in the 16F877A.
What is it about pulling PortA.7 to ground with a pushbutton switch that
could lead to a system reset ??? And why would turning the brownout
reset OFF correct that problem ???
Thanks,
Dan
Sounds like a power supply problem or maybe something causing a short when the button is pushed.
The data sheet states when VDD drops to 4V a you have a brown-out.
Are both VDDs powered? Check the voltage on VDD when the button is pushed.
Two points to clarify.
Why the .1 cap to ground and not a pull-up of say 10k?
PORTA.7??? pin 7 is PORTA.5.
Dave
Always wear safety glasses while programming.
Dave,
Sorry about the mistakes in my typing . . .
I have TRIED a .1 cap to ground on PortA.5 because some comments in this thread indicated that might be of benefit. And it sort of makes sense as a method for smoothing out the switch bounce noise generated by a push button switch.
And there IS a 1K pullup on PortA.5.
It was my confusion that typed PortA.7 in the previous text.
I SHOULD have typed PortA.5 and got that mixed up with the pin number which resulted in my typing PortA.7.
This whole thing is about PortA.5 which is also Pin 7.
I do have +5 to both VDD pins and the 5 volt source is a 150 watt switching supply.
I have had a friend of mine look at VDD and Master Clear with his scope and both of these are steady as a rock when the push button is pressed and the whole thing RESETS.
Pressing the pushbutton to pull PortA.5 to ground does create a little noise from the switch bounce but I cannot see that any amount of noise on an input should result in a reset ??? Do you think ??
Thanks again,
Dan
I assume this is all on a test bench. I have had noise problems with switches when the device in the field next to a plasma cnc. Switch in question would start the torch.
Tell us a little more about the project along with the schematic.
Dave
Always wear safety glasses while programming.
to answer the original question What is the main difference Bet. 16f877 vs 16f877A
The answer is 1588F03![]()
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks