cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 peripheral for logical operations

jman08
Associate

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

5 REPLIES 5
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.

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.

If you feel a post has answered your question, please click "Accept as Solution".

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 ...

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