M16C/62P QSK QSK62P Plus Tutorial 1. Software Development Process using HEW4

Similar documents
SKP16C26 Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

Quick-Start Guide. BNS Solutions. QSK62P Plus

R8C/Tiny. StarterKit Plus SKP8CMINI-15, SKP8CMINI-17. Clock Stop Detect

SKP16C62P Tutorial 2 Creating A New Project Using TM. Renesas Technology America Inc.

A pplications Engineering. Powerful Processors Easy to Use. SKP8CMini-13. User's M anual. Rev. 1.0 October w w w.renesas.com

Tools Basics. Getting Started with Renesas Development Tools R8C/3LX Family

User s Manual. BNS Solutions. QSK62P Plus Quick-Start Kit. BNS Learning. Revision 1.0. BNS Solutions. page 1

A pplications Engineering. Powerful Processors Easy to Use SKP16C26. User's M anual. Rev. 1.0 December w w w.renesas.com

ToolStick-EK TOOLSTICK USER S GUIDE. 1. Kit Contents. 2. ToolStick Overview. Green and Red LEDs. C8051F321 provides USB debug interface.

Old Company Name in Catalogs and Other Documents

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

Old Company Name in Catalogs and Other Documents

Note that FLIP is an Atmel program supplied by Crossware with Atmel s permission.

Old Company Name in Catalogs and Other Documents

Renesas Starter Kit for RX111

Applications Engineering!"!"

IAR EWARM Quick Start for. Holtek s HT32 Series Microcontrollers

Programming in the MAXQ environment

Quick Start Guide for the Turbo upsd DK3300-ELCD Development Kit- RIDE

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP9

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP2

Development Tools. 8-Bit Development Tools. Development Tools. AVR Development Tools

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

Quick Start Guide TWR-S08PT60. 5-Volt S08P Family of 8-bit MCUs for Industrial and Appliance Applications TOWER SYSTEM

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

M16C R8C FoUSB/UART Debugger. User Manual REJ10J

Objective: Additional project details: Code: PSEMBP 100 Category:STEM Level: High School/Community C.

Lab 1 Introduction to Microcontroller

The following article introduces and shows an example of how to set up and use the watchdog timer on the M16C/26 microcontroller (MCU).

USB Debug Adapter. Power USB DEBUG ADAPTER. Silicon Laboratories. Stop. Run. Figure 1. Hardware Setup using a USB Debug Adapter

F 2 MC-8FX Family. 8-bit Microcontroller. MB95200 Series

Z8 Encore! XP F1680 Series 8-Bit Flash Solution with Extended Peripherals

S3F8S5A Development Kit

AN1369 APPLICATION NOTE

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

IAR C-SPY Hardware Debugger Systems User Guide

EPM900 - Overview. Features. Technical Data

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

External Headers. USB Host User LEDs. User Switches. E1 Header (Unfitted)

Figure 1. Proper Method of Holding the ToolStick. Figure 2. Improper Method of Holding the ToolStick

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP21

Keil TM MDK-ARM Quick Start for. Holtek s HT32 Series Microcontrollers

MB95260H/MB95270H. MB95280H Series. MB95260H Series/MB95270H Series/

M16C R8C PC7501 Emulator Debugger V Release Notes

PK-HCS12C32 Starter Kit for Motorola MC9S12C32 User s Manual

Changing the Embedded World TM. Module 3: Getting Started Debugging

Using Virtual EEPROM and Flash API for Renesas MCUs RX600 Series

MicroConverter. QuickStart Development System

Introduction. Purpose. Objectives. Content. Learning Time

As CCS starts up, a splash screen similar to one shown below will appear.

Software Setup and Introductory Assembly programs for the MSP430 *

Embedded Systems Lab Lab 1 Introduction to Microcontrollers Eng. Dalia A. Awad

C8051F700-DK C8051F700 DEVELOPMENT KIT USER S GUIDE. 1. Relevant Devices. 2. Kit Contents. 3. Hardware Setup

