Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 01:24 11 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : I2C2

Author Message
georgestheking
Newbie

Joined: 21/12/2021
Location: Belgium
Posts: 32
Posted: 08:51pm 23 Jan 2025
Copy link to clipboard 
Print this post

Hi,

I use an RP2040 in standard mode ( no USB / no VGA )
Version 6.01

When I try to configure the I2C2 I get an error

SETPIN GP26,GP27,I2C2

[151] SetPin GP26,GP27,I2C2
Error : Pin 31/GP26 is reserved on startup

Best regards

Georges
 
phil99

Guru

Joined: 11/02/2018
Location: Australia
Posts: 2606
Posted: 09:42pm 23 Jan 2025
Copy link to clipboard 
Print this post

Start with Option List to see most of the used pins.
If that doesn't show what is using GP26 add this Sub to your program or the library.
Sub FreePins
 local n%, p%, gp$
 For n%=0 To 29
  gp$ = "GP"+Str$(n%)
  p% = MM.Info(pinno gp$)
  Print gp$, p%,  MM.Info$(pin p%)
 Next
End Sub
Type FreePins to run it. It tests every pin.

Edit.
If the ADC OPEN command is in use GP26 will be locked to that as it is ADC0.
Edited 2025-01-24 09:28 by phil99
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2534
Posted: 04:05pm 24 Jan 2025
Copy link to clipboard 
Print this post

There are two I2C channels. They can operate in master or slave mode.
I/O Pins
Before the I
2C interface can be used the I/O pins must be defined using the following command for the first
channel (referred as I2C):
SETPIN sda, scl, I2C
Valid pins are SDA: GP0, GP4, GP8, GP12, GP16, GP20 or GP28
SCL: GP1, GP5, GP9, GP13, GP17 or GP21

gp26,gp27 are keyboard maybe
Edited 2025-01-25 02:10 by stanleyella
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7857
Posted: 04:44pm 24 Jan 2025
Copy link to clipboard 
Print this post

They shouldn't be, Stan. Default keyboards are not I2C.

Phil is right. OPTION LIST for a start, and see if GP26 is already allocated to something.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2534
Posted: 06:32pm 24 Jan 2025
Copy link to clipboard 
Print this post

always followed the manual and examples. dunno why gp26,27 reserved. what for?
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4037
Posted: 08:25pm 24 Jan 2025
Copy link to clipboard 
Print this post

OPTION LIST - shows what?

John
 
stanleyella

Guru

Joined: 25/06/2022
Location: United Kingdom
Posts: 2534
Posted: 09:14pm 24 Jan 2025
Copy link to clipboard 
Print this post

cool
autosav

Upload completed 1

Saved 165 bytes
>
Time taken: 714mS
RUN
GP0     1      Boot Reserved : AUDIO L
GP1     2      Boot Reserved : AUDIO R
GP2     4      OFF
GP3     5      OFF
GP4     6      Boot Reserved : SPI SYSTEM MISO
GP5     7      OFF
GP6     9      Boot Reserved : SPI SYSTEM CLK
GP7     10     Boot Reserved : SPI SYSTEM MOSI
GP8     11     Boot Reserved : CONSOLE TX
GP9     12     Boot Reserved : CONSOLE RX
GP10    14     OFF
GP11    15     OFF
GP12    16     Boot Reserved : HDMI
GP13    17     Boot Reserved : HDMI
GP14    19     Boot Reserved : HDMI
GP15    20     Boot Reserved : HDMI
GP16    21     Boot Reserved : HDMI
GP17    22     Boot Reserved : HDMI
GP18    24     Boot Reserved : HDMI
GP19    25     Boot Reserved : HDMI
GP20    26     OFF
GP21    27     OFF
GP22    29     Boot Reserved : SD CS
GP23    41     DOUT
GP24    42     DIN
GP25    43     HEARTBEAT
GP26    31     OFF
GP27    32     OFF
GP28    34     OFF
GP29    44     AIN
>
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4037
Posted: 09:52pm 24 Jan 2025
Copy link to clipboard 
Print this post

So they're OFF, I don't understand what the problem is.

John
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 7857
Posted: 10:52pm 24 Jan 2025
Copy link to clipboard 
Print this post

Erm... it wasn't Stan that asked...
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4037
Posted: 11:10pm 24 Jan 2025
Copy link to clipboard 
Print this post

I don't mind who posts an explanation, the OP preferably but hey anyone...

John
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025