Renesas M16C/26A Tutorial
Renesas M16C/26A Tutorial

Renesas M16C/26A Tutorial

M16c family / m16c/tiny series 16-bit single-chip microcomputer
Hide thumbs Also See for M16C/26A:

Advertisement

Quick Links

To our customers,
st
On April 1
, 2010, NEC Electronics Corporation merged with Renesas Technology
Corporation, and Renesas Electronics Corporation took over all the business of both
companies. Therefore, although the old company name remains in this document, it is a valid
Renesas Electronics document. We appreciate your understanding.
Issued by: Renesas Electronics Corporation (http://www.renesas.com)
Send any inquiries to http://www.renesas.com/inquiry.
Old Company Name in Catalogs and Other Documents
Renesas Electronics website:
http://www.renesas.com
st
April 1
, 2010
Renesas Electronics Corporation

Advertisement

Table of Contents
loading

Summary of Contents for Renesas M16C/26A

  • Page 1 On April 1 , 2010, NEC Electronics Corporation merged with Renesas Technology Corporation, and Renesas Electronics Corporation took over all the business of both companies. Therefore, although the old company name remains in this document, it is a valid Renesas Electronics document. We appreciate your understanding.
  • Page 2 Renesas Electronics. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for an application categorized as “Specific”...
  • Page 3 Renesas Starter Kit for M16C/26A Tutorial Manual RENESAS 16-BIT SINGLE-CHIP MICROCOMPUTER M16C FAMILY / M16C/Tiny SERIES Rev.4.00   2007.10...
  • Page 4: Table Of Contents

    Table of Contents Chapter 1. Preface ...1 Chapter 2. Introduction...2 Chapter 3. Tutorial Project Workspace ...3 Chapter 4. Project Workspace ...4 4.1. Introduction...4 4.2. Creating a new Project Workspace ...4 4.3. Build Configurations and Debug Sessions ...5 4.3.1. Build Configuration ...5 4.3.2.
  • Page 5: Chapter 1. Preface

    Cautions 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 Technology Europe Limited. Trademarks All brand or product names used in this manual are trademarks or registered trademarks of their respective companies or organisations.
  • Page 6: Chapter 2. Introduction

    This manual is designed to answer, in tutorial form, the most common questions asked about using a Renesas Starter Kit: The tutorials help explain the following: • How do I compile, link, download, and run a simple program on the Renesas Starter Kit? •...
  • Page 7: Chapter 3. Tutorial Project Workspace

    Chapter 3. Tutorial Project Workspace The workspace includes all of the files for two build configurations. The tutorial code is common to both the Debug and the Release build configurations. The tutorial is designed to show how code can be written, debugged then downloaded in a ‘Release’ situation. The build configuration menu in High-performance Embedded Workshop allows the project to be configured such that certain files may be excluded from each of the build configurations.
  • Page 8: Chapter 4. Project Workspace

    Renesas Microcontrollers. High-performance Embedded Workshop will have been installed during the installation of the software support for the Renesas Starter Kit product. This manual will describe the stages required to create and debug the supplied tutorial code.
  • Page 9: Build Configurations And Debug Sessions

    4.3.2. Debug Session The debug sessions are selected from the right hand drop down list on the tool bar. The options vary between Renesas Starter Kit however one will always start Debug and include the type of debug interface. The alternate selection will be ‘DefaultSession’. The purpose of the debug sessions is to allow the use of different debugger tools or different debugger settings on the same project.
  • Page 10: Chapter 5. Building The Tutorial Project

    Chapter 5. Building the Tutorial Project The tutorial project build settings have been pre-configured in the tool-chain options. To view the tool chain options select the ‘Build’ Menu item and the relevant tool-chain. This should be the first option(s) on the drop down menu. The dialog that is displayed will be specific to the tool-chain selected.
  • Page 11: Connecting The Debugger

    The following assumes that the steps in the Quick Start Guide have been followed and the E8a drivers have been installed. • Fit the LCD module to J8 on the Renesas Starter Kit, so it lies above J1. Insure all the pins of the connector are correctly inserted in the socket.
  • Page 12 • Select FF000 for the Firmware location for the program. It is recommended that the E8a firmware location is towards the top of the memory map. • Select 0B00 for the Work RAM location. It is recommended that the Work RAM is towards the top of the memory map.
  • Page 13: Chapter 6. Downloading And Running The Tutorial

    Chapter 6. Downloading and Running the Tutorial Once the code has been built in High-performance Embedded Workshop it needs to be downloaded to the Renesas Starter Kit. There will now be an additional category in the workspace view for ‘Download Modules’.
  • Page 14 • Place a breakpoint at the call to main(); Breakpoints can only be set when the E8a is connected to the target and the module is downloaded. Breakpoints can be set by double clicking in the column containing the PC arrow next to the line to break at; or selecting the line and pressing <F9>;...
  • Page 15 • Right click on the FlashLEDs(); function and select ‘Go to cursor’. The code will execute to the selected line and stop. An automatic breakpoint was inserted in the code and then removed after calling the break. • Press ‘Step Over’ on the Debug Tool Bar. The code will run and flash the LEDs 200 times.
  • Page 16 • Press <Stop> on the debug tool bar. • Press ‘CTRL-B’ to open the breakpoint window. This dialog is not available if user debugged using eventpoints as suggested at top of page 10. ‘CTRL-E’ will open the eventpoint window. Eventpoins can be viewed in Breakcondition tab of event window.
  • Page 17 When the program stops you can see the modified string displayed on the second line of the LCD. Inspection of the watch pane will show that the first character of the variable string has been replaced with the first character of the constant replacement string.
  • Page 18: Chapter 7. Project Files

    7.1. Standard Project Files The Renesas Starter Kit tutorials are configured so that it is possible to provide the same tutorial code on multiple Renesas Starter Kit products. This allows the evaluation of the different processor cores using equivalent code. To achieve this, the following files are common between all device cores and Tool-chains.
  • Page 19: Board Initialisation Code (Hwsetup.c / Hwsetup.h)

    7.1.2.Board initialisation code (hwsetup.c / hwsetup.h) There are four common stages to the configuration of the microcontroller device. The code to demonstrate this is therefore split into four functions. Each function is written specifically for the device supported. The function calls are shown below.
  • Page 20: Main Tutorial Code (Main.c / Main.h)

    The main tutorial code is common to all tutorial projects. The display initialisation and string display functions operate on the LCD display module. Check compatibility with ks0066u controller and pin connection on the schematic before connecting a LCD module not supplied by Renesas.
  • Page 21: Chapter 8. Additional Information

    For details on how to use High-performance Embedded Workshop, refer to the High-performance Embedded Workshop manual available on the CD or from the web site. Further information available for this product can be found on the Renesas website at: www.renesas.com/renesas_starter_kits General information on Renesas Microcontrollers can be found at the following website.
  • Page 22 Renesas Starter Kit for M16C/26A Tutorial Manual Publication Date Rev.4.00 Oct.22, 2007 Renesas Technology Europe Ltd. Published by: Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, UK ©2007 Renesas Technology Europe Ltd., Renesas Solutions Corp. and Renesas Technology Corp. All Rights Reserved.
  • Page 23 Renesas Starter Kit for M16C/26A Tutorial Manual 1753, Shimonumabe, Nakahara-ku, Kawasaki-shi, Kanagawa 211-8668 Japan REG10J0041-0400...

Table of Contents