C8051F00x/01x-DK C8051F00X/01X DEVELOPMENT KIT USER S GUIDE. 1. Kit Contents. 2. Hardware Setup using a USB Debug Adapter

indart -HCS08 In-Circuit Debugger/Programmer for Freescale HCS08 Family FLASH Devices User s Manual Rev. 2.0

Section Objective: Acquaint with specifications of Launchpad Acquaint with location of switches, LEDs, power-on switch, powering the board.

Section 2: Getting Started with a FPU Demo Project using EK-LM4F232

User Manual For CP-JR ARM7 USB-LPC2148 / EXP

Introduction to ARM LPC2148 Microcontroller

indart -ST7C In-Circuit Debugger for STMicroelectronics ST72CXXX FLASH Devices User s Manual Copyright 2001 SofTec Microsystems DC00326

C8051F530A-DK C8051F530A DEVELOPMENT KIT USER S GUIDE. 1. Relevant Devices. 2. Kit Contents

Quick Start Guide to Convert Files Generated by SANGO to HEW. Installation of Sango Part I.

RTA-FoUSB-MON. Target Board Circuit Example USB Driver Installation Version Update Information

STM32SnippetsL0. STM32L0xx Snippets firmware package. Features. Description

E8a Emulator Additional Document for User's Manual R0E00008AKCE00EP3

1. Opening the sample code workspace Loading the selected sample code project and Opening sample code source files... 5

_ V Intel 8085 Family In-Circuit Emulation. Contents. Technical Notes

AC/DC. Adapter. Serial. Adapter. Figure 1. Hardware Setup

RAM Based File System for HTTP daemon on Renesas M16 board

Introduction to Microcontroller Apps for Amateur Radio Projects Using the HamStack Platform.

Debugging in AVR32 Studio

LAB #1: The CSM12C32 Module and PBMCUSLK Project Board

C8051F800-DK C8051F800 DEVELOPMENT KIT USER S GUIDE. 1. Relevant Devices. 2. Kit Contents. 3. Hardware Setup

Z8 Encore! XP/Z8 Encore! Development Kits

ECE 353 Lab 4. General MIDI Explorer. Professor Daniel Holcomb Fall 2015

MPLAB SIM. MPLAB IDE Software Simulation Engine Microchip Technology Incorporated MPLAB SIM Software Simulation Engine

TEVATRON TECHNOLOGIES PVT. LTD Embedded! Robotics! IoT! VLSI Design! Projects! Technical Consultancy! Education! STEM! Software!

EKK-LM3S811 QUICKSTART

M16C APPLICATION NOTE. Target Setup for the In-Circuit Debugger. 1.0 Abstract. 2.0 Introduction

AC/DC. Adapter. Ribbon. Cable Serial. Serial. Adapter. Figure 1. Hardware Setup using an EC2 Serial Adapter

Microcontroller basics

STM32L100C-Discovery Board Projects

Migration from HEW to e 2 studio Development Tools > IDEs

HI-TIDE Release Notes for Version 3.13

EasyPIC5 Development System

Factsheet 16FX Concept Compatible Platform of 16-bit Microcontrollers

_ V Renesas R8C In-Circuit Emulation. Contents. Technical Notes

Hello, and welcome to this presentation of the STM32L4 power controller. The STM32L4 s power management functions and all power modes will also be

F 2 MC-8L FAMILY 8-BIT MICROCONTROLLER MB89201 SERIES GETTING STARTED DEV-MB89N202-APP1 OPERATION MANUAL

embos Real Time Operating System CPU & Compiler specifics for RENESAS M16C CPUs and HEW workbench Document Rev. 1

AC/DC Adapter. Figure 1. Hardware Setup

Locktronics PICmicro getting started guide

Renesas New Generation of R8C/Tiny Series MCUs Adds 1.8V Support and Coprocessing With Background Operation to Enable Low-cost Innovative Designs

ADuC7XXX MicroConverter Get Started Guide

