Trying to use CORDIC on a NUCLEO-G431RB. I have some example code but
its almost like the CORDIC module is not responding. In CubeMX I have enabled CORDIC but no MX_CORDIC_Init() function appeared in the main.c code (should that function be there?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-26 9:05 AM
How do I initialise it? Do I need to swith on an internal peripheral Bus?
- Labels:
-
STM32CubeIDE
-
STM32CubeMX
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-27 1:06 AM
not an answer but for more info. All the registers, in the debugger contain 0x50. But writing or reading from them seems to make no difference.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-27 6:03 AM
Mysteriously this morning the gui changed and I now have all the HAL libraries!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-02-27 9:16 AM
CORDICsConfig.Function = CORDIC_FUNCTION_COSINE; // Needs M and theta of M.Sin(theta)
CORDICsConfig.Scale = 0;// CORDIC_CSR_SCALE_0 == Q1.32 or B1 making this 0 makes it B0 as it should be
CORDICsConfig.NbWrite = CORDIC_NBWRITE_2;
CORDICsConfig.NbRead = CORDIC_NBREAD_2;
CORDICsConfig.InSize = CORDIC_INSIZE_32BITS;
CORDICsConfig.OutSize = CORDIC_INSIZE_32BITS;
CORDICsConfig.Precision = CORDIC_PRECISION_15CYCLES;
HAL_CORDIC_Configure(&hcordic, &CORDICsConfig);
This seems to work fine for sines and cosines and atan2 (called modulus)
However, the CORDIC_CSR_SCALE_0 (I think) should be named CORDIC_CSR_SCALE_1
To get this working I had to force a zero in.
With CORDIC_CSR_SCALE_0 I get what I would expect would be B1 scaling.
