| View previous topic :: View next topic |
| Author |
Message |
JerryR
Joined: 07 Feb 2008 Posts: 192
|
| RJ5 pull up |
Posted: Thu Oct 01, 2026 10:53 am |
|
|
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
|
|
Posted: Thu Oct 01, 2026 3:07 pm |
|
|
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
|
|
Posted: Thu Oct 01, 2026 5:23 pm |
|
|
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
|
|
Posted: Fri Oct 02, 2026 2:18 am |
|
|
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
|
|
Posted: Fri Oct 02, 2026 3:33 am |
|
|
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
|
|
Posted: Fri Oct 02, 2026 11:33 am |
|
|
Yes, and no.....
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. |
|
 |
|