Problems reading discrete on PIC24FJ256GB106

An area to discuss 16-bit PIC specific problems and examples

Moderator: Benj

csouter
Posts: 21
Joined: Fri Jul 28, 2017 10:58 pm
Has thanked: 1 time
Been thanked: 2 times
Contact:

Problems reading discrete on PIC24FJ256GB106

Postby csouter » Wed Sep 06, 2017 1:44 pm

I am using a pic 24FJ256GB106, and am experiencing problems reading a discrete input on pin 23 (RB10). No matter what level the input is, I always ready the pin as a logic low. I have attached a simplified test project that exhibits the problem for your review. And suggestions are welcome. Thank you.
csouter
Attachments
DUAL.fcfx
(7.43 KiB) Downloaded 32 times

User avatar
LeighM
Matrix Staff
Posts: 1845
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 429 times
Been thanked: 612 times
Contact:

Re: Problems reading discrete on PIC24FJ256GB106

Postby LeighM » Thu Sep 07, 2017 1:59 pm

Does this code work OK with a different pin input then, such as RB11?
I've done a review of the FCD setup, such as turning off ADC for this pin, and all looks OK to me.
All other features for this pin seem to be off by default/reset, according to the datasheet,
but I've no experience with this family of devices, so that's as much as I can do to help.
These users thanked the author LeighM for the post:
csouter (Mon Feb 12, 2018 10:31 pm)
Rating: 5.56%
 

csouter
Posts: 21
Joined: Fri Jul 28, 2017 10:58 pm
Has thanked: 1 time
Been thanked: 2 times
Contact:

Re: Problems reading discrete on PIC24FJ256GB106

Postby csouter » Mon Feb 12, 2018 8:38 pm

This problem is persistent. I can write a program for MpLab, and it reads the B10 discrete without any problem. I try to read it in FlowCode, and I always get a logic low. I import the C code from my MpLab project, and it doesn't work (imported as a c code block). I want to use the FlowCode development environment, but I need to be able to get this pin to work. What is double puzzling is that I can read the other pins on the chip without any problem.

Thank you for any suggestions you may have.