Port B not working

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Port B not working

Post by howard123 »

Hi all

Writing of bits to any of the B port pins is not recognized. Writing to ports A or C is fine.

This is on my target hardware which is a PIC16F18855.

Any ideas?

Thanks
Howard
FC7.2.1.4

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: Port B not working

Post by Benj »

Hi Howard,

I've just tried this and it's working ok for me. Can you post a Flowcode project file that shows the problem and can you also post the contents of your compiler messages showing the errors so we can investigate.

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: Port B not working

Post by medelec35 »

Hi Howard,
Working for me as well.

Have you downloaded, copied and paste all files within zip file from this post?

Martin
Martin

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: Port B not working

Post by howard123 »

Hi Ben and Martin

I had installed those updates some time ago. There is no compiler error message.

I am using a PicKit 3 to target the device and this uses RB6 and RB7 for its communications. This works fine and later, with the programmer disconnected, RB7, RB6, RB5, RB4, RB3, RB2, RB1 and RB0 work only as outputs . They do not recognize an input.

I have attached my test

Thanks
Howard
Attachments
test1.fcfx
(6.87 KiB) Downloaded 226 times

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: Port B not working

Post by Benj »

Hello Howard,

The low voltage programming is enabled in your configuration settings. This will likely stop one of the PORTB pins from working as an input. I would highly recommend disabling this feature.

You have your oscillator set to external clock, is this the case on your circuit? You might instead want HFINTOSC to try the internal clock without any external requirements?

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: Port B not working

Post by howard123 »

Hi Ben and thanks for the speedy response once again.

Unfortunately that did not work for me. My apologies as my example was more illustrative than functional so here is something more robust.

I have used a byte wide input rather than bits and compared Port A to Port B.

In test1 raising any Port B pin to high has no effect on the RC3 output - it remains low.
In test2 raising any Port A pin to high causes RC3 to go high.

Regards
Howard
Attachments
test2.fcfx
(7.23 KiB) Downloaded 223 times
test1.fcfx
(7.23 KiB) Downloaded 221 times

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: Port B not working

Post by Benj »

Hi Howard,

I believe the problem is the definition file which was leaving PortB in analogue mode which basically kills digital inputs. It's been fixed in the definition files I have here but maybe I have not released these yet. I'll try and add a new zip file to the forum updates this week.

This file should hopefully solve the issue for you. Simply copy to your "Flowcode 7\FCD\PIC" folder and restart Flowcode.
16F18855.fcdx
(27.53 KiB) Downloaded 219 times
Let us know how you get on.

howard123
Posts: 75
Joined: Thu May 24, 2012 1:15 pm
Location: Cape Town
Has thanked: 30 times
Been thanked: 28 times
Contact:

Re: Port B not working

Post by howard123 »

Hi Ben
Many thanks this has worked :D

Post Reply