RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or...

44
RX71M Group RX71M Revelation Kit User’s Manual For e 2 studio Rev. 1.00 May 2016 32 RENESAS 32-Bit MCU RX Family / RX700 Series All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject to change by Renesas Electronics Corporation without notice. Please review the latest information published by Renesas Electronics Corporation through various means, including the Renesas Electronics Corporation website (http://www.renesas.com). 32 User’s Manual

Transcript of RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or...

Page 1: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Group

RX71M Revelation Kit User’s Manual For e2 studio

Rev. 1.00 May 2016

32 RENESAS 32-Bit MCU RX Family / RX700 Series

All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject to change by Renesas Electronics Corporation without notice. Please review the latest information published by Renesas Electronics Corporation through various means, including the Renesas Electronics Corporation website (http://www.renesas.com).

32

User’s M

anual

Page 2: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

Notice 1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the

operation of semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software, and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information.

2. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein.

3. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others.

4. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration, modification, copy or otherwise misappropriation of Renesas Electronics product.

5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The recommended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below.

“Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots etc. “High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anticrime systems; and safety equipment etc.

Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems, surgical implantations etc.), or may cause serious property damages (nuclear reactor control systems, military equipment etc.). You must check the quality grade of each Renesas Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any application for which it is not intended. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics.

6. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges.

7. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or systems manufactured by you.

8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.

9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You should not use Renesas Electronics products or technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. When exporting the Renesas Electronics products or technology described in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations.

10. It is the responsibility of the buyer or distributor of Renesas Electronics products, who distributes, disposes of, or otherwise places the product with a third party, to notify such third party in advance of the contents and conditions set forth in this document, Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products.

11. This document may not be reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.

12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products, or if you have any other inquiries.

(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries.

(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics

(2012.4)

Page 3: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

Disclaimer By using this development kit, the user accepts the following terms:

The development kit is not guaranteed to be error free, and the entire risk as to the results and performance of the development kit is assumed by the User. The development kit is provided by Renesas on an “as is” basis without warranty of any kind whether express or implied, including but not limited to the implied warranties of satisfactory quality, fitness for a particular purpose, title and non-infringement of intellectual property rights with regard to the development kit. Renesas expressly disclaims all such warranties. Renesas or its affiliates shall in no event be liable for any loss of profit, loss of data, loss of contract, loss of business, damage to reputation or goodwill, any economic loss, any reprogramming or recall costs (whether the foregoing losses are direct or indirect) nor shall Renesas or its affiliates be liable for any other direct or indirect special, incidental or consequential damages arising out of or in relation to the use of this development kit, even if Renesas or its affiliates have been advised of the possibility of such damages.

Precautions The following precautions should be observed when operating any development kit product:

This development kit is only intended for use in a laboratory environment under ambient temperature and humidity conditions. A safe separation distance should be used between this and any sensitive equipment. Its use outside the laboratory, classroom, study area or similar such area invalidates conformity with the protection requirements of the Electromagnetic Compatibility Directive and could lead to prosecution. The product generates, uses, and can radiate radio frequency energy and may cause harmful interference to radio communications. However, there is no guarantee that interference will not occur in a particular installation. If this equipment causes harmful interference to radio or television reception, which can be determined by turning the equipment off or on, you are encouraged to try to correct the interference by one or more of the following measures;

• ensure attached cables do not lie across the equipment

• reorient the receiving antenna

• increase the distance between the equipment and the receiver

• connect the equipment into an outlet on a circuit different from that which the receiver is connected

• power down the equipment when not in use • consult the dealer or an experienced radio/TV technician for help NOTE: It is recommended that wherever

possible shielded interface cables are used. The product is potentially susceptible to certain EMC phenomena. To mitigate against them it is recommended that the following measures be undertaken;

• The user is advised that mobile phones should not be used within 10m of the product when in use.

• The user is advised to take ESD precautions when handling the equipment. The development kit does not represent an ideal reference design for an end product and does not fulfil the regulatory standards for an end product.

R20UT3803EG0100 Rev. 1.00 Page 3 of 44 May 24, 2016

Page 4: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

How to Use This Manual

1. Purpose and Target Readers This manual is designed to provide the user with an understanding of the demonstration application, how to use e2 studio IDE to develop and debug software for the RX71M Revelation Kit. It is intended for users designing code on the RX71M Revelation Kit, using the many different incorporated peripheral devices. The manual comprises of step-by-step instructions to load and debug a project in e2 studio, but does not intend to be a complete guide to software development on the RX71M Revelation Kit. Further details of the RX71M microcontroller may be found in the RX71M Group Hardware Manual and within the provided demonstration code.

Particular attention should be paid to the precautionary notes when using the manual. These notes occur within the body of the text, at the end of each section, and in the Usage Notes section.

The revision history summarizes the locations of revisions and additions. It does not list all revisions. Refer to the text of the manual for details.

The following documents apply to the RX71M Group. Make sure to refer to the latest versions of these documents. The newest versions of the documents listed may be obtained from the Renesas Electronics Web site.

Document Type Description Document Title Document No. User’s Manual Describes the technical details of the

kit hardware. RX71M Revelation Kit User’s Manual

R20UT3803EG

Quick Start Guide Provides simple instructions to setup the kit and run the first sample, on a single sheet.

RX71M Revelation Kit Quick Start Guide

R20UT3775EG

Schematics Circuit schematics of the kit. RX71M Revelation Kit Schematics

D014637_04

Hardware Manual Provides technical details of the RX71M microcontroller.

RX71M Group User’s Manual: Hardware

R01UH0493EJ

Software Manual Details of the RXv2 Instruction Set Architecture.

RX Family RXv2 Instruction Set Architecture User's Manual: Software

R01US0071EJ

Application Note DDLCD (Internal Memory) Design Details.

RX Direct Drive LCD Design Guide (Internal Memory)

R01AN3384EG

User’s Manual Technical details of using the Renesas GAPI Graphics API.

Renesas GAPI Graphics API User’s Manual

R21UT0231EG

Debugger Manual E2 Emulator Lite Debugger Performance Property.

On-chip Debuggers Performance Property

R20UT0616EJ

User’s manual Getting Started Guide for e2 studio. e2 studio Integrated Development Environment User's Manual: Getting Started Guide

R20UT2771EJ

R20UT3803EG0100 Rev. 1.00 Page 4 of 44 May 24, 2016

Page 5: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

2. List of Abbreviations and Acronyms Abbreviation Full Form

ADC Analog-to-Digital Converter API Application Programming Interface ASCII American Standard Code for Information Interchange CMT Compare Match Timer COM Component Object Model CRC Cyclic Redundancy Check DDLCD Direct Drive Liquid Crystal Display DMA Dynamic memory Access DTC Data Transfer Controller E1 / E2 Lite Renesas On-chip Debugging Emulator ESD Electro Static Discharge FAT File Allocation Table FIT Firmware Integration Technology GAPI Graphics API GDB GNU Debugger GUI Graphical User Interface IDE Integrated Development Environment IRQ Interrupt Request ISR Interrupt Service Routine JPEG Joint Photographic Expert Group JTAG Joint Test Action Group LCD Liquid Crystal Display LED Light Emitting Diode MCU Micro-controller Unit PC Personal Computer

Pmod™ This is a Digilent Pmod™ Compatible connector. PmodTM is registered to Digilent Inc. Digilent-Pmod_Interface_Specification

PMSC Peripheral Mass Storage Class QVGA Quarter Video Graphics Array RAM Random Access Memory ROM Read Only Memory RPB Renesas Promotional Board RSPI RX Serial Peripheral Interface RTC Real Time Clock RTOS Real Time Operating System SD Card Secure Digital Card SDRAM Synchronous Dynamic Random Access Memory SPI Serial Peripheral Interface TFT Thin Film Transistor TPU Timer Pulse Unit USB Universal Serial Bus UTF Unicode Transformation Format WDT Watchdog timer WQVGA Wide Quarter Video Graphics Array

All trademarks and registered trademarks are the property of their respective owners.

R20UT3803EG0100 Rev. 1.00 Page 5 of 44 May 24, 2016

Page 6: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

Table of Contents

1. Overview ............................................................................................................................ 8 1.1 Purpose ...................................................................................................................................................... 8

2. Introduction ........................................................................................................................ 9

3. Running the Demonstration Application ........................................................................... 10 3.1 Reset Source ........................................................................................................................................... 10 3.2 Switching Demo Modes ........................................................................................................................... 10 3.3 GAPI Demonstration Mode ...................................................................................................................... 10

3.3.1 GAPI Auto Demonstration Mode .................................................................................................... 11 3.4 Business Card Demonstration Mode ....................................................................................................... 11

3.4.1 Display Area ................................................................................................................................... 11 3.4.2 USB Mass Storage Device ............................................................................................................. 11

4. RX71M Revelation Kit ..................................................................................................... 13 4.1 E2 Emulator Lite ...................................................................................................................................... 13

4.1.1 Debug USB – CN9 ......................................................................................................................... 14 4.1.2 E2 Lite Activity LED – LED5 ........................................................................................................... 14

4.2 External E1 Emulator Connection – CN11 ............................................................................................... 14 4.3 Reset Source Selection Switch – SW2 .................................................................................................... 14 4.4 Pmod™ Expansion Connectors ............................................................................................................... 14 4.5 User USB ................................................................................................................................................. 15

4.5.1 Current Limitations ......................................................................................................................... 15 4.6 LCD Panels .............................................................................................................................................. 16

4.6.1 8/16 Bit Color Selection .................................................................................................................. 16 4.6.2 WQVGA Display Connector ........................................................................................................... 17 4.6.3 External Touch Connector .............................................................................................................. 17

4.7 Serial Flash Memory ................................................................................................................................ 17 4.8 Circuit Board Layout ................................................................................................................................ 18

5. Development Tools .......................................................................................................... 19 5.1 Demonstration Application Project ........................................................................................................... 19 5.2 e2 studio Download and Installation ......................................................................................................... 19

5.2.1 Renesas RX Compiler .................................................................................................................... 19 5.3 E2 Emulator Lite Connection ................................................................................................................... 20 5.4 Importing Sample Code into e2 studio ...................................................................................................... 20 5.5 Programming and Debug ......................................................................................................................... 21 5.6 Further Reading ....................................................................................................................................... 22

6. GAPI Demonstration Design Details ................................................................................ 23 6.1 Resources ................................................................................................................................................ 23

6.1.1 Splash Screen ................................................................................................................................ 23 6.1.2 Home Screen ................................................................................................................................. 24 6.1.3 Thermostat Screen ......................................................................................................................... 24 6.1.4 Medical Screen .............................................................................................................................. 25 6.1.5 Refrigerator Screen ........................................................................................................................ 25 6.1.6 Classic Home Screen ..................................................................................................................... 26 6.1.7 Countdown Screen ......................................................................................................................... 26 6.1.8 Animate Screen .............................................................................................................................. 27 6.1.9 GAPI_T Use Screen ....................................................................................................................... 27 6.1.10 UTF-8 Screen ................................................................................................................................. 28 6.1.11 QWERTY Screen ........................................................................................................................... 28

R20UT3803EG0100 Rev. 1.00 Page 6 of 44 May 24, 2016

Page 7: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

6.1.12 Writes Screen ................................................................................................................................. 28 6.1.13 Frame Rate Screen ........................................................................................................................ 29 6.1.14 Calibration Screen .......................................................................................................................... 29 6.1.15 Business Card Screen ................................................................................................................... 30

6.2 Touch Screen Simulation ......................................................................................................................... 30

7. Code Structure ................................................................................................................ 31 7.1 File Descriptions ...................................................................................................................................... 31

7.1.1 Initialization Code, project, object and other files........................................................................... 31 7.1.2 Application Demo Code ................................................................................................................. 32 7.1.3 r_Packages .................................................................................................................................... 33

7.2 FIT Modules ............................................................................................................................................. 33

8. Program Operation .......................................................................................................... 34 8.1 Renesas LCD Direct Drive LCD (DDLCD) ............................................................................................... 34 8.2 RTOS ....................................................................................................................................................... 34 8.3 Interrupts .................................................................................................................................................. 34 8.4 Display Memory Monitor Task .................................................................................................................. 34 8.5 Tasks ........................................................................................................................................................ 35 8.6 Memory Usage ......................................................................................................................................... 36

8.6.1 Sections .......................................................................................................................................... 37

9. Resource Storage Access ............................................................................................... 38

10. Additional Information .................................................................................................... 40

R20UT3803EG0100 Rev. 1.00 Page 7 of 44 May 24, 2016

Page 8: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 1 Overview

1. Overview

1.1 Purpose This development kit is an evaluation tool for Renesas microcontrollers. This manual describes the RX71M Revelation Kit hardware, demonstration application and development environment.

R20UT3803EG0100 Rev. 1.00 Page 8 of 44 May 24, 2016

Page 9: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 2 Introduction

2. Introduction

The RX71M Revelation Kit provides an evaluation of the following features: • In circuit flash programming and debugging with E2 Emulator Lite, • QVGA TFT LCD panel driven from standard RX71M peripherals, • Graphics drawing and manipulation using the Renesas Graphics API, • Resistive touch screen sampling with internal ADC channels, • Low memory footprint operating system – FreeRTOS, • Peripheral USB Mass Storage Class.

This manual guides the reader through installing the development tools, importing the demonstration project and its various features.

This manual is designed to show how to use the development kit and is not intended as a comprehensive introduction to e2 studio, the compiler toolchains or the E2 Emulator Lite. Please refer to the relevant user manuals for more in-depth information.

R20UT3803EG0100 Rev. 1.00 Page 9 of 44 May 24, 2016

Page 10: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 3 Running the Demonstration Application 3. Running the Demonstration Application

The RX71M Revelation Kit is delivered with the demonstration application pre-programmed. To start the demonstration application power the board by connecting CN9 ‘Debug USB’ to a USB port on your PC. Two demonstration modes are available:

1) GAPI Demonstration – Renesas Graphics API is used for demonstration Graphical User Interfaces, 2) Business Card Demonstration – Animated business card demonstration using user supplied images

and text.

3.1 Reset Source To allow the demo to run stand-alone ensure SW2 Position 1 set to ‘OFF’. More details of the reset source selection are in section 4.3.

3.2 Switching Demo Modes To toggle the demonstration mode between GAPI Demonstration and Business Card Demonstration:

1) Remove USB Cable from CN9 ‘Debug USB’, 2) Press and hold SW1, 3) Reinsert USB Cable into CN9 ‘Debug USB’ whilst continuing to press and hold SW1, 4) Release SW1 when the Renesas splash screen is displayed.

