Renesas RX700 Series Скачать руководство пользователя страница 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. 

website (http://www.renesas.com). 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RX72N Group 

 

Renesas Starter Kit+ for RX72N 

Smart Configurator Tutorial Manual 

For e

2

 studio 

Rev. 1.00  Nov 2019 

 

32 

RENESAS 32-Bit MCU 

RX Family / RX700 Series 

32 

www.renesas.com

Us

er

s M

anu
al

 

Содержание RX700 Series

Страница 1: ...esas 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 RX72N Group Renesas Starter Kit for RX72N Smart Configurator Tutorial Manual For e2 studio Rev 1 00 Nov 2019 32 RENESAS 32 Bit MCU RX Family RX700 Series 32 www renesas com User s Manual ...

Страница 2: ...ons failure or accident arising out of the use of Renesas Electronics products outside of such specified ranges 7 Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions Unless designated as a hi...

Страница 3: ...put signal during power off state as described in your product documentation 4 Handling of unused pins Handle unused pins in accordance with the directions given under handling of unused pins in the manual The input pins of CMOS products are generally in the high impedance state In operation with an unused pin in the open circuit state extra electromagnetic noise is induced in the vicinity of the ...

Страница 4: ...e 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 ...

Страница 5: ...ing this manual 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 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 Description Do...

Страница 6: ...B Least Significant Bit LVD Low Voltage Detect MCU Micro controller Unit MSB Most Significant Bit PC Personal Computer PLL Phase locked Loop Pmod This is a Digilent Pmod Compatible connector Pmod is registered to Digilent Inc Digilent Pmod_Interface_Specification PSU Power Supply Unit RAM Random Access Memory ROM Read Only Memory RSK Renesas Starter Kit RTC Real Time Clock SCI Serial Communication...

Страница 7: ...r 18 4 5 3 Interrupt Controller 22 4 5 4 Ports 24 4 5 5 SCI SCIF Asynchronous Mode 28 4 5 6 SPI Clock Synchronous Mode 31 4 5 7 Single Scan Mode S12AD 34 4 6 The Pins tabbed page 37 4 6 1 Change pin assignment of a software component 37 4 7 Building the Project 40 5 User Code Integration 41 5 1 Project Settings 41 5 2 LCD Code Integration 42 5 2 1 SPI Code 43 5 2 2 CMT Code 44 5 3 Additional inclu...

Страница 8: ...dio IDE Smart Configurator plug in to create a working project for the RSK platform 1 2 Features This RSK provides an evaluation of the following features Project Creation with e2 studio Code generation using the Smart Configurator plug in User circuitry such as switches LEDs and a potentiometer The RSK board contains all the circuitry required for microcontroller operation ...

Страница 9: ...o selectable build configurations HardwareDebug is a project built with the debugger support included Optimisation is set to zero Release is a project with optimised compile options level two and Outputs debugging information option not selected producing code suitable for release in a product The tutorial examples in this manual assume that installation procedures described in the RSK Quick Start...

Страница 10: ...ady to generate peripheral driver code using Smart Configurator This project generation step is necessary to create the MCU specific source project and debug files 3 2 Creating the Project Start e2 studio and select a suitable location for the project workspace In the Welcome page click Create a new C C project The Welcome page can also be opened from Help Welcome In the Templates for New C C Proj...

Страница 11: ...ct toolchain device debug settings dialog select the options as shown in the screenshot opposite In Toolchains choose Renesas CCRX The R5F572NNDxBD MCU is found under RX700 RX72N RX72N 224 pin Select E2 Lite RX from the pulldown and check Create Release Configuration check box Click Next In the Select Coding Assistant settings dialog select Smart Configurator Click Next ...

Страница 12: ...ick 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 right check the Remember my decision check box and click on Open Perspective The perspective changes automatically when the Smart Configurator starts up ...

Страница 13: ...d preserve any custom code inside the delimiters on subsequent code generation operations This is useful if after adding custom code the user needs to re visit Smart Configurator to change any MCU operating parameters Note If code is added outside the above user code area it will be lost if code generation is executed again with Smart Configurator By following the steps detailed in this Tutorial t...

Страница 14: ...the RX Smart Configurator User s Guide e2 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 Once the user has configured all required MCU sub systems and peripherals the user can ...

Страница 15: ...ov 29 19 4 3 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 Figure 4 2 Board configuration page 4 3 1 Board configuration page Make sure that Custom User Board is selected for the board Figure 4 3 Select board ...

Страница 16: ...ns will be reflected in the r_bsp_config h file in src smc_gen r_config 4 4 1 Clocks configuration Figure 4 4 shows a screenshot of Smart Configurator with the Clocks configurations Click on the Clocks tab Configure the system clocks as shown in the figure In this tutorial we are using the on board 24 MHz crystal resonator for our main clock oscillation source and the PLL circuit is in operation T...

Страница 17: ...nents page 4 5 1 Add a software component into the project Smart Configurator supports five types of software components Startup Drivers Middleware Application and RTOS In the following sub sections the reader is guided through the steps to configure the MCU for a simple project containing interrupts for switch inputs timers ADC and a SCI by component of Drivers Click the Add component icon Figure...

Страница 18: ... 18 of 66 Nov 29 19 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 Select Compare Match Timer as shown in Figure 4 8 below then click Next Figure 4 8 Select Compare Match Timer ...

Страница 19: ...urce CMT0 Ensure that the Configuration name updates to Config_CMT0 as shown in Figure 4 10 below then click Finish Figure 4 10 Ensure Configuration name CMT0 In Config_CMT0 configure CMT0 as shown in Figure 4 11 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...

Страница 20: ...nt dialog Resource select CMT1 as shown in Figure 4 12 below Figure 4 12 Select Resource CMT1 Ensure that the Configuration name updates to Config_CMT1 as shown in Figure 4 13 below then click Finish Figure 4 13 Ensure Configuration name CMT1 Navigate to the Config_CMT1 and configure CMT1 as shown in Figure 4 14 This timer is configured to generate a high priority interrupt after 20ms This timer i...

Страница 21: ...nt dialog Resource select CMT2 as shown in Figure 4 15 below Figure 4 15 Select Resource CMT2 Ensure that the Configuration name updates to Config_CMT2 as shown in Figure 4 16 below then click Finish Figure 4 16 Ensure Configuration name CMT2 Navigate to the Config_CMT2 and configure CMT2 as shown in Figure 4 17 This timer is configured to generate a high priority interrupt after 200ms This timer ...

Страница 22: ...onnected to IRQ15 P07 and ADTRG0n This tutorial uses ADTRG0n which will be configured later in 4 5 7 Click the Add component icon In Software Component Selection dialog Type select Drivers Select Interrupt Controller as shown in Figure 4 18 then click Next Figure 4 18 Select Interrupt Controller In Add new configuration for selected component dialog Resource select ICU as shown in Figure 4 19 belo...

Страница 23: ... Smart Configurator Using the e2 studio R20UT4442EG0100 Rev 1 00 Page 23 of 66 Nov 29 19 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 ...

Страница 24: ...to PL7 and LED3 is connected to PL6 PH3 is used as one of the LCD control lines together with P02 PK7 and PL0 Click the Add component icon In Software Component Selection dialog Type select Drivers Select Ports as shown in Figure 4 21 then click Next Figure 4 21 Select Ports In Add new configuration for selected component dialog Resource select PORT as shown in Figure 4 22 below then click Finish ...

Страница 25: ...own 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 Tick the tickboxes for Out and tick Output 1 the tickboxes except for PL0 under the PORTL tab Start with the PORT0 tab Figure 4 24 Select PORT0 tab ...

Страница 26: ...as Starter Kit for RX72N 4 Smart Configurator Using the e2 studio R20UT4442EG0100 Rev 1 00 Page 26 of 66 Nov 29 19 Select PORT7 tab Figure 4 25 Select PORT7 tab Select PORTH tab Figure 4 26 Select PORTH tab ...

Страница 27: ...as Starter Kit for RX72N 4 Smart Configurator Using the e2 studio R20UT4442EG0100 Rev 1 00 Page 27 of 66 Nov 29 19 Select PORTK tab Figure 4 27 Select PORTK tab Select PORTL tab Figure 4 28 Select PORTL tab ...

Страница 28: ... 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 as shown in Figure 4 29 then click Next Figure 4 29 Select SCI SCIF Asynchronous Mode In Add new configuration for selected component dialog Work mode select Transmission Reception as shown in Figure 4 30 below Figure 4 30 Select Work...

Страница 29: ...EG0100 Rev 1 00 Page 29 of 66 Nov 29 19 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 Figure 4 32 Ensure Configuration name Config_SCI9 ...

Страница 30: ... R20UT4442EG0100 Rev 1 00 Page 30 of 66 Nov 29 19 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 Figure 4 33 Config_SCI9 setting ...

Страница 31: ...e PMOD1 connector as shown in the schematic Click the Add component icon In Software Component Selection dialog Type select Drivers Select SPI Clock Synchronous Mode as shown in Figure 4 34 then click Next Figure 4 34 Select SPI Clock Synchronous Mode In Add new configuration for selected component dialog Operation select Master transmit only as shown in Figure 4 35 below Figure 4 35 Select Operat...

Страница 32: ...EG0100 Rev 1 00 Page 32 of 66 Nov 29 19 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 Figure 4 37 Ensure Configuration name Config_SCI7 ...

Страница 33: ... e2 studio R20UT4442EG0100 Rev 1 00 Page 33 of 66 Nov 29 19 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 Figure 4 38 Config_SCI7 setting ...

Страница 34: ...1 potentiometer output on the RSK The conversion start trigger will be via the pin connected to SW3 Click the Add component icon In Software Component Selection dialog Type select Drivers Select Single Scan Mode S12AD as shown in Figure 4 39 then click Next Figure 4 39 Select Single Scan Mode S12AD Ensure that the Configuration name is Config_S12AD0 as shown in Figure 4 40 below then click Finish ...

Страница 35: ...0 Page 35 of 66 Nov 29 19 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 Figure 4 41 Config_S12AD0 setting 1 ...

Страница 36: ...Renesas Starter Kit for RX72N 4 Smart Configurator Using the e2 studio R20UT4442EG0100 Rev 1 00 Page 36 of 66 Nov 29 19 Figure 4 42 Config_S12AD0 setting 2 ...

Страница 37: ... the software components that are added to the project Assignment of the pins can be changed using the Pins page Figure 4 43 The Pins tabbed page 4 6 1 Change pin assignment of a software component To change the pin assignment of a software component in the Pin Function list click to change view to show by Software Components Figure 4 44 Change view to show by Hardware Resource ...

Страница 38: ...ment IRQ12 to P44 IRQ13 to P45 Ensure the Enable tick box of IRQ12 and IRQ13 are checked as shown in Figure 4 45 Figure 4 45 Configure pin assignment Config_ICU Select the Config_SCI9 of Software Components In the Pin Function list Assignment column Ensure the Enable tick box of RXD9 and TXD9 are checked and Assignment column of RXD9 is PL1 and TXD9 is PL2 as shown in Figure 4 46 Figure 4 46 Confi...

Страница 39: ...d SMOSI7 are checked and Assignment column of SCK7 is PH0 SMOSI7 is PH2 as shown in Figure 4 47 Figure 4 47 Configure pin assignment Config_SCI7 Select the Config_S12AD0 of software components In the Pin Function list Assignment column Ensure the Enable tick box of ADTRG0 AN000 AVCC0 AVSS0 VREFH0 and VREFL0 are checked and Assignment column of AN000 is P40 ADTRG0 is P07 as shown in Figure 4 48 Fig...

Страница 40: ... successful as shown Figure 4 50 below Figure 4 50 Smart Configurator console 4 7 Building the Project The project template created by Smart Configurator can now be built In the Project Explorer pane expand the src folder then smc_gen folder Figure 4 51 Generated folder structure Switch back to the C C perspective using the button on the top right of the e2 studio workspace Select SC_Tutorial in t...

Страница 41: ...lar area of code i e function for insertion of user functions and prototypes global for insertion of user global variable declarations or include for insertion of pre processor include directives User code inserted inside these comment delimiters is protected from being overwritten by Smart Configurator if the user subsequently needs to use Smart Configurator to regenerate any of the Smart Configu...

Страница 42: ...between the user code delimiter comments as shown below Start user code for macro define Do not edit comment generated here define TRUE 1 define FALSE 0 End user code Do not edit comment generated here In the e2 studio Project Tree expand the src folder and open the file SC_Tutorial c by double clicking on it Add header files near the declaration include r_smc_entry h include r_smc_entry h include...

Страница 43: ...nerated here Insert the following code in the transmit end call back function for SCI7 static void r_Config_SCI7_callback_transmitend void Start user code for r_Config_SCI7_callback_transmitend Do not edit comment generated here s_sci7_txdone TRUE End user code Do not edit comment generated here Now insert the following function in the user code area at the end of the file Start user code for addi...

Страница 44: ... static volatile uint8_t gs_one_ms_delay_complete FALSE End user code Do not edit comment generated here Scroll down to the r_Config_CMT0_cmi0_interrupt function and insert the following line in the user code area static void r_Config_CMT0_cmi0_interrupt void Start user code for r_Config_CMT0_cmi0_interrupt Do not edit comment generated here gs_one_ms_delay_complete TRUE End user code Do not edit ...

Страница 45: ...ectory path dialog click the Workspace button and in the Folder selection dialog browse to the SC_Tutorial src folder and click OK e2 studio formats the path as shown in Figure 5 3 below Figure 5 3 Adding workspace search path Close the property by clicking the Apply and Close button shown in Figure 5 2 and when the Settings dialog shown in Figure 5 4 is appeared click Yes to finish the setting Fi...

Страница 46: ... c and Config_CMT2_user c as described in 4 5 2 and 4 5 3 It is necessary to provide additional user code in these files to implement the switch press release detection and de bouncing required by the API functions in r_rsk_switch c 5 4 1 Interrupt Code In the e2 studio Project Tree expand the src smc_gen Config_ICU folder and open the file Config_ICU h by double clicking on it Insert the followin...

Страница 47: ...ption This function sets clears the falling edge trigger for the specified ICU_IRQ Arguments uint8_t irq_no uint8_t set_f_edge 1 if setting falling edge triggered 0 if clearing Return Value None void R_ICU_IRQSetFallingEdge const uint8_t irq_no const uint8_t set_f_edge if 1 set_f_edge ICU IRQCR irq_no BYTE _04_ICU_IRQ_EDGE_FALLING else ICU IRQCR irq_no BYTE uint8_t _04_ICU_IRQ_EDGE_FALLING End of ...

Страница 48: ...nt generated here In the same file insert the following code in the user code area inside the function r_Config_ICU_irq13_interrupt Start user code for r_Config_ICU_irq13_interrupt Do not edit comment generated here Switch 1 callback handler R_SWITCH_IsrCallback1 End user code Do not edit comment generated here In the same file insert the following code in the user code area inside the function r_...

Страница 49: ...t it again in the de bounce routines R_Config_CMT1_Stop Call the de bounce call back routine R_SWITCH_DebounceIsrCallback End user code Do not edit comment generated here In the e2 studio Project Tree expand the src smc_gen Config_CMT2 folder and open the file Config_CMT2_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 includ...

Страница 50: ...efine h Insert the following code the user code area resulting in the code shown below Start user code for function Do not edit comment generated here extern volatile uint8_t g_adc_trigger End user code Do not edit comment generated here In the e2 studio Project Tree expand the src folder and Open the file SC_Tutorial c and add the highlighted code resulting in the code shown below include r_smc_e...

Страница 51: ... R_LCD_Display 1 uint8_t Tutorial R_LCD_Display 2 uint8_t Press Any Switch Start the A D converter R_Config_S12AD0_Start while 1U uint16_t adc_result Wait for user requested A D conversion flag to be set SW1 or SW2 if TRUE g_adc_trigger Call the function to perform an A D conversion adc_result get_adc Display the result on the LCD lcd_display_adc adc_result Reset the flag g_adc_trigger FALSE SW3 i...

Страница 52: ... Clear flag g_switch_flag 0x0 End of function cb_switch_press 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 uint16_t adc value static uint16_t get_adc void A variable to retrieve the adc result uint16_t adc_result Stop the A D converter being triggered from the pin ADTRG0n R_Config_S12AD0_Stop Start a conv...

Страница 53: ...y 3 uint8_t lcd_buffer End of function lcd_display_adc In the e2 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 type define in between the user code delimiter comments as shown below Start user code for type define Do not edit comment generated here typedef char char_t End user code Do not edit comment gen...

Страница 54: ...t comment generated here Open the file Config_S12AD0_user c and insert the following code in the user code area for global resulting in the code shown below Start user code for global Do not edit comment generated here Flag indicates when A D conversion is complete volatile uint8_t g_adc_complete End user code Do not edit comment generated here Insert the following code in the user code area of th...

Страница 55: ...t Insert the following code in the user code area at the end of the file Start user code for function Do not edit comment generated here Exported functions used to transmit a number of bytes and wait for completion MD_STATUS R_SCI9_AsyncTransmit uint8_t const tx_buf const uint16_t tx_num Character is used to receive key presses from PC terminal extern uint8_t g_rx_char End user code Do not edit co...

Страница 56: ...or the transmit end flag Arguments tx_buf transfer buffer pointer tx_num buffer size Return Value status MD_OK or MD_ARGERROR MD_STATUS R_SCI9_AsyncTransmit uint8_t const tx_buf const uint16_t tx_num MD_STATUS status MD_OK Clear the flag before initiating a new transmission s_sci9_txdone FALSE Send the data using the API status R_Config_SCI9_Serial_Send tx_buf tx_num Wait for the transmit end flag...

Страница 57: ...nt8_t Press Any Switch Start the A D converter R_Config_S12AD0_Start Set up SCI9 receive buffer and callback function R_Config_SCI9_Serial_Receive uint8_t g_rx_char 1 Enable SCI9 operations R_Config_SCI9_Start while 1U uint16_t adc_result Wait for user requested A D conversion flag to be set SW1 or SW2 if TRUE g_adc_trigger Call the function to perform an A D conversion adc_result get_adc Display ...

Страница 58: ..._buffer 15 a 0x0A a 0x30 a 0x37 a char_t adc_result 0x000F uart_buffer 16 a 0x0A a 0x30 a 0x37 Send the string to the UART r_debug_print uart_buffer End of function uart_display_adc Select Build Project from the Project menu e2 studio will build the project with no errors The project may now be run using the debugger as described in 6 Connect the RSK G1CUSB0 port to a USB port on a PC If this is t...

Страница 59: ...int16_t adc_result Variable to store the A D conversion count for user display static uint8_t s_adc_count 0 Prototype declaration for led_display_count static void led_display_count const uint8_t count Add the following highlighted code in the main function void main void Initialize the switch module R_SWITCH_Init Set the call back function when SW1 or SW2 is pressed R_SWITCH_SetPressCallback cb_s...

Страница 60: ...count Send the result to the UART uart_display_adc s_adc_count adc_result Reset the flag g_adc_complete FALSE else do nothing Then add the following function definition at the end of the file Function Name led_display_count Description Converts count to binary and displays on 4 LEDS0 3 Argument uint8_t count Return value none static void led_display_count const uint8_t count Set LEDs according to ...

Страница 61: ...sas 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 to the correct frequency They should not use the Enter key after typing in values These can be found from the device schematics in the case of RSK RX72N set the EXTAL Frequency 24 0000 Operating Frequency 240 000 Fo...

Страница 62: ...t click the button The dialog shown in Figure 6 3 will be displayed Figure 6 3 Perspective Switch Dialog Click Remember my decision to skip this dialog later Click Yes to confirm that the debug window perspective will be used The debugger will start up and the code will stop at the Smart Configurator function PowerOn_Reset_PC as shown in Figure 6 4 Figure 6 4 Debugger start up screen For more info...

Страница 63: ...ils Please refer to the contact details listed in section 8 of the Quick Start Guide General information on Renesas microcontrollers can be found on the Renesas website at https 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...

Страница 64: ...C 1 REVISION HISTORY RX72N Group Renesas Starter Kit for RX72N Smart Configurator Tutorial Manual For e2 studio Rev Date Description Page Summary 1 00 Nov 29 19 First Edition issued ...

Страница 65: ...RX72N Group Renesas Starter Kit for RX72N Smart Configurator Tutorial Manual For e2 studio Publication Date Rev 1 00 Nov 29 19 Published by Renesas Electronics Corporation ...

Страница 66: ...R20UT4442EG0100 RX72N Group ...

Отзывы: