Help newbie to understand design structure (SPI/I2C)

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.
Anonymous
Not applicable

Hi 🙂
 

   

I am starting a project and I need some advice on how to start it in the best way. I have good nowlegde in overall programming and basic knowledge in posc architecture. For the project I will use PsoC 4100 M series.

   

My task is to:

   

1) Read out sensor data via SPI as fast as possible, therefore I want to use one SCB as an SPI Master.

   

2) Do basic floatingpoint arithmetic and calculation of the sensor data.

   

3) provide this calculated data to get read by an external I2C/SPI Master. Therefore I would use an unconfigured SCB as I2C / SPI Slave depending on a pin state or something.

   

 

   

I attached a picture of the structure for better understanding. I appreciate every hints or advice of my plan and would be also happy for documents and examples which works in the same direction. But the main question is, is this the correct way in handling my problem?

   

 

   

Thanks and best regards,

   

Nils 🙂

0 Likes
6 Replies
rola_264706
Level 8
Level 8
50 likes received 25 likes received 10 likes received
        What kind of Sensor voltage ,resistance, digital ? Have you looked at the Psoc examples?   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

When the price of the equipment is not busting your budget I would strongly recommend to use a PSoC 42xx. There is more freedom in routing and the additional internal 4 UDB blocks allow for some logic gates etc. There is a prototyping kit for the same price as a -41xx kit, but the chip even has got DMA capabilities.

   

 

   

Bob

   

PS: Where are you located, kleiner Nils 😉 I live near Bremen.

0 Likes
Anonymous
Not applicable

@bobgoar it is similar to an adc, so I use SPI

   

@bob thanks for your feedback! I just checked the datasheet of psoc42.. (http://www.mouser.de/ProductDetail/Cypress-Semiconductor/CY8C4245LTI-DM405/?qs=sGAEpiMZZMvI6uSdB0Aen... ) which looks quite interesting, also the price is ok!

   

Did I understand it correct that this PSoC has USB communication on board?

   

So the main task is to simply readout the sensor data and do some calculation with the data. And then I want to provide this data for other processors via SPI/I2C and maybe if it is possible via USB? In further development I could also use the lot possibilities of PSOC system, but I want to start small 🙂

   

 

   

PS: Yes I am located Mainz (near to Frankfurt) ... also können wir gerne auf deutsch weiter schreiben :))

   

 

   

Gruß Nils

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

@Nils

   

Sorry, forum language is English.

   

The PSoC4 M does not have got a USB interface, but the prototyping kit has got one. That makes debugging easier, because you may send ASCII data via USB to an emulated com-port on the PC to show messages or data in a terminal emulation program as PuTTY.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Hi Bob,

   

ok I understand 🙂

   

Yeah the datasheet I added as a link in before was for a PSoC4200L which support USB FS (12MBit/s) that's pretty cool an d a benefit for my application.

   

 

   

I Think I will use PSoC4200L! How should I start? Start with reading out the sensor data via SPI Master into a buffer/RAM located memory? And then try to write handeler functions for I2C and SPI Slave SCBs? First I thought, that I could do it a bit like a normal I2C sensor where i have defined registers and I can use a uC to read them out. But thtas not how SPI works and I need both to make it easier to use my application.

   

 

   

-Nils

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

Keep in mind that an SPI master receives a byte from slave for every byte sent. So at some points you have to discart buffer contents and at other places you'll have to send dummy bytes just to read out the slaves data.

   

How to start? Just begin! You will need a Development Kit or a Prototyping Board for your selected PSoC4-L lthough I do not know if Cypress has got them.

   

 

   

Bob

0 Likes