Quick Start Guide TWR-S08DC-PT60. Tower System Daughter Card for the 5-Volt 8-bit MC9S08P Family TOWER SYSTEM

Figure 1. JTAGAVRU1 application The JTAGAVRU1 is supported by AVR Studio. Updated versions of AVR Studio is found on

3 TUTORIAL. In This Chapter. Figure 1-0. Table 1-0. Listing 1-0.

Hands on Experience with AVR32

Transcription:

M16C/62P QSK QSK62P Plus Tutorial 1 Software Development Process using HEW4

Overview The following tutorial is a brief introduction on how to develop and debug programs using HEW4 (Highperformance Embedded Workshop) and other software and hardware tools included with the M16C/6x family of Starter Kits. Examples are shown throughout this tutorial using the QSK62P. To get the most out of the Starter Kit, check out the references at the end of this tutorial. Note: This tutorial assumes the user has done the following: 1. Followed the Quickstart Guide 2. Installed the QSK files, examples, and software tools in the default directories. slide 2

The Development Process QSK16C/6x Board SIO Host PC USB slide 3

Connecting the Kit USB port on Windows XP Pro, Vista PC slide 4

slide 5 The QSK Board

QSK62P Board Features M16C/62P (M30626FHPGP) MCU 24MHz Operating Frequency at 3.0V 5V, 10MHz Operating Frequency at 2.7V 5V 384kB Flash ROM, 4kB x 1 data EEPROM, and 31kB RAM 87 GPIO and 4 Key-on Wakeup Inputs 11 Timers plus a Watchdog Timer 26-channel 10-bit ADC, 2-channel 8-bit DAC 2 DMAC 3 USART s plus 2 SIO s (supports I2C and SPI) Voltage and Oscillation Failure Detection Clock sources: Main (Xin), Sub (Xcin), Internal R/C (ring), PLL Onboard Features LED s (3 User, 1 Power) Removable 2-line x 8-character LCD Pushbutton Switches (3 User, 1 Reset) Thermistor and potentiometer on two A/D inputs I/O available on Expansion Ports slide 6

Development Tools HEW An Integrated Development Environment (IDE) that invokes all necessary software for building your project. Also communicates with the ROM Monitor Program (in flash on the MCU) for program debug NC30WA C-compiler (limited version of NC30). Conforms to ANSI C standards (see release notes on limitations) AS30 Relocatable Assembler Supports structured assembly language and a wide variety of macro instructions slide 7

HEW IDE Overview HEW is an acronym for High-performance Embedded Workshop. When writing a microcontroller (or any computer) program, the program is usually split into multiple files to make it easier to read and understand. While exactly how the files are organized is up to the programmer, typically, the code is split up in a logical manner into various files (e.g. math functions in one file, serial port drivers in another, etc). After all the files in a project are compiled and assembled, a linker combines all the files into a single file. These steps can be tedious and repetitive. To make the process simple, we use an Integrated Development Environment (IDE) called HEW. slide 8

Start HEW From the Windows Start menu, click on Programs > Renesas >High-performance Embedded Workshop> High-performance Embedded Workshop slide 9

Open HEW 1. When HEW opens, select Create a new project workspace 2. Select OK slide 10

Project Generator (1/4) 1. Select BNS QSK62P Plus from list. 2. Enter Tutor1 as a name for the workspace. 3. Click OK slide 11

Project Generator (2/4) 1. Select Tutorial 2. Click Next slide 12

Project Generator (3/4) Files to be added to project by project generator. Click Finish to generate project. slide 13

Project Generator (4/4) Confirmation of files to be added to project. Click OK to continue. slide 14

Open a HEW Workspace HEW should look like the figure below. Toolbars Menu Bar Editor Window Workspace Window Output Window slide 15

Workspace Window In the Projects tab, source files and header files are displayed. To change how dependencies are displayed, e.g. show dependencies for each source file, rightclick within the window, and select Configure View. Try the following, click on Show dependencies under each file and see what happens to files displayed on the window. To open a source file, double-click on it. To open a source file, double-click on it. slide 16

