Renesas RX Series User Manual

Renesas RX Series User Manual

Rx23w group. solution starter kit for rx23w smart configurator
Hide thumbs Also See for RX Series:

Advertisement

Quick Links

RX23W Group
32
32
RENESAS 32-Bit MCU
RX Family / RX200 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 Solution Starter Kit for RX23W
Smart Configurator Tutorial Manual
For e
2
studio
Rev. 1.00 Aug 2019

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the RX Series and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Renesas RX 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 RSSK. 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 RX23W 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 RSSK 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 RSSK platform. Features This RSSK provides an evaluation of the following features: Project Creation with e studio.
  • Page 9: Introduction

    Renesas Solution Starter Kit for RX23W 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 RSSK platform. The tutorials help...
  • Page 10: Project Creation With E Studio

    Renesas Solution Starter Kit for RX23W 3. Project Creation with e studio 3. Project Creation with e studio Introduction In this section, the user will be guided through the steps required to create a new C project for the RX23W MCU, ready to generate peripheral driver code using Smart Configurator.
  • Page 11 Renesas Solution Starter Kit for RX23W 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. •...
  • Page 12 Renesas Solution Starter Kit for RX23W 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 RSSK Web Installer (https://www.renesas.com/rsskrx23w/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 Solution Starter Kit for RX23W 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 Solution Starter Kit for RX23W 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 Solution Starter Kit for RX23W 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.
  • Page 18: Compare Match Timer

    Renesas Solution Starter Kit for RX23W 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 Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio In ‘Config_CMT0’ configure CMT0 as shown in Figure 4-10. This timer is configured to generate a high priority interrupt every 1ms. We will use this interrupt later in the tutorial to provide an API for generating high accuracy delays required in our application.
  • Page 20 Renesas Solution Starter Kit for RX23W 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: Interrupt Controller

    Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio 4.5.3 Interrupt Controller Referring to the RSSK schematic, SW1 is connected to IRQ1(P31) and SW2 is connected to IRQ0 (P30). Click ‘Add component’ icon. In ‘Software Component Selection’ dialog -> Type, select ‘Drivers’.
  • Page 22 Renesas Solution Starter Kit for RX23W 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-17 below. Figure 4-17 Config_ICU setting R20UT4449EG0100 Rev. 1.00 Page 22 of 64...
  • Page 23: Ports

    Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio 4.5.4 Ports Referring to the RSSK schematic, LED0 is connected to P41, LED1 is connected to P42, LED2 is connected to P43 and LED3 is connected to P44. PE3 is used as one of the LCD control lines, together with PB3, P03 and PJ3.
  • Page 24 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Tick the tickboxes for ‘PORT0’, ‘PORT4’, ‘PORTB’, PORTE’ and ‘PORTJ’ as shown in Figure 4-20 below. Figure 4-20 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-21, Figure 4-22, Figure 4-23, Figure 4-24 and Figure 4-25 below.
  • Page 25 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Select ‘PORT4’ tab. Figure 4-22 Select ‘PORT4’ tab Select ‘PORTB’ tab. Figure 4-23 Select ‘PORTB’ tab R20UT4449EG0100 Rev. 1.00 Page 25 of 64 Aug.30.19...
  • Page 26 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Select ‘PORTE’ tab. Figure 4-24 Select ‘PORTE’ tab Select ‘PORTJ’ tab. Figure 4-25 Select ‘PORTJ’ tab R20UT4449EG0100 Rev. 1.00 Page 26 of 64 Aug.30.19...
  • Page 27: Sci/Scif Asynchronous Mode

    Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio 4.5.5 SCI/SCIF Asynchronous Mode In the RSSKRX23W, SCI8 is connected via the FT234XD USB-UART converter to provide a USB virtual COM port as shown in the schematic.
  • Page 28 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio In ‘Resource’, select ‘SCI8’ as shown in Figure 4-28 below. Figure 4-28 Select Resource – SCI8 Ensure that the ‘Configuration name’ updates to ‘Config_SCI8’ as shown in Figure 4-29 below then click ‘Finish’...
  • Page 29 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Configure SCI8 as shown in Figure 4-30. Ensure the ‘Start bit edge detection’ is set as ‘Falling edge on RXD8 pin’ and the ‘Bit rate’ is set to 19200 bps. All other settings remain at their defaults.
  • Page 30: Spi Clock Synchronous Mode

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

    Renesas Solution Starter Kit for RX23W 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 RSSK. Click ‘Add component’...
  • Page 34 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Configure S12AD0 as shown in Figure 4-38 and Figure 4-39. Ensure the ‘Analog input channel’ tick box for AN000 is checked and the ‘Start trigger source’ is set to ‘Software trigger’. All other settings remain at their defaults.
  • Page 35 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Figure 4-39 Config_S12AD0 setting (2) R20UT4449EG0100 Rev. 1.00 Page 35 of 64 Aug.30.19...
  • Page 36: The 'Pins' Tabbed Page

    Renesas Solution Starter Kit for RX23W 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 37 Renesas Solution Starter Kit for RX23W 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 IRQ0 to P30, IRQ1 to P31. Ensure the ‘Enable’ tick box of IRQ0 and IRQ1 are checked, as shown in Figure 4-42.
  • Page 38 Renesas Solution Starter Kit for RX23W 4. Smart Configurator Using the e studio Select the Config_SCI12 of Software Components. In the Pin Function list -> Assignment column, Ensure the ‘Enable’ tick box of SCK12 and SMOSI12 are checked and Assignment column of SCK12 is PE0, SMOSI12 is PE1 as shown in Figure 4-44.
  • Page 39: Building The Project

    Renesas Solution Starter Kit for RX23W 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-46. Figure 4-46 Generate Code Button The Console pane should report ‘Code generation is successful’, as shown Figure 4-47 below.
  • Page 40: User Code Integration

    Renesas Solution Starter Kit for RX23W 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 RSSK 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 41: Lcd Code Integration

    Renesas Solution Starter Kit for RX23W 5. User Code Integration LCD Code Integration API functions for the Okaya LCD display are provided with the RSSK. 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 42 Renesas Solution Starter Kit for RX23W 5. User Code Integration In the e studio Project Tree, expand the ‘src\smc_gen\general’ folder and open the file ‘r_cg_userdefine.h’ by double-clicking on it. Insert the following #defines in between the user code delimiter comments as shown below.
  • Page 43: Spi Code

    Renesas Solution Starter Kit for RX23W 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 e2 studio Project Tree, expand the ‘src\smc_gen\Config_SCI12’ folder and open the file ‘Config_SCI12.h’...
  • Page 44: Cmt Code

    Renesas Solution Starter Kit for RX23W 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 Solution Starter Kit for RX23W 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 Solution Starter Kit for RX23W 5. User Code Integration Switch Code Integration API functions for user switch control are provided with the RSSK. Refer to the Tutorial project folder created according to the Quick Start Guide procedure. Check that the following files are in the src folder: ・rsskrx23wdef.h...
  • Page 47 Renesas Solution Starter Kit for RX23W 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: Bounce Timer Code

    Renesas Solution Starter Kit for RX23W 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: Main Switch And Adc Code

    Renesas Solution Starter Kit for RX23W 5. User Code Integration Open the Config_CMT2_user.c file and insert the following code in the user code area inside the function r_Config_CMT2_cmi2_interrupt: /* Start user code for r_Config_CMT2_cmi2_interrupt. Do not edit comment generated here */ /* Stop this timer - we start it again in the de-bounce routines */ R_Config_CMT2_Stop();...
  • Page 50 Renesas Solution Starter Kit for RX23W 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 51 Renesas Solution Starter Kit for RX23W 5. User Code Integration /****************************************************************************** * Function Name : get_adc * Description : Reads the ADC result, converts it to a string and displays it on the LCD panel. * Argument : none * Return value...
  • Page 52: Debug Code Integration

    Renesas Solution Starter Kit for RX23W 5. User Code Integration In the e studio Project Tree, expand the ‘src\smc_gen\Config_S12AD0’ folder and open the file ‘Config_S12AD0.h’ by double-clicking on it. Insert the following code in the user code area for function, resulting in the code shown below: /* Start user code for function.
  • Page 53: Uart Code Integration

    Renesas Solution Starter Kit for RX23W 5. User Code Integration UART Code Integration 5.6.1 SCI Code In the e studio Project Tree, expand the ‘src\smc_gen\Config_SCI8’ folder and open the file ‘Config_SCI8.h’ by double-clicking on it. Insert the following code in the user code area at the end of the file: /* Start user code for function.
  • Page 54 Renesas Solution Starter Kit for RX23W 5. User Code Integration In the same file, insert the following code in the user code area inside the r_Config_SCI8_callback_receiveend function: static void r_Config_SCI8_callback_receiveend(void) /* Start user code for r_Config_SCI8_callback_receiveend. Do not edit comment generated here */...
  • Page 55: Main Uart Code

    Renesas Solution Starter Kit for RX23W 5. User Code Integration 5.6.2 Main UART code Open the file ‘SC_Tutorial.c’. Add the following declaration to 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_rssk_switch.h" #include "r_rssk_debug.h"...
  • Page 56 Renesas Solution Starter Kit for RX23W 5. User Code Integration /* Reset the flag */ g_adc_trigger 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 57: Led Code Integration

    Renesas Solution Starter Kit for RX23W 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_rssk_switch.h" #include "r_rssk_debug.h"...
  • Page 58 Renesas Solution Starter Kit for RX23W 5. User Code Integration while (1U) uint16_t adc_result; /* Wait for user requested A/D conversion flag to be set (SW1 or SW2) */ (TRUE g_adc_trigger) /* Call the function to perform an A/D conversion */ adc_result get_adc();...
  • Page 59: 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’. Ensure that in ‘Connection Settings’ tab that the ‘Power Target From The Emulator (MAX 200mA)’ is set to Yes, and ‘Main Clock Source’...
  • Page 60 Renesas Solution Starter Kit for RX23W 6. Debugging the Project Connect the E2 Lite to the PC and the RSSK E1/E2 Lite connector. Connect the Pmod LCD to the PMOD2 connector. In the Project Explorer pane, ensure that the ‘SC_Tutorial’ project is selected. To debug the project, click the button.
  • Page 61: 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 62 RX23W Group REVISION HISTORY Renesas Solution Starter Kit for RX23W Smart Configurator Tutorial Manual For e studio Rev. Date Description Page Summary 1.00 Aug.30.19 First Edition issued ...
  • Page 63 RX23W Group RX23W Renesas Solution Starter Kit for Smart Configurator Tutorial Manual For e studio Publication Date: Rev. 1.00 Aug.30.19 Published by: Renesas Electronics Corporation...
  • Page 64 RX23W Group R20UT4449EG0100...

This manual is also suitable for:

Rx200 seriesRssk

Table of Contents