3.3 GAPI Demonstration Mode This mode demonstrate the capabilities of the RX71M and the GAPI library with a number of simulated graphical user interfaces, with user selectable options via the touch screen.

Option Description Overview Screen

Thermostat

Weather forecast with thermostat settings. Available buttons:

• Days of the week. • + (plus) / - (minus)

Medical

Implementation of a medical monitoring device. Available buttons:

• Heart slider • Mode • Run • On/Off

Refrigerator

Implements a water dispenser machine with a temperature controlled freezer and fridge.

• Lock/Unlock • Off/On • Filter • Dispenser • + (plus) / - (minus)

Classic Home

Contains various demonstrations which run through basic behaviour of buttons. Available demonstrations:

• Countdown • Animate • Touch Calibration • GAPI_T Use • Writes • Frame Rate • UTF-8 • QWERTY

R20UT3803EG0100 Rev. 1.00 Page 10 of 44 May 24, 2016

Page 11: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 3 Running the Demonstration Application For further technical details on the operation of these options please see section 6.

3.3.1 GAPI Auto Demonstration Mode If no option is selected within 30 seconds of the main GAPI Demonstration menu appearing, auto demonstration mode will start. This simulates a user pressing various items on the touchscreen and repeats on a continuous cycle. To exit Auto Demonstration mode, the RX71M Revelation Kit must be power cycled by disconnecting and re-connecting the cable from CN9 ‘Debug USB’.

