Search found 1695 matches

by Roberthh
Thu Nov 07, 2019 8:44 pm
Forum: ESP32 boards
Topic: Set Pins values synchroniously
Replies: 22
Views: 417

Re: Set Pins values synchroniously

You test code above would with viper and including masking for instance look like: from machine import Pin, mem16 p12=Pin(12, Pin.OUT) p14=Pin(14, Pin.OUT) @micropython.viper def set_gpio(value:int, mask:int): GPIO_OUT = ptr32(0x3FF44004) # GPIO Output register GPIO_OUT[0] = (GPIO_OUT[0] & mask) | v...
by Roberthh
Thu Nov 07, 2019 8:29 pm
Forum: ESP32 boards
Topic: Set Pins values synchroniously
Replies: 22
Views: 417

Re: Set Pins values synchroniously

the decorator is:

@micropython.viper

If that fails, you may need to update the firmware.
Edit: and yes, it has to be at the line before a function definition, like

Code: Select all

@micropython.viper
def my_viper_fct():
    pass
by Roberthh
Thu Nov 07, 2019 8:21 pm
Forum: ESP32 boards
Topic: Set Pins values synchroniously
Replies: 22
Views: 417

Re: Set Pins values synchroniously

Note, that writing to 0x3FF44004 will set all 32 bits to the value defined in the pattern. If you want to change individual bits but leave the others unchanged, you have to read the ports state first, mask the bits out you want to change, insert the new pattern and write it back. Viper code is faster.
by Roberthh
Thu Nov 07, 2019 5:34 pm
Forum: ESP32 boards
Topic: Running a C++ SPI library inside Micropython on ESP32
Replies: 7
Views: 191

Re: Running a C SPI library inside Micropython on ESP32

Update: I made a simulation, which toggles an I/O line and then shifts out a byte over two other GPIO lines emulating SPI CLK and MOSI using viper. Total time 2 µs. from machine import Pin, SPI pin = Pin(4, Pin.OUT, value=1) SCLK = Pin(14, Pin.OUT, value=0) MOSI = Pin(13, Pin.OUT, value=0) @micropyt...
by Roberthh
Thu Nov 07, 2019 4:00 pm
Forum: ESP32 boards
Topic: Running a C++ SPI library inside Micropython on ESP32
Replies: 7
Views: 191

Re: Running a C SPI library inside Micropython on ESP32

What kind of operation requires this 2µs max time? I see a tWINSET in the data sheet, with 1/MCLK minimum time. And a tWINDOW, which is 32/MCLK or ~9 µs. That is fast. If it's only for that first byte to configure the mode, you can do that with Viper code, direct port access and bit banging, control...
by Roberthh
Sat Nov 02, 2019 1:42 pm
Forum: Pyboard D-series
Topic: Where are my Frozen Modules ??
Replies: 8
Views: 189

Re: Where are my Frozen Modules ??

Not this way, but: if you want to keep your old structure, undefine FROZEN_MANIFEST and define FROZEN_MPY_DIR in your makefile. If you want to have the new structure with on manifest file, just leave FROZEN_MANIFEST as it is. Then only manifest.py in the boards directory will be used. After a bit of...
by Roberthh
Sat Nov 02, 2019 11:32 am
Forum: Pyboard D-series
Topic: Where are my Frozen Modules ??
Replies: 8
Views: 189

Re: Where are my Frozen Modules ??

You still can have the set of frozen modules at port level. That is the default. But using manifests also allow for board level control, and more, if you like.
by Roberthh
Fri Nov 01, 2019 4:13 pm
Forum: ESP32 boards
Topic: [Solved] ESP32 - Building Micropython - Built Firmware crashes in loop
Replies: 9
Views: 253

Re: ESP32 - Building Micropython - Built Firmware crashes in loop

I tried to flash the binary you supplied to a ESP32 device, and that fails too.
by Roberthh
Fri Nov 01, 2019 3:06 pm
Forum: ESP32 boards
Topic: [Solved] ESP32 - Building Micropython - Built Firmware crashes in loop
Replies: 9
Views: 253

Re: ESP32 - Building Micropython - Built Firmware crashes in loop

The firmware has to be flashed at offset 0x1000. Did you do that?