Bingshuang Han

question on SPI timer

Discussion created by Bingshuang Han Employee on Jun 7, 2007
Latest reply on Jun 8, 2007 by Bingshuang Han
hello, I just begin the programming SPI with DEMO9S08LC60. Now, I am confused about the time counter. Every time the output SP1CLK is 16-bit (It is not 8-bit?), Is this right? and temp also stops at 2.
Thank you for yourhelp
The sample code shows as follows.
void SPISendChar (unsigned char data)
       while (!SPI1S_SPTEF);    //Wait until transmit buffer is empty
       SPI1D =data;              //Transmit data
void main ()
   SPI1C1=0xD5;  //set the SPI1 as a master
   SPI1BR= 0x45;
    for (temp=0;temp<100000;temp++)
        CurrentByte =0x42;
        SPISendChar(CurrentByte) ;