3.4 Business Card Demonstration Mode This demonstration uses GAPI and associated libraries to display scrolling text and JPEG images from a FAT file system located in the RX71M Data Flash.

3.4.1 Display Area 3.4.2 USB Mass Storage Device The demonstration makes the RX71M Data Flash available as a USB Mass Storage Device via CN3 ‘User USB’. After formatting, 44 Kbytes is available for user images and configuration files. When CN3 ‘User USB’ is connected to the USB on your PC, it will mount as a Removable Storage device. On a WindowsTM PC no additional drivers are required. The file demo.txt contains configuration entries for the business card demo; displayed text and image file names, see section 3.4.2.1. Changes can be made to images and configuration file at any time. Changes will take effect after a reset –achieved by a power cycle. Use standard WindowsTM procedure for ejecting Removable Storage devices before unplugging or resetting the development kit to avoid corruption of the RX71M Data Flash.

[banner] 320 x 110

Left Image 150 x 110

Right Image 150 x 110

[name] 30 Characters maximum

[title] 30 Characters maximum

R20UT3803EG0100 Rev. 1.00 Page 11 of 44 May 24, 2016

Page 12: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 3 Running the Demonstration Application 3.4.2.1 Configuration File: demo.txt This file provides configuration for the demonstration. The format of each entry is: For example the following entry specifies the file ‘mypicture.jpg’ to be displayed as the photo in the demonstration: Possible Entries:

Section*1 Config. data Details [logo] File name for Logo image JPEG Image 150 x 110 pixels

[photo] File name for Photo image JPEG Image 150 x 110 pixels [banner] File name for Banner image JPEG Image 320 x 110 pixels [name] Text for scrolling name position 30 ASCII Characters Maximum [title] Text for static title position 30 ASCII Characters Maximum

*1 Section names are case sensitive. If a specified file cannot be found or an entry is not included in demo.txt, default values will be used. Images If no images are specified, a default Renesas banner will be shown. If a [banner] image is specified, [logo] and [photo] entries are ignored. If only one of [logo] or [photo] is specified, it will be displayed in the Left Image position. The Right Image will show a Renesas Logo. If both [photo] and [logo] is specified; [photo] will be displayed in the Left Image position and [logo] in the Right Image position. Images must be JPEG format and file names must have a short filename; filenames have a maximum of eight characters with up to a three-character extension. Scrolling Text [name] This field is limited to a maximum of 30 ASCII characters. This text is rendered to a 1000 x 60 pixel area. Due to the proportional font used it is possible to exceed the available width, resulting in the displayed string being truncated. Static Text [title] This field is limited to a maximum of 30 ASCII characters. This text is rendered to the display buffer. Due to the proportional font it is possible to exceed the screen width, resulting in the displayed string being truncated.

[section] Config_data

[photo] mypicture.jpg

R20UT3803EG0100 Rev. 1.00 Page 12 of 44 May 24, 2016

Page 13: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit

QVGA 320 x 240 TFT LCD Display with Resistive touch screen.

E2 Lite Emulator

Debug USB

User USB

8/16 bit Color Selection Jumpers

External E1 Debugger Connection

PMOD Expansion

External Touch Connection

Reset Source Select

4. RX71M Revelation Kit

4.1 E2 Emulator Lite The E2 emulator Lite (abbreviated name: E2 Lite) is an on-chip debugging emulator and flash programmer for MCUs of the RX family. All circuitry for the E2 Lite has been included on the RX71M Revelation Kit, requiring just a USB connection to a development PC. The E2 Lite connects to the RX71M using a JTAG interface with a maximum clock rate of 6MHz. For more details of the E2 Lite capabilities please see the ‘On-chip Debuggers Performance Property’ reference document. Host PC Drivers for the E2 Lite are supplied as part of the development tool installation.

R20UT3803EG0100 Rev. 1.00 Page 13 of 44 May 24, 2016

Page 14: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit 4.1.1 Debug USB – CN9 This USB socket provides an interface between the E2 Lite and the development PC. Power for the RX71M Revelation Kit is sourced from this USB connection; it is important that sufficient current is available. If a USB hub is used it must be externally powered.

4.1.2 E2 Lite Activity LED – LED5 LED5 indicates the status of the E2 Lite:

Illuminated Communication established with Host PC Driver.

Flashing Power available but no communication established with host PC.

Not Illuminated Board not receiving power or e2 Lite critical error.

4.2 External E1 Emulator Connection – CN11 This connector allows the use of an external E1 Emulator using JTAG. The E1 Emulator supports a JTAG clock rate of 16.5MHz For details of obtaining and using an external E1 Emulator please contact your local Renesas representative.

4.3 Reset Source Selection Switch – SW2

SW2 is used to select the source of the board reset signal – RESET#.

SW2 Setting Description

Position 1 ON : Debug Reset from E2 Lite. OFF : Run Reset Pulled High.

Standalone operation.

Position 2

ON: Reset Reset# tied low. RX71M held in reset state.

OFF: Normal (Default)

Reset# source determined by SW2 Position 1.

4.4 Pmod™ Expansion Connectors Positions for two Pmod™ Compatible expansion headers are available on the development kit.

Care should be taken when installing Pmodtm modules to ensure pins are not bent or damaged. Pmodtm modules are vulnerable to electrostatic discharge (ESD); therefore appropriate ESD protection should be used.

The Digilent Pmod™ Compatible headers uses an SPI interface. Connection information for the Digilent Pmod™ Compatible headers is provided in Table 4-1 and Table 4-2. Please note that the connector numbering adheres to the Digilent Pmod™ standard and is different from other connectors on the development kit design. Details can be found in the Digilent Pmod™ Interface Specification Revision: November 20, 2011.

Figure 4-1: Digilent Pmod™ Compatible Header Pin Numbering R20UT3803EG0100 Rev. 1.00 Page 14 of 44 May 24, 2016

Page 15: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit

Digilent Pmod™ Compatible Header (PMOD1) Connections

Pin Circuit Net Name MCU Port

Pin Circuit Net Name MCU Port

1 IRQ7 P1.7 7 DA1 P0.5

2 TXD3 P2.3 8 MOSI0 P3.2

3 RXD3 P2.5 9 MISO0 P3.3

4 SCK3 P1.5 10 P0<7> P0.7

5 GROUND - 11 GROUND -

6 VCC3V3 - 12 VCC3V3 -

Table 4-1: Pmod™1 Header Connections

Digilent Pmod™ Compatible Header (PMOD2) Connections

Pin Circuit Net Name MCU Port

Pin Circuit Net Name MCU Port

1 SS2 P5.4 7 IRQ10 P5.5

2 MOSI2 P5.0 8 TXD5 PC.3

3 MISO2 P5.2 9 RXD5 PC.2

