We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
hi ! i am new to keil ... currenly , i am working on p89v51 to enable the spi mode and use it with sd card...
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.......
Thanks in advance...