12 Replies Latest reply on Oct 4, 2017 3:55 AM by user_1377889

    PSoC Capable? Simultaneous 4 SPI Masters, 1 SPI Slave, and 4 Interrupts!!

    JoshuaMazurek

      Hello Everyone. Thanks for reading.

       

      Please excuse any ignorance on my part. I am very new to PSoC and have yet to even program a board! I am well versed in Arduino-type micros and Raspberry Pi but have quickly reached the ceiling of the Arduino processing power and am hoping PSoC is the answer!

       

      Quick overview of a project that I wanting to convert over to PSoC. 

      RF Wireless telemetry system.

      • Current Hardware
        • 4 Wireless nodes
          • Arduino Micro connected to nRF24L01+ sending 4 bytes of data
          • Torque measurements on rotating shaft.
        • 1 Base station
          • Raspberry Pi
            • Connected to nRF24L01+ via SPI
            • Connected to Arduino Mega via USB (Serial)
              • Mega has 4 Arduino Micros attached talking on I2C. These Micros are running interrupts for pulse counters to get RPM (1500RPM, 5-10 pulses per rev (I choose this) so 125Hz-250Hz maximum)
            • Also has GPS talking over USB (Serial)
            • Pi was the best way I knew how to log to files all the data I am collecting
      • Current System Capabilities
        • ~750Hz/channel RF data read sequentially (meaning Base Station RF reads channel 1, then channel 2 then …etc). 4 bytes per channel. 16 bytes total.
        • 400Hz/channel RPM data read sequentially(meaning Arduino Mega asks each Arduino Micro one after another for their current RPM). 4 bytes per channel. 16 bytes total.
        • 10Hz GPS data. Roughly 200 bytes or so.
        • Pi logs each of the above with timestamps to separate .csv files. Each of the above are currently NOT synced together. This is the real problem!
          • The Pi has no hard system clock (oscillator or equivalent), the software clock and nature of an OS proves inaccurate for syncing these files

       

      The Base Station is the Section that I am looking to implement PSoC. I am hoping to have PSoC be the Master on 4 SPI buses (talk to 4 separate nRF24 chips and grab 4 bytes of data), monitor 4 Interrupts (and calculate RPM), then send the 4 RF Channel data and 4 RPMs to Raspberry Pi via SPI (Pi is SPI Master and PSoC is SPI Slave).  To further complicate things I would like this stuff to happen as close to “real time” and simultaneous as possible, meaning I want RF data from each channel at 1000Hz minimum (per channel) while still being able to monitor the interrupts.

       

      I hope I am explaining this in a clear way.

       

      Questions:

      1. Can PSoC be a master to 4 SPI buses and get data from 4 slaves simultaneously?
      2. Can PSoC do the above while monitoring 4 separate interrupts (that WILL inevitable happen at the same time so I don’t want to miss pulses)?
      3. Can PSoC be a SPI slave and send all this data (only 32-ish bytes) to Pi?
      4. All the above be done and >1000Hz?

      The Pi is still being used because the GPS is integrated to it and it has file write/storage/retrieval capability built-in but if you think PSoC could easily handle the addition of serial GPS data with 100-200 bytes @ <20Hz and data storage to SD card or something , then I am all ears!

       

      If you have any questions or something is not making sense please ask am I will try to clear it up. Thanks again.

      -Josh