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;
}

0