This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SPI Initialization

In following function of initializing of SPI,
I am not getting two things Please help me.

1. How to choose the value of SPCCR=0x8. ?
2. As well as why put 0x1 in to the VPBDIV. ?

void Initialize()
{

PINSEL0=0x5500;

/* Set pclk to same as cclk */
VPBDIV=0x1;

/* Set to highest speed for SPI at 10 MHz- > 1.25 MHz */
SPCCR=0x8;

SPCR=0x20;
}

Parents
  • The you can use ARM wizard to make the SPI settings http://alexan.edaboard.eu/

    You have to set the core clock (CCLK) and PCLK divider manually to the settings you use in your mcu (for example 60MHz and 1/4 which means that the SPI peripheral clock is 15MHz), then you can set the SPI/SSP frequency by using up/down arrow on the divider value edits or by right clicking and selecting the target frequency.

    In either case it would be a good idea to check the manual so that you know of the calculations involved, then use the application to do it automatically.

    Alex

Reply
  • The you can use ARM wizard to make the SPI settings http://alexan.edaboard.eu/

    You have to set the core clock (CCLK) and PCLK divider manually to the settings you use in your mcu (for example 60MHz and 1/4 which means that the SPI peripheral clock is 15MHz), then you can set the SPI/SSP frequency by using up/down arrow on the divider value edits or by right clicking and selecting the target frequency.

    In either case it would be a good idea to check the manual so that you know of the calculations involved, then use the application to do it automatically.

    Alex

Children
No data