cancel
Showing results for 
Search instead for 
Did you mean: 

50Hz sine wave generation in STM32

Madhura_Deshmukh
Associate

Hello team,

We are looking to generate a sine function of 50 Hz frequency using the STM Cordic.

Can you please share the theta range in this case. While we are giving 0 to 1 or 0 to 2pi (normal theta range), the resulting sine wave is not as per expectation. Please share a code for our reference.

Also, if we want to use the Matlab embedded libraries, what should be the data type and conversion expected in this case?

 

Requesting your earliest inputs!

Thank you!

Best Regards,

Madhura

1 REPLY 1
######
Senior

I've never used this but I found this link...

https://www.st.com/resource/en/product_training/STM32G4-Peripheral-Cordic_Coprocessor_CORDIC.pdf

Suggests that the cordic input is normalised by pi radians in the -pi to +pi range, which equals -1 to 1. 

As described in the document these input values are signed fixed point, so the numeric range is therefore -1 (0x80000000) to 1 - (2^31) (0x7FFFFFFF).

Hope this helps.