4 SCK2 P5.1 10 SCK5 PC.4

5 GROUND - 11 GROUND -

6 VCC3V3 - 12 VCC3V3 -

Table 4-2: Pmod™2 Header Connections

4.5 User USB The Mini-USB connector CN3 connects to the RX71M Microcontroller’s USB module The demonstration application makes use of this by presenting a USB mass storage class peripheral to a host PC. With appropriate software CN3 can be used as a USB Host port. To supply power to the USB port in Host mode the development kit uses a Maxim MAX3355. This device monitors the ID pin (pin 4) of the USB connector and generates 5V if found to be connected to a USB peripheral.

CN3 ID Pin MAX3355 Charge pump VBUS 0 Active 5V Output to CN3 1 Inactive Input from CN3

Table 4-3: VBUS vs CN3 ID

4.5.1 Current Limitations MAX3355 has a 200mA output current limit. The RX71M Revelation Kit is powered from CN9 ‘Debug USB’. The power available to the entire development kit is limited to the supply capability of the host connected to CN9 ‘Debug USB’, which may not allow the MAX3355 to supply the full 200mA.

R20UT3803EG0100 Rev. 1.00 Page 15 of 44 May 24, 2016

Page 16: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit 4.6 LCD Panels

4.6.1 8/16 Bit Color Selection By default the development kit is configured to drive the LCD panel with 16-bits of color data from the RX71M. This configuration is made by the sixteen 0R resistors shown in the schematic extract below.

To demonstrate the appearance of an 8-bit color LCD, the development kit has positions for solder links that allows reconfiguration between 16-bit and 8-bit color. To drive the LCD with 8-bit color:

1) Remove 16x 0R resistors shown the schematic extract above, 2) Using wire links connect CN5 Pin 2 to CN7 Pin 1, CN5 Pin 4 to CN7 Pin 2 and so on, shown in diagram

below. This diagram is shown looking down on component side of board.

The demonstration project is configured for 16-bit color, please contact your local Renesas representative for more details of driving the LCD in 8-bit colour mode.

R20UT3803EG0100 Rev. 1.00 Page 16 of 44 May 24, 2016

Page 17: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit Note: The supplied development kit demonstration application drives the LCD with 16-bit color data. For details of 8-bit color data demonstrations please contact your local Renesas representative.

RX71M Data Bus Connection Color Selection Jumpers

LCD Color Bit 8-Bit Color 16-Bit Color R0

D5 D11 R1

R2 R3 R4 D12 R5 D13 R6 D6 D14 R7 D7 D15 G0

D2

D5 G1 G2 G3 D6 G4 D7 G5 D8 G6 D3 D9 G7 D4 D10 B0

D0

D0

B1 B2 B3 B4 D1 B5 D2 B6 D3 B7 D1 D4

Table 4-4: LCD Color Bits in 16-bit & 8-Bit mode

4.6.2 WQVGA Display Connector CN4 is a not populated position for a 40-pin ZIF socket. This is intended for connection to a 4.3” WQVGA display. An example display for this connector is the Newhaven display NHC-4.3-480272ZF-ATXI#-1.

4.6.3 External Touch Connector CN14 provides a not populated connector for resistive touch panels. As supplied the development kit uses a display that integrates touch panel signals with the other display signals on CN12.

4.7 Serial Flash Memory IC5 is a not populated position for a Winbond W25Q32VSSIG 32M-bit serial flash memory. This device is connected to the RX71M using a Renesas Serial Peripheral Interface (RSPI) channel and offers high speed, high density non-volatile storage. Please note: PC.4 signal is shared between Serial Flash and PMOD2 connector. Please evaluate if this shared signal will affect the operation before attempting to use PMOD2 and Serial Flash together. PC.7 signal is driven at start up by the E2 Lite. This will be placed in a high-impedance state before user code is executed and should not affect serial flash use.

R20UT3803EG0100 Rev. 1.00 Page 17 of 44 May 24, 2016

Page 18: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 4 RX71M Revelation Kit

4.8 Circuit Board Layout

R20UT3803EG0100 Rev. 1.00 Page 18 of 44 May 24, 2016

CN

1

TP8

TP14

JP4

R17R16

C1

4

C1

5

R12R11

C18

C16

JP1JP2

D1

R1

8LE

D5

TP7

CN8

IC2

C1

9

MR1

C17

C26

IC7L1

C27

IC4

C33

C3

5

C20

CN9

C13

C41 R19

X1

C25C8

R1

0R

35

R36

R6

1 R23

C34

MR

3IC3

R22R20

MR

2

C1

2

R21

C9

R8

R6

R7

R6

0

R5

9

R46

R45

MR

5

CN12

CN6CN13

R5

8

R5

7

R5

6

C3

1

R4

4R

43

C3

0

R39

R40

CN4

R2

R5

5

R5

4

CN11

R9IC8

R1

C24

R5

3

R5

2

R5

1

R38

R37

CN5CN7

R5

0

R4

9

R4

2

C2

9

IC5C

28

R4

1C32

R14R27

CN14

R4

8

R4

R3

R5

R4

7

R3

1

R3

0

R3

4

C7

R13 C11

C10

X2

SW2

MR

4

C22

C2

1

C3

9

IC6

C5

C2

3C

42

C3C4

C2

R2

4C36

C4

6

CN2

CN3

R3

2R

33

C3

8C

40

IC1

C1R

28

SW1

C45

R6

3R

64

R62R15 C44

C6

JP5

R2

9C

43

TP6

CN

10

LED

1R

26

LED

0R

25

TP5

TP15

C37

Page 19: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 5 Development Tools 5.Development Tools

Software for this Renesas kit is available for download from:

5.1 Demonstration Application Project Download the Demonstration Application Project and extract it to a convenient location on your PC. This will be imported in to e2 studio in a following step.

5.2 e2 studio Download and Installation Before installing e2 studio, ensure the kit it is not connected to your PC. Download and launch the e2 studio installer from the location shown above. A welcome dialog will be displayed. Follow the on-screen instructions to install e2 studio. Device Families step: Ensure “Support for RX Devices” is selected.

Components step: Select at least “Renesas RX Debug Support”, “Renesas CCRX Toolchain Integration”. Additional Software step: Select at least “Renesas CCRX v2.05.xx”, where xx is the highest version number available.

Note: Windows™ users may see “User Account Control” dialog box. If applicable, enter the administrator password and click ‘Yes’. Windows™ 10 users may see “Windows Security” dialogue boxes, in each case click ‘Install’. The Windows™ driver signing dialog box may be displayed. Please accept the driver to continue.

5.2.1 Renesas RX Compiler The version of the compiler provided is an evaluation version and expires 60 days after the first build following the installation. The size of linkable object is reduced to 64KB or less and the functions of professional edition are not supported on or after the 61st day.

http://www.renesas.com/rpbrx71m

R20UT3803EG0100 Rev. 1.00 Page 19 of 44 May 24, 2016

Page 20: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 5 Development Tools 5.3 E2 Emulator Lite Connection Slide SW2 position 1 to ‘ON’ – this allows the E2 Emulator Lite to control Reset Signal. Connect CN9 ‘Debug USB’ to a USB port on your PC. The green ‘LED5’ will flash, indicating power to the board and the E2 Emulator Lite. The E2 Emulator Lite drivers will now be installed. Note that, this may take up to a minute and administrator privileges will be required.

Windows™ 7 Windows™ 8.1 / 8 Windows™ 10 “Device driver software installed successfully” pop-up will appear in the Windows™ toolbar and installation will complete.

An icon will appear in the Windows™ toolbar and installation will complete.

No notification will appear if installation was successful.

