Migration Issue with ANSEL bit

Moderator: Benj

Post Reply
spryderweb
Posts: 14
Joined: Tue Jul 22, 2008 6:25 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Migration Issue with ANSEL bit

Post 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.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Migration Issue with ANSEL bit

Post 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.
Martin

spryderweb
Posts: 14
Joined: Tue Jul 22, 2008 6:25 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Migration Issue with ANSEL bit

Post 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.
Attachments
wscode_LMA_ACJCR2.rev2.fcf
(198.54 KiB) Downloaded 211 times

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Migration Issue with ANSEL bit

Post 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?
Martin

spryderweb
Posts: 14
Joined: Tue Jul 22, 2008 6:25 am
Has thanked: 4 times
Been thanked: 2 times
Contact:

Re: Migration Issue with ANSEL bit

Post 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.

Post Reply