Search found 9 matches

by chr_te
Tue Sep 03, 2024 9:33 am
Forum: ESP32 Arduino
Topic: ESP32-S3 USB Port uploads but serial comms are not working.
Replies: 5
Views: 3310

Re: ESP32-S3 USB Port uploads but serial comms are not working.

Also, somehow verify at least once, that your upload goes as planned and make sure you're not actually stuck in boot mode!
E.g. you could turn on an LED or something, that makes you see, that the uc is actually running your program.
by chr_te
Tue Sep 03, 2024 9:28 am
Forum: ESP32 Arduino
Topic: ESP32-S3 USB Port uploads but serial comms are not working.
Replies: 5
Views: 3310

Re: ESP32-S3 USB Port uploads but serial comms are not working.

Hi Chevelle, Serial actually is a macro and it gets defined according to the setup you've configured (e.g. in the arduino ide, more later). It can be especially confusing when accidentally getting the configuration wrong and going crazy over seeing no Serial output. Without changing anything in your...
by chr_te
Thu Aug 29, 2024 11:33 pm
Forum: ESP32 Arduino
Topic: ESP32S3 LEDC for low frequency
Replies: 5
Views: 2294

Re: ESP32S3 LEDC for low frequency

Thank you so much! Don't know how I've missed that example. I can confirm the 3 Hz for the s3, that's as low as it will go utilizing the Arduino API: #include <Arduino.h> #define LED_PIN 6 void setup() { ledcAttachChannel(LED_PIN, 3, 14, 0); // 2 Hz, 14 bit (0-16383) ledcWrite(LED_PIN, 8192); } void...
by chr_te
Thu Aug 29, 2024 9:02 am
Forum: ESP32 Arduino
Topic: ESP32S3 LEDC for low frequency
Replies: 5
Views: 2294

Re: ESP32S3 LEDC for low frequency

It can't go below 1Hz, but there's no reason you can't use it as a blinker blinker example Thanks for the answer and I wish it worked, but it doesn't. Also, I'm using the s3, in case that changes anything. The following program fails: #define LED_PIN 6 void setup() { ledcAttach(LED_PIN, 1, 12); // ...
by chr_te
Thu Aug 29, 2024 12:16 am
Forum: ESP32 Arduino
Topic: ESP32S3 LEDC for low frequency
Replies: 5
Views: 2294

ESP32S3 LEDC for low frequency

Hi everyone, I would like to e.g. blink an LED utilizing the LEDC peripheral. When saying blinking an LED, I'm referring to something like 500 ms on, 500 ms off, i.e. 1 second PWM period with 50 % duty cycle. Using ledcAttach I can't get much below a frequency of 200 Hz. I am aware that documentatio...
by chr_te
Fri Apr 12, 2024 10:44 pm
Forum: ESP32 Arduino
Topic: Protect counter variable by portENTER_CRITICAL vs <atomic>
Replies: 5
Views: 1794

Re: Protect counter variable by portENTER_CRITICAL vs <atomic>

Thank you, @MicroController!
by chr_te
Fri Apr 12, 2024 5:29 pm
Forum: ESP32 Arduino
Topic: Protect counter variable by portENTER_CRITICAL vs <atomic>
Replies: 5
Views: 1794

Re: Protect counter variable by portENTER_CRITICAL vs <atomic>

To answer my own question: We can use the member function is_lock_free() on objects of <atomic> and it will tell us if the associated atomicity is implemented without any software locking etc. This is the case for (u)int8, (u)int16 and (u)int32 types, as shown by the little example: #include <Arduin...
by chr_te
Fri Apr 12, 2024 9:04 am
Forum: ESP32 Arduino
Topic: Protect counter variable by portENTER_CRITICAL vs <atomic>
Replies: 5
Views: 1794

Re: Protect counter variable by portENTER_CRITICAL vs <atomic>

Thank you! And I probably don't need the volatile keyword, right?
Another maybe naive question, but I just want to make sure. Same of course goes for 16-bit and 8-bit atomics, that they are handeled in hardware?
by chr_te
Thu Apr 11, 2024 11:41 pm
Forum: ESP32 Arduino
Topic: Protect counter variable by portENTER_CRITICAL vs <atomic>
Replies: 5
Views: 1794

Protect counter variable by portENTER_CRITICAL vs <atomic>

Hey everyone, I have a counter variable (int type). This counter is incremented from within an ISR. Outside of an ISR that variable is read (for an <=int32 that’s atomic), but also decremented an amount of n (so that’s a read modify write). From what I understand, the proper ESP-IDF FreeRTOS way is ...