5.4 Importing Sample Code into e2 studio e2 studio integrates various tools such as compiler, assembler, debugger and editor into a common graphical user interface. 1. Start e2 studio:

Windows™ 7: Start Menu > All Programs > Renesas Electronics e2studio > e2 studio Windows™ 8.1 & 8: From Apps View , click ‘Renesas e2 studio’ icon Windows™ 10: Start Menu > All apps > Renesas Electronics e2studio > e2 studio

2. In the ‘Select a workspace’ folder that appears, browse a suitable location and folder name to save your

new workspace to. Click OK to continue. 3. In the ‘Toolchain Registry’ dialog select all displayed Renesas Toolchains. Click ‘Register’. A dialog will

appear "Selected Toolchains were successfully integrated with e2 studio". Click ‘OK’.

4. If Code Generator was selected during install:

a. ‘Code Generator Registration’ dialog will be displayed; click ‘OK’.

b. A ‘Code Generator COM component register’ dialog will pop-up with the text “Please restart e2 studio to use Code Generator”. Click ‘OK’.

c. In the ‘Restart e2 studio’ dialog click ‘OK’. e2 studio will be restarted due to first-time registration of

the Code Generator COM component.

d. Once e2 studio is restarted the ‘Select a workspace’ window appears again. Click ‘OK’. 5. In the e2 studio welcome screen, click the ‘Go to the e2 studio workbench’ arrow icon, on the far right. 6. Right click in the project explorer window, and select ‘Import’. 7. In the import source type, select General > Existing Projects into Workspace, and click ‘Next’. 8. Click the ‘Browse’ button, and locate the directory which the demonstration project was extracted to in

section 5.1. 9. Ensure the ‘Copy projects into workspace’ option is ticked, then click ‘Finish’. 10. During the import process an information dialogue may report ‘Toolchain path has been modified for the

project…’, Click ‘OK’.

R20UT3803EG0100 Rev. 1.00 Page 20 of 44 May 24, 2016

Page 21: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 5 Development Tools 5.5 Programming and Debug 11. Select the “RPBRX71M_GAPI” project by left clicking on it, then click the arrow next to build button

(hammer icon), and select ‘HardwareDebugRPBRX71M’ from the drop down menu. 12. e2 studio will now build the project. Once this is complete, debugging can be started by clicking the arrow

next to debug button (bug icon), and selecting ‘Debug Configurations’. 13. Click the symbol next to the entry ‘Renesas GDB Hardware Debugging’ to expand the list and click on

‘HardwareDebug’. 14. Click the ‘Debugger’ tab, then the ‘Connection Settings’ secondary tab.

Review the settings listed in the screenshot below.

15. Click the ‘Debug’ button to download the code to the target, and begin debugging.

16. A firewall warning may be displayed for ‘e2-server-gdb.exe’. Select the check-box for ‘Private networks,

such as my home or work network’, and click ‘Allow access’. 17. A User Account Control (UAC) dialog may be displayed. Enter the administrator password and click ‘Yes’. 18. e2 studio may ask you to change to the ‘Debug Perspective’, click ‘Yes’.

19. The green ‘LED5’ will illuminate constantly.

20. Once the code has been downloaded, click the ‘Resume’ button to run the code up to the first line

of the code: main(void). Click ‘Resume’ again to run the target.

21. The Renesas Splash Screen will be displayed followed by either the GAPI Demonstration or Business Card Demonstration, depending on which was previously selected.

22. Click the ‘Suspend’ button. The program will stop and the source code will be opened at the current program counter.

23. To disconnect from the target board, click the ‘Disconnect’ button on the toolbar. 24. Select the C/C++ perspective (at the top right) to return to the editor view.

Selection Needed: Do you trust these certificates? Dialogue may be shown during the first e2 studio session. Select the ‘REE-EDC release dept’ certificate and click ‘OK’ to continue.

For further details regarding configuration, please refer to the RX Series Software Manual and the RX71M Group Hardware Manual.

R20UT3803EG0100 Rev. 1.00 Page 21 of 44 May 24, 2016

Page 22: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 5 Development Tools 5.6 Further Reading For more details of e2 studio including exploring its debugging capabilities please see ‘R20UT2771EJ e2 studio Integrated Development Environment User's Manual: Getting Started Guide’, which can be downloaded from the Renesas Website.

R20UT3803EG0100 Rev. 1.00 Page 22 of 44 May 24, 2016

Page 23: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6. GAPI Demonstration Design Details

6.1 Resources Resources used in the demonstration (Images, Fonts etc) are assembled in to a single resource file ‘Resources.bin’ by a custom utility. This is invoked on each ‘Clean’ e2 studio build. The files that are assembled in to ‘Resources.bin’ are found in the /Resources folder. The ‘Resources.bin;’ file is combined with the program code by the linker during the build and programmed in to internal flash memory by the E2 Lite.

6.1.1 Splash Screen The demonstration loads the file “_SplashScreen.bmp” and displays this for four seconds prior to transitioning to the home screen. This screen can be bypassed by touching the display and is generated prior to starting normal screen handling in “eventmgr.c”.

R20UT3803EG0100 Rev. 1.00 Page 23 of 44 May 24, 2016

Page 24: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.2 Home Screen Once the framework has loaded the resources, it will start processing the screen defined by the “ScreenHomeData” structure. In this demonstration, that structure is defined in “ScreenHome.c”. This structure refers to a list of screen objects that are located in the _SCR_HM memory section. The objects in this memory section are defined in various files and collected by the linker at build time to create the complete object list. This behaviour allows for simple inclusion/exclusion of objects by linking/not linking files into the project. Here you can see objects that are defined in four different screen files. Pressing any of these objects causes their associated callback function to be executed. In the case of the objects on this screen, the callback sends a new screen event that causes the framework to transition to processing the data structure associated with that screen file.

6.1.3 Thermostat Screen This screen is defined in the file “ScreenThermo.c”. It shows many aspects of the graphics API including anti-aliased fonts, UTF-8 decoding, alpha blending and animation. Notable on this screen is how the buttons on the bottom of screen are run-time composed by combining the screen shape, the forecast icon, the forecast text and the day- of-the-week text (see source code function “DayButtonDraw”). These components can be dynamically selected to create the necessary graphics as the conditions change. Pressing the “Home” button in the upper right corner of the screen will trigger an event to switch to the previous screen, this is true for all sub-screens.

R20UT3803EG0100 Rev. 1.00 Page 24 of 44 May 24, 2016

Page 25: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.4 Medical Screen This screen is defined in the file “ScreenMed.c”. Notable on this screen is the graph being displayed. If the slider is not touched, it displays a repeating waveform. If the “heart slider” is pressed, the graph will reflect the slider value (see source code function “MedGraph”). Additionally, this code demonstrates the usage of the slider. Sliders, buttons and several other behaviours are collected in the “SliderHandler” and “ButtonHandler” functions in the file “ScreenObjs.c”. These functions process event behaviour and appropriately draw objects on the screen and maintain state about the object. These functions are not part of the Graphics API, but use the API for their screen drawing needs.

6.1.5 Refrigerator Screen This screen is defined in the file “ScreenRefrig.c”. On this screen, two data boxes are being maintained with the temperature values via the “DataBoxHandler” and the “Lock” and “Light” buttons are drawn using the “SliderSwitchHandler”. Both of these handlers are supplied in the “ScreenObjs.c” file. As user objects are created, often they readily lend themselves to creating common handlers that can easily be reused. Examining these supplied handlers provides insight into how you can create your own.

R20UT3803EG0100 Rev. 1.00 Page 25 of 44 May 24, 2016

Page 26: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.6 Classic Home Screen This screen is defined in the file “ScreenHomeClassic.c”. The objects on this screen are collected by the linker from files allocating objects in the _SCR_HM_CLASSIC section. This allows for their simple inclusion/exclusion of objects similar to the home screen. The objects on this screen demonstrate basic behaviour of buttons and capabilities as described below.

6.1.7 Countdown Screen This screen is defined in the file “ScreenCountdown.c”. This screen demonstrates how to cleanly display transparent text by compositing on work frame and transferring to the display frame. Also, with the large text the anti-aliasing of the fonts can be clearly seen. Another technique shown is the usage of a single callback to handle a multi-button object (the numeric keypad). This screen also uses a “screen task” thread to update the timer value while running (showing GAPI running under multiple threads).

R20UT3803EG0100 Rev. 1.00 Page 26 of 44 May 24, 2016

Page 27: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.8 Animate Screen This screen is defined in the file “ScreenAnimate.c”. This screen shows how the GAPI can be used to animate an object. Here two screen tasks are used to update the two images (one for the sun and one for the scrolling Renesas banner). Also note that the sun image has a transparency (alpha) channel that is used during rendering to blend the image into the background as it moves.

6.1.9 GAPI_T Use Screen This screen is defined in the file “ScreenSlider.c”. This screen shows usage of multiple instances of the slider object, as well as illustrates the behaviour of the GAPI copy modes. The slider values control the color of the R_GAPI_CopySub “transparency” attribute. The first icon in the top row, selects the background area under the output area for the R_GAPI_CopySub source to demonstrate dimming/fading/shading. The remaining top row icons select the corresponding source images for the R_GAPI_CopySub source. The rendered output area shows the processing of the various modes as labelled.

R20UT3803EG0100 Rev. 1.00 Page 27 of 44 May 24, 2016

Page 28: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.10 UTF-8 Screen This screen is defined in the file “ScreenUTF.c”. This screen shows an example of usage of the UTF8 string processing capability of GAPI.

6.1.11 QWERTY Screen This screen is defined in the file “ScreenQWERTY.c”. This screen shows an example of a virtual keyboard.

6.1.12 Writes Screen This screen is defined in the file “ScreenWrites.c”. This screen measures the amount of time that it takes to display a screen of data based on the source image format. The amount of time required depends on the image size, the image type, and the available vertical blanking time.

R20UT3803EG0100 Rev. 1.00 Page 28 of 44 May 24, 2016

Page 29: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.13 Frame Rate Screen This screen is defined in the file “ScreenIO.c”. This screen allows the screen frame refresh rate and vertical blanking percentage to be adjusted. The Direct Drive API allows this attribute to be dynamically adjusted. Using this screen you can see the effect on the LCD panel characteristics and how the vertical blanking percentage affects performance using the write test screen. Note that due to limitations of the display and availability of internal memory buffers, the refresh rate has been limited to between 60Hz and 63Hz. These limits can be adjusted by the defines “DD_MIN_FRAME_RATE” and “DD_MAX_FRAME_RATE” in the source file “config_r_ddlcd.h”.

6.1.14 Calibration Screen This screen is defined in the file “ScreenCalibrate.c”. This screen allows the adjustment of the calibration points used by the touchscreen driver. The values determined in this screen are entered into the “TouchCalibration” data structure; additionally these values can be saved to internal or external flash as part of a calibration procedure. In the demonstration code, predetermined values are loaded into this data structure. In the case of the LCD panel supplied with the kit, the consistency of the supplied touch-screen overlay has not required individual calibration. Once this screen has been entered, it cannot be exited without completing the calibration procedure. When the calibration is completed, all touches to the screen are shown with their corresponding x,y coordinates. To evaluate the effectiveness of the procedure, the user can select non-requested touch points and observe the resulting behaviour. For example, touching the left side instead of right side during calibration will invert touch locations on this axis. As the initial calibration points are pre-determined, simply resetting the MCU will return to default calibration. To facilitate use with an unknown panel with incorrect calibration constants, pressing SW1 during the GAPI demonstration will start the calibration process. When in this screen, pressing SW1 will skip a calibration point, using the default calibration values instead.

R20UT3803EG0100 Rev. 1.00 Page 29 of 44 May 24, 2016

Page 30: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 6 GAPI Demonstration Design Details 6.1.15 Business Card Screen This screen is defined in the file “ScreenCard.c”. This screen demonstrates scrolling text and JPEG image rendering. Images to be displayed are determined at run-time, based on the contents of a configuration file ‘demo.txt’. JPEG images are retrieved from Data Flash memory, mounted as a FAT file system. This screen is loaded as an alternative to the standard home screen, based on the contents of the file MODE.TXT. This is checked immediately after the splash screen in EventManager(). The back frame buffer is re-sized to a 1000 x 60 pixel buffer, to which the full scrolling text string is written to. On each call of the card_scroll() function, a section of the back buffer is copied to the active display buffer, creating the scrolling text. card_scroll() is configured to be called every 15ms, based on the define: SCROLL_RATE.

6.2 Touch Screen Simulation If no selection is made from the main menu within 30 seconds, demonstration touch screen inputs are simulated. The task ‘TouchSim’ is created at start up. This task schedules the posting of simulated touch events to the event queue. The simulated touch position, touch type and delay before the next simulated input is specified in the header file ‘r_touch_sim_stimuli.h’. The home screen monitors any real touch events and if none is detected within a period defined by ‘TICKS_FOR_DEMO’, R_TOUCH_EnableSimulation() is called to start the simulated inputs.

R20UT3803EG0100 Rev. 1.00 Page 30 of 44 May 24, 2016

Page 31: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 7 Code Structure

7.Code Structure This project is organized into startup code, application code, and other configurable package code.

7.1 File Descriptions 7.1.1 Initialization Code, project, object and other files

File Name Category File Description Location *.* Standard C Initial MCU hardware configuration /r_bsp *.cproject, *.launch e2 studio e2 studio project files / *.* Documents Information documents /doc *.* Resources Resource files (graphic, font, audio, etc),

that are used within the demonstration project. The contents of this directory are packaged into a single “resources.bin” file by the project build process. This file is linked with the code and downloaded to internal flash.

/Resources

*.* Utility Windows applications that are used to create files used by the demonstration.

/Utility

R20UT3803EG0100 Rev. 1.00 Page 31 of 44 May 24, 2016

Page 32: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 7 Code Structure 7.1.2 Application Demo Code The CommonSource subdirectory contains all the common source files shared by the Direct Drive platforms. The descriptions of critical files are listed in following tables.

File Name Category File Description Location Jpeg\ Directory JPEG image decode library and

supporting header. /CommonSource/Jpeg

usb_media\ Directory Support for mapping the Data Flash as a USB Device.

/CommonSource/usb_media

usb_pmsc\ Directory Support files for USB PMSC FIT module. /CommonSource/usb_pmsc main.c Standard C Main program /CommonSource Global.h Demo Header Global definitions and macros /CommonSource LCD_Demo.h Demo Header Graphics application definitions and

macros for LCD Direct Drive demo /CommonSource

EventMgr.c Framework Framework tasks for controlling the touch screen and screen manager functions.

/CommonSource

Frames.c/ Frames.h

Framework Routines and API to manage the memory rasters allocated by the demo.

/CommonSource

ScreenMgr.c/ ScreenMgr.h

Framework Routines and API to control the running and switching of screens.

/CommonSource

ScreenObjs.c/ ScreenObjs.h

Framework Routines and API to provide common screen object behavior such as buttons and sliders.

/CommonSource

Screen*.c Screens Files that contain graphics demo screen code. Each screen is contained in a corresponding file

/CommonSource

