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

xc164cs - spi

hi i configured xc164cs-spi using the following code. but the clk is not coming in the sclk pin. can anybody help
SSC0_CON_EN=0;
SSC_BR = 13 ;//(40000000/2*1000000)-1
SSC0_CON=0xc037;
P3.13=1;
ALTSELP3.13=1;
DP3.13=1;

Parents
  • hi i have written like this SSC0_CON = 0x4037 //en=0; SSC0_CON_EN = 1; SSC0_BR = 0x0013;//(F_CPU /(SPI_BAUDRATE * 2L) - 1); ALTSEL0P3_P8 = 1; ALTSEL0P3_P9 = 1; ALTSEL0P3_P13 = 1;

    DP3_P8 = 0; // MISO Input DP3_P9 = 1; // MOSI Output DP3_P13 = 1; // Clock Output

    P3_P8 = 0; P3_P9 = 1; P3_P13 = 1;

    still im not getting the clock. so i make my own clock in sclk pin and put data in transmit buffer and enable ssc it will trasmit on the transmit pin master? or if i make my own clock on the sclk pin i only have to feed data directly to transmit line?

Reply
  • hi i have written like this SSC0_CON = 0x4037 //en=0; SSC0_CON_EN = 1; SSC0_BR = 0x0013;//(F_CPU /(SPI_BAUDRATE * 2L) - 1); ALTSEL0P3_P8 = 1; ALTSEL0P3_P9 = 1; ALTSEL0P3_P13 = 1;

    DP3_P8 = 0; // MISO Input DP3_P9 = 1; // MOSI Output DP3_P13 = 1; // Clock Output

    P3_P8 = 0; P3_P9 = 1; P3_P13 = 1;

    still im not getting the clock. so i make my own clock in sclk pin and put data in transmit buffer and enable ssc it will trasmit on the transmit pin master? or if i make my own clock on the sclk pin i only have to feed data directly to transmit line?

Children
No data