3 3 EXP500 Ausgabe 07.12.
3 EXP500 Contents 1. Connections 2. Introduction 3. Basic operations 4. 5. 6. 3.1 System image file programming 3.2 Serial debugging environment deploying Installing the libraries required 4.1 LED Demo 4.2 Key Demo 4.3 LCD1602 (Purchased Separately) Demo 4.4 PCF8563 RTC Demo 4.5 UART Demo Libraries Installation for RPi 5.1 Install WiringPi Library 5.2 Install C Library bcm2835 5.3 Install Python Library 5.4 Configuring the interfaces Support Ausgabe 07.12.
EXP500 1. Connection 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19.
3 EXP500 2. Introduction Raspberry Pi Expansion/Evaluation Board, features various interfaces 3. Basic operations 3.1 System image file programming Please load our prebuild Raspbian Lite image file from our website: Download Format your micro SD card with the SDFormatter.exe. Notices: The capability of micro SD card in used here should be more than 4GB. In this operation, a micro SD card reader is also required, which has to be purchased separately. Start the Win32DiskImager.
3 EXP500 3.2 Serial debugging environment deploying Connect your PC to the UART TO USB interface on EXP500 via a mini USB cable; Notices: The USB part of the UART TO USB interface applied by EXP500 is a mini USB interface, while the one on Raspberry Pi board is a micro USB interface. Please take a note. Install the cp2102_driver; Start the software PuTTY.exe, and configure the following parameters: Serial line: it is used to select corresponding serial port.
3 EXP500 4. Installing the libraries required Before using the EXP500 programs, you shall install the the bcm2835, wiringPi and python libraries to the RPi to add the additional APIs, and configure the settings to start up the core drivers of I2C, SPI and UART after the libraries installed. In case that you don’t want to reinstall the libraries, you can program this ready-to-use system image file to your Raspberry Pi board.
3 EXP500 root@raspberrypi:/home/pi/EXP500/LED/bcm2835# ./led Unless otherwise specified, the following demos are pre-compiled to executable files which can be run directly. If you intend to compile the C program of bcm2835, wiringPi, sysfs, etc. then please enter the demo directory and execute the command make to compile the program while the command make clean to remove the executable files.
3 EXP500 4.1 LED Demo bcm2835 program: 1. Enter the Linux terminal, and run the following commands: pi@raspberrypi ~/EXP500/LED/bcm2835 $ sudo ./led 2. The 4 LEDs will light up one by one. 3. Press the keys Ctrl+C to end the demo. wiringPi program: 1. Enter the Linux terminal, and run the following commands: pi@raspberrypi ~/EXP500/LED/wiringPi $ sudo ./led 2. The 4 LEDs will light up one by one. 3. Press the keys Ctrl+C to end the program. Python program: 1.
3 EXP500 4.2 Key Demo bcm2835 program: 1. Enter the Linux terminal, and run the following commands: pi@raspberrypi ~/EXP500/KEY/bcm2835 $ sudo ./key 2. The terminal will show whether there is key-press. 3. Press the keys Ctrl+C to end the program. wiringPi program: 1. Enter the Linux terminal, and run the following commands: pi@raspberrypi ~/EXP500/KEY/bcm2835 $ sudo ./key 2. The terminal will show whether there is key-press. 3. Press the keys Ctrl+C to end the program. Python program: 1.
3 EXP500 4.3 LCD1602 (Purchased Separately) Demo Insert the LCD1602 into the LCD1602 interface on EXP500. Enter the Linux terminal, and run the following commands: pi@raspberrypi ~/EXP500/LCD1602 $ sudo ./lcd1602 LCD1602 will display relative information. If there is nothing shown, please adjust the potentiometer on the LCD1602. The red box in Figure 11 shows the position of the potentiometer. Inserting the LCD1602 into the LCD1602 interface on EXP500 Ausgabe 07.12.
3 EXP500 4.4 PCF8563 RTC Demo Set the jumpers on EXP500: Connect RTC_SDA to SDA Connect RTC_SCL to SCL Install i2c-tools. If you have not installed i2c-tools yet, please enter the terminal, and input: root@ raspberrypi:/# apt-get install i2c-tools Enter the Linux terminal, and run the following commands: root@ raspberrypi:/# i2cdetect –y 1 Then, you will see the device address of PCF8563 connected to Raspberry Pi module.
3 EXP500 4.5 UART Demo Note: The Serial Port of Raspberry pi is used for terminal debugging by default, so for using UART function, the Serial terminal debugging function needs to be closed. Connect the onboard UART TO USB port to a PC via a mini USB cable. Enter the terminal, and execute corresponding commands: wiringPi program: pi@raspberrypi ~/EXP500/UART/wiringPi $ sudo ./UART python program: pi@raspberrypi ~/EXP500/UART/python $ sudo ./uart.
3 EXP500 5. Libraries Installation for RPi In order to use the API examples we provide, related libraries are required, which should be installed manually. bcm2835 libraries wiringPi libraries 5.1 Install WiringPi Library Click to download the wiringPi libraries, or you can also obtain the latest version from the WiringPi website: https://projects.drogon.
3 EXP500 5.3 Install Python Library Python Libraries for Raspbian (contain RPi.GPIO and spidev installation packages. See: https://pypi.python.org/pypi/RPi.GPIO https://pypi.python.org/pypi/spidev ) get it by apt-get commands. Please take a note, your Raspberry Pi should be connected to the network when using the command apt-get to install the library. Before the installation, you can run the following command to update your software list. sudo apt-get update 1.
3 EXP500 5.4 Configuring the interfaces (Before running the API codes we provided, you should start up the corresponding core drivers of the interfaces. In the ready-to-use system image file, both I2C and SPI are set to Enable by default, but the serial port is still in the terminal debugging function mode.) 1. Enable the I2C function. Run the following command to configure your Raspberry Pi board: sudo raspi-config Select Advanced Options -> I2C -> yes, to start up the I2C core driver.
3 EXP500 2. Enable the serial function. The serial port of RPi is set to serial terminal debugging function mode by default. If you want the serial port services as a common IO, you should modify the settings on the RPi. When the terminal debugging function is disabled, you cannot access RPi board via the serial port any more. If you want to control the RPi, you may need to enable the debugging function of the serial port again. sudo raspi-config Select Advanced Options -> Serial.
3 EXP500 6. Support If you have any questions , or problems please contact us via e-mail, phone or support system. E-Mail: service@joy-it.net Support-System: http://support.joy-it.net Phone: +49 (0)2845 98469 – 66 (11- 18 Uhr) Please visit our website for more information: www.joy-it.net Ausgabe 07.12.