Replies: 4 comments 7 replies
-
To control the tight timing, low level pin setting and clearing is used. These are 32bit registers where the bit represents the pin state. Since the original ESP32 only supported pins below 32 as output, the bitbang was never coded to support any other registers. Are you sure you really want to use BitBang? With WiFi or Bluetooth active it is not a reliable method as it can get interrupted as those peripheral interrupts can't be suppressed. The ESP32 S3 has hardware support (RMT) so you don't have to worry about this issue. |
Beta Was this translation helpful? Give feedback.
-
Yes, I saw the built-in example Is it correct to apply With I2S hardware driven outputs, is the timing interrupted issue with concurrent Wifi connection solved? |
Beta Was this translation helpful? Give feedback.
-
Another reason to avoid the high pin numbers on S3 is that those are often taken by the [DQO]IO pins used by the Flash (usally at least DIO, sometimes Q) and faster PSRAM (Double on cheaper boards, Octal on better boards). So they can be kind of a landmine. 35-37 and 45-45 are often off-limits. 39-42 are JTAG and can wiggle around to your surprise. Check your datasheets AND your schematics before blundering around in these pins. Good luck! |
Beta Was this translation helpful? Give feedback.
-
That can be legit. I was just encouraging you to check and be sure.
I've just had to help toooo many people in other ESP32 projects that incur
crashes during specific filesystem actions or specific memory transactions
(and it's rarely the first for either or even the same time from run to
run) and it's sometimes because they bought a board with the same amount of
flash/ram, but because it's a newer revision, it uses more pins for faster
SPI action and few things will make a computer as grumpy as having an
address line "stuck" because it has an WS-2812 or some other device
squatting on the line.
Since you're using PIN37, we can infer you're using no SPIRAM of 8MB or
larger and/or that it's not OSPI.
38 looks clear.
39-42 are used for the "old school" JTAG interface and probably fine for
LEDs. You may see some pins with non-obvious power-on behaviour as some
will be internally pulled high or low as they may power up to be
outputs and thus driven or inputs with internal pull{up,downs}. Pins 38 and
39 have some definite long pulses on boot. atomic14 used those pins in a
design of his and that flicker when the chip started confused the chip he
was attaching enough that he had to lay his board out with changes and have
them remade because they were terrorizing his attached chip. He got a
pretty good video recently on the topic - it's the last link in the page:
https://github.com/atomic14/esp32-s3-pinouts
For plain ole LEDs or even WS2812's, a brief flicker is all you're likely
to ever notice.
Espressif is a bit annoying in advertising "48 GPIOS!!!" when about half of
them have asterisks next to them limiting their use or with some weird
behaviour. It's kind of like their "520K RAM" ... that's chopped up into
IRAM, the secret paging RAM, RTC fast RAM, RTC slow RAM, PSRAM (coming in
Dual, Quad, and Octal, each of which needs to be handled differently), RAM
that you can't use for DMA, and memory that you can use only on Tuesdays if
your last name has a prime number of letters.
Pretty much all of the SOC APIs have weird little speed bumps at
GPIO31->GPIO32 just because that's where they run out of bits to represent
them easily. The CH32V307 with 80-somethnig GPIO's gets REALLY weird. :-)
But back closer to the topic, with recent ESP-IDF, the
https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32/api-reference/peripherals/gpio.html#_CPPv410gpio_num_t
gpio_num (and current is 5.2) gpio_num became a uint64_t internally, so
things should Just Work.
Now if code is relying on some Arduino abstraction over the "real" GPIO
code, I can't much fake shock that the Arduino layer is broken given its
birth on 8-bit CPUs.
I don't REALLY know anything about the guts of NeoPixelBus, but this seems
unlikely to be hard to fix. If you can confirm it's still a problem and
Makuna can give me a slight push ("yes, the build page is current for a
fresh checkout from trunk; I suspect THIS code....") I'm pretty sure I can
stomp my way toward a fix IF you can provide a sample test program that
doesn't work that should. I don't thnk I have any S3's WITHOUT PSRAM, so I
may have to bluff my way through a "looks like this should work - it
compiles, LOL" solution and iterate with you toward a fix. It probably
won't be this week, but I can queue up a little time to helping the cause
if you really can't fix it yourself. But I just dug through
https://github.com/espressif/arduino-esp32/ and it looks like it's trying
really hard to use SOC_GPIO_PIN_COUNT and the code in ESP-IDF looks like
it's trying to set that for S3. It's upcasting from a uint8_t to a
gpio_pin_t and not trying to bit twiddle itself, it's calling the ESP-IDF
functions. If it had been broken in Arduino for the last 3.5+ years,
there'd be cries in the bug system and I don't see anything relevant. Since
the original report is so vague, it's not obvious what the search domain is.
Attach a sample test program that fails on trunk, the actual failure mode,
and i'll help take a look. Simpler the better. I'll take a ten liner that I
can verify, even if only with a scope, over a 10,000 liner with 8 external
dependencies that's a project to build of its own. It looks like my boards
bring out 32, 34, and 35 so I think I have pins for GPIO 39, 41, 42 free
for testing. I think.
…On Mon, Jan 8, 2024 at 11:13 PM John Leung ***@***.***> wrote:
Robertlipe
I understand. But I really need to reserve more pins for keypad and SPI,
etc. So I have sacrificed the bluetooth feature and opt for ESP32S2 instead
of S3. Have verified GPIO pins 42-37 with NeoPixel driver working in DMA
and they all shine in a concurrent manner. Schematic extract is shown here.
2024-01-09_13h07_56.png (view on web)
<https://github.com/Makuna/NeoPixelBus/assets/6328296/8d0cd1ed-15a9-4507-90fa-f6b88284a45e>
Fortunately ESP32S3 and S2 modules are pin compatible. In the future when
Bluetooth feature is mandatory, I will swap the module and wait when I2S
driver for ESP32S3 is ready.
—
Reply to this email directly, view it on GitHub
<#741 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACCSD3YCYKCXFELYKLYKSLTYNTGYBAVCNFSM6AAAAAA65QFFNSVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DANRQGY2DG>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi
Sorry for the typo error on topic. It should be 35 not 32.
I am trying to drive WS2812 with ESP32S3. ON ESP32S3 there are pin number higher than 35 from GPIO35-48.
I find all high pin numbers are not supported by
NeoPixelBus<NeoGrbFeature, NeoEsp32BitBangWs2812xMethod> strip0(PixelCount, PixelPin)
whenever PixelPin>=35.When I use a simple demo to set the high number pins to toggle all of them are working. So it is not a hardware issue.
Is there any requirement to enable pin number from 35?
John
Beta Was this translation helpful? Give feedback.
All reactions