Problem with SPI Master communication between PSOC BLE and External devices (Pi and LM74)?

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

cross mob
Anonymous
Not applicable

Hi Every one,

   

I am back once again with my stupid questions :p.

   

But, I am very thankful to you all for your quick help.

   

This time I have the following problem : May be there is a problem in understanding the thing, but your suggestions are highly needed.

   

I am using PSOC 4 Ble chip, Temperature sensor (LM74) and Raspberry Pi.

   

1. I want to read data from LM74 via PSOC 4 BLE and Pi.

   

2. I also like to get data (from other sensor) via SPI from PSOC to Pi.

   

But, LM74 can only act as 3-wire SPI salve: this means Pi and PSOC will act as SPI master (bidirectional).

   

Since i have limited resources in PSOC 4 BLE I cannot use both spi master and slave blocks in one project design: I thought the following way:

   

Pi will be the master for both PSOC and LM74 and will operate in daisy chain.

   

PSOC will act as master for LM74 and slave for Pi, this means PSOC spi master will have two chip select line(controlled via control register).

   

Now the question is: Is it possible for 3 wire PSOC SPI master to act as master for LM74 and slave for Raspberry PI?

   

Looking forward for your suggestions

   

Regards

   

maknight

0 Likes
1 Solution
Anonymous
Not applicable

If you are wanting more than two devices connected together, why not just have the PI be the master and both the PSoC and the LM be slaves?

   

That being said, as HIMA said above, you can leave the component in unconfigured mode and configure it between slave and master real-time. (You might not even need it to start in unconfigured mode, but might as well)

View solution in original post

0 Likes
6 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

You can have the SCB in unconfigured mode and configure it real time.

   

Thanks,

   

Hima

0 Likes
Anonymous
Not applicable

If you are wanting more than two devices connected together, why not just have the PI be the master and both the PSoC and the LM be slaves?

   

That being said, as HIMA said above, you can leave the component in unconfigured mode and configure it between slave and master real-time. (You might not even need it to start in unconfigured mode, but might as well)

0 Likes
Anonymous
Not applicable

Thank you for your reply e.pratt_1639216.

   

I want to make communication between PSOC and LM but LM can only be slave.

   

AS said you and HIMA "leave the component in unconfigured mode and configure it between slave and master real-time."

   

Are there any limitation in using them?

0 Likes
Anonymous
Not applicable

They take time to switch between, and code space (Flash,RAM, etc). So, the limitation is mostly the overhead for switching between the two setups.

   

There is of course the issue of having multiple masters driving the same clock/data/lines.

   

As long as you don't have the PI and PSOC both driving voltages at the same time, then there shouldn't be any issues for switching between slave and master on the SCB configuration.

0 Likes
Anonymous
Not applicable

Thank you e.pratt_1639216 for your reply.

   

But just to make sure, is it possible to use the PSOC SPI master bidirectional (one at a time) as a slave for Pi and master for LM74?

0 Likes
Anonymous
Not applicable

It should be runtime configureable to switch it between master and slave on the PSoC SPI component (Tldr Yes.).

   

I haven't done it with the SPI specifically, but I have done something similar with the BLE component.

0 Likes