2024-09-27 02:07 AM
Hi,
I'm currently using the STM32G474RET6 controller for my application which makes use of the CORDIC coprocessor. I'd like to perform logical operations (say comparison checks) on the results from the CORDIC coprocessor using an external peripheral, if possible, similar to the CORDIC coprocessor. Does the earlier mentioned controller offer this feature?
Thanks,
jman08
2024-09-27 06:38 AM
Not quite sure what you're asking here. Yes, the chip has a CORDIC coprocessor. Yes, you can use the results from this however you want. Perhaps flesh out the specific behavior you're looking for. What comparison checks do you want to make, and with what peripheral? These will likely require the CPU.
2024-09-27 06:46 AM - edited 2024-09-27 06:49 AM
My application requires me to pass the results of the ADC conversion via DMA to the CORDIC coprocessor. Assuming that there are 100 such ADC samples, the results of the CORDIC coprocessor is an array of 100 values. Each of these 100 values will have to be checked induvidually against a predefined threshold value. I'd like to know if it is possible to perform the comparison against the predefined value using a peripheral similar to the CORDIC. My intention is to send these 100 results from the CORDIC to the peripheral (if it exists) via the DMA. The comparison results should be fetched using the DMA again.
I'm trying to reduce the time required for comparisons on the CPU by relying on an external peripheral if it exists.
2024-09-27 07:07 AM
I don't think anything like that exists. ADC has hardware thresholds you can set, but there isn't any sort of "hardware thresholds" on general memory that I know of.
2024-09-27 07:12 AM
The ADCs are 12-bit - so each sample fits in a single processor word (or half-word, even).
So, in code, each comparison would be, at worst, just a single word comparison ...
2024-09-28 07:28 AM
You probably could use a non-running timer for comparison, loading the compare value to TIMx_CNT and DMA-ing the array into one of the TIMx_CCRx, while having that channel set to one of the PWM modes. To latch the output value, this channel's OCxREF should be output theour TIMx_CR2.MMS as TRGO, and then a second timer linked as a slave could be used in Trigger mode.
I haven't tried so maybe there is something in the details which would make this not viable. Also I don't say it's very practical, but IMO possible.
JW