Strange problem on PIC16F610

Moderator: Benj

Post Reply
Clive44
Posts: 52
Joined: Tue Oct 18, 2011 12:35 pm
Has thanked: 3 times
Contact:

Strange problem on PIC16F610

Post by Clive44 »

Hi
Flowcode V5.1
Very simple program - if logic 1 seen on PIC16F610 Port C.3 then do something, if logic 0 do something-else.
Simulated - all OK.
Didn't work on the hardware!!
Everything looks fine on an oscilloscope but whatever way I wrote the code in Flowcode the PIC always acted as if it was seeing a logic zero.
Tried input as 'single bit'
Tried input as 'entire port with masking'.
Tried input entire port then did a calulation 'result = result AND 8'.
After many frustrating hours I linked the track to RC.3 (pin 7 on the PIC) to the adjacent pin RC.4.
Changed any reference in code from RC.3 to RC.4 and it works!!

Tried it on 6 different PCBs with consistent results. It is like RC.3 cannot be used as an input?????????

Clive

Clive44
Posts: 52
Joined: Tue Oct 18, 2011 12:35 pm
Has thanked: 3 times
Contact:

Re: Strange problem on PIC16F610

Post by Clive44 »

Just tried the original code on a PIC16F616 (same as PIC16F610 but 2K of RAM instead of 1K)
Works fine using RC.3 as an input.

Definitely points to a problem with the Flowcode V5.1 implementation on the PIC16F610. Sorry to be the bearer of bad news!!!

Clive

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem on PIC16F610

Post by Benj »

Hi Clive,

Please can you try adding the following C command into a C icon at the very start of your program and let me know how you get on.

ansel = 0x00;

If this works then I will update the FCD file to replicate the fix here.

Clive44
Posts: 52
Joined: Tue Oct 18, 2011 12:35 pm
Has thanked: 3 times
Contact:

Re: Strange problem on PIC16F610

Post by Clive44 »

Hi Ben

Yes that's fixed it. All working OK now.

Thanks

Clive

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: Strange problem on PIC16F610

Post by Benj »

Cheers Clive.

I will update the FCD file for v5 and this fix should be included in the next update release.

Post Reply