SPI Problem


#1

Hi,

I am using the q2687 and trying to get the spi bus working. When I write more than one byte using adl_busWrite() I can see on the oscilloscope that there is a 30us delay between the first and the second byte (I have set the Clk_Speed to 4 giving 2.6MHz bus speed) The clk stays high for the 30us and only thereafter are the rest of the bytes transmitted

Even if I send more than two bytes I still only have the delay between the first two bytes but no delay between the other bytes.

I have included the relevant code snippets.

const adl_busSPISettings_t MySPIConfig =
{
 4,
 ADL_BUS_SPI_CLK_MODE_0,
 ADL_BUS_SPI_ADDR_CS_NONE,
 ADL_BUS_SPI_CS_POL_LOW,
 ADL_BUS_SPI_MSB_FIRST,
 0,
 ADL_BUS_SPI_FRAME_HANDLING,
 ADL_BUS_SPI_DATA_UNIDIR
};
adl_busAccess_t AccessConfig =
{
    0,0,0,0,
    ADL_BUS_SIZE_BYTE
};
u8 WriteBuffer [ WRITE_SIZE ]

    
MySPI1Handle = adl_busSubscribe(ADL_BUS_SPI1, &MySPIConfig);


 WriteBuffer[0]=0xAA;
 WriteBuffer[1]=0xAA;

   
    adl_busWrite ( MySPI1Handle, &AccessConfig, 2, &WriteBuffer );

Any comments or suggestions?

Kind Regards,
Gert


#2

Has anyone actually used the SPI? And did you send out data?

Regards,
Gert


#3

I found this delay on 2 first byte like you but it still communicate with external device. did you found the problem ? or just only question on this behavior?


#4

Hi Guys

Has anyone there problem with adl_busRead in UNIDIR mode fo SPI1? I can`t read anything! Data are valid (osciloscope) but Q2686 still return 0xFF as read data. Write function seems to be ok.

Has anyone the same problem? BIDIR mode works fine but what about UNIDIR?

Modem: Q2686
Firmware: 6.63
OpenAT: 4.20

Kriss

Sorry - it was my mistake. Now its working properly. by gones


#5

Hello,

I also have this ‘problem’.
There is a delay of 30µs between the first byte and the following ones.

Is there yet a solution or could it give problems?

Thanks


#6

Hi

So your problem is delay of 30µs between the first byte and the following ones?
Im using SPI for many different peripherals and its working quite well.

What is the other side of SPI communication? Memory, ADC, etc.? Maybe we can
help this way - more details please :wink:

\kr