SPI problem with DSP56F826EVM

Started by ltc2400 February 18, 2003
Hello, I am a newcomer to the motorola chips. i have a DSP56F826EVM
and am trying to get the SPI port to write. My code is based on an
example (5.1) in the codewarrior documentation.

#include "port.h"
#include "io.h"
#include "fcntl.h"
#include "bsp.h"
#include "spi.h"

void main (void)
spi_sParams SpiParams;
int SPIMaster;
UWord16 Data = 0x1234;
int i;

SpiParams.bSetAsMaster = 1;

SPIMaster = open(BSP_DEVICE_NAME_SPI_0, 0, &SpiParams);

write(SPIMaster, &Data, sizeof(Data));


My problem is that whenever open() is called, it completes (it does
not return a -1) so it completes successfully. however, when it
exits, the entire program finishes, the for loop is skipped, the close
() function is skipped, it just goes to the closing bracket and stays
there. can anyone help?? thanks a lot