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

unble to use spi mode in philips p89v51rd2

I am working on p89v51rd2 use spi mode and connect it with sd card...
i had configured spi registers (SPCFG and SPCTL) correctly.
my problem is i cant get output on port 1 pins (ss,mosi,miso,sck)

#include <stdio.h>
#include <p89v51rd2.h>

void spi_init()
{
        P1 = 0xBF;                       // defines i/o pins
        SS = 1;                          // sets the chip select pin high
        SPCFG = 0x00;                    // clears spi flag
        SPCTL = 0x5B;                    // selecting master mode and other configurations
}

void main()
{
        spi_init();                      // spi mode initialization
        while(1)
        {
        SS = 0;
        SPDAT = 0xAA;                    // sends AAh to slave device
        while (!(SPCFG & 0x80));
        SPCFG =0x00;
        SS = 1;
        }
}


i have looked to port1 in analysis windows but nothing comes up?
any kind of help would be appreciated.......