![]() |
Forum Index : Microcontroller and PC projects : I2C2
Author | Message | ||||
georgestheking Newbie ![]() Joined: 21/12/2021 Location: BelgiumPosts: 32 |
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: AustraliaPosts: 2606 |
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 Type FreePins to run it. It tests every pin.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 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 KingdomPosts: 2534 |
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 KingdomPosts: 7857 |
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 KingdomPosts: 2534 |
always followed the manual and examples. dunno why gp26,27 reserved. what for? |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4037 |
OPTION LIST - shows what? John |
||||
stanleyella![]() Guru ![]() Joined: 25/06/2022 Location: United KingdomPosts: 2534 |
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 KingdomPosts: 4037 |
So they're OFF, I don't understand what the problem is. John |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7857 |
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 KingdomPosts: 4037 |
I don't mind who posts an explanation, the OP preferably but hey anyone... John |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |