-
Notifications
You must be signed in to change notification settings - Fork 2
Raspberry Pi Pico getting an One-Time-Programmable when using picosleep #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
apparently, the raspberry pico turns completely off when using picosleep as the voltage goes "through it" and activates the MOSFET, even it shouldn't be activated. |
Likewise, I can't wake up after sleeping. Help! |
@flashbtw @aiya70 sorry to hear you are both having issues. @flashbtw with the example you have posted in your first comment, does the Pico onboard LED blink as expected? You have both mentioned that after sleeping the Pico does not respond. Unfortunately I think that when the deep sleep code executes, the connection to the computer is lost, the only way to reset it is to power cycle it by unplugging or perhaps by using a reset button such as here. To work around this, when developing I would use: import time
time.sleep(3) Then when you are ready for this to be run standalone, replace these sleep calls with the If your programme needs to interact with your computer over USB then sleeping using deep sleep is going to cause problems. Communication over UART and I2C does appear to still work fine following deep sleeping, with perhaps a few tweaks, see this comment and thread for an example. I have tried to work around these issues with the REPL/USB but unfortunately have not found a solution. @flashbtw it's interesting that it's allowing voltage to pass through it when sleeping, have you got a wiring example for that? |
The one-time-programmable thing put aside; I'll use time.sleep(time) for developing now. The Pico seems to have control over Port 25 (internal LED) but not the other GPIO Ports/Pins including mine (0).
The behavior of it seems strange. It can be seen on youtube I appreciate your help! |
@flashbtw Apologies for the difficulties you have had with this. I was able to replicate your issue, not sure why it's happening but adding a import picosleep
from machine import Pin
import time
import os
led_onboard = Pin(25, Pin.OUT)
led_not_onboard = Pin(15, Pin.OUT)
# Make sure this is present
time.sleep(1)
def flash(times,sleep,led):
num = 0
while num < times:
led.toggle()
time.sleep_ms(sleep)
num=num+1
def led_toggle(led):
led.toggle()
picosleep.seconds(2)
for x in range(0, 8):
led_toggle(led_onboard)
for x in range(0, 8):
led_toggle(led_not_onboard)
flash(4,500,led_onboard)
flash(4,500,led_not_onboard)
# !!!! be careful here this will remove main.py on your pico !!!!
os.remove("main.py") That seems to work for me. If I save this to the pico as "main.py" using Thonny, and then reset the pico, it runs the code and the led's flash as expected. I've also added a Please be careful with that, as it will wipe "main.py" on your pico, make sure you have saved anything you want to keep on there. Remove that line once you have everything setup and you want to be able to reset it by power cycling it, but continue to run your code on the next reboot. Another option is to have a long Also it doesn't seem to work for me using gpio 0, not sure if that is a special pin. At least for me using a "Maker Pi Pico", that pin is already high for me when the Pico starts. Using Pin 15 works fine. Let me know if this works for you. |
Yeah, Pin 1 has got me wondering because it also just wasn't working (always off). Huge Thanks for your help! It'll make my battery last much longer :) |
Ah great to hear! Thanks for closing the issue 👍 |
No problem 😄 Have a great day! |
Firstly, I want to appreciate your work.
But now to my problem. When I have this code as main.py:
my Pico doesn't seem to be accessible when connecting it to the computer. So when I want to make changes to the program, I have to flash_nuke it in order to function.
Maybe this is my error, I'm just new to this subject :)
Anyways, any help would be appreciated!
The text was updated successfully, but these errors were encountered: