Page 1 of 1
Port B not working
Posted: Mon Aug 14, 2017 11:20 am
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
Re: Port B not working
Posted: Mon Aug 14, 2017 12:03 pm
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.
Re: Port B not working
Posted: Mon Aug 14, 2017 12:16 pm
by medelec35
Hi Howard,
Working for me as well.
Have you downloaded, copied and paste all files within zip file from
this post?
Martin
Re: Port B not working
Posted: Mon Aug 14, 2017 12:56 pm
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
Re: Port B not working
Posted: Mon Aug 14, 2017 3:14 pm
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?
Re: Port B not working
Posted: Thu Aug 17, 2017 10:50 am
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
Re: Port B not working
Posted: Thu Aug 17, 2017 12:23 pm
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.
Let us know how you get on.
Re: Port B not working
Posted: Thu Aug 17, 2017 3:23 pm
by howard123
Hi Ben
Many thanks this has worked
