4 Replies Latest reply on Feb 12, 2015 12:02 PM by jesuzfreak1

    PSoC 4 Pioneer Kit Community Project#083 – Raspberry Pi Integration




      We have been targeting two communities in the 100 days projects, Arduino and Pmod. In today’s example we will be adding support for the wildly popular Raspberry Pi hardware. In this example we will have the Pioneer board communicate to the Raspberry Pi. The Raspberry Pi will then send values back to the Pioneer board to control a PWM connected to the LED. Also included in this example is a python script for users to create a hyperterminal program to read and write data to the Pioneer board from the Pi.


      001 - Schematic Design.png


      Forum Post Attachments:


      At the bottom of this post we are including the following items:

      • Example Project Zip File
      • Project Images


      Components Used: 


      The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:

      • UART
      • I2C
      • SPIS
      • PWM
      • CyClock
      • CyPin
      • ISR


      Firmware Description:


      The main.c firmware is included in the example project. Please review the commented sections for more details.


      The firmware for this project consists of three communication protocols UART, I2C, and SPI. The Pioneer board continuously sends data over the UART and SPI lines which are received by the Raspberry Pi. The Raspberry Pi in return transmits the data back to the Pioneer board using the I2C interface. The values sent from the Raspberry Pi over the I2C port control a PWM value that drives an LED.


      Also included in this example is the python script that creates the terminal window that displays the UART and SPI values on the Raspberry Pi’s OS screen. In this project we are running the Raspbian OS on the Raspberry Pi. Raspbian is a free OS based on the Debian Linux distro. The following image is for the Python code.


      007 - Python.png


      Hardware Connections:


      For this example the user will need to make a number of connections from the Pioneer board to the Raspberry Pi. On the Raspberry Pi there is a large header that will accept all of the wires from the Pioneer board. Please follow the schematics to connect the Pioneer kit to the Pi.


      006 - RPi 5.png


      005 - RPi 4.png


      Test Your Project:


      Program the example code into the Pioneer board, complete all of the connections to the Raspberry Pi, load up the python script and start reading in serial data.


      004 - RPi 3.png


      I hope this example can help you in your design.




        • Re: PSoC 4 Pioneer Kit Community Project#083 – Raspberry Pi Integration

          I like the set up.


          It uses a very simple connection to show how you can integrate a General Purpose computer system to a dedicated I/O intensive MCU for a given application.


          It helps make the issues between RPi and the Beagle Bone moot.  Why chose one over the other when you can use Both to make a really powerful system?


          I think a lot of people forget the overall system design process and get hung up over the selection of minor components. 

          MCU's, desk tops, lap tops, tablets, and even dumb terminals all have a place in system design. 

          Any component you choose today will be obsolete within a year. 


          Concentrate on the functions you want to implement and select the components that enable you to attain those goals.


          Just my opinion,


          • Re: PSoC 4 Pioneer Kit Community Project#083 – Raspberry Pi Integration

            Hi Matt,


            Thanks, thats very useful!

            We use the UART connection between the Pi and the PSoC4 Board. What we want to do is use a second PSoC4 Board.

            Is it possible to connect the PSoC kit via USB?


            The PSoC5 on the board could be used as an UART-to-USB converter, but I didn't find a way by now to get a device in /dev like tty.usbserial or something on the Raspberry.


            That would be a simple scaleable structure to connect as much PSoCs as needed (3 in my case).


            Thank you very much,




              • Re: PSoC 4 Pioneer Kit Community Project#083 – Raspberry Pi Integration

                Hey Richard,


                There's a few ways you could connect multiple PSoCs to a single RasPi -


                1. [RasPi] --> [PSoC 4] over UART, SPI, I2C each. This will get you 3 PSoCs connected, although talking different serial protocols across each (as demonstrate in this example)


                2. [RasPi] --> [PSoC 5LP] over USB --> [PSoC 4] over UART (as you suggested)


                3. [RasPi] + USB Hub --> Multiple Pioneer Kits [PSoC 5LP] (as many as your USB hub can support, each will show up as a separte virtual COM port on the RasPi)


                4. [RasPi] --> Multiple Pioneer Kits [PSoC 4] over I2C/SPI using addressing on each slave on the communication bus. This way, again, you could have multiple PSoCs connected to the RasPi, talk the same protocol (SPI or I2C), and use slave addressing to talk to the individual PSoCs on the bus.

                1 of 1 people found this helpful
              • Re: PSoC 4 Pioneer Kit Community Project#083 – Raspberry Pi Integration

                Hey Matt,


                If I am trying to interface the PSoC 3 CY8C3866AXI-040 chip with the Raspberry Pi. Will his work in a similar fashion to your tutorial?