Comments (3)
@wz2b I have now merged the fix. Thanks again for reporting it.
from micropython-esp32-ulp.
You are very correct. That code is indeed incorrect. Some bad copy-pasting that happened to work(ish).
The correct way would be to set the port to output enabled once with this instruction:
WRITE_RTC_REG(RTC_GPIO_ENABLE_W1TS_REG, RTC_GPIO_ENABLE_W1TS_S + gpio, 1, 1)
and then to toggle the LED on and off with these instructions:
//on
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 1)
//off
WRITE_RTC_REG(RTC_GPIO_OUT_REG, RTC_GPIO_OUT_DATA_S + gpio, 1, 0)
Alternatively one can use the RTC_GPIO_OUT_W1TS_REG
and RTC_GPIO_OUT_W1TC_REG
registers, but I prefer the RTC_GPIO_OUT_REG
approach. I am not sure why there are two ways to do this.
I just tested this with a power profiler (nordic PPK2), which supports reading in logic signals alongside the power profile. When I connect my GPIO output to the logic port with the current (wrong) blink.py
code, I can see the initial low to high transition, but the logic port never "sees" a low again (I guess with "output enable" turned off the pull-down is also disabled and the pin is left floating).
When I instead fix the code as per above, I correctly see the highs and lows of the GPIO output from via the logic port.
Thanks for picking this up. I will create a PR for this soon.
from micropython-esp32-ulp.
Great, thanks explaining - I thought that was what was going on, but I'm using these examples to learn how to make a virtual SPI port in the ULP and I'm not quite used to the GPIO/RTC muxes in this thing yet.
from micropython-esp32-ulp.
Related Issues (20)
- github + pypi setup > docs?
- "how to release" docs
- Can't get it to run HOT 16
- Thank you so much for great lib, I cannot figure out I2C RD/WR. HOT 8
- LED is not blinking HOT 3
- Still Struggling HOT 37
- Bug: Upper case expressions not supported
- memory problem HOT 3
- Requesting a WAKE example HOT 12
- Request for Clarification of ULP GPIO example HOT 1
- Update Actions runner image HOT 1
- Fix build
- Decide how to follow the latest MicroPython HOT 2
- Support ESP32-S2 HOT 8
- ulp rtc clock calibration HOT 2
- Add License/Copyright to all files HOT 7
- interrupt from RTC GPIO
- Update quickstart to use mip instead of upip HOT 7
- Release 1.3.0
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from micropython-esp32-ulp.