ADC ISR pinned in a specific core
Posted: Wed Mar 30, 2022 11:33 pm
I have been use Esp32 in several applications. Wifi and bluetooth resources are very interesting and work very well, which increases the cost-benefit of this device. However, my first disappointment with this device was the impossibility of the use of floating point instructions inside ISR's. This is very bad limitation and reduces the aplications of this device. After the implementation of the IOT part, I was forced to change my calculations to fixed point to take the advantage of the part I have already implemented.
In another application using 16 analog inputs, I was surprised by the impossibility to use any kind of radio (wifi, bluetooth and espnow). I had to include another unit, one for 16 analog inputs and other for wifi, exchanging data by i2c, in order to get data by web pages. During this development, I found out that some analog inputs are multiplexed with strapping pins (boot configuration), so I have to include an external multiplex chip. It would be interesting in next designs that Espressif do not multiplex analog inputs with strapping pins.
Besides the non linearities we have in adc, we don't have enough information to implement the direct control of adc converter. We can see in a simpler microcontroller, like Atmega328P, a way to trigger adc by a timer and get the results using an ISR requested by adc. This is a best way to sample data. However I have to use functions like ad1_get_raw() to sample data in Esp32, because I don't have information to control the adc directly, as I have done for Atmega328p or TMS28379. It's frustrating when you don't have enough information available to design our own routines if we want to. I don't know if Esp32 doesn't have these resources (like to create a sequence of channels to be sampled in a timer trigger) or this is a simple lack in documentation.
Another point that is very important is to provide clearly a way to pin an ISR to a specific core.
I would appreciate if someone can indicate a way to overcome the difficulties I have mentioned above. At the end, I want to know if it is possible to sample a sequence of channels by a single timer trigger, and get the results using an adc ISR pinned in a specific core.
Thanks in advance
In another application using 16 analog inputs, I was surprised by the impossibility to use any kind of radio (wifi, bluetooth and espnow). I had to include another unit, one for 16 analog inputs and other for wifi, exchanging data by i2c, in order to get data by web pages. During this development, I found out that some analog inputs are multiplexed with strapping pins (boot configuration), so I have to include an external multiplex chip. It would be interesting in next designs that Espressif do not multiplex analog inputs with strapping pins.
Besides the non linearities we have in adc, we don't have enough information to implement the direct control of adc converter. We can see in a simpler microcontroller, like Atmega328P, a way to trigger adc by a timer and get the results using an ISR requested by adc. This is a best way to sample data. However I have to use functions like ad1_get_raw() to sample data in Esp32, because I don't have information to control the adc directly, as I have done for Atmega328p or TMS28379. It's frustrating when you don't have enough information available to design our own routines if we want to. I don't know if Esp32 doesn't have these resources (like to create a sequence of channels to be sampled in a timer trigger) or this is a simple lack in documentation.
Another point that is very important is to provide clearly a way to pin an ISR to a specific core.
I would appreciate if someone can indicate a way to overcome the difficulties I have mentioned above. At the end, I want to know if it is possible to sample a sequence of channels by a single timer trigger, and get the results using an adc ISR pinned in a specific core.
Thanks in advance