Home
Software Development Process Using HEW4
Contents
1. eH gn Files 2 Macro Test Version Control E2 E3 E4 Default desktop Read write 151 155 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 oource window slide 34 TEM Modifying the Program 2 2 Sow EJ 5 Source 98 Static unsigned char adSwvitch 59 100 Pfs if adSwitch 0 read the a d char 101 adSwitch 1 102 F40p4 adconO 0x80 One shot software 103 F4 O0D8 i ff Start 20 conver 104 FAQDC while adst 1 wait for A D cor 105 F40Ez tal 10 and preload Time 106 ff the 10 is to 107 F40EE A2DValue ado 108 F40F4 AzDValuePot AZDValue 109 Pfs 110 else K v QSKBZP lt gt Intemupts c p E Debug SessionM16C E8 SYST 4 Build the project again Slide 35 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 Ox3FF ado 3 If program is running click STOP 7 INTIS armninmno 2 V a L X The HEW debugger will automatically detect that the program has been recompiled and ask if you wish to download again Confirma
2. Debug Find in Files 1 Find in Files 2 Macro Test version Control Ee Defaulti desktop slide 15 BNS Learning 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 right click within the window and select Configure View Configure View iw Shaw standard library includes Cancel Show file paths Sort files in time order 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 slide 16 1G tutorial Assembly source file nerti a30 3 source file 2 Interrupts c 5 LCD c 5 MCUInit c f 5 2 3 Documentalion askez Schematic pdf C3 Download modules 3 Dependendies B B extern pro open a source file double click on it Any opened source file within the workspace are shown on the Editor window Source uint AzD ValueTherm char zDProcesse d Build File oid 1 7014 l Purpose The MCU 10 Right clicking on a file py List Members Chrl Space sm opens the Editor i Replace t Goto Line Ckrl 6 D IOns MCUInit ti bv cu Tu
3. 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 High performance 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 OSK files examples and software tools in the default directories slide 2 j SNS Solutions QSK16C 6x Board 1 Write programs using editor Esc NN Mt E 5 Correct errors 5 amp repeat process e 2 HEW automates compile amp link Host USB A oun 4 Debugging t HEW Editor _ petits window Corr 3 sends the machine sent back amp forth que code to the M16C 6x QSK during 7 i eM s downloads and uses the symbols for source level debugging AQ Th HEW Debug interface Slide 3 BNS Learning Solutions Connecting th
4. Setup Tools Test Window Help 1 When HEW opens select Create a new project workspace Welcome F Create a new project workspace Cancel X dis C Open recent project workspace Administration 2 C Browse to another project workspace 5 of AL at 2 Select OK aal af f Build Debug Find in Files 1 Find in Files 2 Macro Test Version Control Ready 1 slide 10 Pea BNS Learning 1 Select BNS QSK62P Plus from list New Project Workspace Projects Project Types Workspace Mame G Application erase Name source startup Application Empty Application i Import Makefile Decks Library EworkSpace Browse Debugger only 1 S r Debugger only 1 Simulat CPU M1 amp E Tool chain Renesas MI6C Standard Properties slide 11 2 Enter Tutor1 as a name for the workspace 3 Click slide 12 What type of project wou want to generate aom 1 Select Tutorial Tutorial Project Sample Code Sample code for Peripherals 2 Click Next Application Empty Application Project r3 rw e NIS earnino 5 Project Generator 3 4 The following files will be added to the project Description DefaultS ession hef Hew Ses
5. is connected If you get an error check all connections See QSK user s manual on Troubleshooting for details MMM HEV Debug Session Step execute 1 line of code Register Step Over Memory Open Init Step out I O i run Status sf EL ET El ER ir RS Tee m vo PE 1 Ido sid bm Display PC Locals Go to cursor 20 to cursor C Watch Go run Asm Watch Reset CPU slide 27 When the software connects to hardware the executable x30 is downloaded to QSK board 3 columns are added to the edit window View options Source 0 Breakpoints eEvent Software Double clicking adds breakpoints Slide 28 MCUIniti l Initbisplayi Turorl InitWUARTil BHSPrintf SERIAL TimerIniti ADIniti l ENABLE SWITCHES LED initializati ENABLE LEDS whileii Address column an address on a line indicates that line contains executable code BNS Solutions Running Downloaded Program Click on the Reset icon to run the tutor1 program Note the STOP button turns red On the board LED s D1 D2 amp 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 zt EM EE 8 GD 1 xe m Click the Stop button Open the register window slide 29 sl HAPPED 4
6. 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 programs in Assembly or when making changes to the startup ile 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 r
7. on the MI 6C 6x 5 board slide 23 utions 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 IS HEW debugging example Launch a debugging session by pulling down the menu in the sessions box and select SessionM16C E8 SYSTEM Release Sessionkilbl EB 5751 EE Detaults esson _ gt slide 25 Debug Init Window 2 Verify that the following M16C 62P Group M30620FCP eErase Flash and Connect 3 Click to power device at 3 3 Volts since board will be powered through USB slide 26 608 2 1 Click Connect Emulator Emulator mode Finare Location MOU Setting MCU Gm MIEC E2P Group we M30620FCP f Erase Flach and Connect Keep Flath and Connect Program Flach Debuggng of CPU rewrite mode Power Target from Emulator 300mA 4 Click OK start a debug session be sure hardware
8. PS Click to step a few lines Any register values that change turn red Slide 30 Yalue R E 0001 Tie n1 E R2 nooo H 0000 H 0000 K A1 0400 H FE 0477 E USP 0401 H ISP 0477 H E 3B 0400 H INTE FFBOO E 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 By double click an address you can change the Open Memory window address range you want to view p e E m Display Address Display Address 00000 iral Scroll Start Address 100000 iral Scroll End Address FFFFF iral 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 By right clicking on a variable in Open a Watch Window the file edit window you can add it to the watch window by clicking a a Instant Watch then Add TE amp lse if S2 0 BHSPEint iLCD tButWonz in 81 ow 5 mp S os Instant Watch 52 Mat available now b Close only Zhp0 s04u 2 DAN 7 AD INS Learning The I O Window
9. allows you to view register contents and status of port pins Open Window H pMAU interrupt iz DMAI interrupt Lj Key input inte A D conversion UART2 transmit VART receive 9 UART transmit a a0tic 000051 2 11v10 s tic 11711 sDUtic mJ ilvlz s tic s tic GJ transmit 22 DART receive Timer inter Timer Al inter HE Timer AZ inter SeectedRegeter slide 33 gt r H 121 VS Le al the Program 1 2 33 tutoriall High performance Embedded Workshop QSK62P c ci File Edit View Project Build Debug Setup Tools Test Window Help x Reese SessionM16 M T d ESO EIE Ala E t 4 tutorial tutoriali J Assembly source file 3 nert0 a30 4 C source 2 Interrupts c 3 LCD c 3 MCUInit c i 5 2 Documentation DATE Mon Mar 23 2009 Schema les DESCRIPTION This is the main file for the p A 0000 contains most of the project sz jt ctype h CPU GROUP 62P extem h LCD h Copyright c 2009 by BNS Solutions Inc nc define inc fed NN 7 7 0 Line Sour 5 Source Hinclude OSKDefines h include proto h include extern h 0
10. arnings 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 rt HEW Debugging Overview The new HEWA 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 IS BNS Solutions 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 modifying the program rebuilding and running the updated program
11. ced 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 l 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 MOT executable files for M16C slide 19 Debug SessionM16C E8 SYST Build uild All re build Let s rebuild the Tutor 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 The major use of the Output window is to determine if any errors or warnings occurred and where during the build process and Renesas Solutions Corp All Rights Reserved Phase Ml16C Load Module Converter finished Build Finished Errors W
12. e Kit USB port on Windows XP Pro Vista PC slide 4 gt R5 232 Port Link LED NN BOLT TTA TE x 2 line LED lt Expansion Port 7 A NN Reset Switch M Power LED A Thermistor t Ring AHAA e Mec 1h 4 1 m Analog Adjust Pot w 11 7 P4 User LEDs 3 d an User Pushbutton 3 a J2kHz Crystal under bonrd slide 5 QSK62P Board Features M16C 62P M30626FHPGP MCU e 24MHz Operating Frequency at 3 0V 5V 10MHz Operating Frequency at 2 7 5V 384 Flash ROM 4 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 e 3 5 plus 2 510 5 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 e Thermistor and potentiometer on two A D inputs e available on Expansion Ports slide 6 Solutions 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
13. 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 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 oue Solutions etel 9 Realne T RENESAS TOOLS a High performance Embedded Workshop i High performance Embedded Workshop 2 High performance Embedded Workshop Help High performance Embedded Workshop Read Manual Navigator From the Windows Start menu click on Programs gt Renesas gt High performance Embedded Workshop High performance Embedded Workshop slide 9 e BNS Solutions A dE High performance Embedded Workshop PEE File Edit view Project Build Debug
14. sion description twt Sample Cod estern h C Header File Interrupts c C Source File C Source File _ LCD h Header File Files to be added to ILI IHE c C Source File 830 C Startup File project by project nc define inc Assembly Inc proto h C Header File generato JE KbzZF Schematic Adobe POF F LISEBZP c C Source File L5 KD efines h Header File inc C Startup File se Click Finish to generate project slide 13 Project generator information The project will be generated with the following specication CPU information CPU Additional files defaultsession hsf description tut extern h interrupts c led c Confirmation of files to c 30 added project define inc proto h qskbzp schematic pdf qskbzp c qskdefines h sect3l inc sessionm system hsf Click OK to continue slide 14 EP BNS Solutions MU should look like the figure below tutorial High performance Embedded Workshop File Edit wiew Project Build Debug Setup Tools Test Window Help m Cg nb errors Debug SESSION if Sit El E Menu Bar Toolbars IN tutorial Assembly so nerti asl 425 source file Interrupt LED c MCUlInit 05 62 Documentatii meres Workspace Window Output Window
15. t ri Match Braces ShiFE CEFIH M InitUARTil Bookmarks BH2SPrintf SERIAL Templates TimerIniti l ADIniti l ENABLE SWITCHES LED initializati Define Column Format ENABLE LEDS Columns k SS layi LED control variable Li J total U m be 12181 01 Properties of lines and column numbers are displayed here Virtual workspace selection S OSKB2P c Default desktop Readwite ons INS NUM slide 17 inr di 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 errors Debug v SessionM1BC EB SYST l6 B PH EJ Debug Toolbar Debug Run Toolbar Default Window Version Control Bookmarks Toolbar Help System Toolbar Tools Notes 1 M16C is supported by the Debug toolbars on HEW 4 x and above 2 5ee HEW user s manual about these toolbars 3 These toolbars are added removed depending on settings slide 18 Standard Toolbar Clean All Current Launch External Build Configuration Debugger Debug SessionM1BC EB SYST Build um Build Current Debugger Session Clean All removes intermediate and output files produ
16. tion Request 1 to download module Cork ebugtutarial x3t Don t ask this question again es to all Ma to all Cancel 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 O Solutions 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 gt lutions References and Recommended Reading All documents that came with the QSK can be found using the Document Description from the Start gt Programs gt Renesas gt 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 IS 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
Download Pdf Manuals
Related Search
Related Contents
Guide d`entretien et manuel d`installation コンパクトボディに凝縮。 ASUS TR7895 User's Manual D-ILA Projectors - JVC Customer Support MTU & MTR User Guide Samsung Micro-ondes (28L) User Manual ACCU-Pro MODEL 670 SEMI-AUTOMATIC Copyright © All rights reserved.
Failed to retrieve file