SCB SPI and non SCB SPI modules have different behaviour

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi all,

   

We have a different behaviour of the Cypress SPI modules on different Cypress CPUs.
When we use the SPI Slave non SCB (UDB?) based, version 2.70 on a CY8C4247LQI-BL483 we do receive SPI frames
from a Renesas controller, means the buffersize remains 0,
but when we change to CYBL10563-56LQXI we can only use the SCB based SPI module version 3.0 and
do not receive any frames with this component.
We use mode Slave and submode Motorola, with SCLK mode CPHA=1 and CPOL=0, Oversampling=8,
RX/TX data bits=8, MSB First, Number of SS:1, Active Low, with a FIFO Buffer size of 8 bytes. The datarate is 1kHz.

   

And the SCB SPI component has no rx/tx interrupt? Only an SPI_Done status and the various FIFO status and the buffer size?

   

Has anyone an idea why the modules are so different?

   

Thanks a lot and best regards

   

Andreas

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Andreas,

   

Set the SCB SPI to byte mode, Rx and Tx buffer to > 16. Then you have all interrupts you want.

   

The reason for the different components is related to the underlying hardware the SPI is build from. USB differs from SCB dramatically.

   

 

   

Bob

View solution in original post

0 Likes
8 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Andreas,

   

Set the SCB SPI to byte mode, Rx and Tx buffer to > 16. Then you have all interrupts you want.

   

The reason for the different components is related to the underlying hardware the SPI is build from. USB differs from SCB dramatically.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thanks Bob,

   

I will try this.

   

Is it neccessary to have the exact (or a greater) Timing Correlation as described in the SCB Datasheet on page 120?

   

What, if the trailing (or/or in addition) 1 or 1/2 SCLK period is missing and the clock and the select is inactive directly

   

after the last bit?

   

Andreas

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

For the slave there is a 100ns timing between ssel and sclock needed, obviously no hold required. See datasheet, AC characteristics. My component is 3.10, but changes from 3.0 are in datasheet only. Nonetheless, update.

   

 

   

Bob

Anonymous
Not applicable

I changed the settings of the SCB SPI now to byte mode, Rx and Tx buffer to == 32.

   

And implemented the interrupts, but only receive an tx interrupt, no rx interrupt and

   

the buffer size remains 0.

   

When I switch to the USB component, I receive the frames...

   

This is really weird...

   

Do you have an simple example with the SCB component correctly configured

   

as a slave with interrupts?

   

Andreas

0 Likes
lock attach
Attachments are accessible only for community members.
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Here is the example.

   

 

   

Bob

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

When using an interrupt on the SCP SPI, you need to select the proper interrupt source. You probably want to activate 'RX FIFO not empty', together with external interrupts, which should be triggered after the first byte has been received. (for external interrupts set the FIFO level to 8, otherwise internal buffer handling is needed)

0 Likes
Anonymous
Not applicable

Hi Bob,

   

thanks for the example, but the USB component is at least receiving some date - not in the correct order, but receiving something at least. The problem is the SCB component. The controller we use just supports this SCB SPI component and does not receive a single byte sent bythe same master. Its really weird and confusing. When I have two SCB SPI components on different Cypress Eval Boards one as master and the other as slave everything is fine, but if I change the master nothing works. Have tried an Arduino as master as well with the same result - no bytes receiving, while the USB SPI component (is USB correct? You where using this expression) receives data as well from the arduino, but not correct as well, I send 8 times a 0xBB and the SCB SPI component receives eight times a 0x77...

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Reduce the project(s) to the barest SPI communication master/slave. Then post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes