SPI Protocol issues PSOC4 BLE

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

cross mob
lock attach
Attachments are accessible only for community members.
SuRa_2245351
Level 4
Level 4
First like received First like given

I have written basic code for reading x,y and z axis data from ADXL362 accelerometer using SPI protocol.Following are the problems I am facing while using SPI protocol with PSOC4 BLE ki(CY8C4247LQI-BL483):

1.when SPI is used in Byte mode with Rx buffer size set more than 16, then SPI won't work and data is not received from ADXL362. If Rx buffer size is less than or equal to sixteen than program works and data is received.

2.If I change pin configuration as mentioned below in the same program then SPI won't work even if the Rx buffer size is less than or equal to 16.

P4.0=SCB1_SPI_MOSI[0]

P4.1=SCB1_SPI_MISO[0]

P5.0=SCB1_SPI_SS0[0]

P5.1=SCB1_SPI_SCLK[0]

I have attached code below please help.

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

The USB block has 16 bytes of hardware FIFO.  So, if the RX buffer size is set more than sixteen, the SPI_Master component provides a software FIFO code using interrupts.

You call the function SingleByteWrite() using SPI APIs from main() prior to invoking CyGlobalIntEnable.  These SPI APIs would not work because all interrupts are disabled.  Please try to move the CyGlobalIntEnable line before the SingleByteWrite() function.

I don't know the reason of the issue number 2.

Regards,

Noriaki

View solution in original post

0 Likes
2 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

The USB block has 16 bytes of hardware FIFO.  So, if the RX buffer size is set more than sixteen, the SPI_Master component provides a software FIFO code using interrupts.

You call the function SingleByteWrite() using SPI APIs from main() prior to invoking CyGlobalIntEnable.  These SPI APIs would not work because all interrupts are disabled.  Please try to move the CyGlobalIntEnable line before the SingleByteWrite() function.

I don't know the reason of the issue number 2.

Regards,

Noriaki

0 Likes
SuRa_2245351
Level 4
Level 4
First like received First like given

Thank you ! !

Noriaki my first issue is solved but second issue still persists.

0 Likes