-1

I just bought 2 new raspberry pi pico units, but I am struggling with them. I ran a few basic commands in Thonny's shell and maid a program to have the onboard LED blink. Everything is working fine but I can't run any program that has external connections. I can't blink an external led, check if a button is pressed, etc. This happens with both the pico boards. Here is how I installed the Pico requirements :

  • I installed Thonny and flashed the micro-python firmware(.uf2) to the Pico in boot-loader mode (RPI-RP2 mass storage device).
  • When I flashed the firmware though, the file finished transferring and the pico ejected itself, then I opened it in bootloader mode again but the firmware file isn't showing itself in the RPI-RP2 path, does that mean the firmware didn't install? Also "Micro-python version1.19..." does show up on my Thonny's shell screen.
  • I installed micro-python from Thonny's "Configure Interpreter > Interpreter > Update or Install Micropython" tab too.

Here is the code I used for Led Toggle-

import machine
import utime

led = machine.Pin(7, machine.Pin.OUT)

while True:
    led.value(1)
    utime.sleep(1)
    led.value(0)
    utime.sleep(1)

I connected an 220 ohms resistor and an LED(anode) in series with the pin labelled GP7 and the ground of the Pico(one of the pins labelled GND) to the cathode of the led. I changed the code to 15 and used the pin labelled GP15 with both the Pico boards but the LED doesn't blink, it doesn't even turn on. I added a print("ON") after led.value(1) statement and the shell prints "ON" but the led does not blink.

Anyone know what the problem might be? Is it a pico problem or a GPIO problem or a firmware problem?

5
  • 1
    Have you tried turning the LED around - they only work in one direction. Post a photo of your wiring.
    – CoderMike
    Apr 10, 2023 at 10:39
  • Thank you for responding. I have tried that, the result is the same. The pico isn't responding to any external components. What could the reason be ? Is it a problem with the Micropython install ? I tried it with both my Pico boards btw and the led still doesnt work.
    – Coder
    Apr 10, 2023 at 13:55
  • Post a photo of your wiring. Pico must be working if you are seeing the print on commands in Thonny.
    – CoderMike
    Apr 10, 2023 at 14:33
  • The RPI-RP2 device not showing the contents is fine. It's not a typical mass-storage device you can write to and read from like a USB drive. If you flashed the micro-python firmware .uf2 file to it, the RPI-RP2 device should disappear when the flash completes and entering boot-mode again will not show anything present in that device. I would be suspicious that entering boot-mode again may have caused issues with the original flash of the micropython firmware. Do it again and trust it is there. I could help further with C, but not python. There are many example to go by. Apr 11, 2023 at 7:45
  • Thanks for responding guys, I worked around the connections again and everything was right although I did check out the led I was using and it turns out i was using a photo-transistor by mistake, a very silly mistake. I really appreciate the responses from you guys thanks a tone.
    – Coder
    Apr 13, 2023 at 10:26

1 Answer 1

0

I opened it in bootloader mode again but the firmware file isn't showing itself in the RPI-RP2 path, does that mean the firmware didn't install?

No, this is normal behaviour. The file is removed after the firmware is installed.

Anyone know what the problem might be?

Based on your description it might be problem of almost anything, starting with wrong wiring, ending with the way you reset the boards after flashing the firmware. You need to provide more details, at least show the wiring and check if your LEDs are working.

Is it a pico problem or a GPIO problem or a firmware problem?

In addition to said above, it is unlikely to be Pico problem (or GPIO problem, depending on what you have meant here), as both boards show the same behaviour and chance that they are damaged in the same way is low. To check if it is the firmware problem, you could flash different version of firmware and check if a) it got flashed and b) if behaviour is different. Simple googling should help finding out a way to know the firmware version after it is flashed (for example).

In your question it also sounded like you booted in flash mode again and then ran the code. This would have been wrong. In any case make sure you stick to a simple guide (e.g. this) for the beginning.

1
  • Thanks for the detailed response, I figured out what went wrong though. The transfer of the firmware was correct so were the connections, it turns out I was using a photo-transistor instead of an led, very very silly mistake, everything seems fine now though. Once again thanks alot.
    – Coder
    Apr 13, 2023 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.