Migration Issue with ANSEL bit

Moderator: Benj

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

Postby spryderweb » Tue Jul 10, 2018 6:51 pm

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.

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7851
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2204 times
Been thanked: 3122 times
Contact:

Re: Migration Issue with ANSEL bit

Postby medelec35 » Tue Jul 10, 2018 9:32 pm

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.
These users thanked the author medelec35 for the post:
spryderweb (Tue Jul 10, 2018 10:07 pm)
Rating: 5.88%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Postby spryderweb » Tue Jul 10, 2018 10:06 pm

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 12 times

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7851
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2204 times
Been thanked: 3122 times
Contact:

Re: Migration Issue with ANSEL bit

Postby medelec35 » Tue Jul 10, 2018 10:39 pm

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?
These users thanked the author medelec35 for the post (total 2):
spryderweb (Tue Jul 10, 2018 10:53 pm) • Benj (Thu Jul 12, 2018 11:17 am)
Rating: 11.76%
 
Martin

If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

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

Postby spryderweb » Tue Jul 10, 2018 10:53 pm

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.
These users thanked the author spryderweb for the post:
Benj (Thu Jul 12, 2018 11:18 am)
Rating: 5.88%