Example Projects
CY8CKIT-044 PSoC® 4 M-Series Pioneer Kit Guide, Doc. No. 001-96598 Rev. *C
38
4.9 Raspberry Pi
4.9.1 Project Description
This example project is same as the
Sensor Hub
example project described above, except that the UART data is sent to the
Raspberry Pi interface instead of the USB-UART Bridge interface. This project demonstrates the capability of the PSoC
4200M device to function as a sensor hub and output the values to a Raspberry Pi. In this example project, the PSoC
4200M interfaces an I2C-based accelerometer, a PWM-based temperature sensor, an I2C-based F-RAM, and an ambient
light sensor.
The firmware writes the timestamp information from the RTC, ambient temperature from the temperature sensor, and the
accelerometer values to the F-RAM. These values are read back from the F-RAM and then transmitted through the UART
to the Raspberry Pi.
Minicom
is a text-based terminal emulation program running on the Raspberry Pi. This example project uses Minicom to
view the UART output on the Raspberry Pi. You must use the µC/Probe tool to change the color of the RGB LED similar to
the
Sensor Hub
example project.
4.9.2 Hardware Connections
You must populate the Raspberry Pi compatible header (J15) on the PSoC 4 M-Series Pioneer Kit and connect a
Raspberry Pi to the header, as shown in
Figure A-22
. Refer to the following section for instructions on how to setup the
Raspberry Pi for viewing the output.
4.9.3 Setting Up Raspberry Pi
1. Setup the Raspberry Pi hardware, as explained in this
tutorial
.
2. Login to the Raspberry Pi using the default User ID: pi and Password: raspberry (unless you have explicitly changed it
while setting up the Raspberry Pi).
3.
Type “
startx
” at the command prompt to enter the graphical user interface.
4. Double-click on LXTerminal on the desktop to open the terminal program.
5. Install Minicom to view the serial data coming from CY8CKIT-
044 by typing “sudo apt-get install minicom”.
6. Wait until the minicom gets installed.
4.9.4 Verify Output
1. Power the PSoC 4 M-Series Pioneer Kit through USB connector J6.
2. Program the PSoC 4 M-Series Pioneer Kit with
CY8CKIT_044_Raspberry_Pi
project.
3. Connect a Raspberry Pi and login as specified in step 2 in
Setting Up Raspberry Pi
.
4. Launch Minicom
by typing “sudo minicom -b 115200 -o -D /dev/ttyAMA0” in LXTerminal.
5. The Minicom terminal opens and the UART data is displayed.
6. To stop Minicom, press
CTRL-A
and then press
Z
. The Minicom help screen is displayed.
7. Press
Q
to quit the Minicom.
8. Minicom pops-up a window to confirm quitting without reset. Press
Enter
to confirm and quit.
Note:
If you did not follow the steps in
Setting Up Raspberry Pi
to setup the Raspberry Pi, refer to the online tutorials for
details on accessing UART, since the above settings/options may change depending on the installation.
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from