Renesas H8SX1664 User Manual
Renesas H8SX1664 User Manual

Renesas H8SX1664 User Manual

Starter kit usb sample code

Advertisement

Quick Links

REG10J0134-0100
Renesas Starter Kit for H8SX1664
User's Manual
USB Sample Code
RENESAS SINGLE-CHIP MICROCOMPUTER
H8SX FAMILY
Rev.1.00
Renesas Technology Europe Ltd.
Revision date 08.January.2008
www.renesas.com

Advertisement

Table of Contents
loading

Summary of Contents for Renesas H8SX1664

  • Page 1 REG10J0134-0100 Renesas Starter Kit for H8SX1664 User's Manual USB Sample Code RENESAS SINGLE-CHIP MICROCOMPUTER H8SX FAMILY Rev.1.00 Renesas Technology Europe Ltd. Revision date 08.January.2008 www.renesas.com...
  • Page 2: Table Of Contents

    Table of Contents Table of Contents ... ii Chapter 1. Preface ...3 Chapter 2. Introduction...4 Chapter 3. Development Environment...5 3.1. Sample Code Configuration ...5 3.2. Target Sample Code Options ...5 3.3. Host Application Software ...5 Chapter 4. USB Stack (Target)...6 4.1.
  • Page 3: Chapter 1. Preface

    All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations. Copyright © Renesas Technology Europe Ltd. 2007. All rights reserved. © Renesas Technology Corporation. 2007. All rights reserved. © Renesas Solutions Corporation. 2007. All rights reserved.
  • Page 4: Chapter 2.Introduction

    The RSK USB sample code provides a basis for a developer to add USB device functionality to a system. It includes sample applications for the three most common USB Device classes • Human Interface Device (HID) • Communication Device Class - Abstract Control Model (CDC-ACM) •...
  • Page 5: Chapter 3.Development Environment

    Chapter 3.Development Environment 3.1.Sample Code Configuration The Sample code is provided as a project generator with the RSK. To create the sample code project follow the instructions in the RSK Quick Start Guide. When created the sample code will contain the source for both the Host and Target projects, including any configuration driver files. 3.2.Target Sample Code Options When developing USB software it is useful to be able to get debug information out at runtime without stopping code from running such as when stepping in a debugger.
  • Page 6: Chapter 4.Usb Stack (Target)

    Control (Setup, Data IN/OUT, Status) Bulk (IN and OUT) Interrupt (IN) Some HAL implementations may not be able to support all these modes but the H8SX1664 implementation does. Here is a list of the functions that make up the USBHAL API. Name...
  • Page 7: Usbcore

    4.2.USBCore The USBCore layer handles standard USB requests common to all USB devices during the enumeration stage. This means that a developer can concentrate on any class or vendor specific implementation. The USBCore requires initialising with the descriptors specific to the device being implemented.
  • Page 8: Human Interface Device Class

    4.3.Human Interface Device Class The HID class as the name suggests is commonly used for things like keyboards, mice and joysticks where a human’s action is causing the need for communication. However this does not need to be the case. The HID class is suitable for any device where the communication can be achieved by sending data in ‘reports‘...
  • Page 9: Communication Device Class

    4.4.Communication Device Class The CDC ACM allows a host to see a device as a standard serial (COM) port. This is particularly useful when working with legacy applications that use serial communications. Bulk IN and Bulk OUT transfers are used for all non-setup data. The CDC module utilises the USBCore layer for the processing of all standard requests.
  • Page 10: Mass Storage Class

    4.5.Mass Storage Class The MSC class has become a very popular way for devices, such as cameras and USB Pens, to share data with PCs. The reason for the success is that when the device is plugged in to a host PC it appears to the PC as just another drive and therefore users can use familiar applications such as Windows Explorer to access the data.
  • Page 11: Chapter 5.Applications

    All the applications require that the RSK has been programmed with the appropriate sample code for the application. Details of how to program the RSK have been provided as part of the tutorial with the product. To obtain a digital copy of the manual please visit the Renesas web site at www.renesas.com/renesas_starter_kits...
  • Page 12 Input Report: Byte 1 Bit 0 = LED status. Bit 1 = ADC value valid indicator. Bit 2 = Switch pressed indicator. Byte 2-5 = 32 bit, little endian ADC Value. Output Report: Byte 1 Bit 0 = LED toggle request. Bit 1 = ADC read request.
  • Page 13: Communications Device Class Application

    5.3.Communications Device Class Application The CDC sample application demonstrates communication with a Windows PC using a standard terminal program. Windows provide a suitable application called HyperTerminal. Any other serial terminal program will be able to be used if available. Program the RSK with the CDC application and run the code as described in the RSK tutorial manual. Connect a USB cable between the host PC and the RSK.
  • Page 14 COM port , it will receive a repeating message from the RSK saying: “Renesas USB CDC Sample, Press Switch SW1.” Note that the configuration settings for such things as baud rate and parity are irrelevant for this virtual COM port.
  • Page 15 Pressing SW1 on the RSK will stop this repeating message and will bring up the main menu as shown below. To demonstrate two way communication press SW2 to put the RSK into echo mode. In this mode anything typed on the Terminal will be read by the RSK and then echoed back to the terminal.
  • Page 16: Mass Storage Class Demonstration

    Using Windows Explorer, or similar, look to find the new drive that Windows will have mounted. This drive is viewing the contents of the sample RAM Disk on the RSK. It has been formatted with a FAT file system and given a volume name of “RENESAS”. The available space for data is 4KB.
  • Page 17: Libusb

    5.5.LibUSB The LibUSB sample application is functionally similar to the previous HID application. The difference is that this sample includes software for a Windows host PC called RSK_LibUSB. The intention of this open source library is to provide a platform independent operating system interface allowing a device to be used on multiple operating systems with a common code base.
  • Page 18 The “Set LCD” button allows the text of the LCD on the RSK to be changed. To demonstrate that the RSK can also instigate communications you can press a switch on the RSK and this will be indicated back to the host resulting in a message being displayed on the dialog.
  • Page 19: Chapter 6.Additional Information

    For information about the H8SX/1664 assembly language, refer to the H8SX Series Programming Manual For information about the E10A Emulator, please refer to the H8S, H8SX Family E10A-USB Emulator User’s Manual Further information available for this product can be found on the Renesas website at: http://www.renesas.com/renesas_starter_kits General information on Renesas Microcontrollers can be found on the following website.
  • Page 20 Renesas Starter Kit for H8SX1664 USB Sample Code User's Manual Publication Date Rev.1.00 08.Jan.2008 Published by: Renesas Technology Europe Ltd. Dukes Meadow, Millboard Road, Bourne End Buckinghamshire SL8 5FH, United Kingdom ©2008 Renesas Technology Europe and Renesas Solutions Corp., All Rights Reserved.
  • Page 21 Renesas Starter Kit for H8SX1664 USB Sample Code User's Manual Renesas Technology Europe Ltd. Dukes Meadow, Millboard Road, Bourne End Buckinghamshire SL8 5FH, United Kingdom...

Table of Contents