crc.c Utility Routines to generate CRC values. /CommonSource ad_dtc_RX71M.c/ ad_dtc_RX71M.h/ dtc_vext_RX.h

Utility Routines to coordinate the ADC capture for the touchscreen.

/CommonSource

FindFile.c/ FindFile.h

Utility Routines and API to access the contents of the resource files

/CommonSource

FlashSerialStubs.c/ FlashSerialStubs.h

Utility Stub functions for Serial flash memory access. For population if serial flash is used in future projects.

/CommonSource/SerialFlashStubs

r_config_demo.c/ r_config_demo.h

Utility Routines to set and get the demonstration mode: GAPI or Business Card.

/CommonSource

r_config_parse.c/ r_config_parse.h

Utility Routines for extracting values from a configuration file.

/CommonSource

iResources.h Utility Resource image file that is always located in internal flash memory, thus allowing use during boot process.

/CommonSource

Resources.c Utility Routines to load, store and verify resource files in serial flash memory.

/CommonSource

r_touch_sim_stimuli.h\r_touch_simulate.c \r_touch_simulate.h

Utility Touch screen press simulation routines and stimuli used for auto demo mode.

/CommonSource

simple_printf.c Utility Simplified (small memory, reentrant) Printf routines

/CommonSource

timer_RTC.c/ timer_RTC.h

Utility Routines to simulate a Real Time Clock. /CommonSource

touchScreen.c/ TouchScreen.h

Utility Routines and API for touch screen driver. /CommonSource

R20UT3803EG0100 Rev. 1.00 Page 32 of 44 May 24, 2016

Page 33: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 7 Code Structure 7.1.3 r_Packages The contents of the packages are described below.

File Name Category File Description Location *.h Configuration The files in this directory are used to

configure the packages during the build process. Please refer to the relevant package document for details.

The files in this directory are the only r_Packages files intended to be modified by the user.

/r_Packages/config

*.* DDLCD The Renesas Direct Drive LCD library package

Please refer to the provided Direct Drive user manual for details and API.

/r_Packages/r_ddlcd

*.* GAPI The Renesas GAPI graphics library package

Please refer to the provided GAPI user manual for details and API.

/r_Packages/r_gapi

*.* RTOS The FreeRTOS library package

Please refer to the FreeRTOS website for details and API.

/r_Packages/r_freertos

7.2 FIT Modules The following FIT modules are used in this project:

FIT Module Description Location r_tfat_rx TFAT library is a FAT file system which

just requires small memory. /r_tfat_rx

r_usb_basic USB Basic Host and Peripheral firmware /r_usb_basic r_usb_pmsc USB Peripheral Mass Storage Class

Driver (PMSC) /r_usb_pmsc

r_flash_rx A simple Application Program Interface (API) has been created to allow users of flash based RX700, RX600, RX200 and RX100 Series devices to easily integrate reprogramming abilities into their applications using User Mode programming. User Mode programming is the term used to describe a Renesas MCU's ability to reprogram its own internal flash memory while running in its normal operational mode.

/r_flash_rx

R20UT3803EG0100 Rev. 1.00 Page 33 of 44 May 24, 2016

Page 34: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 8 Program Operation

8.Program Operation The following figure illustrates the interrupt service routines (ISRs) and tasks that are running in the RX71M Revelation Kit demonstration project.

Color Coding

DispMemoryList

Inte

rrupt

Prio

rity

Leve

lTa

sk P

riorit

y Le

vel

R_DDLCD_DD_BLANK_isr(Direct Drive ISR during vertical

blanking time)

R_DDLCD_Memory_ISR(wake up DispMemoryMonitor)

vTickISR(preemption interrupt)

DispMemoryMonitor(coordinate tasks using

external memory with DMA)

ScreenTasks Pool(controlled by icon functions)

Object Y callback functionObject X callback function

EventManager(update screen objects)

TouchScreenCapture(acquire touchscreen events)

R_DDLCD_DD_DATA_isr(Direct Drive ISR during vertical

active data time)

Event Queue

Event Processing

Idle(RTOS idle task)

Activates

Task handles

Priority Level 0 Task

Priority Level 1 Task

Priority Level 2 Task

ISR within RTOS

ISR outside RTOS

ScreenTasks Pool(controlled by icon functions)ScreenTasks Pool

(controlled by icon functions)ScreenTasks Pool(controlled by icon functions)

8.1 Renesas LCD Direct Drive LCD (DDLCD) Renesas LCD Direct Drive package provide a low cost, long life solution for driving TFT panels for use in GUI applications with limited animation requirements. The demonstration project uses the Direct Drive LCD for Internal Memory. For details of the Direct Drive LCD that uses External Memory (E.g. SDRAM) for driving data to the LCD panel please refer to R01AN3384EG Direct Drive LCD Design Guide.

8.2 RTOS This project requires an RTOS to manage the tasks and access to the display buffer memory. FreeRTOS has been chosen for this purpose. However, most RTOS’s are equally suited to the needs of the system.

8.3 Interrupts The LCD Direct Drive API executes two R_DDLCD_DD Interrupt Service Routines once the driver is initialized. These ISRs control the DMA and timer channels that transfer data from the frame RAM to the LCD panel. For optimized performance, one ISR is active during the vertical blanking time, and the other ISR is active during the data transfer portion of the refresh cycle. These ISRs are triggered once per horizontal period (line) of the refresh cycle. Twice per vertical period (frame) (once before the data transfer starts and once after it ends), the R_DDLCD_Memory_ISR is triggered to activate the “DispMemoryMonitor” task. This task is responsible for coordinating user’s application with the LCD update.

8.4 Display Memory Monitor Task The “DispMemoryMonitor” task gives user application tasks a way to coordinate activity with the update of LCD

R20UT3803EG0100 Rev. 1.00 Page 34 of 44 May 24, 2016

Page 35: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 8 Program Operation panel. Typically this is used to prevent applications updating the active display buffer while a LCD update is in progress. The consequence of accessing the active display buffer without using this facility is visible screen artefacts and tearing of the displayed image. Tasks that need to be suspended during LCD panel update may call the “R_DDLCD_DispMemoryAcquire” function to notify the framework. Multiple tasks can be simultaneously registered (up to the configurable DD_DISPMEMORY_MANAGER_MAX_TASKS limit). The “DispMemoryMonitor” task suspends all registered tasks at the beginning of the vertical data transfer and resumes these tasks at the beginning of the vertical blanking period. Tasks no longer requiring this facility can unregister itself by calling “R_DDLCD_DispMemoryRelease”. The last ISR shown in the diagram is the “vTickISR” which causes the FreeRTOS scheduler to pre-empt the currently running task and evaluate which task should run next. If multiple tasks at the same task priority level are ready to run, they will be run in turn after each “vTickISR” in a “round robin” fashion.

8.5 Tasks The “TouchScreenCapture” task is responsible for acquiring events from the touchscreen overlay. When a touch event is judged to have occurred by this task, the information is added to the EventQueue. TouchScreenCapture uses the DispMemoryManager to synchronise the DTC (used to gather ADC samples) with the vertical blanking period, avoiding bus contention between the DTC and the DMA (LCD data transfer). This links the touchscreen sample rate in to the LCD refresh rate; 60Hz by default in the demonstration application. The EventQueue is also used to accept events from other sources such as push buttons, timers or application source code (e.g. Touch Screen Simulation for the auto demo mode). The “EventManager” task determines how events on the current screen should be processed. Every event received is passed to the callback function associated with each object on the current screen. It is the responsibility of the object callback functions to determine if and how to process the event. The supplied demonstration code shows numerous examples of event processing. The next figure shows the interaction of the ISRs in relation to the LCD panel Vsynch signal. It also shows how tasks that have been registered as currently accessing the display memory are suspended during the “vertical data” portion of the period.

