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.
rasa
Level 1
Level 1
First reply posted First question asked Welcome!

Writing code for SPI master - CYpress PSOC4.

Currently, I have a shorted,MOSI and MISO lines to test basic SPI communication. In the technical manual, they have given one of the below steps for SPi initialization.i need more details on these registers. unable to get clarity in these registers.

Problem: Value loaded into tx write register is still empty.

From reference manual:

15.2.6 Enabling and Initializing SPI

The SPI must be programmed in the following order:

  1. Program the transmitter and receiver FIFOs using the SCB_TX_FIFO_CTRL and SCB_RX_FIFO_CTRL registers respectively, as shown in Table 15-5:

a. Set the trigger level.

b. Clear the transmitter and receiver FIFO and Shift registers.

c. Freeze the TX and RX FIFO

But unable to understand the above register values. Also need more details on WR_PTR,RD_PTR,SR_VALID,USED.

Unable to write data in SCB_TX_FIFO_WR.Am missing these register settings.

 

 

 

 

 

 

 

0 Likes
3 Replies
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @rasa ,

Can you please let us know MPN of the PSoC 4 device, which you are using ? Meanwhile, I am sharing the register TRM for PSoC 4100/4200 Family devices here: https://www.cypress.com/documentation/technical-reference-manuals/psoc-41004200-family-psoc-4-regist...

You can search the register TRM for the device family that you are using. Please go through the SCB registers section to read about the registers in details and different data fields in the register. Each of the bit in a register correspond to a particular field in order to perform a task.

Please go through above and let us know if this helps.

Best Regards,

Aashita 

 

 

 

0 Likes
rasa
Level 1
Level 1
First reply posted First question asked Welcome!

Hi Thanks for the reply,

Already i have gone through this document. Unable to see data in TX_FIFO_WR register. So I need more details on these above registers.

 

 

0 Likes
Aashita_R
Moderator
Moderator
Moderator
50 likes received 100 solutions authored 250 replies posted

Hi @rasa ,

Did you get a chance to check out our already available PSoC 4 Code example for SPI Master functionality  : https://www.cypress.com/documentation/code-examples/ce224339-psoc-4-spi-master . This code example shows how to use a PSoC Creator Serial Communication Block (SCB) Component is configured in SPI mode as a master in a PSoC 4 device. You can compare the flow of your programme and check for yourself if there is something which is being missed.

Please let us know in case of further help.

Best Regards,

Aashita

 

0 Likes