[En-Nut-Discussion] SPI1 problem on olimex256 ex

Andreas Wickström andreas.wickstroem at spray.se
Sat May 24 18:18:52 CEST 2008


Hello 

Has anyone got the spi port 1 on the olimex256ex card to work? My problem
seems to be that I don’t get any interrupt from the At91SpiTransfer2
function.

I do this when I start the spi port.

At91SpiInit(SPI1_BASE);

At91SpiInitChipSelects(SPI1_BASE, _BV(0));    

At91SpiSetRate(SPI1_BASE, 0, 166000);

At91SpiSetModeFlags(SPI1_BASE, 0, SPIMF_MASTER | SPIMF_MFDETECT |
SPIMF_SCKIAHI | SPIMF_CAPRISE);

At91SpiSetBits(SPI1_BASE, 0, 8);

At91SpiSetSckDelay(SPI1_BASE, 0, 1);

At91SpiSetTxDelay(SPI1_BASE, 0, 1);

 

And when I send data I use this function

int WriteData(unsigned int data_out)

{

    unsigned int data_in;

 

    data_out = data_out | 0x0100;

    At91SpiTransfer2(SPI1_BASE, 0, &data_out, &data_in, 1, NULL, NULL, 0);

    return data_in;

}

 

when I use the same code as above but on the spi port 0 I get an interrupt
and everything seems to work perfectly. What do I do wrong to get it to work
with the port 1?

Best regards Andreas Wickström




More information about the En-Nut-Discussion mailing list