PSRAM changes IO behaviour of ESP32-CAM
PSRAM changes IO behaviour of ESP32-CAM
Hello,
I've been working with ESP32-CAM implementing the WS2812 with RMT. On the first deployment, the WS2812 works fine, but if I enable the PSRAM (required for accessing cam) the IO behaviour is uncertain.
I'm using IO33 as my signal pin to WS2812. While probing that IO the behaviour is shown.
Before enabling PSRAM
After enabling PSRAM
My CPU core is running at 240MHz and the flash size is 4MB
What am I missing? Any additional configurations required to work with PSRAM?
I've been working with ESP32-CAM implementing the WS2812 with RMT. On the first deployment, the WS2812 works fine, but if I enable the PSRAM (required for accessing cam) the IO behaviour is uncertain.
I'm using IO33 as my signal pin to WS2812. While probing that IO the behaviour is shown.
Before enabling PSRAM
After enabling PSRAM
My CPU core is running at 240MHz and the flash size is 4MB
What am I missing? Any additional configurations required to work with PSRAM?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: PSRAM changes IO behaviour of ESP32-CAM
Can you post your RMT code?
Re: PSRAM changes IO behaviour of ESP32-CAM
- void setup_rmt_data_buffer(rgbVal *pixels)
- {
- // --
- for (uint32_t led = 0; led < NUM_LEDS; led++) {
- uint32_t bits_to_send = 0;
- bits_to_send += (pixels[led].r) << 8;
- bits_to_send += (pixels[led].g);
- bits_to_send += (pixels[led].b) << 16;
- uint32_t mask = 1 << (BITS_PER_LED_CMD - 1);
- for (uint32_t bit = 0; bit < BITS_PER_LED_CMD; bit++) {
- uint32_t bit_is_set = bits_to_send & mask;
- led_data_buffer[led * BITS_PER_LED_CMD + bit] = bit_is_set ?
- (rmt_item32_t){{{T1H, 1, TL, 0}}} :
- (rmt_item32_t){{{T0H, 1, TL, 0}}};
- mask >>= 1;
- }
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: PSRAM changes IO behaviour of ESP32-CAM
Nothing particularily wrong there. Can you post your entire project, perhaps? It's odd that the two waveforms seem to be the exact inverse of eachother.
Re: PSRAM changes IO behaviour of ESP32-CAM
Here is the project file.
- Attachments
-
- ws_rmt.zip
- (14.57 KiB) Downloaded 621 times
Re: PSRAM changes IO behaviour of ESP32-CAM
ESP_Sprite - Did you had a chance to take a look into the project file I've shared?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: PSRAM changes IO behaviour of ESP32-CAM
The RMT WS2811 driver itself is missing there?
Re: PSRAM changes IO behaviour of ESP32-CAM
You mean in the components dir?
-
- Posts: 9709
- Joined: Thu Nov 26, 2015 4:08 am
Re: PSRAM changes IO behaviour of ESP32-CAM
That zip file does not have a components dir when I download it?
Re: PSRAM changes IO behaviour of ESP32-CAM
ESP_Sprite - Thanks for looking into the file I provided. I managed to get it working with PSRAM enabled after changing ws2812_control_init().
Code: Select all
rmt_config_t config = RMT_DEFAULT_CONFIG_TX(LED_RMT_TX_GPIO, LED_RMT_TX_CHANNEL);
config.clk_div = 2;
ESP_ERROR_CHECK(rmt_config(&config));
ESP_ERROR_CHECK(rmt_driver_install(config.channel, 0, 0));
Who is online
Users browsing this forum: No registered users and 242 guests