Renesas RX700 Series Manual
Hide thumbs Also See for RX700 Series:

Advertisement

RX72N Group
32
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 Corp. without notice. Please review the latest information published by
Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
website (http://www.renesas.com).
www.renesas.com
Renesas Starter Kit+ for RX72N
Smart Configurator Tutorial Manual
For e
2
studio
Rev. 1.00 Nov 2019

Advertisement

Table of Contents
loading

Summary of Contents for Renesas RX700 Series

  • Page 1 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 Corp. without notice. Please review the latest information published by Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
  • Page 2 Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.
  • Page 3 Unit Products The following usage notes are applicable to all Microprocessing unit and Microcontroller unit products from Renesas. For detailed usage notes on the products covered by this document, refer to the relevant sections of the document as well as any technical updates that have been issued for the products.
  • Page 4 RSK+. 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...
  • Page 5 The following documents apply to the RX72N 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...
  • Page 6 Application Programming Interface bits per second Compare Match Timer COMmunications port referring to PC serial port Central Processing Unit E1 / E2 Lite Renesas On-chip Debugging Emulator Graphical User Interface Integrated Development Environment Interrupt Request Liquid Crystal Display Light Emitting Diode...
  • Page 7: Table Of Contents

    Table of Contents 1. Overview ..........................8 Purpose ..............................8 Features ..............................8 2. Introduction ........................9 3. Project Creation with e studio ..................10 Introduction .............................. 10 Creating the Project ..........................10 4. Smart Configurator Using the e studio ................13 Introduction ..............................
  • Page 8: Overview

    1. Overview Purpose This RSK+ is an evaluation tool for Renesas microcontrollers. This manual describes how to use the e studio IDE Smart Configurator plug-in to create a working project for the RSK+ platform. Features This RSK+ provides an evaluation of the following features: Project Creation with e studio.
  • Page 9: Introduction

    Renesas Starter Kit+ for RX72N 2. Introduction 2. Introduction This manual is designed to answer, in tutorial form, how to use the Smart Configurator plug-in for the RX family together with the e studio IDE to create a working project for the RSK+ platform. The tutorials help explain the following: •...
  • Page 10: Project Creation With E Studio

    C/C++ project’. (The Welcome page can also be opened from 'Help'-> 'Welcome'.) In the ‘Templates for New C/C++ Project’ • dialog, selecting ‘Renesas RX’ -> ‘Renesas CC-RX C/C++ Executable Project’. Click ‘Next’. • R20UT4442EG0100 Rev. 1.00 Page 10 of 66...
  • Page 11 Renesas Starter Kit+ for RX72N 3. Project Creation with e studio • Enter the project name ‘SC_Tutorial’. Click ‘Next’. In the ‘Select toolchain, device & debug • settings’ dialog, select the options as shown in the screenshot opposite. In ‘Toolchains’ choose ‘Renesas CCRX’.
  • Page 12 Renesas Starter Kit+ for RX72N 3. Project Creation with e studio • Click ‘Next’. • A summary dialog will appear, click ‘Finish’ to complete the project generation. Wait for file generation to start. • In future, to skip the pop-up message on the •...
  • Page 13: Smart Configurator Using The E Studio

    SC_Tutorial. The fully completed Tutorial project is contained in the RSK+ Web Installer (https://www.renesas.com/rskrx72n/install/e2) and may be imported into e studio by following the steps in the Quick Start Guide. This Tutorial is intended as a learning exercise for users who wish to use the Smart Configurator to generate their own custom projects for e studio.
  • Page 14: Project Configuration Using Smart Configurator

    In this section, a brief tour of Smart Configurator is presented. For further details of the Smart Configurator paradigm and reference, refer to the RX Smart Configurator User's Guide: e studio. You can download the latest document from: https://www.renesas.com/smart-configurator. The Smart Configurator initial view is displayed as illustrated in Figure 4-1. Figure 4-1 Overview page Smart Configurator provides GUI features for configuration of MCU sub systems.
  • Page 15: The 'Board' Tabbed Page

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio The ‘Board’ tabbed page On the ‘Board’ tabbed page, set the board type and device type. Click the 'Board' tab and it will be displayed as shown in Figure 4-2.
  • Page 16: The 'Clocks' Tabbed Page

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio The ‘Clocks’ tabbed page The ‘Clocks’ tabbed page configures clocks of the device selected. Clock source, frequency, PLL settings and clock divider settings can be configured for the output clocks. Clock configurations will be reflected in the r_bsp_config.h file in \src\smc_gen\r_config.
  • Page 17: The 'Components' Tabbed Page

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio The ‘Components’ tabbed page Drivers and middleware are handled as software components in Smart Configurator. The ‘Components’ page allows the user to select and configure software components. Figure 4-5 Components page 4.5.1...
  • Page 18: Compare Match Timer

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio 4.5.2 Compare Match Timer CMT0 will be used as an interval timer for generation of accurate delays. CMT1 and CMT2 will be used as timers in de-bouncing of switch interrupts.
  • Page 19 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio In ‘Add new configuration for selected component’ dialog -> Resource, select ‘CMT0’ as shown in Figure 4-9 below. Figure 4-9 Select Resource - CMT0 Ensure that the ‘Configuration name’ updates to ‘Config_CMT0’ as shown in Figure 4-10 below then click ‘Finish’.
  • Page 20 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Click the ‘Add component’ icon. In ‘Software Component Selection’ dialog -> Type, select ‘Drivers’. Select ‘Compare Match Timer’ then click ‘Next’. In ‘Add new configuration for selected component’ dialog ->...
  • Page 21 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Click the ‘Add component’ icon. In ‘Software Component Selection’ dialog -> Type, select ‘Drivers’. Select ‘Compare Match Timer’ then click ‘Next’. In ‘Add new configuration for selected component’ dialog ->...
  • Page 22: Interrupt Controller

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio 4.5.3 Interrupt Controller Referring to the RSK+ schematic, SW1 is connected to IRQ13(P45) and SW2 is connected to IRQ12(P44). SW3 is connected to IRQ15(P07) and ADTRG0n. This tutorial uses ADTRG0n, which will be configured later in §4.5.7.
  • Page 23 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Navigate to the ‘Config_ICU’, configure these two interrupts as falling edge triggered as shown in Figure 4-20 below. Figure 4-20 Config_ICU setting R20UT4442EG0100 Rev. 1.00 Page 23 of 66...
  • Page 24: Ports

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio 4.5.4 Ports Referring to the RSK+ schematic, LED0 is connected to P71, LED1 is connected to PH6, LED2 is connected to PL7 and LED3 is connected to PL6. PH3 is used as one of the LCD control lines, together with P02, PK7 and PL0.
  • Page 25 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Tick the tickboxes for ‘PORT0’, ‘PORT7’, ‘PORTH’, PORTK’ and ‘PORTL’ as shown in Figure 4-23 below. Figure 4-23 Select Port selection Navigate through each of the 'PORTx' tabs, configuring these four I/O lines and LCD control lines as shown in Figure 4-24, Figure 4-25, Figure 4-26, Figure 4-27 and Figure 4-28 below.
  • Page 26 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Select ‘PORT7’ tab. Figure 4-25 Select PORT7 tab Select ‘PORTH’ tab. Figure 4-26 Select PORTH tab R20UT4442EG0100 Rev. 1.00 Page 26 of 66 Nov.29.19...
  • Page 27 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Select ‘PORTK’ tab. Figure 4-27 Select PORTK tab Select ‘PORTL’ tab. Figure 4-28 Select PORTL tab R20UT4442EG0100 Rev. 1.00 Page 27 of 66 Nov.29.19...
  • Page 28: Sci/Scif Asynchronous Mode

    4.5.5 SCI/SCIF Asynchronous Mode In the RSK+RX72N, SCI9 is connected via a Renesas RL78/G1C to provide a USB virtual COM port as shown in the schematic. Click the ‘Add component’ icon. In ‘Software Component Selection’ dialog -> Type, select ‘Drivers’. Select ‘SCI/SCIF Asynchronous Mode’...
  • Page 29 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio In ‘Resource’, select ‘SCI9’ as shown in Figure 4-31 below. Figure 4-31 Select Resource – SCI9 Ensure that the ‘Configuration name’ updates to ‘Config_SCI9’ as shown in Figure 4-32 below then click ‘Finish’.
  • Page 30 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Configure SCI9 as shown in Figure 4-33. Ensure the ‘Start bit edge detection’ is set as ‘Falling edge on RXD9 pin’ and the ‘Bit rate’ is set to 19200 bps. All other settings remain at their defaults.
  • Page 31: Spi Clock Synchronous Mode

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio 4.5.6 SPI Clock Synchronous Mode In the RSK+RX72N, SCI7 is used as an SPI master for the Pmod LCD on the PMOD1 connector as shown in the schematic. Click the ‘Add component’...
  • Page 32 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio In ‘Resource’, select ‘SCI7’ as shown in Figure 4-36 below. Figure 4-36 Select Resource – SCI7 Ensure that the ‘Configuration name’ updates to ‘Config_SCI7’ as shown in Figure 4-37 below then click ‘Finish’.
  • Page 33 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Configure SCI7 as shown in Figure 4-38. Ensure the ‘Transfer direction’ is set as ‘MSB-first’ and the ‘Bit rate’ is set to 15000 kbps. All other settings remain at their defaults.
  • Page 34: Single Scan Mode S12Ad

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio 4.5.7 Single Scan Mode S12AD We will be using the S12AD in Single Scan Mode on the AN000 input, which is connected to the RV1 potentiometer output on the RSK+. The conversion start trigger will be via the pin connected to SW3. Click the ‘Add component’...
  • Page 35 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Configure S12AD0 as shown in Figure 4-41 and Figure 4-42. Ensure the ‘Analog input channel’ tick box for AN000 is checked and the ‘Start trigger source’ is set to ‘A/D conversion start trigger pin’. All other settings remain at their defaults.
  • Page 36 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Figure 4-42 Config_S12AD0 setting (2) R20UT4442EG0100 Rev. 1.00 Page 36 of 66 Nov.29.19...
  • Page 37: The 'Pins' Tabbed Page

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio The ‘Pins’ tabbed page Smart Configurator assigns pins to the software components that are added to the project. Assignment of the pins can be changed using the Pins page.
  • Page 38 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Select the Config_ICU of Software Components. In the Pin Function list -> Assignment column, change the pin assignment IRQ12 to P44, IRQ13 to P45. Ensure the ‘Enable’ tick box of IRQ12 and IRQ13 are checked, as shown in Figure 4-45.
  • Page 39 Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Select the Config_SCI7 of Software Components. In the Pin Function list -> Assignment column, Ensure the ‘Enable’ tick box of SCK7 and SMOSI7 are checked and Assignment column of SCK7 is PH0, SMOSI7 is PH2 as shown in Figure 4-47.
  • Page 40: Building The Project

    Renesas Starter Kit+ for RX72N 4. Smart Configurator Using the e studio Peripheral function configuration is now complete. Save the project using the File -> Save, then click ‘ Generate Code’ at location of Figure 4-49. Figure 4-49 Generate Code Button The Console pane should report ‘Code generation is successful’, as shown Figure 4-50 below.
  • Page 41: User Code Integration

    Renesas Starter Kit+ for RX72N 5. User Code Integration 5. User Code Integration In this section, the remaining application code is added to the project. Source files found in the RSK+ Web Installer are copied into the workspace and the user is directed to add code in the user areas of the code generator files.
  • Page 42: Lcd Code Integration

    Renesas Starter Kit+ for RX72N 5. User Code Integration LCD Code Integration API functions for the Okaya LCD display are provided with the RSK+. Refer to the Tutorial project folder created according to the Quick Start Guide procedure. Check that the following files are in the src folder: ・ascii.c...
  • Page 43: Spi Code

    Renesas Starter Kit+ for RX72N 5. User Code Integration 5.2.1 SPI Code The Okaya LCD display is driven by the SPI Master that was configured using Smart Configurator in §4.5.6. In the e studio Project Tree, expand the ‘src\smc_gen\Config_SCI7’ folder and open the file ‘Config_SCI7.h’ by double-clicking on it.
  • Page 44: Cmt Code

    Renesas Starter Kit+ for RX72N 5. User Code Integration 5.2.2 CMT Code The LCD code needs to insert delays to meet the timing requirements of the display module. This is achieved using the dedicated timer which was configured using Smart Configurator in §4.5.2.
  • Page 45: Additional Include Paths

    Renesas Starter Kit+ for RX72N 5. User Code Integration Additional include paths Before the project can be built the compiler needs some additional include paths added. Select the SC_Tutorial project in the Project Explorer pane. Right click in the Project Explorer window and select 'Properties'.
  • Page 46: Switch Code Integration

    Renesas Starter Kit+ for RX72N 5. User Code Integration Switch Code Integration API functions for user switch control are provided with the RSK+. Refer to the Tutorial project folder created according to the Quick Start Guide procedure. Check that the following files are in the src folder: ・rskrx72ndef.h...
  • Page 47 Renesas Starter Kit+ for RX72N 5. User Code Integration Now, open the Config_ICU.c file and insert the following code in the user code area at the end of the file: /* Start user code for adding. Do not edit comment generated here */...
  • Page 48 Renesas Starter Kit+ for RX72N 5. User Code Integration Open the Config_ICU_user.c file and insert the following code in the user code area for include near the top of the file: /* Start user code for include. Do not edit comment generated here */...
  • Page 49: Bounce Timer Code

    Renesas Starter Kit+ for RX72N 5. User Code Integration 5.4.2 De-bounce Timer Code studio Project Tree, expand the ‘src\smc_gen\Config_CMT1’ folder and open In the e ‘Config_CMT1_user.c’ file and insert the following code in the user code area for include near the top of the file: /* Start user code for include.
  • Page 50: Main Switch And Adc Code

    Renesas Starter Kit+ for RX72N 5. User Code Integration 5.4.3 Main Switch and ADC Code In this part of the tutorial we add the code to act on the switch presses to activate A/D conversions and display the result on the LCD. In §4.5.7 we configured the ADC to be triggered from the ADTRG0# pin, SW3. In this code, we also perform software triggered A/D conversion from the user switches SW1 and SW2, by reconfiguring the ADC trigger source on-the-fly once an SW1 or SW2 press is detected.
  • Page 51 Renesas Starter Kit+ for RX72N 5. User Code Integration Next add the highlighted code below in the main function and the code inside the while loop, resulting in the code shown below: void main(void) /* Initialize the switch module */ R_SWITCH_Init();...
  • Page 52 Renesas Starter Kit+ for RX72N 5. User Code Integration Then add the definition for the switch call-back, get_adc and lcd_display_adc functions below the main function, as shown below: /****************************************************************************** * Function Name : cb_switch_press * Description : Switch press callback function. Sets g_adc_trigger flag.
  • Page 53 Renesas Starter Kit+ for RX72N 5. User Code Integration /****************************************************************************** * Function Name : lcd_display_adc * Description : Converts adc result to a string and displays it on the LCD panel. * Argument : uint16_t adc result * Return value...
  • Page 54 Renesas Starter Kit+ for RX72N 5. User Code Integration Open the file ‘Config_S12AD0.c’ by double-clicking on it. Insert the following code in the user code area for adding at the end of the file, as shown below: /* Start user code for adding. Do not edit comment generated here */...
  • Page 55: Debug Code Integration

    Renesas Starter Kit+ for RX72N 5. User Code Integration Debug Code Integration API functions for trace debugging via the RSK+ serial port are provided with the RSK+. Refer to the Tutorial project folder created according to the Quick Start Guide procedure. Check that the following files are in the src folder: ・r_rsk_debug.c...
  • Page 56: Main Uart Code

    Renesas Starter Kit+ for RX72N 5. User Code Integration In the same file, insert the following code in the user code area inside the r_Config_SCI9_callback_receiveend function: static void r_Config_SCI9_callback_receiveend(void) /* Start user code for r_Config_SCI9_callback_receiveend. Do not edit comment generated here */...
  • Page 57 Renesas Starter Kit+ for RX72N 5. User Code Integration /* Prototype declaration for lcd_display_adc */ static void lcd_display_adc (const uint16_t adc_result); /* Prototype declaration for uart_display_adc */ static void uart_display_adc(const uint8_t adc_count, const uint16_t adc_result); /* Variable to store the A/D conversion count for user display */...
  • Page 58 Renesas Starter Kit+ for RX72N 5. User Code Integration /* Reset the flag */ g_adc_complete FALSE; else /* do nothing */ Then, add the following function definition in the end of the file: /****************************************************************************** * Function Name : uart_display_adc * Description : Converts adc result to a string and sends it to the UART.
  • Page 59: Led Code Integration

    Renesas Starter Kit+ for RX72N 5. User Code Integration LED Code Integration Open the file ‘SC_Tutorial.c’. Add the following declaration to the near the top of the file: #include "r_smc_entry.h" #include "r_okaya_lcd.h" #include "r_cg_userdefine.h" #include "Config_S12AD0.h" #include "r_rsk_switch.h" #include "r_rsk_debug.h"...
  • Page 60 Renesas Starter Kit+ for RX72N 5. User Code Integration /* Increment the s_adc_count and display using the LEDs */ (++s_adc_count)) s_adc_count led_display_count(s_adc_count); /* Send the result to the UART */ uart_display_adc(s_adc_count, adc_result); /* Reset the flag */ g_adc_trigger FALSE; /* SW3 is directly wired into the ADTRG0n pin so will...
  • Page 61: Debugging The Project

    ‘Debug Configuration’. Figure 6-1 Debug Configurations In order to execute the project, it is necessary to change the following settings in ‘Renesas GDB Hardware Debugging’ -> ‘SC_Tutorial HardwareDebug’ -> ‘Debugger’ -> ‘Connection Settings’. Set ‘Power Target From The Emulator (MAX 200mA)’ to ‘No’, set ‘Extal Frequency [MHz]’ and 'Operating Frequency [MHz]’...
  • Page 62 Renesas Starter Kit+ for RX72N 6. Debugging the Project Connect the E2 Lite to the PC and the RSK+ E1/E2 Lite connector. Connect the Pmod LCD to the PMOD1 connector. Connect the center positive +5V PSU to the PWR connector on the RSK+ and apply power.
  • Page 63: Additional Information

    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 GmbH. © 2019 Renesas Electronics Europe GmbH. All rights reserved.
  • Page 64 RX72N Group REVISION HISTORY Renesas Starter Kit+ for RX72N Smart Configurator Tutorial Manual For e studio Rev. Date Description Page Summary 1.00 Nov.29.19 First Edition issued ...
  • Page 65 RX72N Group RX72N Renesas Starter Kit+ for Smart Configurator Tutorial Manual For e studio Publication Date: Rev. 1.00 Nov.29.19 Published by: Renesas Electronics Corporation...
  • Page 66 RX72N Group R20UT4442EG0100...

This manual is also suitable for:

Rx72n

Table of Contents