<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MicroPython port form M5StickC]]></title><description><![CDATA[<p dir="auto">I'm currently trying to get the LCD running with MicroPython (from <a href="https://github.com/m5stack/M5Stack_MicroPython" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5Stack_MicroPython</a>) on the M5StickC. MicroPython is running but the LCD stays dark and I think the issue is the control of the PMIC AXP192 which according to the block diagram controls the chip enable of the LCD and the backlight LED.<br />
Is there a MicroPython port or module available which controls the AXP192? All examples I found for the M5Stack directly control the LCD without the AXP192.</p>
]]></description><link>https://community.m5stack.com/topic/1578/micropython-port-form-m5stickc</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Apr 2026 09:40:38 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/1578.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 05 Jan 2020 21:56:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MicroPython port form M5StickC on Sat, 25 Jan 2020 20:17:30 GMT]]></title><description><![CDATA[<p dir="auto">I now found the documentation about the pins (<a href="https://docs.micropython.org/en/latest/esp8266/tutorial/pins.html" target="_blank" rel="noopener noreferrer nofollow ugc">https://docs.micropython.org/en/latest/esp8266/tutorial/pins.html</a>) and was able to trigger a callback when pressing the big M5 button (btna):</p>
<pre><code class="language-python">#Define Callback:
def on_wasPressed(p):
print("Button was pressed: ", p)
B_M5 = Pin(37, Pin.IN, handler=on_wasPressed, trigger=Pin.IRQ_FALLING, debounce= 500)

</code></pre>
]]></description><link>https://community.m5stack.com/post/7192</link><guid isPermaLink="true">https://community.m5stack.com/post/7192</guid><dc:creator><![CDATA[ForestRupicolous]]></dc:creator><pubDate>Sat, 25 Jan 2020 20:17:30 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Sat, 25 Jan 2020 19:50:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/lukasmaximus" aria-label="Profile: lukasmaximus">@<bdi>lukasmaximus</bdi></a> said in <a href="/post/7184">MicroPython port form M5StickC</a>:</p>
<blockquote>
<p dir="auto">from machine import Pin<br />
btna = Pin(37, <a href="http://Pin.IN" target="_blank" rel="noopener noreferrer nofollow ugc">Pin.IN</a>)</p>
</blockquote>
<p dir="auto">Perfekt, thanks a lot! Thats exactly the piece of code which I needed now.<br />
For the link: Thats also very helpful. I didn't took the time to port the complete AXP192 library and just added the commands I needed. I will use his full port. Additionally I have to check his port because of some LCD issues I have.</p>
]]></description><link>https://community.m5stack.com/post/7191</link><guid isPermaLink="true">https://community.m5stack.com/post/7191</guid><dc:creator><![CDATA[ForestRupicolous]]></dc:creator><pubDate>Sat, 25 Jan 2020 19:50:40 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Sat, 25 Jan 2020 10:47:50 GMT]]></title><description><![CDATA[<p dir="auto">After a little digging (I am currently trying to go fully standard micropython also) I turned up this <a href="https://github.com/m5stack/M5StickC/issues/82" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5StickC/issues/82</a> a user has ported an axp192 library to micropython <a href="https://github.com/karfas/M5StickC-uPy" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/karfas/M5StickC-uPy</a> I have not tested yet, but perhaps it will help us</p>
]]></description><link>https://community.m5stack.com/post/7186</link><guid isPermaLink="true">https://community.m5stack.com/post/7186</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Sat, 25 Jan 2020 10:47:50 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Sat, 25 Jan 2020 10:08:30 GMT]]></title><description><![CDATA[<p dir="auto">for AXP i'm not so sure if there is a standard micropython library available but buttons are simple. The M5stickC buttons are on gpios 37 = A 39 = B the standard way to implement buttons in micropython is:</p>
<pre><code>from machine import Pin
btna = Pin(37, Pin.IN)
btnb = Pin(39, Pin.IN)

#for a simple test we can use the button to turn on the led on pin 10

ledpin = Pin(10, Pin.OUT)

while True:
       if btna.value() == 1:
             ledpin.value(1)
       else:
             ledpin.value(0)

