I am using a Raspberry Pi Pico with a number of PiicoDev modules on a robot (i.e. distance sensor, OLED display, 3-axis accelerometer) and I am driving the four individual motors on the mecanum wheels with 2 x Maker Drive boards (a 2-channel H-bridge motor controller). I have programmed the pico and wired the system to use pins 4,5,9,10,14,15,19,20 to drive the forward and rear H-bridge controllers. However, having uploaded the python program to the pico, the system will no longer connect via the serial link. If I remove the pico from the expansion board so that it is not connected to anything, I regain the ability to connect (which I think rules out the firmware being the issue). Any ideas on what may be going wrong? Are there any pins on the pico that need to be avoided as these are being used for I2C?
I thought that the PiicoDev kit was using the I2C0 pins on the pico and deliberately stayed away from those… Any help would be greatly appreciated.
The PiicoDev expansion board uses GP8 + 9 on the Pico so it looks like that might cause some issues.
As for the disconnecting, would it be possible to send through some photos? It sounds like there is a short happening.
Ricardo - are your pin numbers actual physical pins? or are they the GPIO pin numbers?
if physical - you should be clear of the I2C bus
if GPIO - then you have doubled onto the I2C bus pin at GPIO 9 ( physical pin 12 )
Hi @Murray125532 ,
Thanks for your response. The pin numbers that I mentioned on my post are the actual physical pins, so I should be ok. I will recheck all of my connections.
I am not using GP8 and 9 but rather GP2, GP3, GP6 and GP7 for the first maker drive board and GP10, GP11, GPI4 and GP15 for te second maker drive board will send through some photos. I am clear of GP8 and GP9. I am also plugging in the 5V from both the MakerDrives to the VSYS pin on the Pico and the GND from the MakerDrives to the nearest ground adjacent to the VSYS pin.
Sounds like something amiss on the motor driver board but you would not expect both boards to be the same.
Maybe a conflict between 5V supplies. When you plug in the USB to communicate with the Pico it is trying to power the Pico as well. I am not too familiar with Pico but are you applying the 5V to the correct pin on the Pico. Does the Pico allow 2 different supply sources or does it shut down when you do that. All questions to be investigated.
Does the set up work with the computer disconnected. Have you actually measured the relevant voltages on Pico under the different conditions.
Hmmm if it is a power supply issue - usb vs other source - make sure you check the Pico manuals re the correct way to do this… there is a reference to it in my Borg Cube project about safely powering the pico and attachments and still being able to plug in the usb for programming without the smoke escaping or other untoward events…
The actual lines from the project about powering correctly
Also, regarding the power, is the need to be able to connect the programmer Raspberry 3 to the Pico, while the big PSU is in use also. Without the smoke getting out of either one.
Solution: RTFM (https://datasheets.raspberrypi.com/pico/pico-datasheet.pdf - page Section 4.5 on page 19) and wire up the power to the Pico with a Schottky diode in line to the VSYS pin. And build in a good solid common earth point for everything to connect to.
Result: can safely power up from the battery, and can connect/disconnect the Raspberry Pi programmer, without disturbing the Pico (or killing the Raspberry Pi).
Thanks so much for this! I totally agree with you having now consulted the pico datasheet. In fact, I actually like the P-Channel MOSFET idea also proposed in the datasheet a bit better so I will be definitely doing that.
Nevermind… the recommended MOSFET in the pico datasheet only seems to be available as a surface mount component and I have a few through-hole 1N5819 Schottky diodes lying around so, will be going with your suggestion…
Good idea @Robert93820, I will definitely check out the voltages after I connect the Schottky diode as suggested by @Murray125532 below…
There would be alternatives. The current capability and gate threshold voltage along with operating voltage would be the parameters to look for. Even operating voltage is not super critical as long as it is in the ball park.
Great to hear you’ve settled on a solution, it would be great to see some photos of your project once you’ve got the motor drivers up and running.
Thank Murray and Bob for your advice in chasing this one down, it’s a tricky fault to troubleshoot!
This may not be what you are experiencing, but what I have related to the Pi Pico.
Hope I have understood your problem correctly.
In the main loop I needed a small delay to allow the Pico to detect the serial connection.
I use about 20 or 50ms.
Without this I have caused a Pico be inaccessible via the serial connection and Thonny.
The only way I could find to fix it, was to reload the firmware.
In your case removal of the Pico from the system probably would have caused to program to error when it could not detect the other devices you have connected.
Of course this may not be what is wrong.
Hope you get it sorted.