LCD_DD_BLANK_isr

Panel Data

Vsynch

LCD_DD_DATA_isr

TASK_DD_isr

vTickISR

Disp. Memory Task

Level 1 RTOS Tasks

Level 0 RTOS Tasks

Verti

cal

Blan

king

Verti

cal

Dat

a

Verti

cal

Blan

king

Verti

cal

Dat

a

Tasks currently using display memoryTasks not using display memory Su

spen

d ta

sks

usin

g di

spla

y m

emor

y

R20UT3803EG0100 Rev. 1.00 Page 35 of 44 May 24, 2016

Page 36: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 8 Program Operation

8.6 Memory Usage The LCD Direct Drive demonstration code uses internal RAM memory for frame buffers stack, variables and pools. Flash memory is used for resource storage, program storage and constants. The location of these resources in memory is determined by the toolchain linker options (Project > Renesas Tool Settings > Linker > Section). RX71M Data Flash is used as a storage area for the Business Card demonstration files. Data Flash offers greater write endurance and allows normal code execution flow during writes. This area is made available to the user as a USB Mass Storage Class device. In the RX600/RX700 family, internal RAM is mapped to the bottom of the memory space, internal flash is mapped to the top of the memory space.

R20UT3803EG0100 Rev. 1.00 Page 36 of 44 May 24, 2016

Page 37: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 8 Program Operation 8.6.1 Sections

Section Name Type Description B_* RAM BSS memory that is zero filled by startup code. The heap is allocated within

this section, and because the RTOS makes extensive use of the heap, significant memory is allocated by the HEAPSIZE macro in “sbrk.h”.

R_* RAM Initialized RAM memory. This area is initialized by startup code with data contained in the D_* sections.

BDTC_TABLE RAM Data storage structures used by the DTC unit. SU RAM User stack space. As the RTOS allocates individual stacks from the heap for

each task, minimal space is required in this section. SI RAM Interrupt stack space. This memory is used during the processing of interrupts

for stack usage. As interrupts can be nested, care must be taken to ensure adequate space is allocated.

BDD_RAS_INT* RAM Space allocated by the Direct Drive API for the display raster. The demonstration uses 3 frames: Background, Work and Display.

BGAPI_POOL* RAM Space allocated by the GAPI for dynamic memory pools. BResources Flash Memory used for runtime access of the Resources.bin file. Note that because

this file is of variable size, the demonstration code is allocating 2Mb for this use in “ScreenMgr.c”

C* Flash Sections allocated for constant variables in the demonstration code. C$ Flash The MCU’s relocatable vector table. D* Flash Initialization data for the R* sections. P* Flash Program memory associated with the application. W* Flash Constant memory allocated for use in switch tables. C_SCR_HM* Flash Constant structures that define the contents of the home screen. C_SCR_HM_CLASSIC* Flash Constant structures that define the contents of the classic home screen. FIXEDVECT Flash The MCUs fixed vector table including the reset vector.

R20UT3803EG0100 Rev. 1.00 Page 37 of 44 May 24, 2016

Page 38: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 9 Resource Storage Access

9. Resource Storage Access Resources (BMP’s, Fonts, Audio files, etc) are accessed from a resource image file located in the linear memory of the MCU. This demonstration expects the resources to be located in internal flash memory. If this design was ported to a platform with external RAM, the resource file could be transferred at power up from non-linear memory (such as serial flash or SD card) to external RAM by the user’s application code. The resource image file is created by a custom utility “Resource_Gen.exe” found in the “Utility” folder of the project. This command line application takes option arguments as follows:

Option Description -D <subdirectory> Process all files in <subdirectory>. -e Include file extension in record name. -q Run in quiet mode (minimal output). -b Generate binary data file. -c Generate 'c' source array (comma delimited by array). -f Suppress records containing only 0xFF for -i/-m options). -i[aaaaaaaa] Generate Intel hex record format. [aaaaaaaa] optional hex address relocation -m[aaaaaaaa] Generate Motorola hex record format. [aaaaaaaa] optional hex address

relocation The demonstration application code runs this utility during every ‘clean’ command input via e2 studio. The options in this build phase are “-b -q -D Resources Resources.bin”; this will take the contents of the Resources directory and include them in the Resources.bin file. The following table illustrates the format of the file header resource image file. Each entry is 32 bytes long. The first record provides CRC and size information for the resource file. Unless the –e option is used, the record name does not include the extension (File_1.bmp would become “File_1”)

Record Name (max 24 characters)

Location (4 Bytes) Size (4 Bytes)

0x000000 “BFS_Header” CRC Resource File Size 0x000020 “File_1” File_1 offset location File_1 size 0x000040 “File_2” File_2 offset location File_2 size 0x000060 … 0x0xxxx0 0xFFFFFFFFFFFF

(termination record) 0xFFFFFFFF 0xFFFFFFFF

The application code accesses information in an image file by resource name using the “FileFind()” function. All contents of the “Resources” directory are included in the Resources.bin file. If the resource file is located in internal flash, typically you would include it into the project by generating a comma delimited array using the “-c” option. Refer to the “iResources.h” file in the demonstration code. The resource file then becomes part of the project download as a constant array. To view the configurations for the custom utility “Resource_Gen.exe”, in e2 studio navigate to:

Image_1.bmp

Image_2.bmp

Image_3.jpg

Font1.efnt

Resource.xxx

Resources.bin Resource_Gen.exe CCRX Linker Binary Program Image

R20UT3803EG0100 Rev. 1.00 Page 38 of 44 May 24, 2016

Page 39: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 9 Resource Storage Access Project Properties > Builders > Resource Builder Select the Resource Builder configuration and click ‘Edit’. The ‘Edit Configuration’ dialog will appear as shown in the following images.

The Resource_Gen.exe file is configured to run during each project ‘Clean’ command, shown in the image above right. Click ‘Cancel’ to exit the Edit Configuration.

R20UT3803EG0100 Rev. 1.00 Page 39 of 44 May 24, 2016

Page 40: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit 10 Additional Information 10.Additional Information

Technical Support For details on how to use e2 studio, refer to the help file by opening e2 studio, then selecting Help > Help Contents from the menu bar.

For information about the RX71M Group microcontrollers refer to the RX71M Group Hardware Manual. For information about the RX assembly language, refer to the RX Family Software Manual. Technical Contact Details

Online technical support and information is available at http://www.renesas.com/rpbrx71m Technical Contact Details

America: [email protected] Europe: http://www.renesas.eu/ibg-kitsupport

Japan: [email protected] Website: http://www.renesas.com Trademarks All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations. Copyright This document may be, wholly or partially, subject to change without notice. All rights reserved. Duplication of this document, either in whole or part is prohibited without the written permission of Renesas Electronics Europe Limited. © 2016 Renesas Electronics Europe Limited. All rights reserved. © 2016 Renesas Electronics Corporation. All rights reserved. © 2016 Renesas System Design Co., Ltd. All rights reserved.

R20UT3803EG0100 Rev. 1.00 Page 40 of 44 May 24, 2016

Page 41: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

REVISION HISTORY RX71M Revelation Kit User’s Manual

Rev. Date Description Page Summary

1.00 May 24, 2016 First Edition issued

C-1

Page 42: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

RX71M Revelation Kit: User’s Manual Publication Date: Rev. 1.00 May 24, 2016 Published by: Renesas Electronics Corporation

Page 43: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited
Page 44: RX71M Group 322016/05/24  · 9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited

R20UT3803EG0100

RX71M Group