</code></pre>
<p dir="auto">hope this helps</p>
]]></description><link>https://community.m5stack.com/post/7184</link><guid isPermaLink="true">https://community.m5stack.com/post/7184</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Sat, 25 Jan 2020 10:08:30 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Fri, 24 Jan 2020 21:50:48 GMT]]></title><description><![CDATA[<p dir="auto">Thank you for the link. I got micropython running on the M5StickC but I'm missing some libraries (e.g. AXP, or buttons). When UIFLow is working on top of micropyton I hoped it means that the libraries are available somewhere and can be used/ examined.<br />
I'm currently working on porting the parts I need from the Arduino M5StickC lib.</p>
]]></description><link>https://community.m5stack.com/post/7179</link><guid isPermaLink="true">https://community.m5stack.com/post/7179</guid><dc:creator><![CDATA[ForestRupicolous]]></dc:creator><pubDate>Fri, 24 Jan 2020 21:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Mon, 20 Jan 2020 05:30:06 GMT]]></title><description><![CDATA[<p dir="auto">This project may help in setting up standard micropython on m5stick though its for m5stack <a href="https://www.hackster.io/andreas-motzek/execute-logo-on-m5stack-esp32-basic-with-micropython-3713fd" target="_blank" rel="noopener noreferrer nofollow ugc">https://www.hackster.io/andreas-motzek/execute-logo-on-m5stack-esp32-basic-with-micropython-3713fd</a> the modules used to be transferable from the flash using ampy in older firmware versions but now they are frozen in bytecode and so unextractable.</p>
]]></description><link>https://community.m5stack.com/post/7124</link><guid isPermaLink="true">https://community.m5stack.com/post/7124</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Mon, 20 Jan 2020 05:30:06 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Sun, 12 Jan 2020 20:40:02 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a> said in <a href="/post/6896">MicroPython port form M5StickC</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/forestrupicolous" aria-label="Profile: forestrupicolous">@<bdi>forestrupicolous</bdi></a> If you use UIFlow firmware 1.4.3 then the screen works fine however it is built on a slightly older version of Micropython.</p>
</blockquote>
<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="/user/ajb2k3" aria-label="Profile: ajb2k3">@<bdi>ajb2k3</bdi></a>, is the source code available somewhere? I wasn't able to find the code for the M5StickC anywhere on github. The only UIFlow code I was able to find (<a href="https://github.com/m5stack/UIFlow-Code" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/UIFlow-Code</a>) has gotten it's last commit in June and I think is missing the M5StickC libraries.</p>
]]></description><link>https://community.m5stack.com/post/7012</link><guid isPermaLink="true">https://community.m5stack.com/post/7012</guid><dc:creator><![CDATA[ForestRupicolous]]></dc:creator><pubDate>Sun, 12 Jan 2020 20:40:02 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Thu, 09 Jan 2020 21:35:53 GMT]]></title><description><![CDATA[<p dir="auto">Thank you both for your answers. <a class="plugin-mentions-user plugin-mentions-a" href="/user/lukasmaximus" aria-label="Profile: lukasmaximus">@<bdi>lukasmaximus</bdi></a> is right I would prefer using the standard micropython firmware. As I wasn't able to find an available python module I took a look at the M5StickC Arduino code (<a href="https://github.com/m5stack/M5StickC/edit/master/src/AXP192.cpp" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/m5stack/M5StickC/edit/master/src/AXP192.cpp</a>) and transferred the parts I needed to python. The available datasheet is just in Chinese but together with the code I got the display enabled.</p>
<p dir="auto">Here is my prototype code to enable the display and backlight. Please be aware that I haven't included everything from the cpp file so some functionality is missing:</p>
<pre><code class="language-python">from machine import I2C
i2c = I2C(freq=400000, sda=21, scl=22) #Enable I2C
i2c.scan()  #Check for devices
    [52, 81, 104] #52 is the adress of AXP192

i2c.writeto_mem(52, 0x28, b'\xcc') #Set TFT and TFT_LED to 3.0V
i2c.readfrom_mem(52, 0x12, 1) #Read Byte 12
  #returns  b'\x13' = 0b10011 -&gt; DCDC enabled but LDO3/2 disabled
i2c.writeto_mem(52, 0x12, b'\x1f') # enable LDO3/2 (TFT and TFT_LED)

# other code parts:
i2c.writeto_mem(52, 0x12, b'\x13') #disable LDO3/2 (TFT and TFT_LED)
i2c.writeto_mem(52, 0x28, b'\x9c') #Dimm display by reducing the voltage
</code></pre>
<p dir="auto">One important thing is that the register 0x12 is also responsible for powering the ESP32. Thats the reason why just setting the LDO3/2 bits alone isn't enough.</p>
]]></description><link>https://community.m5stack.com/post/6955</link><guid isPermaLink="true">https://community.m5stack.com/post/6955</guid><dc:creator><![CDATA[ForestRupicolous]]></dc:creator><pubDate>Thu, 09 Jan 2020 21:35:53 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Wed, 08 Jan 2020 02:26:53 GMT]]></title><description><![CDATA[<p dir="auto">I believe <a class="plugin-mentions-user plugin-mentions-a" href="/user/forestrupicolous" aria-label="Profile: ForestRupicolous">@<bdi>ForestRupicolous</bdi></a> is trying to use standard non uiflow micropython firmware. I think you are right in assuming that the axp12 also needs to engage the screen to turn it on. I was talking with John Maloney yesterday who is adding M5Stick support to microblocks (<a href="http://microblocks.fun/" target="_blank" rel="noopener noreferrer nofollow ugc">http://microblocks.fun/</a>) and he came across the same issue when implementing support. Although microblocks is not using micropython perhaps he can shed some light on this, I'll check and get back to you</p>
]]></description><link>https://community.m5stack.com/post/6927</link><guid isPermaLink="true">https://community.m5stack.com/post/6927</guid><dc:creator><![CDATA[lukasmaximus]]></dc:creator><pubDate>Wed, 08 Jan 2020 02:26:53 GMT</pubDate></item><item><title><![CDATA[Reply to MicroPython port form M5StickC on Mon, 06 Jan 2020 05:40:40 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/forestrupicolous" aria-label="Profile: forestrupicolous">@<bdi>forestrupicolous</bdi></a> If you use UIFlow firmware 1.4.3 then the screen works fine however it is built on a slightly older version of Micropython.</p>
]]></description><link>https://community.m5stack.com/post/6896</link><guid isPermaLink="true">https://community.m5stack.com/post/6896</guid><dc:creator><![CDATA[ajb2k3]]></dc:creator><pubDate>Mon, 06 Jan 2020 05:40:40 GMT</pubDate></item></channel></rss>