Instruction manual

Renesas USB MCU and USB ASSP USB Basic Host and Peripheral firmware
R01AN0512EJ0210 Rev.2.10 Page 130 of 157
Apr 1, 2013
5.11.4 Host mode example
The following uses RX62N as an example to show the setup routine that enables USB-BASIC-FW and the sample
program to operate as host.
1. Selecting HwResourceForUSB
Change the folder name from "HwResourceForUSB_RX62N" to "HwResourceForUSB".
2. Selecting USB mode (Host/Peripheral)
Set macros USB_FUNCSEL_USBIP0_PP and USB_FUNCSEL_USBIP1_PP in the user definition information file
(r_usb_usrconfig.h) as follows.
#define USB_FUNCSEL_USBIP0_PP USB_HOST_PP // Host Mode
//#define USB_FUNCSEL_USBIP0_PP USB_PERI_PP // Peripheral Mode
//#define USB_FUNCSEL_USBIP0_PP USB_NOUSE_PP
//#define USB_FUNCSEL_USBIP1_PP USB_HOST_PP // Host Mode
//#define USB_FUNCSEL_USBIP1_PP USB_PERI_PP // Peripheral Mode
#define USB_FUNCSEL_USBIP1_PP USB_NOUSE_PP
3. Workspace Setting
Double click “Fw.hws” to start up HEW. Then set the build configuration in the workspace to “HOST”.
4. Generating Executable file
From the tabs at the top of the workspace, select [Build Æ Build all], and then execute the build.
5. Connect to evaluation board
From the tabs at the top of the workspace, select [DebugÆ Connect], and then connect the evaluation board to the
emulator.
6. Download and execute the execute file
From the tabs at the top of the workspace, select [DebugÆ DownloadÆ (target execute file)], and then download the
execute file to the evaluation board.
7. From the tabs at the top of the workspace, select [DebugÆ Reset then execute], and execute the
program.