Editor (Source) Window Any opened source file within the workspace are shown on the Editor window. Right clicking on a file opens the Editor Options menu. Virtual workspace selection Line, total number of lines, and column numbers are displayed here slide 17

HEW Toolbars HEW is a powerful development environment with a lot of features and functionality. For this tutorial, the focus will be on features (i.e. Standard Toolbar) that will help you understand the M16C development process using HEW. Editor Toolbar² Search Toolbar² Standard Toolbar Debug Toolbar¹ ³ Bookmarks Toolbar² Debug Run Toolbar¹ ³ Default Window² Help System Tools² Version Control Toolbar² ³ Notes: 1.M16C is supported by the Debug toolbars on HEW 4.x and above. 2.See HEW user s manual about these toolbars. 3.These toolbars are added/removed depending on settings. slide 18

Standard Toolbar Clean All Build Current Configuration¹ Launch External Debugger Build File Stop Build All Current Debugger Session Clean All removes intermediate and output files produced in building Build File builds² a specific file Build builds files that were modified since last build Build All builds the whole project regardless of whether there were modifications or not Stop stops a running build process Current Configuration build configuration (e.g. for debug, optimized, etc) Current Debugger Session debug session configuration Launch Debugger calls defined external debugger Notes: 1. See HEW User s manual for details. 2. A build means running certain files (e.g. source files) under some tools (e.g. compiler, linker) to produce an output file (e.gx30 or MOT executable files for M16C) slide 19

Build (re-build) Tutor1 Build Build All (re-build) Let s rebuild the Tutor1 project into an executable module, click on the Build All icon. This will re-compile and link all the source files. If any of the source files are modified, click on the Build icon as this will only compile these modified files, which makes generating an executable module faster. Always perform a Build All when the configuration has changed. Status, errors, messages, etc during a build process is displayed on the Output window... slide 20

Output Window The major use of the Output window is to determine if any errors or warnings occurred, and where, during the build process. The no. of errors and warnings will show up in this window. You can then scroll up to find where the error(s) occurred. If no errors or warnings were found, Build Finished will be displayed. Now that an executable file has been created, the next step is to download and run the program on the M16C/6x QSK Board and the ICD slide 21

HEW Debugging: Overview The new HEW4 integrates in-circuit Debugging. These features can be used to verify that the program we developed works exactly as we intended and when it does not, we can also use HEW to find out why. Breakpoints can be set in HEW to stop the program at certain points and verify registers, variables in memory, etc. The number of breakpoints will vary from MCU to MCU. For M16C/62P the maximum no. of breakpoints is 8. HEW allows step execution in our program, which means the program executes on a per line basis (whether in source level or machine code level). Various windows in HEW allow us to see register values and memory locations As the debugging features of HEW are fully integrated with the IDE, edit, compiling and debugging can be done in the same window. slide 22

HEW Debugger Exercise Download and run a program on the M16C/6x QSK+ board General use of the Debugger including stepping and setting breakpoints Within HEW, modifying the program, rebuilding, and running the updated program on the M16C/6x QSK+ board slide 23

Connect Hardware Before debugging, connect the ICD to the M16C/6x QSK Board as shown. Connect the USB cable to the PC. On the ICD, the Power LED is on and the Status (Yellow) LED is blinking once a second (this means that the ICD USB driver was loaded correctly by Windows ). If not (i.e. blinking three times a second), the Windows driver has not been loaded. Try disconnecting the mini USB cable, wait a few seconds, and then plug it back in. If this does not work, please check Appendix. A Troubleshooting in the M16C/6x QSK user s manual. slide 24

HEW debugging example Launch a debugging session by pulling down the menu in the sessions box and select 'SessionM16C_E8_SYSTEM'. slide 25

