Content originally posted in LPCWare by JohnR on Mon Apr 08 05:52:32 MST 2013
Hi,
Are you sure that the default parameters set are appropriate for your interface?
In your code the default structure is used thus in lpc43xx_sssp.c
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT][/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [B]SSP_ConfigStructInit[/B]([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]SSP_CFG_Type[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] *SSP_InitStruct)
{
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CPHA[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_CPHA_FIRST;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CPOL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_CPOL_HI;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ClockRate[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 100000;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]Databit[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_DATABIT_8;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]Mode[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_MASTER_MODE;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]FrameFormat[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_FRAME_SPI;
}
In my code I had to alter [COLOR=#0000c0]CPHA[/COLOR][SIZE=2] to match the SPI device used thus[/SIZE]
[/LEFT]
[/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055][LEFT]void[/B][/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] [B]SSP_ConfigInit[/B]([/SIZE][SIZE=2][COLOR=#005032][SIZE=2][COLOR=#005032]SSP_CFG_Type[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] *SSP_InitStruct)
{
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CPHA[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_CPHA_SECOND; [/SIZE][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]//SSP_CPHA_FIRST[/LEFT]
[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][LEFT]SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]CPOL[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_CPOL_HI;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]ClockRate[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = 100000; [/SIZE]
[SIZE=2]SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]Databit[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_DATABIT_8;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]Mode[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_MASTER_MODE;
SSP_InitStruct->[/SIZE][SIZE=2][COLOR=#0000c0][SIZE=2][COLOR=#0000c0]FrameFormat[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] = SSP_FRAME_SPI;
}
JohnR.[/LEFT]
[/SIZE]