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 on MCB 2300

I had code to configure the LPC 2378 as an SPI slave that appeared to be working, but now no longer does. Now, when I read the S0SPDR register, I always get 0xFFFF

        PCONP   |=  0x00000100;
        PINSEL0 &= ~0xC0000000;
        PINSEL1 &= ~0x0000003F;
        PINSEL0 |=  0xC0000000;
        PINSEL1 |=  0x0000003F;
        S0SPCR   =  0x0004;                      //SLAVE mode; 16 bit transfers; MSB first; SPI Mode 0
  while (1) {
        status = (S0SPSR & 0x0080);
        if (status) {
                data = S0SPDR;

"data" above always returns 0xFFFF. I looked at the SPI lines on a scope and they look correct. I read the SPTSR register and it shows no errors. I ran the same code on an LPC2478 development board with the same results

Thanks in advance,
Bill F

Parents Reply Children
  • Thanks.
    I thought about that. My master (NI 8541) can be configured from clock speeds down to 1 kHz. I have sent data as low as 50 kHz (any lower and the SPIF flag is never set). The default for the SPI clock is CCLK/4. I went ahead and tried /2 and /1 by setting PCLKSEL0 with the same results. Is there another clock setting I need to set? The manual says the SPI Clock Counter Register is not relevant in SLAVE mode

    Bill F