This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

SK-TDA4VM: EB can not config SPI baudrate

Part Number: SK-TDA4VM

Hi,

I install  MCUSW_09_00_00_10_CONFIG-windows-installer.exe and EB 24.0 ,

and try to config MCAL SPI, but get some trouble.

I config McuClock(80Mhz) and SpiExtDeviceClockDivider(1 or 2) for SPI,but Prama SpiBaudrate still 500.

1. I want to know how to change the value?

2. how I assign mcu pin to SPI peripheral in EB?

  • 1. To change the value of SpiBaudrate, you need to calculate the desired baud rate based on the clock frequency and the desired SPI clock rate. The formula for calculating the SPI baud rate is:

    SPI Baud Rate = (SPI Clock Frequency) / (2 x SpiBaudrate)

    For example, if your SPI clock frequency is 10 MHz and you want a baud rate of 1 MHz, you would set SpiBaudrate to 5:

    SpiBaudrate = (10 MHz) / (2 x 1 MHz) = 5

    Once you have calculated the desired SpiBaudrate value, you can set it using the SPI_setConfig function in MCAL SPI.

    2. To assign MCU pins to SPI peripheral in EB, you can use the Pinmux tool. The Pinmux tool allows you to configure the pin assignments for different peripherals, including SPI. Here are the steps to assign MCU pins to SPI peripheral in EB:

    a. Open the Pinmux tool in EB.

    b. Select the MCU device you are using.

    c. Navigate to the SPI peripheral in the pinmux configuration.

    d. Select the pins you want to use for SPI communication.

    e. Save the pinmux configuration.

    f. Generate the code for the pinmux configuration.

    g. Include the generated code in your project.

    With the pinmux configuration in place, you can use the corresponding pins for SPI communication in your MCAL SPI configuration.

  • Hi, Gary!

    I have configured "SPI Clock Frequency" in MCUClockReferencePoint to 8.0E7 (80MHz)  and

    configured "SpiExtDeviceClockDivider" in SpiExtDeviceClockDivider to 2. But the value of SpiBaudrate no change.

    I don't find parameter or function_API of "SPI_setConfig", can you upload the figure or demo to make it clear?

  • Hello,

    Firstly, it's important to understand that the SPI baud rate is determined by the combination of the SPI clock frequency and the SPI clock divider. The SPI clock frequency is typically set by configuring the MCU clock frequency, while the SPI clock divider is set separately.

    To set the SPI clock frequency in MCUClockReferencePoint to 80MHz, you can follow these steps:

    1. Open the MCUClockReferencePoint configuration in your software tool.
    2. Locate the parameter for MCU clock frequency and set it to 80MHz (or 8.0E7).
    3. Save the configuration changes and rebuild your project.

    To set the SpiExtDeviceClockDivider to 2, you can follow these steps:

    1. Open the SPI configuration in your software tool.
    2. Locate the parameter for SpiExtDeviceClockDivider and set it to 2.
    3. Save the configuration changes and rebuild your project.

    Once you have set the SPI clock frequency and the SPI clock divider, you can calculate the desired SPI baud rate using the following formula:

    SPI Baud Rate = SPI Clock Frequency / (2 * SpiExtDeviceClockDivider)

    For example, if you have set the SPI clock frequency to 80MHz and the SpiExtDeviceClockDivider to 2, the SPI baud rate would be:

    SPI Baud Rate = 80MHz / (2 * 2) = 20MHz

    Regards,

    Gary