CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

RJ5 pull up

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
JerryR



Joined: 07 Feb 2008
Posts: 192

View user's profile Send private message

RJ5 pull up
PostPosted: Thu Oct 01, 2026 10:53 am     Reply with quote

Hello Group:

PCWH v5.121

I am using a custom target board with a PIC18F86J60. I have nothing connected to RJ5 and have the RJPU set to TRUE using:

// Enable internal pull-ups for PORTJ
port_j_pullups(TRUE);

After executing this code,

In the debug window I see RJPU is set to "1" (CORRECT)

However, PORTJ reads XX00XXXX. (NOT CORRECT)

Electrically, pin RJ5 reads 0.07 volts.

With RJPU set, shouldn't I see RJ5 pulled close to Vcc as indicated with a scope or voltmeter. What am I missing here?
temtronic



Joined: 01 Jul 2010
Posts: 9658
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Oct 01, 2026 3:07 pm     Reply with quote

I don't use that pin, yeesh it has a LOT of pins , but things I can think of....

perhaps the compiler didn't set the correct bits) ,check the filename.lst to confirm bits are properly set...


is another peripheral resetting the bits ?

I did read that when an I/O pin is reconfigured from input to output, the pullups are disabled.

Pretty sure someone who uses that PIC or a close cousin will KNOW what's going on !
JerryR



Joined: 07 Feb 2008
Posts: 192

View user's profile Send private message

PostPosted: Thu Oct 01, 2026 5:23 pm     Reply with quote

Hi there Temtronic, thanks for your reply.

Yes, something is going on that I don't understand. Open pin, RJPU set and confirmed to TRUE. RJ5 TRIS to input. Pin shows nothing near Vcc as expected and is confirmed at 0 with the debugger.

I've been developing on this target for months and this is the first issue I've had.

Any help is appreciated.

Regards
Ttelmah



Joined: 11 Mar 2010
Posts: 20145

View user's profile Send private message

PostPosted: Fri Oct 02, 2026 2:18 am     Reply with quote

Is the port in standard_io mode?.
Read the TRIS register and see what this says.
jaka



Joined: 04 May 2014
Posts: 54
Location: Finland

View user's profile Send private message

PostPosted: Fri Oct 02, 2026 3:33 am     Reply with quote

The J port is multiplexed with external memory bus. From the data sheet, page 166:
'When the external memory interface is enabled, all of
the PORTJ pins function as control outputs for the
interface. This occurs automatically when the interface
is enabled by clearing the EBDIS control bit
(MEMCON<7>). The TRISJ bits are also overridden.'
Ttelmah



Joined: 11 Mar 2010
Posts: 20145

View user's profile Send private message

PostPosted: Fri Oct 02, 2026 11:33 am     Reply with quote

Yes, and no..... Very Happy
You can only enable this if the chip is not programmed in microcontroller
mode. Normally this is the default.
So look at the fuses. The chip needs to be in microcontroller mode. If
it isn't, then this becomes very much a potential problem.
Config 3L bits 5 & 6, need to be 11.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group