Home
SKP8CMINI-15,17 Tutorial 1 Software Development Process using
Contents
1. builds a specific file Launch Debugger 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 debugger Notes 1 These features are only supported for R8C on HEW4 0 and above 2 See HEW User s manual for details 3 A build means running certain files e g source files under some tools e g compiler linker to produce an output file e g X30 or MOT executable files for R8C 17 434 NESAS Build re build Tutor es Ree dl Defaut ession LE B 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 changed Status errors messages etc during a build process is displayed on the Output window 18 434 NESAS Output Window The major use of the Output window is to determine if any errors or warnings occurred and where during the build process
2. Xllprocessing C AMTOOLYSKPECMINI Sample Code Tutorl Tutorl Release ncrt0_r8c_tutor r30 processing C MTOOL SKPSCMINI Sample Code Tutorl Tutorl Release Tutorl r30 processing Libraries now processing pass 2 processing C MTOOL SKP amp CMINI Sample_Code Tutor1 Tutor1 Release ncrt0_ r8c tutor r30 processing C MTOOL SKPSCMINI Sample Code Tutorl Tutorl Release Tutorl r30 DATA 0000087 00057H Byte s ROMDATA 0000000 00000H Byte s CODE 0000889 00379H Byte 3 Phase M16C Linker finished Build Finished 0 Errors 0 Warnings Build A Debug A Find in Files A Version Control Ready Read write 1 290 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 Mini R8C board using the ICD 19 434 NESAS HEW Debugging Overview The new HEWZA 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 R8C 15 and 17 the maximum no of breakpoints is 4 HEW allows step execution in our progra
3. si a2 x4 4 nr FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF EF EF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 1A OO F7 04 04 OO OO OF OO OO OO OO OO 8 9 4 B C D E F ASCII n nn rr nr nn nn ni PR oun Click the GO icon You can view the RAM 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 32 434 NESAS Memory 8 C Watch Windows Open a Memory window Open a C Watch window Is E m ge aa e le m mie wm m i o 4 aot mms 16 1040 8 2 labe da d do de 4 Address Label Regi 0 000000 00 000010 lemado 00 000020 sarl 00 000030 sarl 00 000040 08 000050 s2ric 00 000060 00 Reduce 10 bit AD sample to 8 bits by removing the current temp value ad gt gt 2 3 mx 1 2 De 000070 oo 000080 oo 000090 oo 000040 oo DODOBO 00
4. p4 5 pragma INTERRUPT tmrZ_isr void tmrZ isr void void mcu init void void light level display char void temperature display void char disp count LED control variable char temp count temperature reading counter char slider light slider sw position light level side 1 int temp value 1 4 4 10 bit D temperature value gt Tutorl c Line total no of lines and column numbers are displayed here on Control f rm Any opened source file within the workspace are shown on the Editor window 15 stENESAS 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 R8C development process using HEW Editor Toolbar Debug Toolbar Search Toolbar osud a oro anios Es ene 2 7 JAR A m E Release DetaultSession 3 i pu EYE e Standard Toolbar Version Control Toolbar Debug Run Toolbar Bookmarks Toolbar Templates Toolbar Notes 1 On HEW 4 0 and above R8C is supported by the Debug and Debug Run toolbars See HEW user s manual about these toolbars 434 NESAS Standard Toolbar Build File Launch View Build All Current Configuration Slave HEW Output Current Debugger Session DefaultSession hi A La sa ES Release Build Stop View Workspace Build File
5. D000co 00 ers Hinna anmam fea ha ha H0 A AAA Al By right clicking on a variable in the file edit window you can add it to The Memory Window displays the the watch window location and contents of variables 33 RENESAS I O Window Open the I O window Ga y If the I O window is empty right click a inside the window and load IO A paises mame lt File R8C16 io R8C14 io for Trigger select register SKP8CMini15 Up down flag Use MOV instruct Timer AD register Read and wri amp Sg tad 000386 EDO1 Timer Al register Read and wri El Timer A2 register Read and wri Bl Load IO File El Timer A3 register Read and wri E Timer A4 register Read and wri Print Timer BO register Read and wri Save To File E Timer B1 register Read and wri Y Toolbar display Timer B2 register Read and wri SS cutone oa i s v Allow Docking Hide The I O Window allows you to view register contents and status of port pins 34 434 NES AS Modifying the Program 2 2 void tmrz isr void 1 1 Scroll down and find the Static Variables retair tmrZ isr function static char pattern index Read slider switch S1 tc note you can also find functions I DM R o using the Navigation tab MEASURE LIGHT
6. USII ch0 1 mea C Projects adconl 0x20 8 b adst 1 Stat MM A 2 Change this line to tzpr adl q i tzpr OxFF adl Advance to the next The current positior iti S2 Button l 3 Build the project again revised file automatically saved Default ession Aa uz stENESAS Load re load Modified Program The HEW debugger will automatically detect that the program has been recompiled and ask if you wish to download again x 2 DK to download module C MMTOOL SKP16C264X5 ample Code Tutorl tutorl debugT utor 30 Don t ask this question again No Yes to all No to all Cancel Click Go Now decreasing the light level increases the blink rate To stop a debug session but leave HEW open i e edit only re open the default session iM16C RSC FoLISB 36 434 NESAS End of Tutorial This is the end of the tutorial You can try downloading other sample programs from the Sample Code directory Tutorial 2 provides step by step instructions on how to use the Project Generator to simplify project creation It also provides specific details on setting up your environment and creating a new project from scratch In addition check out the references on the next page Have Fun 37 434 NESAS References and Recommended Reading All documents that came with the SKP can be found using the Document Descripti
7. 44 NESAS SKP8CMINI 15 17 Tutorial 1 Software Development Process using HEW4 Tiny Renesas Technology America Inc Overview The following tutorial provides an introduction to the Mini R8C Family of SKPs It explains the basic development environment how to develop and debug programs using HEW High Performance Embedded Workshop and how to work with existing example projects Examples shown throughout this tutorial are specific to the SKP8CMINI17 If using the SKP8CMINI 15 replace any references to the SKP8CMINI 17 with SKP8CMINI 15 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 Quick Start Guide 2 Installed the SKP files examples and software tools in the default directories 2 434 NESAS The Development Process Mini R8C 1 Write programs using text editor User Flash Monitor Flash Board 5 Correct errors amp repeat process I O Connector 2 HEW automates compile amp link i Host PC USB 4 Debugging info sent back amp forth 3 HEW sends the machine code to the ICD during downloads and uses the symbols for source level debugging L ae SKP8CMINI17 Connectivity J ORN 09000000017 a 00100000000 TARGET USB a ENESAS d gt e o Y x n 6 Power Mode USB PC STOP RUN RTA F
8. ERE RI DISCLAIMEF The softwe intended amp i sfr26a h This softu E skp_bsp h Renesas Te L skp_led h copyright E B I d podes Download module B 3 83 mon i s r2Ba labels Unload module El In the project window RIGHT Click on the tutor1 x30 file then select Download Module RENESAS Download the executable file to the R8C Tiny SKP Board 2 2 After download 3 columns are added to the edit window View T Source Mix rela unsigned char last_temp val union byte def led value ARRRARARARARA RARA AAA AA RAA RA Name main Parameters none Returns Disassembly Address column void main void 1 Double click here to set a breakpoint pece 1 e LE LEDS Configure Timer X txmr 0x00 DI prex OxFF 4 tx OxFF Zy anit tess 0x02 ff Configure Timer Y tyzmr 0x00 ff prey OXFF fune NOF 77 Double clicking here changes pass count Contigure Timer Z tyzmr 0x00 2 Add a few more breakpoints 0c872 prez 0x01 ff 0c876 tzpr 0x01 Ae tcss 0x10 Au 28 434 NESAS HEW Advanced Breakpoint Options 1 Click on breakpoint button 22 jam n CEA lala By double clicking on an entry lead Seve e you can enable or disable the L Address al Peri cl 4 o or use the F SA prok Po Delete TT buttons to co
9. ES AS Open a HEW Workspace 2 3 Using the Open Workspace dialog box browse until you get to C Renesas SKP8CMINI17 Sample_Code Tutor1 folder Click on Tutor1 hws HEW workspace file and then click on Open button Open Workspace Files of type HEW Workspaces hws Cancel 12 434 NESAS Open a HEW Workspace 3 3 HEW should look like the figure below Menu bar Tutor1 High performance Embedded Workshop Tutor1 c Bo x File Edit View Project Options Build Memory Tools Window Help Denga ejovaj josol ajena a m a ML pr Cd Da Ga zd o Hog C Release m Defautsession 2 89 G p Toolbars pasear v o e ir Z DEDE DE DE DEDE ME DE DEDE 3 3 3 3 3 3 JE 3 3 KK JE 3 JE JE JE 3 JE JE 3 3 9 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 EN Tutor1 FILE Tutorl c Assembly include file DATE 21175703 2 sect30_r8c_tutor inc DESCRIPTION Main Program EA 7 CPU TYPE R8C 11 Assembly source file ae A nee rRe titor a This file is generatec E tor Ver 3 1 Workspace window Di Copyright 2003 Renesas Editor window All rights reserved EN source me ee y oa i E sect30 r8c tutorinc xdi 4 gt MEL Workspace Window zd x In the Projects ta
10. and communicates commands and data to and from the Mini R8C board via a synchronous serial interface As a debugging tool during program debug the ICD HEW downloads a small kernel or ROM Monitor program with the user program to the Mini R8C board This kernel provides a communication interface between the R8C MCU and the ICD HEW Debugger application on MCU status While the kernel uses some resources of the R8C the operation of the ICD is transparent to the user s program As a programming tool the ICD Flash over USB M FoUSB Programmer can be used to download user programs to the R8C MCU on the Mini R8C board and many other Renesas flash MCU s the ICD will support other Renesas flash MCU s by downloading an MCU Monitor Image MMI file for a particular MCU thru HEW or FoUSB Programmer NOTE The kernel is only downloaded with the user program when using HEW Debugger but NOT the FoUSB Programmer 7 434 NESAS Development Tools HEW An Integrated Development Environment IDE that invokes all necessary software for building and debugging your project NC30WA C compiler with Assembler Conforms to ANSI C standards see release notes on limitations Flash over USB Programmer Flash programmer for Renesas Flash MCU s 8 434 NESAS HEW 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 fi
11. b source files and header IB ped files are displayed 43 Assembly include file 3 sect30_r8c_tutorinc 3 Assembly source file i E not r amp c tutor 230 To change how dependencies are displayed e pr e g show dependencies for each source a so file right click within the window and i Tutor1 c Dependencies Insert Project select Configure View sect30_r8c_tutor Version Control gt lt Navi Configure View Y Allow Docking Hide Configure View V Show dependencies under each file Properties Show standard library includes Cancel Show file paths To open a source file double click on it Try the following click on Show dependencies under each file and see what happens to files displayed on the window 14 234 NES AS Editor Source Window E AS Copyright 2003 Renesas Technology America Inc All rights reserved ZE AS Z DE DE DE IE DE DEDE DE C 3 3 3 9 3 9 3 3 3 3 9 3 9 HHH 3 9 9 3 9 3 9 9 3 9 3 9 9 3 J 3 9 HH J 3 9 3 3 HHH 9 3 9 3 9 9 3 9 3 9 9 3 9 9 9 3 9 E finclude sfrr8c11 h R8C 11 special function register definitions LEDs define red led pi 0 define yellow led pl 1 define green led pi 2 Switches define slider pl 3 define pushbutton
12. les 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 9 434 NESAS Start HEW H High performance Embedded Workshop gt e High perFormance Embedded Workshop FA Startin HIFA MAT NCANWA V5 Release N Y From the Windows Start menu click on Programs gt Renesas gt High performance Embedded Workshop High performance Embedded Workshop 434 NES AS Open a HEW Workspace 1 3 der High performance Embedded Workshop File Edit View Project Options Build Memory Tools Window Help Cw hd S Ba we FT Qu o w Mead g Z m z METEO JA g amp 1 o E T LI Jesss l sf ARA lle e zl TE io oe ws ZII Create a new project workspace C Open a recent project workspace e CAMTOOL SKPSCMINISample_Cod e Browse to another project workspace 1 After HEW opens from the Welcome dialog box select Browse to another project workspace option then click OK 11 234 N
13. m which means program execution 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 20 434 NESAS Debugger Exercise Download and run a program on the Mini R8C board General use of the Debugger including stepping and setting breakpoints e Within HEW modify the program rebuild and run the updated program on the Mini R8C board 21 434 NESAS Connect Hardware Before Debugging connect the ICD to the Mini R8C 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 J 850 9000000000 1 100100000000 E n os Nm o b TARGET USB RG N ESAS Power Mode USB PC RTA FOUSB MON sh Programmer amp In Circuit Debugger ICD In Circuit Debugger Mini R8C board Note The Mini R8C board connector is not keyed so pay close attention when connecting to the ICD 22 434 NESAS HEW debugging example Launch a debugging session by pulling down the menu in the sessions box and select M16C R8C FoUSB EIL 23 434 NESAS Debug Init Window 1 2 Step 1 Click on Refer and select R5F21174SP MCU for the Step 3 Now click the SKP8CMINI 17 or Run Mode tab R5F21154SP MCU for the SKP8CMINI15 Init MCU Compiler fun Mode Resu
14. me MCU RSF21114FP meu is C Seid PE Step 2 Select USB Cancel Help Next Hide 434 NESAS Debug Init Window 2 2 For full debugging features be sure Sampling Mode is selected Free Run Mode is for real time execution of your program but debugging is limited Do NOT select for this tutorial Now click OK to start a HEW debug session be sure hardware is connected If you get an error check all connections See SKP user s manual on Troubleshooting for details Note 1 See HEW User s Manual or Help for the differences between Sampling Mode and Free Run Mode Also see the ICD RTA FoUSB MON User s Manual for details on how ICD works under these two modes 25 434 NESAS HEW Debug Session Edit window has not changed but more buttons are available in the toolbar Step in Open Windows ona execute 1 line of code Registers RamMonitor sa Step over Memory Status zi Ui our Fu DE run 7 EE m an cn tere Er el Sk x o id xe 25 6 5 04 Ba E xill Reset go Go to cursor Go run Reset CPU Go to cursor Breakpoints C Watch Asm Watch Go free Display PC 26 434 NESAS Download the executable file to the R8C Tiny SKP Board 1 2 EH Tuot B E Tutor E Assembly source file i B B nert 26askp tutor1 a30 ie sect30_26askp_tutor1 inc B 83 C source file E El main tutorl c tab space FRRZEZEREZ
15. nfigure them 0E892E 941 C ARENESA Breakpoint information ggg 97 C RENESA _ Delete dll x GES OSC 125 C RENESA ee can be saved and 0E896A 139 C RENESA E All Enable loaded between sessions _ z a Disable E All Disable View a 2 Click Delete Timer mode 32 no pulse output All and close window 434 NESAS Running Downloaded Program Click on the Go icon to run the Tutor1 program you just downloaded LED s D1 D2j amp D3 will blink sequentially Covering the CdS light cell will decreas the LED blink rate and uncovering it will increase it IT El E n Click on the STOP button T Open the register window 30 434 NESAS Program Stepping st EL EY EL Click to step a few lines Any register values that change turn red 31 stENESAS RAM Monitor Window The RAM 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 By double click an address you can change the address range you want to view ie o 0 E tx RamMonitor disp count abel Register 0 1 42 43 4 5 8 disp count SB 01 75 4c 03 00 00 00 AS OF 07 FF FF FF FF FF FF 1 n o 00 co co ca rs rr Open a RAM Monitor window FF FF EF FF FF FF FF EF E d
16. oUSB MON Flash Programmer amp In Circult Debugger ICD In Circuit Debugger Mini R8C board 4 sENESAS Mini R8C17 Board siena CdS Cell Battery Points 20MHz Crystal poc 18 pin I O Header J1 i Clock Stop Detect JP ili 0 0000011 Thermistor Jumper JP3 31oe e fee ee oc Pu lo 7 lt B Daria i ns Slide P d Switch S1 R8C 17 R5F21174SP UI gr Pushbutton 44 Switch S2 3 User LED s 16 pin I O Header J2 External Power MCU Power Supply Points Jumper JP1 5 434 NESAS R8C MCU Features R8C 13 R5F21134FP MCU e 20MHz Operating Frequency at 3 0V 5 5V 10MHz Operating Frequency at 2 V 5V e 16kB Flash ROM 1kB RAM e 2kB x 2 Data Flash ROM e 24 GPIO including 4 Key on Wakeup Inputs 3 8 bit and 1 16 bit Timers plus a Watchdog Timer 12 channel 10 bit ADC 2 SIO 1 Clock Sync UART 1 UART Voltage Detect and Oscillation Stop Detection Clock sources Main Xin Ring oscillator Low and High speed R8C 17 R5F21 174SP MCU same as above w following exceptions 20 pin 15 GPIO including 2 8 bit and 1 16 bit Timers plus a Watchdog Timer 4 channel 10 bit ADC 1 SIO clock sync UART 1 12C channel R8C 15 R5F21154SP same as above except I C channel replaced with SSU channel See hardware manuals for product details 6 434 NESAS ICD RTA FoUSB MON The ICD In Circuit Debugger provides power and a USB interface to the Host PC
17. on from the Start gt Programs gt Renesas gt SKP8CMINI17 15 menu e SKP8CMINI User s Manual This is a must read document It details all the things you need to know on how to use the Starter Kit e R8C Hardware Manuals Device specifications for R8C Tiny MCUs e HEW User s Manual To fully understand and get the most out of HEW this is recommended reading i NC30WA Version X XX User s Manual Check this manual out for features specific to the NC30 compiler e RTA FoUSB MON User s Manual Read this manual to understand how the In Circuit Debugger Flash Programmer works 38 434 NESAS More References and Recommended Reading e M16C 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 family of microcontrollers e R8C Tiny Series Software Manual This document describes the instruction set and timing information for the R8C Tiny series MCUs e 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 http www renesas com e SKP updates www renesas com skp T E RG 39 434 NESAS
Download Pdf Manuals
Related Search
Related Contents
RT-5SW - GeoShack L`art sera mis en boîte SY-P4I Fire DRAGON MOTHERBOARD Acer Extensa 4210 Owner's Manual Samsung P24FHD User Manual GC Columns Accessories Keysight Technologies 34401A Digital Multimeter 取付説明書・取扱説明書 Copyright © All rights reserved.
Failed to retrieve file