@ADEngineer
New Member
I am using MG32F157VCT6 for SPI connectivity but the MCU is not transferring data to the SPIx->DR and vice-versa for receiving data. This issue is happening even in the example code given in the library.
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
If that is the case, it might explain why MG32F157VCT6 is not generating SCLK. SPI is not a request response kind of exchange. Whenever data is sent, data is also received on the same clock pulses. The received data is whatever the peripheral device has available when a transmission begins. Often this is "NULL" or meaningless data, and it is discarded.Are you trying to use the MCU as a slave device? Your description is not clear on that.
I have already done that. This is happening with all other mg32f157vct6. All the procedure is as per the documentation still no sck. Although the same procedure when executed on STM32 BluePill it works.If that is the case, it might explain why MG32F157VCT6 is not generating SCLK. SPI is not a request response kind of exchange. Whenever data is sent, data is also received on the same clock pulses. The received data is whatever the peripheral device has available when a transmission begins. Often this is "NULL" or meaningless data, and it is discarded.
The way to debug this is to have the MG32F157VCT6 disconnected from ALL of the peripheral devices, put it in a loop sending data, and see if the SCLK pulses appear. If they don't then you have some investigation to do.
no the pin is assigned properly.Is the pin configuration for the pin SCLK is used for correct. With multi-function pins on many processors this can be a convoluted process to decode and implement.
Yes GPIOs, timers, PWM ADC and DAC work fine but not SPI and I2C.Have you tested other functions on the MCU and does everything else work, other than the SPI?