Lattice Semiconductor iCE40 UltraPlus User manual

iCE40 UltraPlus Sensor Data Buffer with BLE -
Radiant Software
User Guide
FPGA-UG-02058 Version 1.0
June 2018

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
2 FPGA-UG-02058-1.0
Contents
Acronyms in This Document .......................................................................................................................................... 3
1. Introduction .......................................................................................................................................................... 4
2. Functional Description........................................................................................................................................... 4
3. Demo Setup........................................................................................................................................................... 5
3.1. Hardware Requirements............................................................................................................................... 5
3.2. Software and Firmware Requirements.......................................................................................................... 5
3.3. Configuring the MDP Board .......................................................................................................................... 6
3.3.1. Setting Jumpers and Switches................................................................................................................... 6
4. Programming the Demo ........................................................................................................................................ 8
4.1. Programming the Bitmaps to the MDP Board................................................................................................ 8
4.2. Installing the Sensor Data Buffer BLE APK onto the Android Phone ............................................................. 10
4.3. Connecting the iCE40 UltraPlus MDP to the Android Phone ........................................................................ 10
5. Running the Demo............................................................................................................................................... 11
Technical Support Assistance....................................................................................................................................... 14
Revision History .......................................................................................................................................................... 14
Figures
Figure 2.2. iCE40 UltraPlus Sensor Data Buffer with BLE Demo Block Diagram................................................................ 4
Figure 3.1. Android Phone with Jelly Bean 4.3 or KitKat 4.4 and the iCE40 UltraPlus MDP .............................................. 5
Figure 3.2. MDP Board Configuration............................................................................................................................. 6
Figure 4.1. Getting Started Dialog Box ........................................................................................................................... 8
Figure 4.2. Radiant Programmer Main Interface ............................................................................................................ 8
Figure 4.3. Device Properties Dialog Box........................................................................................................................ 9
Figure 4.4. Program Button ........................................................................................................................................... 9
Figure 4.5. Activate Bluetooth Prompt......................................................................................................................... 10
Figure 5.1. BLE Device Scan ......................................................................................................................................... 11
Figure 5.2. Start Demo Button ..................................................................................................................................... 11
Figure 5.3. Airplane Button.......................................................................................................................................... 12
Figure 5.4. Successful Operation.................................................................................................................................. 13
Figure 5.5. Interface is Reset ....................................................................................................................................... 13
Tables
Table 3.1. Detailed Information of the Board Configuration ........................................................................................... 7

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 3
Acronyms in This Document
A list of acronyms used in this document.
Acronym
Definition
APK
Application Package Kit
BLE
Bluetooth Low Energy
FPGA
Field-Programmable Gate Array
I²C
Inter-Integrated Circuit
MDP
Mobile Development Platform
PCM
Pulse Code Modulation
PDM
Pulse Density Modulation
SPI
Serial Peripheral Interface
SSP
System Solution Platform

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
4 FPGA-UG-02058-1.0
1. Introduction
The iCE40 UltraPlus™Sensor Data Buffer with BLE demo shows the application of the sensor data buffer feature with
Bluetooth Low Energy (BLE) on the iCE40 UltraPlus Mobile Development Platform (MDP). Data from the three sensors
below is read for ten seconds and sent to the application to playback the movement.
Accelerometer
Gyroscope
Magnetic field
2. Functional Description
Figure 2.1 shows the demo block diagram.
INT_GEN
SYS_RMI_reg
SYS_sensor_reg
iCE40 UltraPlus
intr
Ram_data_o
Ram_en0
Ram_en1
Ram_en2
rbop
Lb_addr
Lb_wdata
Lb_wr
Lb_en
Lb_ack
Lb_rdata
RMI
UART
Mag
Sensor
Gyro
Sensor
ACCEL
Sensor
I2C
Arbiter
MAG_CTRL
GYRO_CTRL
ACCEL_CTRL
RAM ctrl
Figure 2.1. iCE40 UltraPlus Sensor Data Buffer with BLE Demo Block Diagram

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 5
3. Demo Setup
This section describes the demo setup.
The demo setup consists of an Android phone with Jelly Bean 4.3 or higher and the iCE40 UltraPlus Mobile
Development Platform.
Figure 3.1. Android Phone with Jelly Bean 4.3 or KitKat 4.4 and the iCE40 UltraPlus MDP
3.1. Hardware Requirements
Android phone
iCE40 UltraPlus MDP
USB Mini Port
3.2. Software and Firmware Requirements
Android Jelly Bean 4.3 or KitKat 4.4
Radiant Programmer
(Refer to the http://www.latticesemi.com/Products/DesignSoftwareAndIP/FPGAandLDS/Radiant)
Programming file for the iCE40 UltraPlus MDP

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
6 FPGA-UG-02058-1.0
3.3. Configuring the MDP Board
3.3.1. Setting Jumpers and Switches
Board reconfiguration is needed before running this demo. Figure 3.2 highlights (in orange boxes) all switches and
jumpers need to be verified or reconfigured on Mobile Development Platform (MDP) board.
J23 Pins 2-3
J28 Pins 1-2
J27 Pins 9-10
J26 Pins 7-8
J25 Pins 11-12
J17 Pins 9-10
Pins 3-4
Pins 1-2
J18 –Disconnect
SW5-1 OFF
SW5-2 ON
J19 Vertical Jumpers
SW2 ON
Figure 3.2. MDP Board Configuration

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 7
Table 3.1 lists the detailed information of these configurations on switches and jumpers.
Table 3.1. Detailed Information of the Board Configuration
Items
Configuration
Description
J17, J27
Shunt pin 9-10
Disable ICE40UP5K_A/D devices.
J25
Shunt pin 11-12
Disable ICE40UP5K_B device.
J26
Shunt pins 1-2, 3-4, 7-8
Enable ICE40UP5K_C device.
J28
Shunt pin 1-2
Enable Board control for programming SPI Flash.
J19
Shunt pins 1-3, 2-4 (vertical)
Enable programming SPI Flash
J23
Shunt pin 2-3
Use Xtal U14 as clock source.
J18
Disconnect
Default BLE program
SW2
Set to ON
Power switch, slide down for power-on.
SW5
Set SW5-1 to OFF, and SW5-2 to ON.
Select ICE40UP5K_C as target device.

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
8 FPGA-UG-02058-1.0
4. Programming the Demo
4.1. Programming the Bitmaps to the MDP Board
To program the bitmaps to the MDP board:
1. Power ON the iCE40 UltraPlus MDP.
2. Start the Radiant Programmer tool.
3. In the Getting Started dialog box, select Create a new project from a scan as shown in Figure 4.1.
4. Set Cable to HW-USBN-2B (FTDI).
5. Set Port to FTUSB-0.
Figure 4.1. Getting Started Dialog Box
6. Click OK. This opens the Radiant Programmer main interface as shown in Figure 4.2.
Figure 4.2. Radiant Programmer Main Interface
7. Select iCE40 UltraPlus under Device Family.
8. Select iCE40UP5K under Device.
9. Right-click on the device and select Device Properties in the context menu. The Device Properties dialog box is
displayed as shown in Figure 4.3.

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 9
Figure 4.3. Device Properties Dialog Box
10. Select External SPI Flash Programming under Target Memory.
11. Select the program file /Bitmap/sensor_buf_top_bitmap.hex.
12. Select Micron under Vendor.
13. Select SPI-M25P80 under Device.
14. Click OK.
15. Click the Program Device button to program the FPGA.
Figure 4.4. Program Button
When the programming sequence is completed, the CDONE LED glows on the iCE40 UltraPlus MDP.
If the programmer issues an error, recheck the connection.

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
10 FPGA-UG-02058-1.0
4.2. Installing the Sensor Data Buffer BLE APK onto the Android Phone
To install the APK (Android application package) onto the Android Phone:
16. In the Android phone, select Settings > Security > Unknown sources.
17. Connect the phone to a PC and copy the SensorBufferDemo.apk to any directory on the phone.
18. On the phone, browse to the directory where the APK is copied and select it to install.
19. Deselect the Unknown sources option.
4.3. Connecting the iCE40 UltraPlus MDP to the Android Phone
To connect the iCE40 UltraPlus MDP to the Android phone:
20. Power ON the iCE40 UltraPlus MDP and the Android phone
21. Disable Bluetooth on the phone.
22. Go to the Apps menu and select Sensor Buffer Demo.
23. In the message prompt to activate Bluetooth on the phone, press Allow as shown in Figure 4.5.
Figure 4.5. Activate Bluetooth Prompt
24. Select the iCE40UP-MDP device to connect the iCE40 UltraPlus device in the vicinity.
25. If the top right text box displays CONNECT, it means that the device has been disconnected. Press CONNECT or
press the back button to reconnect the device.

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 11
5. Running the Demo
Follow the steps in the previous sections so that the iCE40 UltraPlus MDP and the Android phone are ready with the
necessary bitmap and application.
To run the demo:
26. Connect the Android phone application to the BLE device. Tap on the device that you want to connect with the
application as shown in Figure 5.1.
Figure 5.1. BLE Device Scan
27. Press the Start Demo button as shown in Figure 5.2.
Figure 5.2. Start Demo Button

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
12 FPGA-UG-02058-1.0
28. Press the Airplane button. The FETCHING SENSOR DATA PLEASE WAIT message is displayed as shown in Figure
5.3.
Figure 5.3. Airplane Button
29. Move the MDP board for ten seconds until the LED stops blinking. The sensor data produced by the movement of
the MDP board is recorded.
Note: The application waits for the interruption. Once interruption occurs, the application reads the sensor data
from the buffer. Otherwise, the interface is reset and you need to press the Airplane button again.
30. If the data is collected successfully, the application uses these data to manipulate the 3D airplane image shown in
Figure 5.4. The movement of the airplane mimics the recorded movement of the MDP board in the previous step.
This playback also lasts for ten seconds.

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
FPGA-UG-02058-1.0 13
Figure 5.4. Successful Operation
To test airplane movement again, press the Back button. The previous interface is displayed. Press on the Airplane
button again as shown in Figure 5.5.
Figure 5.5. Interface is Reset

iCE40 UltraPlus Sensor Data Buffer with BLE - Radiant Software
User Guide
© 2018 Lattice Semiconductor Corp. All Lattice trademarks, registered trademarks, patents, and disclaimers are as listed at www.latticesemi.com/legal.
All other brand or product names are trademarks or registered trademarks of their respective holders. The specifications and information herein are subject to change without notice.
14 FPGA-UG-02058-1.0
Technical Support Assistance
For assistance, submit a technical support case at www.latticesemi.com/techsupport.
Revision History
Date
Version
Change Summary
June 2018
1.0
Initial release.
Other manuals for iCE40 UltraPlus
2
Table of contents
Other Lattice Semiconductor Accessories manuals