SPI problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI problem

717 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by FDamn922 on Tue Apr 03 19:21:46 MST 2012
Hi, I'm trying to configure the SPI module.

Here is my code:

main()
{
SystemInit();
GPIOInit();
SSP_IOConfig(0);           //using port 0
SSP_Init(0);               //using port 0

uint8_t data=0x55;         //data to send

SSP_Send( 0, &data, 1 );   //send 0x55 on port 0, 1 time...
}

On CLK pin, I see the square clock signal (but it had 32 cycles, insted of 8 or 16).
On MOSI pin, I see nothing, the line is always 0 (with some noise...).

The functions GPIOInit, SSP_IOConfig, SSP_Init and SSP_Send are in the LPC/SPI example.

Any help? Thanks.
0 Kudos
Reply
2 Replies

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by FDamn922 on Wed Apr 04 22:45:30 MST 2012
Ok, I will check it today. Thank you!
0 Kudos
Reply

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by HalC on Wed Apr 04 00:06:56 MST 2012
Hi,
before you call the SSP_Send() function you have to ensure that the SSEL-pin is low and after the call high. I use the following code:

     
    /* Assert the SSEL pin */
    GPIOSetValue(PORT0, 2, 0);

    /* send SPI frame */
    SSP_Send( SSP0, tx_buff, 2);

    /* Deassert the SSEL pin */
    GPIOSetValue(PORT0, 2, 1);
0 Kudos
Reply