Page 1 of 1

Migration Issue with ANSEL bit

Posted: Tue Jul 10, 2018 6:51 pm
by spryderweb
I am currently migrating from a 16f876a to a 16f886 and having some issues. The biggest seems to be a difference in the ANSEL bits. I thought it would be just be configuring the new chip and be done.
To start my program has been running great on the 876a but does not on the 886. The migration documents said that the ANSEL bits have to be set on the 886. I guess on the 876a they were automatically set? I am only using AN0 and AN1. Any idea how to do this in Flowcode? Currently I am reading two potentiometer values and using them to adjust a PWM output. Any help would be much appreciated.

Re: Migration Issue with ANSEL bit

Posted: Tue Jul 10, 2018 9:32 pm
by medelec35
Hi spryderweb,
Flowcode will take care of the ANSEL bits automatically.
There must be some other issue you with your flowchart.
If you post it I will look at it for you.

Re: Migration Issue with ANSEL bit

Posted: Tue Jul 10, 2018 10:06 pm
by spryderweb
Great. Thanks, that is what I thought. I have attached the program. Would love for you to take a look. It may be how I am configuring the chip but I can't find any info on that.
Thanks again for the help.

Re: Migration Issue with ANSEL bit

Posted: Tue Jul 10, 2018 10:39 pm
by medelec35
No problem.
I have taken a look at your flowchart.
You have left watchdog timer enabled within configuration settings.
See if hardware works with it disabled.
Also you have MCLR enabled, is the pin tied up via a pull-up resistor to Vcc?

Re: Migration Issue with ANSEL bit

Posted: Tue Jul 10, 2018 10:53 pm
by spryderweb
BINGO!
I have tried so many combinations of the config! Must have missed that one. I do have the MCLR pulled high.

Thanks so much. Appreciate the help.