Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

spi mode on p89v51 for sd card

Status
Not open for further replies.

jaydeep.gajjar90

Newbie level 6
Joined
Mar 11, 2011
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,409
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.......
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top