I am new to the RP2040, but I am using it (for the first time) on a board with an EEPROM connected to the I2C0 on GPIO0 and GPIO1.
I see that the relevant default pins in the pins_arduino.h file are
// Serial #define PIN_SERIAL_TX (0ul) #define PIN_SERIAL_RX (1ul)
I have tried to switch these pins around so that serial is on 4/5 and Wire is on 0/1, but the board now no longer registers as a COM port on one of my prototype boards.
I use a microUSB port connected to RP2040 pins 46 and 47. I am thinking that this is connected to serial and I cannot use serial and i2c 0 at the same time? Can anyone confirm this?
Is there a way for me to use i2c 0 and serial at the sale time?
Changing those code lines doesn't change the configuration of the chip. The configuration of the chip was set when the chip was designed and cannot be altered in this way.
Some chips allow limited re-configuration of the functions of some the pins. I don't think you can do that here.
I clarify that I have no experience with the Nano Connect but with Pi Pico.
The Tx and Rx pins refer to Serial1, they are not used for communication with the console so from the code you can change their assignment.
Check the RP2040 core documentation for how to reassign the I2C and UART pins.
For example, in Pi Pico setRX() and setTX() are used to reassign the pins of a serial port.
Yes the alternate use of pins is an option shown by the different colours and yo can only use one of those options at any one time.
Yes just use one set of pins for I2C 0 and another set for Serial.
So you can use pins GP20 & 21for I2C0 and GP7 & 8 for serial. The pins do not even have to be in the pairs shown.
However I am wondering exactly what you have here because pins 46 an 47 do not exist on an RP Pico2040.
Edit:- So it seems you do not have a RP Pico2040, but a Nano Connect. This is more complex to use because only certain pins are connected to the Pico 2040 processor. You need to study the schematic of the Nano Connect to see what pins you actually have access to.
I have designed a board (and am working with the first physical version) that uses the RP2040, so I have access to all pins on the IC.
The schematic in my post above shows how it is connected, as per the "minimal" dev board from RPi foundation.
Pins 46/47 are dedicated USB port pins and is what is routed to the microUSB connectos on the Pico.