Debug Init Window 1. Click Connect 2. Verify that the following M16C/62P Group M30620FCP Erase Flash and Connect 3. Click to power device at 3.3 Volts since board will be powered through USB 4. Click OK start a HEW debug session (be sure hardware is connected). If you get an error, check all connections. See QSK user s manual on Troubleshooting for details. slide 26

HEW Debug Session Open 'Init' Window Step in: (execute 1 line of code) Step over Step out Stop run Register Memory I/O Status Go free Reset go Go to cursor Go (run) Reset CPU Display PC Go to cursor Locals C Watch Asm Watch slide 27

Download to the QSK Board When the software connects to the hardware, the executable (*.x30 file) is downloaded to QSK board. 3 columns are added to the edit window. View options: Source Mix Disassembly Breakpoints: Event Software Address column: an address on a line indicates that line contains executable code Double clicking adds breakpoints. slide 28

Running Downloaded Program Click on the Reset Go icon to run the tutor1 program. Note the STOP button turns red. On the board, LED s D1, D2, & D3 will blink sequentially. Turning the Analog Adjust potentiometer clockwise increases the LED blink rate and turning it counter-clockwise decreases the LED blink rate. Click the 'Stop' button. Open the register window. slide 29

Program Stepping Click to step a few lines. Any register values that change turn red. slide 30

Memory Monitor Window The Memory Monitor displays the current value of the memory area shown on the window. It is updated at a preset value which can be modified by the user. Open Memory window By double-click an address you can change the address range you want to view. Click 'OK' Click the GO icon. You can view the memory as it is updating. This function is not available in Free Run mode. Click the STOP icon before proceeding. With this window open, programs do not run in real time. slide 31

Variable Watch By right clicking on a variable in the file edit window, you can add it to the watch window by clicking 'Instant Watch' then 'Add' Open a Watch Window slide 32

I/O Window The I/O Window allows you to view register contents and status of port pins. Open I/O Window slide 33

Modifying the Program (1/2) If QSK62P.c is not shown on the Editor window, double-click on it in the Workspace window and the file will be opened/displayed on the Source window. slide 34

Modifying the Program (2/2) 1. Open the Interrupts.c file and scroll down and find the function Interrupts.c routine. Note you can also find a function by clicking the Navi tab in the project window and double click on the function name. 2. Change this line to: ta1 = 0x3FF ad0; 4. Build the project again. 3. If program is running, click 'STOP'. slide 35

Load Modified Program The HEW debugger will automatically detect that the program has been recompiled and ask if you wish to download again. Click Go. Turning Analog Adjust potentiometer on M16C/6x QSK Board clockwise decreases the LED blink rate. Turning it counter-clockwise increases the blink rate. To stop a debug session but leave HEW open (i.e. edit only), re-open the default session. slide 36

End of Tutorial This is the end of the tutorial. You can try downloading other sample programs from the \Sample_Code directory. In addition, check out the references on the next page. Have Fun!! slide 37

References and Recommended Reading All documents that came with the QSK can be found using the Document Description from the Start > Programs > Renesas > QSK16C62+ menu. User s Manuals: This documents provide details on the Starter Kit. HEW User s Manual: To fully understand and get the most out of HEW, this is recommended reading. NC30 Version X.XX User s Manual: Check this manual out for features specific to the NC30 compiler. M16C/62P Hardware Manuals: M16C/6x device specifications. slide 38

References and Recommended Reading M16C/10/20/60 Series C Language Programming Manual: This is a great document for any level of programmer. The first chapter is an introduction and reference on the C language. The next chapter explains specifics of C programming with the M16C microcontroller. M16C/10/20/60 Series Software Manual: This document describes the instruction set and timing information for the M16C/20/60 series CPU cores. AS30 Version X.XX User s Manual: Read this manual if you plan on writing programs in Assembly or when making changes to the startup file. Application Notes and Sample Programs: Application notes and other sample programs can be accessed from Renesas Technology America s website: www.renesas.com. QSK updates: america.renesas.com BNS Resources: www.bnssolutions.com/qsk slide 39