Home
78K0 Design - Renesas Electronics
Contents
1. Return value None Example Below are examples of callback processing by the trigger for the UART communication error interrupt CG_serial_user c include CG macrodriver h _ interrupt void MD_INTSRE S void Interrupt processing for INTSRE6 UCHAR err_type UART6_ErrorCallback err_type Call callback routine void UART6_ErrorCallback UCHAR err _ type Callback routine for INTSRE6 if err_type amp 0x1 4 Determine trigger Callback processing in response to overrun error err type amp 0x2 Determine trigger Callback processing in response to framing error err_type amp 0x4 Determine trigger Callback processing in response to parity error R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 158 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS R20UT0006EJ0100 Rev 1 00 tENESAS Page 159 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSI1n_Init Performs initialization of the serial interface CSI1n channel Classification CG_serial c Syntax void Colin Ini void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 160 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSI1n_Userlnit Performs user defined initialization of the serial interface CSI1n Remark This API function is calle
2. 19 2 3 2 Select color 20 2 3 3 Select popup information 21 2 3 4 Select additional information 22 2 4 Enter Information 23 2 5 Output Report Files 24 2 5 1 Output device pin list 24 2 5 2 Output device top view 25 CHAPTER 3 FUNCTIONS Code Generator 26 3 1 Overview 26 3 2 Open Code Generator Panel 27 3 3 Enter Information 28 3 3 1 Inputrule 28 3 3 2 Icon indicating incorrect entry 29 3 3 3 Icon indicating pin conflict 30 3 4 Confirm Source Code 31 3 5 Output Source Code 32 3 5 1 Setting that determines whether or not to generate source code 33 3 5 2 Change file name 34 3 5 3 Change API function name 35 3 5 4 Change output mode 36 3 5 5 Change output destination folder 37 3 6 Output Report Files 38 3 6 1 Change output format 40 3 6 2 Change output destination 41 APPENDIX A WINDOW REFERENCE 42 A 1 Description 42 APPENDIX B OUTPUT FILES 103 B 1 Overview 103 B 2 Output File 103 APPENDIX C API FUNCTIONS 108 C 1 Overview 108 C 2 Output Function 108 C 3 Function Reference 114 C 3 1 System 116 C 3 2 Port 127 C 3 3 INT 134 C 3 4 Serial 145 C 3 5 Operational Amplifier 185 C 3 6 Comparator 195 C 3 7 A D 200 C 3 8 Timer 210 C 3 9 Watchdog Timer 241 C 3 10 RTC 243 C 3 11 Clock Output 277 C 3 12 LVI 283 APPENDIX D INDEX 291 CubeSuite V
3. 195 Comparator_Init 196 Comparatorn_Start 198 Comparatorn_Stop 199 Comparator Userlnit 197 Comparator_Init 196 Comparatorn_Start 198 Comparatorn_Stop 199 Comparator Userlnit 197 CSlin_Init 160 CSl1n_ReceiveData 164 CSlin_ReceiveEndCallback 169 CSlin_SendEndCallback 168 CSl1n_SendReceiveData 166 CSlin_Start 162 CSl1n_Stop 163 CSlin_Userlnit 161 D Device Pin List panel 63 External Peripheral tab 69 Macro tab 67 Pin Number tab 65 Device Top View panel 71 Device Top View Settings tab 55 E External Peripheral tab 69 F File Setting tab 62 Functions 11 26 Code Generator 26 Pin Configurator 11 G Generation tab 58 IICA_GetStopConditionCallback 184 ICA Init 170 I1CA_MasterErrorCallback 178 IICA_MasterReceiveEndCallback 177 IICA_MasterReceiveStart 174 IICA_MasterSendEndCallback 176 IICA_MasterSendStart 173 IICA_SlaveErrorCallback 183 IICA_SlaveReceiveEndCallback 182 IICA_SlaveReceiveStart 180 IICA_SlaveSendEndCallback 181 IICA_SlaveSendStart 179 IICA_Stop 172 IICA_StopCondition 175 IICA Userlnit 171 INT 79 INT 134 INT MaskablelnterruptEnable 139 INTP_Init 135 INTPn_Disable 141 INTPn_ Enable 142 INTP_Userlnit 136 KEY Disable 143 KEY Enable 144 KEY Init 137 KEY Userlnit
4. INT Serial Operational Amplifier Comparator A D Timer Watchdog Timer RTC Clock Output LVI Remark See User s Manual for Microcontroller for details on the items to be set File menu Code Generator panel dedicated items Save Code Generator Report Outputs report files a file containing information configured using Code Generator and a file containing information regarding the source code Remarks 1 The output format for the report file either HTML or CSV is selected by clicking Generation tab gt gt Report type in the Property panel 2 The destination folder for the report file is specified by clicking Generation tab gt gt Output folder in the Property panel Help menu Code Generator panel dedicated items Open Help for Code Generator Displays the help of this panel Panel R20UT0006EJ0100 Rev 1 00 tENESAS Page 76 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE System This panel allows you to configure the information necessary to control the functions of clock generator on chip debug function and etc provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 17 Example of System Clock getting On chip debug setting Confirming reset source Main system clock setting Intern
5. MD_STATUS ret TM00_Stop Stop count ret CG_SelectPowerSaveMode PSSTOP Change to STOP mode if ret MD_OK while 1 R20UTO006EJ0100 Rev 1 00 tENESAS Page 123 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_Init Initialize TMOQ TM00_Start Start count R20UT0006EJ0100 Rev 1 00 tENESAS Page 124 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG _SelectStabTime Configures the oscillation stabilization time of the X1 clock Classification CG_system c Syntax include CG macrodriver h include CG_system h MD STATUS CG_ SelectStabTime enum StabTime waittime Argumeni s enum StabTime waittime Oscillation stabilization time type STLEVELO 2 11 fx STLEVEL1 2 13 fx STLEVEL2 2 14 fx STLEVEL3 2 15 fx STLEVEL4 2 16 fx Remark fx signifies the frequency of the X1 clock Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 125 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_ChangePIlIMode Controls the operation of PLL function Classification CG_system c Syntax include CG macrodriver h include CG_system h MD_STATUS CG_ChangePllMode enum PllMode plimode Argumeni s enum P11Mode pllmode Control of operation SYSPLLON Enable operati
6. None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 274 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTCDIV_OutputDisable Disables output of the real time counter clock 32 kHz cycle to the RTCDIV pin Classification CG_rtc c Syntax void RIC RICDIV OutputDisable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 275 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_ChangeCorrectionValue Changes the timing and correction value for correcting clock errors Classification CG_rtc c Syntax include CG mMmacrodriver h include CG FLeesh MD STATUS RTC_ChangeCorrectionValue enum RTCCorectionTiming timing UCHAR corectval Argumeni s enum RTCCorectionTiming timing When clock errors are corrected EVERY20S When the seconds digits are 00 20 or 40 EVERY60S When the seconds digits are 00 Ea UCHAR corectval Clock error correction value Remark This API function does not correct clock errors if correction value corectVal is set to 0x0 0x1 0x40 or 0x41 Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 276 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 11 Clock Output Below is a list of API functions output by Code Generator for clock output u
7. Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 215 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMX_EnableHighImpedanceState Begins high impedance output of the 16 bit timer Xn Classification CG_timer c Syntax void TMX_EnableHighImpedanceState void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 216 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMX_DisableHighImpedanceState Ends high impedance output of the 16 bit timer Xn Classification CG_timer c Syntax void TMX_DisableHighImpedanceState void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 217 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_Init Performs initialization necessary to control 16 bit timer event counter 00 functions Classification CG_timer c Syntax void TMOO_ Init void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 218 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_Userlnit Performs user defined initialization relating to the 16 bit timer event counter 00 Remark This API function is called as the TMO0O Init callback routine Classification CG_timer_user c Syntax void TMOO_UserInit void Argument s None Return va
8. b Description Description of return value 7 Example Shows an example of the API function in use R20UTO006EJ0100 Rev 1 00 tENESAS Page 115 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 1 System Below is a list of API functions output by Code Generator for system use Table C 2 API Functions System CLOCK Init Performs initialization required to control the clock generator on chip debug and etc CLOCK Userlnit Performs user defined initialization relating to the clock generator on chip debug and etc CG_ReadResetSource Performs processing in response to RESET signal R20UT0006EJ0100 Rev 1 00 tENESAS Page 116 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CLOCK_Init Performs initialization required to control the clock generator on chip debug and etc Classification CG_system c Syntax void CLOCK_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 117 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CLOCK Userlnit Performs user defined initialization relating to the clock generator on chip debug and etc Remark This API function is called as the CLOCK Init callback routine Classification CG_system_user c Syntax void CLOCK_UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESA
9. 2 Tool Tip category Select whether to display a tooltip with information about a pin when the mouse cursor is moved over the pin in the device top view Tool tip Selects whether to display a tooltip with information about a pin when the mouse cursor is moved over the pin in the device top view panel Display all Displays the Description Recommend Connection For Unused and Attention strings for the device pin list Description recommended Displays the Description and Recommend connection for unused pin Connection For Unused string for the device pin list only Attention only Displays the Attention string for the device pin list Not display Hides tooltips when the mouse cursor hovers over a pin R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 56 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 3 Pin Name Display category Select whether to display additional information about the pin in the device top view Define name Selects whether to display the Define Name string of the device pin list appended to the pin in the device top view Display Displays the Define Name string of the device pin list in appended format Not display Hides the Define Name string of the device pin list Pin function Selects whether to also display unselected functions in the device top view when a function has been selected from the device pin list s Function feature Display all Displays functio
10. Argumeni s 0 ULONG aighwidth 0 Pointer to area storing the high level measurement width 0x0 to Oxffff 0 ULONG lowwidth Pointer to area storing the low level measurement width 0x0 to Oxffff enum TMChannel channel The pin to measure TMCHANNELO T1000 pin TMCHANNEL1 T1010 pin Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 226 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n Init Performs initialization necessary to control 8 bit timer event counter 5n functions Classification CG_timer c Syntax void TM5n_Init void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 227 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n_Userlnit Performs user defined initialization relating to the 8 bit timer event counter 5n Remark This API function is called as the TM5n_ Init callback routine Classification CG_timer_user c Syntax void TM5n_UserInit void Remark nis the channel number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 228 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n_ Start Starts the count for 8 bit timer event counter 5n Remark The time from the call to this API function to the start of counting depends on the type of the function in que
11. Changes the content displayed in the Information setting area to the System for configuring the information necessary to control the functions of clock generator on chip debug function and etc provided by the microcontroller Changes the content displayed in the Information setting area to the Port for con figuring the information necessary to control the port functions provided by the microcontroller Changes the content displayed in the Information setting area to the INT for con figuring the information necessary to control the interrupt functions and the key inter rupt function provided by the microcontroller Changes the content displayed in the Information setting area to the Serial for configuring the information necessary to control the functions of serial array unit and functions of serial interface provided by the microcontroller Changes the content displayed in the Information setting area to the Operational Amplifier for configuring the information necessary to control the functions of com parator programmable gain amplifier provided by the microcontroller Changes the content displayed in the Information setting area to the Comparator for configuring the information necessary to control the function of comparator pro vided by the microcontroller Changes the content displayed in the Information setting area to the A D for con figuring the information necessary to control the function of A D c
12. Ea UCHAR rxbuf Pointer to a buffer to store the received data USHORT rxnum Total amount of data to receive Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 180 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_SlaveSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO Remark This API function is called as the callback routine of interrupt process MD_INTIICAO corresponding to the IICA communication complete interrupt INTIICAO Classification CG_serial_user c Syntax void IICA_SlaveSendEndCallback void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 181 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO Remark This API function is called as the callback routine of interrupt process MD_INTIICAO corresponding to the IICA communication complete interrupt INTIICAO Classification CG_serial_user c Syntax void IICcCA_SlaveReceiveEndCallback void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 182 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_SlaveErrorCallback Performs processing in response to detection of error in IICA slave communication Classifi
13. RTC_ConstPeriodinterruptCallback Performs processing in response to the cyclic interrupt INTRTC Remark This API function is called as the callback routine of interrupt process MD_INTRTC corresponding to the cyclic interrupt INTRTC Classification CG_rtc_user c Syntax void RTC_ConstPeriodInterruptCallback void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 257 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarmEnable Starts the alarm interrupt function Classification CG_rtc c Syntax void RTC_AlarmEnable void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 258 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarmDisable Ends the alarm interrupt function Classification CG_rtc c Syntax void RTC_AlarmDisable void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 259 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarmSet Sets the alarm conditions weekday hour minute Classification CG_rtc c Syntax include COG roe void RTC_AlarmSet struct RTCAlarmValue alarmval Argumeni s I O Argument Description struct RTCAlarmValue alarmval Alarm conditions weekday hour minute Remark Below is shown the structure RTCAlarmValue
14. Remark When the new message is output mark is displayed to the left of the tab name R20UT0006EJ0100 Rev 1 00 tENESAS Page 92 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE File menu Output panel dedicated items Save Output Tab Name Saves the message corresponding to the specified tab overwriting the existing file Save Output Tab Name As Opens the Save As dialog box for naming and saving the message corresponding to the specified tab Edit menu Output panel dedicated items Sends the character string or lines selected with range selection to the clipboard Select All Selects all the messages displayed on the Message area Search Opens the Search and Replace dialog box for searching strings with the Quick Search tab selected Replace Opens the Search and Replace dialog box for replacing strings with the Whole Replace tab selected Help menu Output panel dedicated items Open Help for Output Panel Displays the help of this panel Context menu The following context menu items are displayed by right clicking the mouse Sends the character string or lines selected with range selection to the clipboard Select All Selects all the messages displayed on the Message area Deletes all the messages displayed on the Message area Stop Searching Cancels the search currently being executed This is invalid when a search is not being executed Open Help fo
15. C OD D me o lt S C D CubeSuite Ver 1 40 Integrated Development Environment User s Manual 78K0 Design Target Device 78KO Microcontroller All information contained in these materials including products and product specifications represents information on the product at the time of publication and is subject to change by Renesas Electronics Corp without notice Please review the latest information published by Renesas Electronics Corp through various means including the Renesas Electronics Corp website http www renesas com Renesas Electronics www renesas com Rev 1 00 Sep 2010 8 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website Renesas Electronics does not assume any liability for infringement of patents copyrights or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document No license express implied or otherwise is granted he
16. Remarks 1 This API function repeats the byte level CSI1n transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum 2 This API function performs byte level CSI1n reception the number of times specified by the parameter txnum and stores the data in the buffer specified by the parameter rxbuf 3 When performing a CSl1n reception CS 1n_ Start must be called before this API function is called Classification CG_serial c Syntax include CG tactodriver kh MD STATUS CSIln_SendReceiveData UCHAR txbuf USHORT txnum UCHAR rxbuf Remark nis the channel number Argumeni s Ch oar meaner sai rreresonaie peee aenttaaminomaiesie o pe seas Pomerat essa Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of sending and receiving a CSI10 transmission of four bytes of fixed length data from channel 10 one time CG_main c include CG_macrodriver h BOOL gSflag Transmission complete flag void main void UCHAR txbuf 0123 USHORT txnum 4 UCHAR rxbuf 10 R20UT0006EJ0100 Rev 1 00 tENESAS Page 166 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Initialize flag CSI1LO Start Start CSI10 communication CSI10_SendReceiveData amp txbuf txnum amp rxbuf Start CSI10 send receive while gSlag Wait for
17. struct RTCCounterValue counterwriteval Argumeni s Argument Description struct RTCCounterValue Counter value counterwriteval Remark Below is an example of the structure RT CCounterValue counter value for the real time counter struct RTCCounterValue UCHAR Sec second UCHAR Min Minute UCHAR Hour Hour UCHAR Day Day UCHAR Week Weekday 0 Sunday 6 Saturday UCHAR Month Month UCHAR Year Year Return value MD_OK Normal completion MD_BUSY1 Executing count process before change to setting MD_BUSY2 Stopping count process after change to setting Remark If MD_BUSY1 or MD_BUSY2 is returned it may be because the counter operation is stopped or the counter operation start wait time is too short so make the value of the RTC_WAITTIME macro defined in the header file CG_rtc h larger Example The example below shows the counter value of the real time counter being set to 2008 12 25 Thu 17 30 00 R20UT0006EJ0100 Rev 1 00 tENESAS Page 251 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_main c include OG TiC void main main struct RTC_CounterEnable counterwriteval counterwriteval counterwriteval counterwriteval counterwriteval counterwriteval counterwriteval RTC_SetHourSystem HOUR24 RTC_CounterSet Week Hour Ae RTCCounterValue counterwriteval Year 0x08
18. 138 INT MaskablelnterruptEnable 139 INTP_Init 135 INTPn_Disable 141 INTPn_ Enable 142 INTP_Userlnit 136 K KEY Disable 143 KEY Enable 144 KEY Init 137 KEY Userlnit 138 R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 L LVI 88 LVI 283 LVI_Init 284 LVI_InterruptModeStart 286 LVI_ResetModeStart 287 tENESAS Page 292 of 300 CubeSuite Ver 1 40 LVI_SetLViLevel 289 LVI_ Stop 288 LVI UserInit 285 LVI_Init 284 LVI_InterruptModeStart 286 LVI_ResetModeStart 287 LVI_SetLViLevel 289 LVI_ Stop 288 LVI UserInit 285 M Macro Setting tab 61 Macro tab 67 Main window 43 N New Column dialog box 99 O OPAMP _Init 186 OPAMP_Userlnit 187 Operational Amplifier 81 Operational Amplifier 185 AMPn_Start 193 AMPn_Stop 194 AMP_ Start 191 Sep 01 2010 APPENDIX D INDEX PGA_ChangePGAFactor 190 PGA_Start 188 PGA_Stop 189 Pin Configurator Information tab 54 Pin Configurator Settings tab 52 Pin Number tab 65 Port 78 Port 127 PORT ChangePmninput 130 PORT_ChangePmnOutput 132 PORT _Init 128 PORT UserlInit 129 PORT ChangePmninput 130 PORT _ChangePmnOutput 132 PORT Init 128 PORT UserlInit 129 Project Tree panel 46 Property panel 49 Device Top View Settings tab 55 File Setting tab 62 Generati
19. 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVI Init Performs initialization necessary to control low voltage detector functions Classification CG _Ivi c Syntax void LVI_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 284 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVI_Userlnit Performs user defined initialization relating to the low voltage detector Remark This API function is called as the LV Init callback routine Classification CG_lvi_user c Syntax void LVI_Userinit void Argument s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 285 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVL InterruptModeStart Starts low voltage detection when in interrupt generation mode Classification CG _Ivi c Syntax void LVI_InterruptModeStart void Argumeni s None Return value None Example The example below shows the detection of low voltage when the operation mode is interrupt generation mode gener ate the interrupt INTLVI CG_main c void main void LVI_InterruptModeStart Start low voltage detection _ interrupt void MD_INTLVI void Interrupt processing for INTLVI LVIF 1 Trigger identification Check LVIF flag Handle case when power voltage Vpp lt det
20. CHAPTER 2 FUNCTIONS Pin Configurator 2 2 Open Device Pin List Panel Open the Device Pin List panel where you enter information on the pins of the microcontroller To open the Device Pin List panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List in the Project Tree panel Device Pin List Figure 2 1 Open Device Pin List Panel H Function 4 VO a N ch a Define PAO SGL Ag 5 iG Free E11 4INTP11 Pal SDAAO SH 1 Free AINTFIO Pw S5011 INTF9 Free External Peripheral Remarks 1 If an unsupported microcontroller is defined in the project for Pin Configurator then Pin Configurator Design Tool node will hide under Project name Project in the Project Tree panel 2 The Device Pin List panel consists of three tabs Selecting one of the tabs changes the order in which information on each pin of the microcontroller is displayed Pin Number tab Information on each pin of the microcontroller is displayed in the order of pin number Macro tab Information on each pin of the microcontroller is displayed in the order it was grouped into peripheral functions External Peripheral tab Information about the pins connected to external peripherals is displayed in order grouped at the external peripheral component level R20UT0006JJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 13 of 300 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2
21. Design Tool in the Project Tree panel changes the content displayed accordingly Description of each area 1 Product Information category This area displays product information Version and Release date on Code Generator R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 58 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Version Displays the version of Code Generator Release date Displays the release date of Code Generator 2 Generate File Mode category This area allows you to view and change the setting for the file generation mode Generate file Output folder Report type and Register files of Code Generator Generate file Views or selects the operation mode applied when the Generate Code button is pressed Operation mode applied when you select File menu gt gt Save Code Generator Report is fixed to Overwrite file Overwrite file If a file with the same name exists the existing file is ae ae Merge file If a file with the same name exists a new file is merged with the existing file Only the section between Start user code Do not edit comment generated here and End user code Do not edit comment generated here will be merged Do nothing if file exists If a file with the same name exists a new file will not be output Output folder Views or selects the destination folder for various files Source code and report files which are output when the G
22. Device Top View in the Project Tree panel changes the content displayed accordingly Description of each area 1 Color category Select the display colors to differentiate the pin groups power pins special pins unused pins etc in the device top view Selects the display color for power pins pins whose use is limited to power R20UTO006EJ0100 Rev 1 00 stENESAS Page 55 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Special pins Selects the display color for special pins pins with specified uses Unused pins Selects the display color for unused pins dual use pins with no use set in the Device Pin List panel Used pins Selects the display color for used pins dual use pins with a use set in the Device Pin List panel Device Selects the display color of the microcontroller Highlight Selects the background color of a pin selected in the Device Pin List panel on the Pin Number tab Macro highlight Selects the background color of pins selected in the Device Pin List panel on the Macro tab External peripheral highlight Selects the background color of pins selected in the Device Pin List panel on the External Peripheral tab Remark To change the setting of the color use the following color palette which opens by making a selection from the dropdown list in this area Figure A 7 Color Palette Custom Web System mi TEETE E EEEE E LLALL LLL BEEBE EEE EERE EERE
23. Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired col umn to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which opens by pressing the button in the upper left corner of the device pin list R20UT0006EJ0100 Rev 1 00 tENESAS Page 70 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Device Top View panel This panel displays the information entered in the Device Pin List panel Figure A 15 Device Top View Panel Device Top View O PIZI TOOLGd Ch P Ip EGLE T D Pad RTCCLS RTO AGEI n0 Pd ATG HE S11 Ch PLZ INTAI ESL 301 Cy Pd xTZ EXGLKS D RESET P IZ CP PIINATI PROSOLAQ SENINI lil t l PAXP SSII I IHTPA PESDA DSI ATI CQ Pon TOM Poz SOl I THTPS Gim PAS TAT PE Cpe ey POX IHTP PaaS TIGL TOG ATP De ey AM IO PTI AMP O PPG KRG P TORDE C L Cy AML PEI AMPOOUT PGAIH maoh uPD78F0581_48 ganran PAKRI 0 g Ana Pra PIERI AH id Prd PIRI C ey AH IG PIR PRO KRO Ci OpAN IG FRG Paty MTPa TOOLOL Cp FANIT PET q Lr Ply hh 13
24. INT_MaskablelnterruptEnable INTPn_Disable R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 103 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included INT CG_int c INTPn_Enable KEY_ Disable KEY Enable CG_int_user c MD_INTPn MD_INTKR INTP_Userlnit KEY_Userlnit Serial CG_serial c UART6_ Init UART6_ Start UART6_ Stop UART6_SendData UART6_ReceiveData CSl1n_Init CSl1n_ Start CSlin_Stop CSl1n_ReceiveData CSl1n_SendReceiveData ICA_Init IICA Stop IICA _MasterSendStart IICA_MasterReceiveStart IICA_StopCondition IICA_SlaveSendStart IICA_SlaveReceiveStart CG_serial_user c MD_INTSR6 MD_INTSRE6 MD_INTST6 MD_INTCSI1n MD_INTIICAO UART6_UserlInit UART6_SendEndCallback UART6_ReceiveEndCallback UART6_SoftOverRunCallback UART6_ErrorCallback CSl1n_Userlnit CSl1n_SendEndCallback CSl1n_ReceiveEndCallback IICA _Userlnit IICA_MasterSendEndCallback IICA_MasterReceiveEndCallback IICA_MasterErrorCallback IICA_SlaveSendEndCallback IICA_SlaveReceiveEndCallback IICA_SlaveErrorCallback IICA_GetStopConditionCallback R20UTO006EJ0100 Rev 1 00 tENESAS Page 104 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included Operational Amplifier CG_opamp c OPAMP_Init PGA_ Start PGA_Stop PGA_ChangePGAFactor AMP_ Start AMP_Stop AMPn_ Start AMPn_Stop CG_opamp_user c OPAMP
25. MD_SET Output HIGH level 1 MD_CLEAR Output LOW level 0 Return value None Example 1 Below is shown an example where pin POO N ch open drain output none is changed as follows I O mode type Output mode Initial output value Output HIGH level 1 CG_main c include CG_macrodriver h void main void PORT_ChangeP000utput MD_SET Switch I O mode R20UT0006EJ0100 Rev 1 00 tENESAS Page 132 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Example 2 Below is shown an example where pin P04 N ch open drain output yes is changed as follows I O mode type Output mode Output mode type N ch open drain output VDD withstand voltage mode Initial output value Output LOW level 0 CG_main c include CG _macrodriver h void main void d win ET O MD_TRUE MD_CLEAR Switch I O mode oe R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 133 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 3 INT Below is a list of API functions output by Code Generator for interrupt and key interrupt use Table C 4 API Functions INT INTPn_Disable Disables the acceptance of the maskable interrupts INTPn external interrupt requests INTPn_Enable Enables the acceptance of the maskable interrupts INTPn external interrupt requests KEY_ KEY_Disable Disables the acceptance of the key interrupts INTKR m Enables the acceptance of the k
26. Macro tab and the Pin Number tab 2 Click the ES button to remove the external peripheral component in question from the Device top view area if the Device Top View panel 2 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller 3 Tab selection area Selecting the tab changes the order in which information on each pin of the microcontroller is displayed This panel has the following tabs Pin Number tab This tab displays information on each pin of the microcontroller in the order of pin number Macro tab This tab displays information on each pin of the microcontroller in the order it was grouped into peripheral functions External Peripheral tab This tab displays information about the pins connected to external peripherals in order grouped at the external peripheral component level File menu Device Pin List panel dedicated items Save Pin List Saves a report file a file containing information configured using Pin Configurator device pin list overwriting the existing file Save Pin List As Opens the Save As dialog box for naming and saving a report file a file containing infor mation configured using Pin Configurator device pin list Help menu Device Pin List panel dedicated items Open Help for Device Pin List Displays the help of this panel Panel R20UT0006EJ0100 Rev 1 00 tENESAS Page 64 of 300 Sep 01 2010 Cub
27. My Documents of My Computer E3 My Network Places 2 Unused Desktop Shortcuts Make New Folder o Cancel R20UT0006JJ0100 Rev 1 00 tENESAS Page 41 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE APPENDIX A WINDOW REFERENCE This appendix explains in detail the functions of the windows panels and dialog boxes of the design tool A 1 Description The design tool has the following windows panels and dialog boxes Table A 1 Window Panel Dialog Box List Main window This is the first window to open when CubeSuite is launched This window is used to operate various components design tool build tool etc provided by CubeSuite Project Tree panel This panel displays the components of the project microcontroller design tool build tool etc in a tree structure Property panel This panel allows you to view the information and change the setting for the node selected in the Project Tree panel the peripheral function button pressed in the Code Generator panel or the file selected in the Code Generator Preview panel Device Pin List panel This panel allows you to enter information on each pin of the microcontroller Device Top View panel Device Top View panel View panel This panel displays the information entered in the Device Pin List panel This panel displays the information entered in the Device Pin List panel displays the information entered in the Device Pin List panel C
28. Output folder Description of each area 1 Folder location Select the folder to which the files source code report file etc are output Function buttons Make New Folder Creates a New Folder below the folder selected in the Folder location Specifies the folder selected in the Folder location as the destination for the files Ignores the setting and closes this dialog box R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 100 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Save As dialog box This dialog box allows you to name and save a file such as a report file Figure A 41 Save As Dialog Box Save As My Recent Documents My Documents a My Computer Newark iene ff O 4 plies Save as type Microsoft Office Excel Bool Function buttons The following items are explained here How to open Description of each area Function buttons How to open From the File menu select Save lt object gt As Description of each area 1 Save in Select the folder to which the files report files etc are output 2 List of files This area displays a list of files matching the conditions selected in Save in and Save as type R20UT0006EJ0100 Rev 1 00 tENESAS Page 101 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 3 File name Specify the name of the file to be output 4 Save as type Se
29. dual use pins with no use set in the Device Pin List panel Selects the display color for used pins dual use pins with a use set in the Device Pin List panel Selects the display color of the microcontroller Highlight Selects the background color of a pin selected in the Device Pin List panel on the Pin Number tab Macro highlight Selects the background color of pins selected in the Device Pin List panel on the Macro tab R20UT0006JJ0100 Rev 1 00 tENESAS Page 20 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator External peripheral highlight Selects the background color of pins selected in the Device Pin List panel on the External Peripheral tab 2 3 3 Select popup information Select the type of information that popups when you move the mouse cursor over each pin in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the popup information click Device Top View Settings tab gt gt Tool tip in the Property panel and select the desired type of information Figure 2 9 Select Popup Information Property af Device Top View Property El Color Power ping Red Special ping Green Unused ping Black Used ping Blue Device LightGray Highlight Red Macro highlight Fellow External peripheral highlight i Green El Tool Tip Display all E PinName Display ieee Defne name Description recommended connection for unused pin only
30. 2 1 Select item The Pin Configurator is used to select items to be displayed in the device pin list using the button in the upper left corner of the device pin list button in the To select the item to be displayed use the Column Chooser dialog box that opens by pressing the upper left corner of the device pin list Figure 2 2 Select Item Column Chooser x Pin Number Pin Hame Function Fall H ch Define Name Description Recommend Connection For Unused Attention S E e e A A C lt C8 External Peripheral iNew Column Delete Colum Default Remark To select the item to be displayed check the check box that corresponds to the item Table 2 1 Select Item Checked Displays the selected item in the device pin list Not checked Hides the selected item in the device pin list R20UT0006JJ0100 Rev 1 00 tENESAS Page 14 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 2 Change display order In Pin Configurator you can change the display order of columns in the device pin list move columns by dragging and dropping columns Figure 2 3 Change Display Order Device Pin List 38 ee Macro Name H Total H Used 4 0 Converteri ADC On chip Debug Function OGO 4 Port A PORTI 2 6 S wire Serial 0110501 T o Bin Number y External Peripheral J Device Pin List Macro Name a Total 4 0 Converter ADG 13 On chip Debug Function OGO P
31. 248 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_SetHourSystem Sets the clock type 12 hour or 24 hour clock of the real time counter Classification CG_rtc c Syntax include CG mMmacrodriver h include CG FEeech MD_STATUS RTC_SetHourSystem enum RTCHourSystem hoursystem Argumeni s enum RTCHourSystem hoursystem Clock type HOUR12 12 hour clock HOUR24 24 hour clock Return value MD_ARGERROR Invalid argument specification Remark If MD_BUSY1 or MD_BUSY2 is returned it may be because the counter operation is stopped or the counter operation start wait time is too short so make the value of the RTC_WAITTIME macro defined in the header file CG_rtc h larger Example Below is an example of setting the clock type to the 24 hour clock CG_main c include CG Pee ia void main void RTC CounterEenable Start count RTC_SetHourSystem HOUR24 Set clock type R20UTO006EJ0100 Rev 1 00 tENESAS Page 249 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 250 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_CounterSet Sets the counter value year month weekday day hour minute second of the real time counter Classification CG_rtc c Syntax include CG mMmacrodriver h include CG FLGsh MD STATUS RTC_CounterSet
32. API FUNCTIONS TMHn_ChangeDuty Changes the duty ratio of the PWM signal output to the TOHn pin Remark This API function can only be called when the 8 bit timer Hn is being used for PWM output Classification CG_timer c Syntax include CG macrodriver h void TMHn ChangeDuty UCHAR ratio Remark nis the channel number Argumeni s Remark The value set to duty ratio ratio must be in base 10 notation Return value None Example The example below shows changing the duty ratio to 25 CG_main c include CG macrodriver hi void main void 4 UCHAR ratio 25 TMHO_Start Start count TMHO_ChangeDuty ratio Change duty ratio R20UT0006EJ0100 Rev 1 00 RENESAS Page 238 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMH1_CarrierOutputEnable Begins carrier pulse output of the 8 bit timer H1 carrier generator mode Classification CG_timer c Syntax void TMH1_CarrierOutputEnable void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 239 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMH1_CarrierOutputDisable Ends carrier pulse output of the 8 bit timer H1 carrier generator mode Classification CG_timer c Syntax void TMH1 CarrierOutputDisable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 0
33. Ch PO ATG THES I Ch PLZ INTRO ESL 301 Cy Pla xTZ EXGLKS Cc RESET PIT CP PIINATI PAYSAN SEII IHTP l OPA PL SSI llI HTPR PSDS ATIN C POY T1Om PRI SO 1 TATPS 0 PA I HTPR C POX IHTP Poa TIGL TII I HTPA 0 AM 10 PO AMPO ProsKRG TORDE C L OPAH IPE AMP ODIT PGA H Pra KRA C WED YSFOUSa 44 SPAH II PEN AMPO PrayKRa PELENE PIERI OPAH Id P2d PriskKRI C ey AM 15 P25 PrOyKRO Cyan In P26 Paty IMTFa TOLO O eyAN IT PRT q a PIJ ATF G PLT T 160 C PG TOH I TAT PG C Pl k Pid Ros PIET GAHI 1 AMP 1 C Pal ATP2 TOOLC PIB TOHI PLL S110 SN 19 APT Oe Pl 30K 10a AMP I Remark In the Property panel on the Pin Configurator Settings tab if BGA is selected for the Package type then Device Top View panel cannot be opened R20UT0006JJ0100 Rev 1 00 tENESAS Page 18 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 1 Select shape of microcontroller Select the shape of the microcontroller displayed in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the shape of the microcontroller click Pin Configurator Settings tab gt gt Package type in the Property panel and select the desired shape Figure 2 7 Select Shape of Microcontroller Property A Pin Configurator Property El Product Informaton El Use of Pin Contigurator Panek Use pin configurator panels Mo El Pac
34. EH E tel GE E tat GEH htt The following items are explained here How to open Description of each area File menu Code Generator Preview panel dedicated items Help menu Code Generator Preview panel dedicated items Context menu How to open From the View menu select Code Generator Preview Description of each area 1 Preview tree This area allows you to confirm or configure on a per API function basis the setting that determines whether or not the source code device driver program is generated when the Generate Code button is pressed in the Code Generator panel R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 89 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Remarks 1 You can change the source code to be displayed by selecting the source file name or API function name in this tree 2 To select whether or not to generate the source code use the context menu Generate code Not generate code which is displayed by right clicking the mouse while the mouse cursor is on the desired icon in the tree 3 You can confirm the current setting that determines whether or not to generate the source code by checking the type of icon Table A 2 Setting That Determines Whether or Not to Generate the Source Code Source code for the currently selected API function is gener ated If this icon is displayed next to the API function the corre sponding s
35. LVI_InterruptModeStart Starts low voltage detection when in interrupt genera tion mode LVI_ResetModeStart Starts low voltage detection when in internal reset mode LVI_Stop Stops low voltage detection LVI SetLVILevel Sets the low voltage detection level R20UT0006EJ0100 Rev 1 00 tENESAS Page 113 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 Function Reference This section describes the API functions output by Code Generator using the following notation format Figure C 1 Notation Format of API Functions 5 Argument s 6 Return value 7 Example 1 Name Indicates the name of the API function Outline Outlines the functions of the API function 2 v 3 w Classification Indicates the name of the C source file to which the API function is output 4 Syntax Indicates the format to be used when describing an API function to be called in C language R20UT0006EJ0100 Rev 1 00 tENESAS Page 114 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS 5 Argument s API function arguments are explained in the following format a b c a 1 0 Argument classification Input argument O Output argument b Argument Argument data type c Description Description of argument 6 Return value API function return value is explained in the following format a Macro Macro of return value
36. Month 0x12 Day 0x25 0x05 0x17 Min 0x30 Sec 0 Start count Set clock type counterwriteval Set counter value R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 252 of 300 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_CounterGet Reads the counter value year month weekday day hour minute second of the real time counter Classification CG_rtc c Syntax include CG mMmacrodriver h include CG FLGsh MD STATUS RTC_CounterGet struct RTCCounterValue counterreadval Argumeni s Argument Description struct RTCCounterValue Pointer to structure in which to store the counter value being read counterreadval Remark See RIC CounierSet for details about the RTCCounterValue counter value Return value Remark If MD_BUSY1 or MD_BUSY2 is returned it may be because the counter operation is stopped or the counter operation start wait time is too short so make the value of the RTC_WAITTIME macro defined in the header file CG_rtc h larger Example Below is an example of reading the counter value of the real time counter CG_main c include Ce Tee i void main void struct RTCCounterValue counterreadval RTC CounterEnable Start count RTC_CounterGet amp counterreadval Read count value R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 253 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPEN
37. PGAFACTOR2 x16 PGAFACTOR3 x32 Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 190 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Starts the operation of operational amplifier single AMP mode Classification CG_opamp c Syntax void AMP_Start void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 191 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AMP_Stop Ends the operation of operational amplifier single AMP mode Classification CG_opamp c Syntax void AMP Stop void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 192 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Starts the operation of operational amplifier n single AMP mode Classification CG_opamp c Syntax void AMPn_ Start void Remark nis the channel number Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 193 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AMPn_Stop Ends the operation of operational amplifier n single AMP mode Classification CG_opamp c Syntax void AMPn Stop void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Re
38. PITI GAHI G AP 1 C PLL S110 AK 19 AP OUT Oe 21 Pid Ros PL 30K 10 Ad yA I PIB TOHI C PIJ ATPL G PLT T 160 Td C PIS TOH 1 VAT PS De Pal ATP2 TOMLC The following items are explained here How to open Description of each area File menu Device Top View panel dedicated items Help menu Device Top View panel dedicated items Context menu How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View From the View menu select Pin Configurator gt gt Device Top View Remark In the Property panel on the Pin Configurator Settings tab if BGA is selected for the Package type then this panel cannot be opened R20UT0006EJ0100 Rev 1 00 tENESAS Page 71 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Description of each area 1 Toolbar This area consists of the following buttons ye Clicks this button to enable changing of the display in the Device top view area by drag and drop By pressing this button the shape of the mouse cursor in the Device top view area changes from the arrow to the hand Clicks this button to enable moving external peripheral components in the Device top view area to arbitrary locations and select pins By pressing this button the shape of the mouse cursor which has changed into the hand by pressing the button re
39. PRS MHz Internal low speed oscillation clack ILI setting Can be stopped by software Option byte Stop Frequency kHz RESET pin setting Unused Used P125 The following items are explained here How to open Description of each area File menu Code Generator panel dedicated items Help menu Code Generator panel dedicated items How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral func tion node System Port etc Remark _ If this panel is already open pressing a different peripheral function button E S etc changes the content displayed in the Information setting area accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 74 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Description of each area 1 Toolbar This area consists of the following peripheral function buttons When there is peripheral function target microcontroller is not supporting peripheral functionbutton is not disokayed Reflects settings made on this panel in the Device Pin List panel This button will be grayed out disabled if Not reflected is selected in the PinPart Combination Mode category of the Generation tab Generate Code Outputs the source code device driver program to the folder specified by selecting Generation tab gt gt Output folder in the Property panel
40. RTC _RTCCL_OutputEnable 272 UART6 Userlnit 148 RTC_RTCDIV_OutputDisable 275 System 77 RTC _RTCDIV_OutputEnable 274 System 116 RTC _SetHourSystem 249 CG_ChangeClockMode 120 RTC_Userlnit 245 CG_ChangeFrequency 122 R20UT0006EJ0100 Rev 1 00 tENESAS Page 294 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX D INDEX CG_ChangePllMode 126 CG_ReadResetSource 119 CG_SelectPowerSaveMode 123 CG_SelectStabTime 125 CLOCK Init 117 CLOCK Userlnit 118 T Timer 84 Timer 210 TMOO ChangeDuty 225 TMO0O_ChangeTimerCondition 222 TMOO_GetFreeRunningValue 223 TMOO GetPulseWidth 226 TMOO Init 218 TMOO_SoftwareTriggerOn 224 TMOO_ Start 220 TMOO_ Stop 221 TMOO_Userlnit 219 TM5n_ChangeDuty 232 TM5n_ChangeTimerCondition 231 TM5n_Init 227 TM5n_Start 229 TM5n_Stop 230 TM5n_UserlInit 228 TMH1_CarrierOutputDisable 240 TMH1_CarrierOutputEnable 239 TMHn_ChangeDuty 238 TMHn_ChangeTimerCondition 237 TMHn_ Init 233 TMHn_ Start 235 TMHn_Stop 236 TMHn_UserlInit 234 TMX_DisableHighlmpedanceState 217 TMX_EnableHighImpedanceState 216 TMX_Init 211 TMXn_ChangeDualDuty 215 TMXn_ChangeDuty 214 TMXn_Start 212 TMXn_Stop 213 TMO0O ChangeDuty 225 TMOO_ChangeTimerCondition 222 TMOO_GetFreeRunningValue 223 TMOO GetPulseWidth 226 TMOO Init 218 T
41. RTC_IntervalStop RTC_IntervallnterruptEnable RTC_IntervallnterruptDisable RTC_RTC1HZ_OutputEnable RTC_RTC1HZ_OutputDisable RTC_RTCCL_OutputEnable RTC_RTCCL_OutputDisable RTC_RTCDIV_OutputEnable RTC _RTCDIV_OutputDisable RTC_ChangeCorrectionValue CG_rtc_user c MD_INTRTC MD_INTRTCI R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 106 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included RTC CG_rtc_user c RTC _Userlnit RTC_ConstPeriodinterruptCallback RTC_AlarmInterruptCalloack come Clock Output CG_pcl c PCL_Init PCL Start PCL_Stop PCL_ChangeFreq CG_pcl_user c PCL_Userlnit LVI CG_lvi c LVI_Init LVI_InterruptModeStart LVI_ResetModeStart LVI_Stop LVI SetLVILevel CG_lvi_user c MD_INTLVI LVI Userlnit R20UTO006EJ0100 Rev 1 00 tENESAS Page 107 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS APPENDIX C API FUNCTIONS This appendix describes the API functions output by Code Generator C 1 Overview Below are the naming conventions for API functions output by Code Generator Macro names are in ALL CAPS The number in front of the macro name is a hexadecimal value this is the same value as the macro value Local variable names are in all lower case Global variable names start with a g and use Camel Case Names of pointers to local variables start with a p and are in all lower case Names
42. _Ivi c Syntax include CG mMacrodriver h OG vast include MD STATUS LVI _SetLVILevel enum LVILevel level Argumeni s enum LVILevel level Voltage level to detect as low voltage LVILEVELO LVILEVEL1 LVILEVEL2 LVILEVELS3 LVILEVEL4 LVILEVEL5 LVILEVEL6 LVILEVEL7 LVILEVEL8 LVILEVEL9 4 22V 0 1V 407V 0 1V 3 92V 0 1V 3 76V 0 1V 3 61V 0 1V 3 45V 0 1V 3 30 V 0 1V 3 15V 0 1V 2 99V 0 1V 2 84V 0 1V LVILEVEL10 LVILEVEL11 LVILEVEL12 LVILEVEL13 LVILEVEL14 LVILEVEL15 2 68V 0 1V 2 53V 0 1V 2 38V 0 1V 2 22V 0 1V 2 07V 0 1V 1 91V 0 1V Remark LVILEVEL10 to LVILEVEL15 can only be specified when the target device is a 78KO Kx2 L Return value MD_OK Normal completion MD ERROR Exit with error abend The target of low voltage detection is external input voltage EXLVI from the external input pin MD_ARGERROR Invalid argument specification R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 289 of 300 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Remark The value MD ERROR will only be returned when the target device is a 78KO KB2 L or 78KO KC2 L R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 290 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX D INDEX A A D 83 A D 200 AD_ComparatorOff 204 AD_ComparatorOn 203 AD_Init 201 AD_Read 208 AD_ReadByte 209 AD_SelectADChannel 207 AD_ Start 205 AD_Stop 206 A
43. not reflect Code Generator panel settings in the Device Pin List panel Remark If Not reflected is selected then the Fi Reflect in Fin button will be grayed out deselected R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 60 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Macro Setting tab This tab allows you to view the information Macro Information on and change the setting for the peripheral function node System Port etc selected in the Project Tree panel or the peripheral function button E k etc pressed in the Code Generator panel Figure A 9 Macro Setting Tab Property i system Property E Macro Information Macro name Macro name Macro name of selected macro Macro Setting The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral func tion node System Port etc and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral func tion node System Port etc and then select Property from the context menu Remarks 1 _ If this panel is already open selecting a different peripheral function node System Port etc in the Project Tree panel changes the content disp
44. of pins for which the purpose has been set by other peripheral functions R20UT0006EJ0100 Rev 1 00 tENESAS Page 67 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE b Second layer Displays the pin number of the pin Function This area allows you to select which function to use when the pin has more than one functions This area allows you to select the I O mode of the pin N ch This area allows you to select which output mode to apply when using the pin in the output mode This area allows you to assign a user defined pin name to the pin Displays the summary of function of the pin Recommend Connection For Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Function column Attention Displays the precaution on using the pin External Parts This area is for selecting which external peripheral controller to connect the pin to Remarks 1 You cannot add information in the Macro Name Total Used Used by other function Pin Number Pin Name Description Recommend Connection For Unused and Attention col umns because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins
45. opens by pressing the button in the upper left corner of the device pin list R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 66 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Macro tab This tab displays information on each pin of the microcontroller in the order it was grouped into peripheral functions Figure A 13 Macro Tab Device Pin List Macro Name H Total H Used User 4 0 CGonverteri 400 On chip Debug Function OGO Port FORTI 2 3 wire Serial FOVW CSN 1 Powert POWER S bit Timer Event Counter OFT M50 Port APORT Port APORTA ee m mmm 1 iit Pin Number A External Peripheral DJ E E I ee OOo mp d Oo ee St IO a a ae a ees a ros es ee es es a Va The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller The device pin list in this area is organized in the order the pins were grouped into peripheral functions a First layer The following are the columns comprising the device pin list Used in Other Macro Displays the total number
46. ratio of the CPU clock peripheral hardware clock Classification CG_system c Syntax include CG macrodriver h include CG_system h MD_STATUS CG_ChangeFregquency enum CPUCLlock clock Argumeni s enum CPUClock clock Division ratio type SYSTEMCLOCK fMAIN SYSONEHALF fMAIN 2 SYSONEFOURTH fMAIN 4 SYSONEEIGHTH fMAIN 8 SYSONESIXTEENTH fMAIN 16 Remark fMAIN signifies the frequency of the main system clock Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 122 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_SelectPowerSaveMode Configures the CPU s standby function Classification CG_system c Syntax include CG macrodriver h include CG_system h MD STATUS CG_SelectPowerSaveMode enum PSLevel level Argumeni s enum PSLevel level Standby function type PSSTOP STOP mode PSHALT HALT mode Return value MD_OK Normal completion MD_ERROR Exit with error abend Kx2 L If the CPU is operating by XT1 clock then STOP mode cannot be specified MD_ARGERROR Invalid argument specification Remark The value MD ERROR will only be returned when the target device is a 78KO0 KC2 L Example Below is an example of changing the standby function to STOP mode CG_main c include CG macrodriver h include CG_system h void Main void
47. to detection of error in IICA master communication IICA_SlaveSendStart Starts IICA slave transmission IICA_SlaveReceiveStart Starts IICA slave reception ICA_Init Performs initialization of the serial interface IICA IICA_Userlnit Performs user defined initialization of the serial interface IICA R20UT0006EJ0100 Rev 1 00 tENESAS Page 145 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS ICA_SlaveSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_SlaveErrorCallback Performs processing in response to detection of error in IICA slave communication IICA_GetStopConditionCallback Performs processing in response to detection of stop condition in IICA slave communi cation R20UTO006EJ0100 Rev 1 00 tENESAS Page 146 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTE Init Performs initialization of the serial interface UART6 channel Classification CG_serial c Syntax void VARIG Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 147 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_Userlnit Performs user defined initialization of the serial interface UART6 Remark This API function is called as the UART
48. to generate the corresponding source code on a per API function basis by selecting Gener ate code Not generate code from the context menu displayed by right clicking the API function name in the Code Gener ator Preview panel Figure 3 7 Setting That Determines Whether or Not to Generate Source Code Code Generator Preview Eg File E e Common i CG maine Be Ee Be Be Be E CLECECCCccece T OG_lk dr T CG optionasm system Port INT er lal CIP AMP rD Timer Watchdog Timer RTG Clock Output LWI FE E EEE EE E EE E E E E E E E E E EE E EE E E E EE EE E E E E E EE E E EE E EE EE E E E E E EE E EE E E EE E X rill NEC Electronics Corporation 2009 z served by NEG Electronics Corporation should be used on your own responsibility Ics Corporation assumes no responsibility for any losses ustomers or third parties arising from the use of this file This device driver was created by GodeGenerator for TAKOK 2L Filename CG manc Obetract This file implements main function AFIlib GodeGenerator for TBKOKx2L E1 00c O5 May 2009 Device uPOFeFObSS 46 Compiler STFA Creation date 2009 0626 EEE EE E E E E E E E E E E E E E EE E EE E E E E E E E E E E E E E E E E E E E E E E E E E E E EE E E E E E E EE E 7 Fis EE Rae Remark You can confirm the current setting for the generation of source code by checking the type of icon in the Code Generator Preview panel Table 3 4 Setting
49. up WO4OS004 The tollowing pin conflicts have been detected You must change the setting in that module before you can Unused Ih use it for other purpose Pie Pi was used as AN Unused Oh O Ocut Pull up Pia Unused Th O Out Pull up lt R20UT0006JJ0100 Rev 1 00 tENESAS Page 30 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 4 Confirm Source Code Confirm the source code device driver program that reflects the information configured as described in 3 3 Enter Information To confirm the source code use the Code Generator Preview panel that opens by selecting View menu gt gt Code Generator Preview Code Generator Preview Common CG manc T CG_systeminite F OG_macrodriverh F CG userdefineh OG kdr T cG optionasm System Port INT Ser lal Figure 3 4 Confirm Source Code Pe EEE EE EE E E E E E E E E E E E EE E EE E GG GCG E E E E E E E E E E E E E E E E E E E E EE E Copyrighti NEG Electronics Corporation 2009 All rights reserved by NEO Electronics Corporation This program should be used on your own responsibility WEG Electronics Corporation assumes no responsibility for any losses incurred by customers or third parties arising from the use of this file This device driver was created by GodeGenerator for SKORx2L Filename CG manc Obstract This tile impleme
50. 0 tENESAS Page 240 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 9 Watchdog Timer Below is a list of API functions output by Code Generator for watchdog timer use Table C 10 API Functions Watchdog Timer WDT_Restart Clears the watchdog timer counter and resumes counting R20UTO006EJ0100 Rev 1 00 tENESAS Page 241 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS WDT_Restart Clears the watchdog timer counter and resumes counting Classification CG_wdt c Syntax void WDT_Restart void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 242 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 10 RTC Below is a list of API functions output by Code Generator for real time counter use Table C 11 API Functions RTC RTC _CounterEnable Starts the count of the real time counter year month weekday day hour minute sec ond RTC_CounterDisable Ends the count of the real time counter year month weekday day hour minute sec ond RTC_SetHourSystem Sets the clock type 12 hour or 24 hour clock of the real time counter RTC_CounterSet Sets the counter value year month weekday day hour minute second of the real time counter RTC_CounterGet Reads the counter value year month weekday day hour minute second of the real time counter RTC_ConstPeriodIinterruptDisabl
51. 1 00 tENESAS Page 72 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 1 When a pin is right clicked Use as If the pin has multiple functions select which function to use Connect to External Peripheral Selects which external peripheral controller to connect the pin to 2 When an external peripheral controller is right clocked Delete External Peripheral Removes the external peripheral controller R20UT0006EJ0100 Rev 1 00 tENESAS Page 73 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Code Generator panel This panel allows you to configure the information necessary to control the peripheral functions provided by the micro controller Figure A 16 Code Generator Panel System Code Generator 1 Generate Code sie ge 7 On Gi BE Power voltage VOD setting a7 AA s VOD lt 55 A O18 s VOD lt 27 0 Main system clock selection Internal high speed oscillation fH High speed system clock fH Internal hieh speed oscillation clock setting Operation Frequency MHz High speed system clock setting Xi oscillation i External clock input fEXOLE Frequency MHz Stable time 1310720 21 6 T t iuz Subsystem clock fSUB setting Operation ATI oscillation AT External clock input EXOLKS Frequency kHz AT oscillator oscillation mode selection CPU and peripheral clock setting GPU clock CPL kHz Peripheral hardware clock
52. 1 40 APPENDIX C API FUNCTIONS TMXn_ChangeDuty Changes the duty ratio of the PWM signal single output to the TOXn pin Remark This API function can only be called when the 16 bit timer Xn is being used for single output Classification CG_timer c Syntax include CG macrodriver h void TMXn_ChangeDuty UCHAR ratio Remark nis the channel number Argumeni s Remark The value set to duty ratio ratio must be in base 10 notation Return value None Example The example below shows changing the duty ratio to 25 CG_main c include CG macrodriver hi void main void 4 UCHAR ratio 25 TMXO_Start Start count TMXO_ChangeDuty ratio Change duty ratio R20UTO006EJ0100 Rev 1 00 tENESAS Page 214 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMXn_ChangeDualDuty Changes the duty ratio of the PWM signal dual output to the TOXn pin Remark This API function can only be called when the 16 bit timer Xn is being used for dual output Classification CG_timer c Syntax include CG macrodriver h void TMXn_ChangeDualDuty UCHAR ratio UCHAR ratiol UCHAR delay Remark nis the channel number Argumeni s Remarks 1 The value set to duty ratio ratio ratio and delay must be in base 10 notation 2 The following figure displays the meaning of each argument Cycle lt lt R delay ratio
53. 1 40 APPENDIX C API FUNCTIONS PORT_ChangePmninput Switches the pin s I O mode from output mode to input mode Classification CG_port c Syntax The format for specifying this API function differs according to whether the target pin has built in pull up resistance a SMBus input buffer Built in pull up resistance none SMBus input buffer none void PORT_ChangePmnInput void Built in pull up resistance yes SUBus input buffer none include CG_macrodriver h void PORT_ChangePmniInput BOOL enablepu Built in pull up resistance yes SMBus input buffer yes include CG macrodriver h void PORT_ChangePmniInput BOOL enablepu BOOL enablesmbus Remark mnis the port number Argumeni s BOOL enablepu Built in pull up resistance used MD_TRUE Yes MD_FALSE No BOOL enablesmbus Input buffer type MD_TRUE SMBus input buffer MD_FALSE Normal input buffer Return value None Example 1 Below is shown an example where pin POO built in pull up resistance yes SMBus input buffer none is changed as follows I O mode type Input mode Built in pull up resistance used Yes R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 130 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_main c include CG macrodriver h void main void PORT_ChangePOOInput MD_TRUE Switch I O mode Example 2 Below is shown an example where pin POO built in pull up
54. 20 2 16T t tue Subsystem clock fSUB setting Operation TI oscillation X73 External clock input fEXCGLES Frequency kHz AT oscillator oscillation mode selection CPU and peripheral clock setting GPU clock CPL kHz Peripheral hardware clock fPRS MHz Internal low speed oscillation clack ILI setting Can be stopped by software Option byte Stop Frequency kHz RESET pin setting Unused Used P125 Remark If an unsupported microcontroller is defined in the project for Code Generator then Code Generator Design Tool node will hide under Project name Project in the Project Tree panel R20UT0006JJ0100 Rev 1 00 tENESAS Page 27 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 3 Enter Information Configure the information necessary to control the peripheral functions in the information setting area of the Code Gen erator panel which is opened as described in 3 2 Open Code Generator Panel Remark When controlling multiple peripheral functions repeat the procedures described in 3 2 Open Code Gener ator Panel through 3 3 Enter Information 3 3 1 Input rule Following is the rules for input to the Code Generator panel 1 Character set Character sets that are allowed to input are as follows Table 3 1 List of Character Set ASO 1 byte _1 byte alphabet number symbol _1 byte alphabet number symbol symbol JIS 2 byte alphabe
55. 213 0200 Fax 65 6278 8001 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 JIn Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia Tel 60 3 7955 9390 Fax 60 3 7955 9510 Renesas Electronics Korea Co Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 http www renesas com 2010 Renesas Electronics Corporation All rights reserved Colophon 1 0 CubeSuite Ver 1 40 CENESAS Renesas Electronics Corporation R20UTOO06EJ0100
56. 6_ nit callback routine Classification CG_serial_ user c Syntax void UART6_UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 148 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_ Start Sets UART communication to standby mode Classification CG_serial c Syntax void UART6_Start void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 149 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_Stop Ends UART communication Classification CG_serial c Syntax void UART6_Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 150 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_SendData Starts UART data transmission Remarks 1 This API function repeats the byte level UART transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum 2 When performing a UART transmission UART6_Siart must be called before this API function is called Classification CG_serial c Syntax include CG macrodri ver h MD STATUS UART6_SendData UCHAR txbuf USHORT txnum Argumeni s pI UCHAR exbut Pointer to a buffer storing the transmission data Remark You can only set 1 for the total txnum of the send
57. 80 s VOD lt 27 Main system clock selection Internal high speed oscillation fH High speed system clock fH Internal high speed oscillation clock setting Operation Frequency MHz High speed system clock setting 1 oscillation 3 External clock input GEXCGLE Frequency MHz Stable tine is Subsystem clack fSUB setting Meut wae tance Te Operation ATI oscillation AT External clock input GEXOLKS Frequency ATI oscillator oscillation mode selection Low power consumption CPU and peripheral clock setting GPU clock CPL kHz Peripheral hardware clock fPRS Internal low speed oscillation clack ILI setting Gan be stopped by software Option byte Stop Frequency kHz RESET pin setting Unused Used P125 R20UT0006JJ0100 Rev 1 00 tENESAS Page 29 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 3 3 Icon indicating pin conflict If a conflict occurs between the pins while setting various peripheral functions in the Code Generator panel the icon is displayed at the location where the conflict occurs to warn the user of a conflict between the pins Remark Ifthe mouse cursor is moved over the T icon information regarding the conflict between the pins tips for avoiding the conflict popups Figure 3 3 Icon Indicating Pin Conflict Code Generator Unused Oh g O Out g Pull
58. APPENDIX C API FUNCTIONS lICA_StopCondition Generates stop conditions Classification CG_serial c Syntax void IICA_StopCondition void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 175 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO Remark This API function is called as the callback routine of interrupt process MD_INTIICAO corresponding to the IICA communication complete interrupt INTIICAO Classification CG_serial_user c Syntax void IIcA_MasterSendEndCallback void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 176 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO Remark This API function is called as the callback routine of interrupt process MD_INTIICAO corresponding to the IICA communication complete interrupt INTIICAO Classification CG_serial_user c Syntax void IIcA_MasterReceiveEndCallback void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 177 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_MasterErrorCallback Performs processing in res
59. DIV_OutputDisable 275 CSlin_Stop 163 RTC_RTCDIV_OutputEnable 274 CSlin_Userlnit 161 RTC _SetHourSystem 249 IICA_GetStopConditionCallback 184 RTC_Userlnit 245 ICA _Init 170 RTC_AlarmDisable 259 IICA_MasterErrorCallback 178 RTC_AlarmEnable 258 IICA_MasterReceiveEndCallback 177 RTC_AlarmGet 263 IICA_MasterReceiveStart 174 RTC_AlarminterruptCallback 264 IICA_MasterSendEndCallback 176 RTC_AlarmSet 260 IICA_MasterSendStart 173 RTC_ChangeCorrectionValue 276 IICA_SlaveErrorCallback 183 RTC_ConstPeriodinterruptCallback 257 IICA_SlaveReceiveEndCallback 182 RTC_ConstPeriodIinterruptDisable 256 IICA_SlaveReceiveStart 180 RTC_ConstPeriodinterruptEnable 255 IICA_SlaveSendEndCallback 181 RTC _CounterDisable 248 IICA_SlaveSendStart 179 RTC_CounterEnable 247 IICA_Stop 172 RTC_CounterGet 253 IICA_StopCondition 175 RTC _CounterSet 251 IICA Userlnit 171 RTC_Init 244 UART6_ErrorCallback 158 RTC_IntervallnterruptDisable 269 UART6 Init 147 RTC_IntervallnterruptEnable 267 UART6_ReceiveData 153 RTC_IntervalStart 265 UART6_ReceiveEndCallback 156 RTC_IntervalStop 266 UART6 SendData 151 RTC_PowerOff 246 UART6_SendEndCallback 155 RTC_RTC1HZ_OutputDisable 271 UART6_SoftOverRunCallback 157 RTC_RTC1HZ_OutputEnable 270 UART6 Start 149 RTC _RTCCL_OutputDisable 273 UART6_ Stop 150
60. DIX B OUTPUT FILES APPENDIX C API FUNCTIONS APPENDIX D INDEX How to Read This Manual It is assumed that the readers of this manual have general knowledge of electricity logic circuits and microcontrollers Conventions Data significance Higher digits on the left and lower digits on the right Active low representation XXX overscore over pin or signal name Note Footnote for item marked with Note in the text Caution Information requiring particular attention Remark Supplementary information Numeric representation Decimal XXXX Hexadecimal OXXXXX Related Documents The related documents indicated in this publication may include preliminary versions However preliminary versions are not marked as such Integrated Development Environment R20UTO267E V 50 Debug Caution The related documents listed above are subject to change without notice Be sure to use the latest edition of each document when designing All trademarks or registered trademarks in this document are the property of their respective owners MEMO MEMO MEMO TABLE OF CONTENTS CHAPTER 1 GENERAL 10 1 1 Overview 10 1 2 Features 10 CHAPTER 2 FUNCTIONS Pin Configurator 11 2 1 Overview 11 2 2 Open Device Pin List Panel 13 2 2 1 Select item 14 2 2 2 Change display order 15 2 2 3 Add column 16 2 2 4 Delete column 17 2 3 Open Device Top View Panel 18 2 3 1 Select shape of microcontroller
61. DIX C API FUNCTIONS R20UTO006EJ0100 Rev 1 00 tENESAS Page 254 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_ConstPeriodinterruptEnable Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function Classification CG_rtc c Syntax include CG ree MD_STATUS RTC_ConstPeriodInterruptEnable enum RTCINTPeriod period Argumeni s enum RTCINTPeriod period Interrupt INTRTC cycle HALFSEC 0 5 seconds ONESEC 1 second ONEMIN 1 minute ONEHOUR 1 hour ONEDAY 1 day ONEMONTH 1 month Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of setting the cycle of the interrupts INTRTC then starting the cyclic interrupt function CG_main c include CG Tree ah void main void RTC_ConstPeriodinterruptDisable End of cyclic interrupt function RIC ConstPeriodinterrupthnable HALFSEC Start of cyclic interrupt function R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 255 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_ConstPeriodIinterruptDisable Ends the cyclic interrupt function Classification CG_rtc c Syntax void RTC_ConstPeriodInterruptDisable void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 256 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS
62. DIX C API FUNCTIONS Example 2 The example below shows the alarm conditions being set to Saturday Sunday time left unchanged CG_main c include CG_rtce h void main void struct RTCAlarmValue alarmval RTC_AlarmEnable Start alarm interrupt function RTC_AlarmSet alarmval Change conditions R20UTOOO6EJ0100 Rev 1 00 2CENESAS Page 262 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarmGet Reads the alarm conditions weekday hour minute Classification CG_rtc c Syntax include COG roe void RTC_AlarmGet struct RTCAlarmValue alarmval Remark See RIC AlarmSet for details about RTCAlarmValue alarm conditions Argumeni s ES struct RTCAlarmValue alarmval Pointer to structure in which to store the conditions being read Return value None Example The example below shows the alarm conditions being read CG_main c include CG Fre hi void main void struct RTCAlarmValue alarmval RTC_AlarmEnable Start alarm interrupt function RTC_AlarmGet amp alarmval Read conditions R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 263 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarminterruptCallback Performs processing in response to the alarm interrupt INTRTC Remark This API function is called as the callback routine of interrupt process MD_INTRTC correspond
63. D_ReadByte Reads the results of A D conversion 8 bits most signif icant 8 bits of 10 bit resolution Timer TMX_Init Performs initialization necessary to control 16 bit timer Xn functions TMXn_ Start Starts the count for 16 bit timer Xn TMXn_Stop Ends the count for 16 bit timer Xn TMXn_ChangeDuty Changes the duty ratio of the PWM signal single output to the TOXOn pin TMXn_ChangeDualDuty Changes the duty ratio of the PWM signal dulal output to the TOXOn pin TMX_EnableHighImpedanceState Begins high impedance output of the 16 bit timer Xn TMX_DisableHighImpedanceState Ends high impedance output of the 16 bit timer Xn TMOO_ Init Performs initialization necessary to control 16 bit timer event counter 00 functions TMOO_User Init Performs user defined initialization relating to the 16 bit timer event counter 00 TMOO_ Start Starts the count for 16 bit timer event counter 00 TMOO_ Stop Ends the count for 16 bit timer event counter 00 TMO0O_ChangeTimerCondition Changes the value of capture compare control register 00 CRCOO TMO0O_GetFreeRunningValue Captures the content of the capture register CROn0 TMO0_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output TMO00O_ChangeDuty _ the duty ratio of the signal output to the TOOO TMOO_GetPulseWidth Captures the high low level width measured for the sig nal pulses input to the TIOnO pin TM5n_Init Performs initialization necessary t
64. D_Userlnit 202 AD_ComparatorOff 204 AD_ComparatorOn 203 AD_Init 201 AD_Read 208 AD_ReadByte 209 AD_SelectADChannel 207 AD_Start 205 AD_Stop 206 AD_Userlnit 202 All Output Messages tab 94 AMPn_Start 193 AMPn_Stop 194 AMP_ Start 191 AMP_Stop 192 API functions 108 A D 200 Clock Output 277 Comparator 195 INT 134 LVI 283 Operational Amplifier 185 Port 127 RTC 243 Serial 145 System 116 Timer 210 APPENDIX D INDEX Watchdog Timer 241 B Browse For Folder dialog box 100 C CG_ChangeClockMode 120 CG_ChangeFrequency 122 CG_ChangePllMode 126 CG_ReadResetSource 119 CG_SelectPowerSaveMode 123 CG_SelectStabTime 125 CLOCK_Init 117 Clock Output 87 Clock Output 277 PCL_ChangeFreg 282 PCL Init 278 PCL Start 280 PCL_Stop 281 PCL Userlnit 279 CLOCK Userlnit 118 Code Generator panel 74 A D 83 Clock Output 87 Comparator 82 INT 79 LVI 88 Operational Amplifier 81 Port 78 RTC 86 Serial 80 System 77 Timer 84 Watchdog Timer 85 Code Generator Preview panel 89 Code Generator tab 95 Column Chooser dialog box 96 Comparator 82 R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 291 of 300 CubeSuite Ver 1 40 APPENDIX D INDEX Comparator
65. El Package Package type GC Version Pin configurator version information Pin Configurator Settings Fi The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the context menu Remark If this panel is already open selecting a different Pin Configurator Design Tool in the Project Tree panel changes the content displayed accordingly Description of each area 1 Product Information category This area displays product information Version and Release date on Pin Configurator Version Displays the version of Pin Configurator Release date Displays the release date of Pin Configurator 2 Use of Pin Configurator Panels category Select whether to show the Device Pin List panel and Device Top View panel R20UT0006EJ0100 Rev 1 00 tENESAS Page 52 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Selects whether to display the Device Pin List panel and Device Top View panel in Use pin configurator panels the Main window the next time this project is opened Displays the Device Pin List panel and Device Top View panel Hides the Device Pin List panel and De
66. FFICES Renesas Electronics Corporation Refer to http www renesas com for the latest and detailed information Renesas Electronics America Inc 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 Dusseldorf Germany Tel 49 211 65030 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Tel 86 21 5877 1818 Fax 86 21 6887 7858 7898 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 7F No 363 Fu Shing North Road Taipei Taiwan Tel 886 2 8175 9600 Fax 886 2 8175 9670 Renesas Electronics Singapore Pte Ltd 1 harbourFront Avenue 06 10 keppel Bay Tower Singapore 098632 Tel 65 6
67. ICA_MasterSendStart Starts IICA master transmission Remark This API function repeats the byte level IICA master transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum Classification CG_serial c Syntax include CG_macrodriver h MD_STATUS ITICA_MasterSendStart UCHAR adr UCHAR txbuf USHORT txnum UCHAR wait Argument s pee e Ci ee e eee eee enee UCHAR wait Setup time of start conditions Return value MD_OK Normal completion MD_ERROR1 Bus communication status MD_ERROR2 Bus not released status R20UT0006EJ0100 Rev 1 00 tENESAS Page 173 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA_MasterReceiveStart Starts IICA master reception Remark This API function performs byte level IICA master reception the number of times specified by the parameter rxnum and stores the data in the buffer specified by the parameter rxbuf Classification CG_serial c Syntax include CG_macrodriver h MD_STATUS IICA MasterReceiveStart UCHAR adr UCHAR rxbuf USHORT rxnum UCHAR wait Argument s pee e o pe e eeose eee eneee o UCHAR wait Setup time of start conditions Return value MD_OK Normal completion MD_ERROR1 Bus communication status MD_ERROR2 Bus not released status R20UT0006EJ0100 Rev 1 00 tENESAS Page 174 of 300 Sep 01 2010 CubeSuite Ver 1 40
68. JJ0100 Rev 1 00 tENESAS Page 16 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 4 Delete column The Pin Configurator is used to delete the user s own column from the device pin list using the Delete Column button in the Column Chooser dialog box that opens by pressing the EF button in the upper left corner of the device pin list To delete a column select the column you want to delete in the displayed item selection area of the Column Chooser dialog box and press the Delete Column button Figure 2 5 Delete Column Column Chooser x Pin Number Pin Hame Function LO H ch Define Name Description Recommend Connection For Unused Attention External Peripheral Hew Column New Column Column Delete Colum Remark You can only delete the column which you added using the New Column dialog box R20UT0006JJ0100 Rev 1 00 tENESAS Page 17 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 Open Device Top View Panel Open the Device Top View panel where you can confirm the information entered for the pins of the microcontroller To open the Device Top View panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View in the Project Tree panel Figure 2 6 Open Device Top View Panel Device Top View l 4 F PIZI X TOOLGd Ch P23 ia EGLE TI Ch PgR TEGL RTO SCKI I
69. MOO_SoftwareTriggerOn 224 TMOO_ Start 220 TMOO_ Stop 221 TMOO_ Userlnit 219 TM5n_ChangeDuty 232 TM5n_ChangeTimerCondition 231 TM5n_Init 227 TM5n_Start 229 TM5n_Stop 230 TM5n_UserlInit 228 TMH1_CarrierOutputDisable 240 TMH1_CarrierOutputEnable 239 TMHn_ChangeDuty 238 TMHn_ChangeTimerCondition 237 TMHn_Init 233 TMHn_ Start 235 TMHn_Stop 236 TMHn_UserlInit 234 TMX_DisableHighImpedanceState 217 TMX_EnableHighImpedanceState 216 TMX_Init 211 TMXn_ChangeDualDuty 215 TMXn_ChangeDuty 214 TMXn_Start 212 TMXn_Stop 213 U UART6_ErrorCallback 158 UART6 Init 147 UART6 ReceiveData 153 UART6_ReceiveEndCallback 156 UART6 SendData 151 UART6_SendEndCallback 155 UART6_SoftOverRunCallback 157 UART6 Start 149 UART6_Stop 150 UART6_Userlnit 148 R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 295 of 300 CubeSuite Ver 1 40 APPENDIX D INDEX W Watchdog Timer 85 Watchdog Timer 241 WDT_ Restart 242 WDT_Restart 242 Window reference 42 R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 296 of 300 Sep 01 2010 Revision Record Description Sep 01 2010 Sep 01 2010 2010 P First Edition issued CubeSuite Ver 1 40 User s Manual 78KO Design Publication Date Rev 1 00 Sep 1 2010 Published by Renesas Electronics Corporation CENESAS SALES O
70. OPAMP Device uPOFSFOb88 48 4D Compiler CATEKO Timer Creation date 2000 06 26 Watchdog Timer DEEE E E EE EEE E E E E E E E EE E E E E E E EE E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E RTG k Clock Output LWI fe Remark To restore the default file name defined by Code Generator select Default from the context menu R20UT0006JJ0100 Rev 1 00 tENESAS Page 34 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 3 Change API function name The Code Generator is used to change the name of the API function by selecting Rename from the context menu dis played by right clicking the API function name in the Code Generator Preview panel Code Generator Preview El File Ehei Common E f CG_maine 5 g OG aU ay ar OG_ mac CG lk dr T CG_option asm System Port INT Serial OPAMP A D Timer Watchdog Timer RIG Glock Output LVI Figure 3 9 Change API Function Name m Compiler a OO OO OO OO at ot o ai e e a Copyrighti NEG Electronics Corporation 2009 ft All rights reserved by NEO Electronics Corporation wogram should be used on your own responsibility lectronics Corporation assumes no responsibility for any losses ed by customers or third parties arising from the use of this file This device driver was created by GodeG
71. P_ Init Performs initialization necessary to control operational amplifier functions OPAMP_Userlnit Performs user defined initialization relating to the operational amplifier PGA_ Start Starts the operation of operational amplifier PGA mode PGA_Stop Ends the operation of operational amplifier PGA mode Sets the input voltage amplification factor of a operational amplifier PGA mode AMP_ Start Starts the operation of operational amplifier single AMP mode AMP_Stop Ends the operation of operational amplifier single AMP mode AMPn_ Start Starts the operation of operational amplifier n single AMP mode AMPn_Stop Ends the operation of operational amplifier n single AMP mode Comparator Comparator_Init Performs initialization necessary to control comparator functions PGA_ChangePGAFactor Comparator_Userlnit Performs user defined initialization relating to the com parator Comparatorn_ Start Starts the operation of comparator n Comparatorn_Stop Ends the operation of comparator n R20UT0006EJ0100 Rev 1 00 tENESAS Page 110 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_ Init Performs initialization necessary to control A D con verter functions AD_Userlnit Performs user defined initialization relating to the A D converter AD_SelectADChannel Configures the analog voltage input pin for A D conver sion AD_Read Reads the results of A D conversion 10 bits A
72. Pin function Attention only Not display Tooltip Select contents displayed in the toal tip Device Top Yiew Settings Remark Popup information is selected from the following four types Table 2 3 Select Popup Information Display all Displays the Description Recommend Connection For Unused and Attention strings for the device pin list Description recommended con Displays the Description and Recommend Connection For nection for unused pin only Unused string for the device pin list Attention only Displays the Attention string for the device pin list Not display Hides tooltips when the mouse cursor hovers over a pin R20UT0006JJ0100 Rev 1 00 tENESAS Page 21 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 4 Select additional information Select the type of information to display in Pin area in the Device Top View panel opened in 2 3 Open Device Top View Panel Note that additional information is selected from the Property panel on the Device Top View Settings tab by selecting the corresponding information under Pin Name Display Figure 2 10 Select Additional Information Property af Device Top View Property El Color Power ping Red Special ping Green Unused pins Black Used ping Blue Device Light ray Highlight Red Macro highlight Yellow External peripheral highlight i Green Tool Tip Tool tip Display all Pin Name Display Detine nam
73. S Page 118 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG _ReadResetSource Performs processing in response to RESET signal Classification CG_system_user c Syntax void CG_ReadResetSource void Argument s None Return value None Example Below are examples of the different processes executing depending on the RESET signal trigger CG_Systeminit c void systeminit void CG_ReadResetSource Processes executed by RESET signal trigger CG_system_user c include CG _macrodriver h void CG_ReadResetSource void UCHAR flag RESF Reset control flag register Obtain RESF contents if flag amp Oxl Trigger identification Check LVIRF flag Internal reset request by low voltage detector else if flag amp 0x10 Trigger identification Check WDTRF flag Internal reset request by watchdog timer R20UTO006EJ0100 Rev 1 00 tENESAS Page 119 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_ChangeClockMode Changes the CPU clock peripheral hardware clock Classification CG_system c Syntax include CG macrodriver h include CG_system h MD_STATUS CG_ChangeClockMode enum ClockMode mode Argumeni s enum ClockMode mode CPU clock fCPU peripheral hardware clock fPRS type HIOCLK fCPU fPRS gt gt Internal high speed oscillation clock HIOSYSCLK
74. Suite Figure A 32 Code Generator Tab F fd i i The following items are explained here How to open Description of each area How to open From the View menu select Output Description of each area 1 Message area This area displays only operation logs for Code Generator out of those for various components design tool build tool etc provided by CubeSuite The following table displays the meaning of the color of the message text displayed in this area Table A 6 Color of Message Text Background Black White Information message Displayed with information notices Blue Standard Color Warning message Displayed with warnings about operations Red LightGray Fatal error message Displayed when there is a fatal error or when execution is not possible due to a operational mistake R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 95 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Column Chooser dialog box This dialog box allows you to choose whether or not to display the item listed in this dialog box in the device pin list and add columns to or delete columns from the device pin list Figure A 33 Column Chooser Dialog Box Column Chooser Ed of Fin Humber Fin Hame Function LO H ch Define Name Description Recommend Connection For Unused Atenton L E E A A Cs Es External Feripheral Function buttons d Column Delete Colum Defaul
75. Suite Ver 1 40 APPENDIX C API FUNCTIONS PCL Stop Ends clock output Classification CG_pcl c Syntax void PCL_Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 281 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCL_ChangeFreq Changes the output clock to the PCL pin Remark The value specified in parameter clock is set to clock output select register CKS Classification CG_pcl c Syntax include CG pelbuz Jp MD_STATUS PCL_ChangeFregq enum PCLclock clock Argumeni s enum PCLclock clock Output clock type FPRS fPRS FPRS2 fPRS 2 FPRS4 fPRS 4 FPRS8 fPRS 8 FPRS16 fPRS 16 FPRS32 fPRS 2048 FPRS64 fPRS 4096 FPRS128 fPRS 8192 SUBCLOCK fSUB Remark fPRS is the main system clock frequency fSUB is the subsystem clock frequency Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 282 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 12 LVI Below is a list of API functions output by Code Generator for low voltage detector use Table C 13 API Functions LVI LVI_ResetModeStart Starts low voltage detection when in internal reset mode LVI Stop Stops low voltage detection LVI SetLVILevel Sets the low voltage detection level R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 283 of 300 Sep 01
76. That Determines Whether or Not to Generate Source Code Source code for the currently selected API function is gener ated If this icon is displayed next to the API function the correspond ing source T must be generated it is impossible to change the icon to E a Source code for the currently selected API function is gener ated Source code for the currently selected API function is not gen erated R20UTOO06JJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 33 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 2 Change file name The Code Generator is used to change the file name by selecting Rename from the context menu displayed by right clicking the file name in the Code Generator Preview panel Figure 3 8 Change File Name Code Generator Preview El File fx I ia Common a OO OO OO OO OO at ot o ai a a H g G_maianc yrightiG NEC Electronics Corporation 2009 tl g GF Ehta reserved by NEG Electronics Corporation i g Gid Default program should be used on your own responsibility a g OG Electronics Corporation assumes no responsibility for any losses g CGJ Properties rred by customers or third parties arising from the use of this file S gi CGn ASET E system This device driver was created by GodeGenerator for SRKORx2L Port Filename OG mainc INT Obstract This tile implements main function Serial APTlib CodeGenerator for TAKOK 2L E1 00c O05 May 2009
77. The register to change 1 CROOO 2 CROOO CRO10 Return value MD_OK Normal completion MD_ERROR Invalid argument array_num specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 222 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_GetFreeRunningValue Captures the content of the capture register CROn0 Remark This API function can only be called when the 16 bit timer event counter 00 is running in free running timer mode and the 16 bit timer capture compare control register OnO CROn0 is being used as a capture regis ter Classification CG_timer c Syntax include CG macrodriver h include OG timer i MD STATUS TMOO_GetFreeRunningValue ULONG count enum TMChannel channel Argumeni s o Ramen Co Pointer to area in which to store the captured value enum TMChannel channel The pin to capture TMCHANNELO T1000 pin TMCHANNEL1 T1010 pin Return value MD MDK Normal completion MD_ 2 Exit with error abend CROn0 is operating as a compare register MD MD_ARGERROR Invalid argument specification R20UT0006EJ0100 Rev 1 00 tENESAS Page 223 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output Remark This API function can only be called when the 16 bit timer event counter 00 is being used for one shot pulse output Classificatio
78. Tool gt gt Operational Amplifier Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 81 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Comparator This panel allows you to configure the information necessary to control the functions of comparator provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 22 Example of Comparator Operation setting O Unused Used Comparator setting Use comparator Use comparator Use comparator Internal reference voltage setting DAO internal reference voltage DAL internal reference voltage DA internal reference voltage Comparator setting Reference voltage selection Enable noise elimination ns Se amp gt Ss Forward output O Reversal output Comparator setting Reference voltage selection DAO et Enable noise elimination ns Forward output O Reversal output Comparator setting Reference voltage selection Enable noise elimination 500 AFPR inal Forward output O Reversal output Interrupt setting When detecting the valid edge of the comparator output generate an interrupt NTCMPO Walide edge detection Falling edge a Priority Lowy et When detecting the valid e
79. _Userlnit Comparator CG_comparator c Comparator _lnit Comparatorn_ Start Comparatorn_ Stop CG_comparator_user c MD_INTCMPn Comparator Userlnit a A D CG_ad c AD_Init AD_ComparatorOn AD_ComparatorOff AD_ Start AD_ Stop AD_SelectADChannel AD_Read AD_ReadByte CG_ad_user c MD_INTAD AD_UserInit Timer CG_timer c TMX_Init TMXn_ Start TMXn_Stop TMXn_ChangeDuty TMXn_ChangeDualDuty TMX_EnableHighImpedanceState TMX_DisableHighImpedanceState TMOO_Init TMOO_ Start TMO0O0_ Stop TMO0O_ChangeTimerCondition TMOO_GetFreeRunningValue TMOO_SoftwareTriggerOn TMO00O_ChangeDuty TMOO_GetPulseWidth TM5n_Init TM5n_ Start R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 105 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included Timer CG_timer c TM5n_Stop TM5n_ChangeTimerCondition TM5n_ChangeDuty TMHn_ Init TMHn_ Start TMHn_Stop TMHn_ChangeTimerCondition TMHn_ChangeDuty TMH1_CarrierOutputEnable TMH1_CarrierOutputDisable CG_timer_user c MD_INTTMXn MD_INTTMOn0d MD_INTTM5n MD_INTMHn TMOO_UserlInit TM5n_Userlnit TMHn_UserInit Watchdog Timer CG_wdt c WDT_Restart RTC CG_rtc c RTC_Init RTC_PowerOff RTC_CounterEnable RTC_CounterDisable RTC_SetHourSystem RTC_CounterSet RTC_CounterGet RTC_ConstPeriodinterruptEnable RTC_ConstPeriodinterruptDisable RTC_AlarmEnable RTC_AlarmDisable RTC_AlarmSet RTC_AlarmGet RTC_IntervalStart
80. al high speed oscillation 1H High speed system clock fH Internal high speed oscillation clock setting Operation Frequency MHz High speed system clock setting 1 oscillation 3 External clack input GEXOLE Frequency MHz Stable time 13107 20 2 16t us Internal low speed oscillation clock LIL setting Gan be stopped by software Option byte Stop Frequency kHz CPU and peripheral clock setting Main system clock FAP MHz GPU clock GPL kHz Peripheral hardware clock fPRS MHz fo RESET pin settine Unused Used P125 How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt System Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 77 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Port This panel allows you to configure the information necessary to control port functions provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 18 Example of Port Port Porti Port2 Porta Port Port Port Portia 5 Ped B i z p Unused h Out Pulkup SMBus buffer N c
81. al interval Interrupt INTRTCI cycle INTERVALO 2 6 fSUB INTERVAL1 27 fSUB INTERVAL2 2 8 fSUB INTERVAL3 249 fSUB INTERVAL4 2 10 fSUB INTERVALS 2411 fSUB INTERVAL6 2412 fSUB Remark fSUB is the frequency of the subsystem clock Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of changing the interval the restarting the interval interrupt function CG_main c include CG Tree hi void main void RTC_IntervalStart Start interval interrupt function R20UT0006EJ0100 Rev 1 00 tENESAS Page 267 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_IntervalStop End interval interrupt function RTC_IntervaliInterruptEnable INTERVAL6 Start interval interrupt function R20UT0006EJ0100 Rev 1 00 tENESAS Page 268 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_IntervallnterruptDisable Ends the interval interrupt function Classification CG_rtc c Syntax void RTC_IntervalInterruptDisable void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 269 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTC1HZ_OutputEnable Enables output of the real time counter correction clock 1 Hz to the RTC1HZ pin Classification CG_rtc c Syntax void RTC_RTC1HZ_OutputEnable voi
82. alarm conditions struct RTCAlarmValue UCHAR Alarmwm Minute UCHAR Alarmwh Hour UCHAR Alarmww Weekday Alarmwm Minute Below are shown the meanings of each bit of the structure member Alarmwm nid BCD code minute digit 1 BCD code minute digit 10 Alarmwh Hour Below are shown the meanings of each bit of the structure member Alarmwh If the real time counter is set to the 12 hour clock then bit 5 has the following meaning 0 AM 1 PM R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 260 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS _ BCD code hour digit 1 BCD code hour digit 10 00 Fixed Alarmww Weekday Below are shown the meanings of each bit of the structure member Alarmww TWIT Le 1 Sunday Ls 1 Tuesday 1 Wednesday 1 Thursday 1 Friday 1 Saturday 0 Fixed Return value None Example 1 The example below shows the alarm conditions being set to Monday Tuesday Wednesday at 17 30 CG_main c include CG rtc h void main void struct RTCAlarmValue alarmval RTC_AlarmEnable Start alarm interrupt function RTC_CounterEnable Start count RTC_SetHourSystem HOUR24 Set clock type alarmval Alarmww Oxe alarmval Alarmwh 0x17 alarmval Alarmwm 0x30 RTC_AlarmSet alarmval Set conditions R20UT0006EJ0100 Rev 1 00 tENESAS Page 261 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPEN
83. anel allows you to configure the information necessary to control the function of watchdog timer provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 25 Example of Watchdog Timer Watchdog timer operation setting Unused Used Overflow time setting Overflow time 436907 277A ILI ima Window open period setting window open period Ea How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Watchdog Timer Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 85 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE RTC This panel allows you to configure the information necessary to control the function of real time counter provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 26 Example of RTC Real time counter operation setting O Unused Used Real time counter setting Hour system selection Set real time counter initial value 00 01 01 00 00 00 Saturday Enable output of RTC1HZ pin 1 Hz Alarm detection function setting Use alarm detection f
84. anel allows you to confirm or configure on a per API function basis the setting that determines whether or not the source code device driver program is generated when the Generate Gode button is pressed in the Code Genera tor panel It also allows you to confirm the source code that reflects the information configured in the Code Generator panel Figure A 29 Code Generator Preview Panel Code Generator Preview a File ik Eher Common EEE EE EE E E E E E E E E E E E EE E ELE E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E EE E E E EE E g E Copyright G NEG Electronics Corporation 2009 4 g GiG_systeminite All rights reserved by NEO Electronics Corporation T CG_macrodriverh This program should be used on your own responsibility g G _userdefine h NEG Electronics Corporation assumes no responsibility for any losses F OG_Ik de X incurred by customers or third parties arising from the use of this file T SG_option asm oyetem This device driver was created by GodeGenerator for SKORx2L Port Filename OG mainc INT Abstract This tile implements main function serial APTlib CodeGenerator for TEKOKx2L E1 00c H5 May 2009 OPAMP Device uPD7SF0583_43 A D Compiler CATEKO Timer Oreation date 2009 06 26 Watchdog Timer EEE E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E E RTE xf Clock Output et iat et tat E GEH EH tat
85. ard mode et Conversion time B28 264 9P RS t us Interrupt setting Use A D interrupt INTAD3 Prior ity Lowy et How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt A D Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 83 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Timer This panel allows you to configure the information necessary to control the function of timer array unit provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 24 Example of Timer TMx TMOO TMS TMH Functions Unused Interval timer O SQuare waye output External event counter One shot pulse output PPG output Pulse width measurement Free runnine timer How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Timer Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 84 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Watchdog Timer This p
86. ark nis the channel number Argumeni s Remark The value set to duty ratio ratio must be in base 10 notation Return value None Example The example below shows changing the duty ratio to 25 CG_main c include CG macrodriver hi void main void 4 UCHAR ratio 25 TM50_Start Start count TM50_ChangeDuty ratio Change duty ratio R20UTO006EJ0100 Rev 1 00 tENESAS Page 232 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMHn Init Performs initialization necessary to control 8 bit timer Hn functions Classification CG_timer c Syntax void TMHn_Init void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 233 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMHn_Userlnit Performs user defined initialization relating to the 8 bit timer Hn Remark This API function is called as the TMHn_ Init callback routine Classification CG_timer_user c Syntax void TMHn UserInit void Remark nis the channel number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 234 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMHn Start Starts the count for 8 bit timer Hn Remark The time from the call to this API function to the start of counting depends on the type of th
87. arks 1 The output format for the report file either HTML or CSV is selected by clicking Generation tab gt gt Report type in the Property panel 2 The destination folder for the report file is specified by clicking Generation tab gt gt Output folder in the Property panel Help menu Code Generator Preview panel dedicated items Displays the help of this panel Open Help for Code Generator Preview Panel Context menu The following context menu items are displayed by right clicking the mouse Generate code Not generate code Rename Makes a setting so that the source code of the currently selected API function is gener ated to the folder specified by selecting Generation tab gt gt Output folder in the Prop erty panel Selecting this context menu item changes the icon of the currently selected API function from to Makes a setting so that the source code of the currently selected API function is not gen erated when the button is pressed in the Code Generator panel Selecting this context menu item changes the icon of the currently selected API function from to Selecting this menu item changes the name portion of the currently selected file or API function into an edit box for editing the name You can change the name of the file or API function by editing its name in the edit box Default Reverts the file name or API function name to its original name before it was edited Property Opens
88. as Electronics does not warrant that such information is error free Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below You must check the quality grade of each Renesas Electronics product before using it in a particular application You may not use any Renesas Electronics product for any application categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of 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 or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office equip
89. be left free between the call to AD ComparatorOn and the call to this API function Classification CG_ad c Syntax void AD Start void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 205 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_ Stop Ends A D conversion Remark The voltage converter continues to operate after the process of this API function completes Consequently to stop the operation of the voltage converter you must call AD_ ComparatorOff after the pro cess of this API function completes Classification CG_ad c Syntax void AD Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 206 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_SelectADChannel Configures the analog voltage input pin for A D conversion Remark The value specified in parameter channel is set to analog input channel specification register ADS Classification CG_ad c Syntax include CG 2d h MD STATUS AD_SelectADChannel enum ADChannel channel Argumeni s enum ADChannel channel Analog voltage input pin ADCHANNELn Input pin ADCHANNELPGAIN Operational amplifier output pin ADCHANNEL12V Internal voltage 1 2 V Remark See the header file CG_ad h for details about the analog voltage input pin ADCHANNEL n Return value MD_OK Normal com
90. cation CG_serial_ user c Syntax include CG macrodriver h void IICA_ SlaveErrorCallback MD_STATUS flag Argumeni s MD_STATUS flag Cause of communication error MD ERROR Address mismatch detected MD_NACK Acknowledge not detected Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 183 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_GetStopConditionCallback Performs processing in response to detection of stop condition in IICA slave communication Classification CG_serial_ user c Syntax void IICA GetStopConditronCallback void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 184 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 5 Operational Amplifier Below is a list of API functions output by Code Generator for operational amplifiers use Table C 6 API Functions Operational Amplifier R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 185 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS OPAMP Init Performs initialization necessary to control operational amplifier functions Classification CG_opamp c Syntax void OPAMP _Init void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 186 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS OPAMP Userinit Performs user defined initia
91. d Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 270 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTC1HZ_OutputDisable Disables output of the real time counter correction clock 1 Hz to the RTC1HZ pin Classification CG_rtc c Syntax void RIC RTICIAZ OutputDisable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 271 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTCCL_OutputEnable Enables output of the real time counter clock 82 kHz source to the RTCCL pin Classification CG_rtc c Syntax void RTC_RTCCL_OutputEnable void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 272 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTCCL_OutputDisable Disables output of the real time counter clock 32 kHz source to the RTCCL pin Classification CG_rtc c Syntax void RIC RICCh OutputDisable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 273 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_RTCDIV_OutputEnable Enables output of the real time counter clock 82 kHz cycle to the RTCDIV pin Classification CG_rtc c Syntax void RTC_RTCDIV_OutputEnable void Argument s
92. d as the CS 1n_ Init callback routine Classification CG_serial_ user c Syntax void CSIlIn_UserInit void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 161 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSl1n_Start Sets CSI1n communication to standby mode Classification CG_serial c Syntax void CSlin Stare void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 162 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSl1n_Stop Ends CSI1n communication Classification CG_serial c Syntax void CSiln stop void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 163 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSlI1n_ReceiveData Starts CSl1n data reception Remarks 1 This API function performs byte level CSI1n reception the number of times specified by the parameter rxnum and stores the data in the buffer specified by the parameter rxbuf 2 When performing a CSl1n reception CS 1n_ Start must be called before this API function is called Classification CG_serial c Syntax include CG macrodriver h MD SIATUS CSIln ReceiveData UCHAR rxbuf USHORT rxnum Remark n
93. d items How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Toolbar This area consists of the following buttons Displays the information in the Device pin list area in an expanded view Displays the information in the Device pin list area in a folded view only Clicks this button to automatically process the configuration information in the selected function I O N ch and other fields after selecting one of the peripheral functions displayed in the first level on the Macro tab H Clicks this button to initialize the selected function I O N ch and other fields after selecting one of the peripheral functions displayed in the first level on the Macro tab Clicks this button to create an external peripheral controller from the external periph eral controller information on the External Peripheral tab and display it in the Device Top View panel Clicks this button to delete the information for the external peripheral controller dis played on the External Peripheral tab on the first layer R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 63 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Remarks 1 Click the E button to add the information in question as a choice in the External Parts column of the
94. d view Indicates that the items within the category are displayed as an expanded view Remarks 1 See the sections Pin Configurator Settings tab Device Top View Settings tab Generation tab Macro Setting tab and File Setting tab for details on the content displayed in this area Pin Configurator Information tab 2 To switch between and click this mark or double click the category name 2 Explanation area This area displays a brief description of the category or item selected in the Detail information display change area Edit menu Property panel dedicated items Undo Cancels the effect of an edit operation to restore the previous state the effect of an edit Cancels the effect of an edit operation to restore the previous state to restore the previous state mo o the character string or lines selected with range selection to the clipboard and deletes them Coy Copy Sends the character string or lines selected with range selection to the clipboard the character string or lines selected with range selection to the Sends the character string or lines selected with range selection to the clipboard Inserts the contents of the clipboard at the caret position Deletes the character string or the lines selected with the range selection Select All Selects all strings displayed in the item being edited Help menu Property panel dedicated items Open Help for Property Pane
95. d with range selection to the clip board and deletes them Copy Property panel Output panel dedicated item Sends the character string or lines selected with range selection to the clip board Paste Property panel dedicated item Inserts the contents of the clipboard at the caret position Delete Property panel dedicated item Deletes the character string or the lines selected with the range selection Select All Property panel Output panel dedicated item Selects all the strings displayed in the item being edited or all the strings dis played in the Message area R20UTO006EJ0100 Rev 1 00 tENESAS Page 44 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Search Replace c Help menu Open Help for Project Tree Panel Open Help for Property Panel Open Help for Device Pin List Panel Open Help for Device Top View Panel Open Help for Code Generator Panel Open Help for Code Generator Preview Panel Open Help for Output Panel 2 Panel display area Device Pin List panel Code Generator Preview panel Output panel dedicated item Opens the Search and Replace dialog box for searching strings with the Quick Search tab selected Output panel dedicated item Opens the Search and Replace dialog box for replacing strings with the Whole Replace tab selected Project Tree panel dedicated item Displays the help of Project Tree panel Property panel dedicated item Displays th
96. de Generator and the API functions con tained in the source code R20UT0006JJ0100 Rev 1 00 tENESAS Page 10 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator CHAPTER 2 FUNCTIONS Pin Configurator This chapter describes the key functions provided by the design tool Pin Configurator along with operation proce dures 2 1 Overview The Pin Configurator is used to output report files such as a device pin list and a device top view by entering pin assign ment information of the microcontroller The following sections describe the operation procedures for Pin Configurator 1 Start CubeSuite Launch CubeSuite from the Start menu of Windows Remark See CubeSuite Start User s Manual for details on Start CubeSuite 2 Create Open project Create a new project that defines a kind of project microcontroller to be used build tools to be used etc or load an existing project Remark See CubeSuite Start User s Manual for details on Create Open project 3 Open Device Pin List Panel Open the Device Pin List panel where you enter information on the pins of the microcontroller a Select item Allows you to select items displayed in the device pin list b Change display order Allows you to change the order in which items are displayed in the device pin list c Add column Allows you to add columns to the device pin list d Delete column Allows you to delete columns from the
97. device pin list 4 Open Device Top View Panel Open the Device Top View panel where you can confirm the information entered for the pins a Select shape of microcontroller Allows you to select the shape of the microcontroller displayed in the Device Top View panel b Select color Allows you to select colors used to distinguish the type of pins power pins special pins used pins etc whose information is displayed in the Device Top View panel R20UT0006JJ0100 Rev 1 00 tENESAS Page 11 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator c Select popup information Allows you to select the type of information that popups when you move the mouse cursor over each pin in the Device Top View panel d Select additional information Select the type of information to display in Pin area of the Device Top View panel 5 Enter Information Enter information on the pins of the microcontroller in the Device Pin List panel 6 Output Report Files Output report files files containing configured information using Pin Configurator device pin list and device top view to the specified folder a Output device pin list Output a device pin list b Output device top view Output a device top view 7 Save project Save a project Remark See CubeSuite Start User s Manual for details on Save project R20UT0006JJ0100 Rev 1 00 tENESAS Page 12 of 300 Sep 01 2010 CubeSuite Ver 1 40
98. dge of the comparator output generate an interrupt INTGMP1 Walide edge detection Falling edge et Prior ity Lowy al When detecting the valid edge of the comparator output generate an interrupt INTGMP VWalide edge detection Falling edge et Prior ity Lowy et How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Comparator Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 82 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE A D This panel allows you to configure the information necessary to control the function of A D converter provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 23 Example of A D 4 0 conversion operation setting O Unused Used Comparator operation setting Stop Operation Conversion start method setting Software trigger Timer trigger TMD synchronization Operation mode setting 4 0 pins analog input s lection v ANID M ANT AMPOUT PGAIN ANI F ANB v ANI v ANB v ANIE v ONT ANIS 4 0 channel selection ANI ka Conversion time zetting Reference voltage range 40s AVREF 65 ae OW Conversion time mode stand
99. ding pin in the Device Top View panel changes from the color representing the unused pins to the color repre senting the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel Figure 2 11 Change in Displayed Color Device Top View lf Tol 5 Tol wm orno BE B m defi EEH defi SSE E _ ri Lh Ey PRO SCLAQ SKII IHTP i l if PASDA HTI OT mE Paz Sol I TKIP Ola J Poa ITPA gt lq Poa HT Pa q PRTG TOG Lf ATP 0 lr PAJ TI IY TOI IHTP mf FTKRE hi TOKI P7Gy KRG i Priko CH 17 WEL Pid KRA 7 PIERI q Pray KR2 A H FTIR Gi Pit KRD PTIERI C 10 PUY RED C PrOKRO T PW ERD P ITPA TOMO Paz IMTPa THILO C JOOU Q JO OOQ SaeES GBE EERE Ie m P Boe EEEE lt gt PRE ea F E j p af u R20UTOOO6JJ0100 Rev 1 00 stENESAS Page 23 of 300 Sep 01 2010 Ch Pry a2 EXcLe TOOLOd Ch PIX TOOLcd Device Top View D PI Bij TLC CP ey RI EX md CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 5 Output Report Files Output report files files containing information configured using Pin Configurator device pin list and device top view to the specified folder 2 5 1 Output device pin list Select File menu gt gt Save Pin List As to output a report file a file containing information configured using Pin Con figurator device pin list The destination folder for the device pi
100. e None R20UT0006EJ0100 Rev 1 00 tENESAS Page 144 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 4 Serial Below is a list of API functions output by Code Generator for serial array unit and serial interface use Table C 5 API Functions Serial Performs initialization of the serial interface UART6 channel Performs user defined initialization of the serial interface UART6 UART6_SendEndCallback Performs processing in response to the UART transmission complete interrupt INTST6 UART6_ReceiveEndCallback Performs processing in response to the UART reception complete interrupt INTSR6 UART6_SoftOverRunCallback Performs processing in response to the serial transfer end interrupt INTSR6 UART6_ErrorCallback Performs processing in response to the UART communication error interrupt INTSRE6 CSl1n_Init Performs initialization of the serial interface CSI1n channel Peon isan silts e CSI1n_SendEndCallback Performs processing in response to the CSI1n communication complete interrupt INTCSI1n CSI1n_ReceiveEndCallback Performs processing in response to the CSI1n communication complete interrupt INTSClin IICA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_MasterErrorCalloback Performs processing in response
101. e RTC_ConstPeriodinterruptCallback RTC_AlarmSet Sets the alarm conditions weekday hour minute RTC_AlarmGet Reads the alarm conditions weekday hour minute RTC_RTC1HZ_ OutputEnable Enables output of the real time counter correction clock 1 Hz to the RTC1HZ pin RTC_RTC1HZ_ OutputDisable Disables output of the real time counter correction clock 1 Hz to the RTC1HZ pin RTC_RTCCL_OutputEnable Enables output of the real time counter clock 82 kHz source to the RTCCL pin RTC_RTCCL_OutputDisable Disables output of the real time counter clock 32 kHz source to the RTCCL pin RTC_RTCDIV_OutputEnable Enables output of the real time counter clock 32 kHz cycle to the RTCDIV pin RTC_RTCDIV_OutputDisable Disables output of the real time counter clock 82 kHz cycle to the RTCDIV pin RTC_ChangeCorrectionValue Changes the timing and correction value for correcting clock errors R20UTO006EJ0100 Rev 1 00 tENESAS Page 243 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_Init Performs initialization necessary to control real time counter functions Classification CG_rtc c Syntax void RTC_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 244 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_Userlnit Performs user defined initialization relating to the real time counter Remark This API function is call
102. e 3 5 Output Source Code Proj Tree Eeecisample Project by CATSKO Build Tool cos TOKO Simulator Debug Tool pE LIB Programmer Flash Programming Tool A F Startup Proj Tree E a sample Project UPOVSFO5SS 48 Microcontroller by CASED Build Tool TSEO Simulator Debug Tool LIB Programmer Flash Programming Tool a File al Build Tool Output Files Startup LI CodeGener ator die GG _Ikdir Remark In order to both output source files and add them to the project display the corresponding source file names in the Project Tree panel when you click the Generate Code button you must open the Property panel and under Generation tab gt gt Register files specify Output files to project Figure 3 6 Configure Whether to Register Property HH Gode Generator Property El Product Information Version Release date El Generate File Mode Generate file Werge file Output folder C Documents and Settings Report type HTML file Register tiles Output files to project iw O Pin Configurator Refla m Py se Mode Not output files to project Register files The register mode of the output files i displayed Genaration R20UTOO06JJ0100 Rev 1 00 tENESAS Sep 01 2010 Page 32 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 1 Setting that determines whether or not to generate source code You can set whether or not
103. e Display Fin function Display Not display D efine name Select to show or hide the define name Device Top Yiew Settings Remarks 1 Select one of the following two types for Define name whether to display the Define Name string of the Device Pin List in appended format Display Displays the Define Name string of the device pin list in appended format Not display Hides the Define Name string of the device pin list 2 Select one of the following two types for Pin function whether to display it whether or not a function is selected for Function on the Device Pin List Display all Displays functions selected via the device pin list s Function feature in parentheses Selected function only Only display functions selected via the device pin list s Function feature in the device top view R20UT0006JJ0100 Rev 1 00 tENESAS Page 22 of 300 Sep 01 2010 CubeSuite Ver 1 40 2 4 Enter Information CHAPTER 2 FUNCTIONS Pin Configurator Enter information on the pins of the microcontroller in the Device Pin List panel which is opened as described in 2 2 Open Device Pin List Panel Remarks 1 You cannot add information in the Pin Number column Pin Name column Description column Recommend Connection For Unused column and Attention column because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the correspon
104. e function in question e g interval timer square wave output or PWM output Classification CG_timer c Syntax void TMH Start void Remark nis the channel number Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 235 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMHn_Stop Ends the count for 8 bit timer Hn Classification CG_timer c Syntax void TMHn Stop void Remark nis the channel number Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 236 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMHn_ChangeTimerCondition Changes the value of 8 bit timer H compare register 0n 1n CMPOn CMP1n Remark To change the contents of CMPOn CMP1n you must call TMHn_ Stop before calling this API function Classification CG_timer c Syntax include CG_macrodriver h include CG_timer h MD_STATUS TMHn_ChangeTimerCondition UCHAR array_reg UCHAR array_num Remark nis the channel number Argument s o moe O O o o O O miee Pointer to the area storing the value to set in the target register UCHAR array_num The register to change 1 CMPOn 2 CMPOn CMP1n Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 237 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C
105. e help of Property panel Device Pin List panel dedicated item Displays the help of Device Pin List panel Device Top View panel dedicated item Displays the help of Device Top View panel Code Generator panel dedicated item Displays the help of Code Generator panel Code Generator Preview panel dedicated item Displays the help of Code Generator Preview panel Output panel dedicated item Displays the help of Output panel This area consists of multiple panels each dedicated to a different purpose See the following sections for details on this area Project Tree panel Property panel Device Pin List panel Device Top View panel Code Generator panel Code Generator Preview panel Output panel R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 45 of 300 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Project Tree panel This panel displays components of the project microcontroller design tool build tool etc in a tree structure Figure A 2 Project Tree Panel Project Tree A Pin Configurator Design Tool Device Pin List PETER a J e pi Device Top View i Code Generator Design Tool a system wi Port INT W Serial 1 E OPAMP E A D w Timer n watchdog Timer E RTC we Clock Output eM a CAFSEO Build Tool cos TAKO Simulator Debug Tool I QB Frogrammer Flash Programming Tool a i File The following items are explained here How to op
106. eSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Pin Number tab This tab displays information on each pin of the microcontroller in the order of pin number Figure A 12 Pin Number Tab Device Pin List E E E H Sa Pin Number Fin belila H Function 4 VO 4 ch 4 Detin A P60 SOLAD K11 INTP11 1 3 Pal SDAAC SINT Free AINTPIO Po2 SO11 INTPS Free External Peripheral The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller The device pin list in this area is organized in the order of pin number The following are the columns comprising the device pin list Displays the pin number of the pin Pin Name This area allows you to select which function to use when the pin has more than one functions Function This area allows you to select which function to use when the pin has more than one functions vo This area allows you to select the VO mode of theping area allows This area allows you to select the I O mode ofthe pin 0 to select the I O mode of the pin This area allows you to select
107. ected voltage V y detected Handle case when power voltage Vpp gt detected voltage V y detected R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 286 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVI_ResetModeStart Starts low voltage detection when in internal reset mode Classification CG _Ivi c Syntax MD SIATUS LVI_ResetModeStart void Argumeni s None Return value MD_OK Normal completion MD_ERROR Exit with error abend The object of low voltage detection is external voltage VDD and power voltage VDD lt detected voltage VLVI The object of low voltage detection is external input voltage EXLVI and external input voltage EXLVI lt detected voltage VEXLvI R20UT0006EJ0100 Rev 1 00 tENESAS Page 287 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVI_ Stop Stops low voltage detection Classification CG _Ivi c Syntax void LVI_Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 288 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LVI_SetLViLevel Sets the low voltage detection level Remarks 1 To change the low voltage detection level you must call LV _ Stop before calling this API function 2 The value specified in parameter evel is set to low voltage detection level select register LVIS Classification CG
108. ed as the RI C_ Init callback routine Classification CG_rtc_user c Syntax void RTC Userinity void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 245 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_PowerOff Halts the clock supplied to the real time counter Remark Calling this API function changes the real time counter to reset status For this reason writes to the control registers e g real time counter control register 0 RTCCO after this API function is called are ignored Classification CG_rtc c Syntax void RTC_PowerOff void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 246 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_CounterEnable Starts the count of the real time counter year month weekday day hour minute second Classification CG_rtc c Syntax void RTC_CounterEnable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 247 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_CounterDisable Ends the count of the real time counter year month weekday day hour minute second Classification CG_rtc c Syntax void RTC_CounterDisable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page
109. electing File menu gt gt Save R20UTOO06JJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 25 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator CHAPTER 3 FUNCTIONS Code Generator This chapter describes the key functions provided by the design tool Code Generator along with operation proce dures 3 1 Overview The Code Generator outputs source code device driver programs based on information selected entered on CubeSu ite panels that is needed to control peripheral functions provided by the microcontroller clock generator port functions etc The following sections describe the operation procedures for Code Generator 1 Start CubeSuite Launch CubeSuite from the Start menu of Windows Remark See CubeSuite Start User s Manual for details on Start CubeSuite 2 Create Open project Create a new project that defines a kind of project microcontroller to be used build tools to be used etc or load an existing project Remark See CubeSuite Start User s Manual for details on Create Open project 3 Open Code Generator Panel Open the Code Generator panel used to configure the information necessary to control the peripheral functions clock generator port functions etc 4 Enter Information Configure the information necessary to control the peripheral functions in the Code Generator panel 5 Confirm Source Code Confirm the source code device driver program that reflects the i
110. en Description of each area Help menu Project Tree panel dedicated items Context menu How to open From the View menu select Project Tree Description of each area 1 Project tree area This area displays components of the project microcontroller design tool build tool etc in a tree structure a Pin Configurator Design Tool This node consists of the following pin nodes R20UT0006EJ0100 Rev 1 00 tENESAS Page 46 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Device Pin List Opens the Device Pin List panel for entering information on the pins of the microcontroller Device Top View Opens the Device Top View panel that displays the information entered in the Device Pin List panel b Code Generator Design Tool This node consists of the following peripheral function nodes When there is peripheral function target microcontroller is not supporting peripheral functionbutton is not disokayed System Opens the System for configuring the information necessary to control the functions of clock generator on chip debug function and etc provided by the microcontroller Port Opens the Port for configuring the information necessary to control the port functions provided by the microcontroller INT Opens the INT for configuring the information necessary to control the inter rupt functions and the key interrupt function provided by the microcontroller Serial Open
111. enerate Code button is pressed or when File menu gt gt Save Code Generator Report is selected Report type Views or selects the format of the report files a file containing information config ured using Code Generator and a file containing information regarding the source code which are output when File menu gt gt Save Code Generator Report is selected HTML file Outputs a report file in HTML format CSV file Outputs a report file in CSV format Register files Selects whether source code generated by pressing the Generate Code button should be added to the project Output files to project Adds output source code to the project The source code will be added to the Project Tree panel under the File Code Generator node Not output files to project Does not add output source code to the project Remark To change the output destination use the Browse For Folder dialog box which opens by pressing the button in this area 3 Pin Configurator Reflect Mode category Configure the information linking mode between Code Generator and Pin Configurator R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 59 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Selects whether to reflect the settings made in the Code Generator panel in the Device Pin List panel when the button is pressed Reflected Reflects Code Generator panel settings in the Device Pin List panel Not reflected Does
112. enerator for SKORx2L Filename Abstract CG manc This tile implements main function APTlib CodeGenerator for 78KOKx2L E1 00c 15 May 2009 Device uPDOFeFObSs 43 CATOK Greation date 2009 06 26 SO EE RR EE E af Fi aeRO TETTE E TETE IE TETTE ES VELE OE TETTE ES TETTE IE TETTE OES VET ET IE TE TET OES TET TET ITE TET OES TETE OTE E OES TETE TTE Cafe Fragma directive w Remark To restore the default name of the API function defined by Code Generator select Default from the context menu R20UT0006JJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 35 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 4 Change output mode The Code Generator is used to change the output mode Overwrite file Merge file Do nothing if file exists for the source code by selecting Generation tab gt gt Generate file in the Property panel Figure 3 10 Change Output Mode Property ee Code Generator Property E Product Information EO Generate File Mode Generate file Meree file Output tolder Overwrite file Report type berge file Register files Do nothing if file exists EO PinGontieurator Reflect Mode Generate file Generate file information Genaration Remark The output mode is selected from the following three types Table 3 5 Output Mode of Source Code Overwrite file If a file with the same name exists the existing file is overwrit ten by a new file Merge
113. er 1 40 CHAPTER 1 GENERAL CHAPTER 1 GENERAL CubeSuite is an integrated development environment used to carry out tasks such as design coding build and debug for developing application systems This chapter gives an overview of the design tool Pin Configurator Code Generator 1 1 Overview The design tool which is one of the components provided by CubeSuite enables you to output the pin assignment of the microcontroller device pin list and device top view and the source code device driver programs C source files and header files necessary to control the peripheral functions provided by the microcontroller clock generator port functions etc by configuring various information using the GUI 1 2 Features The design tool Pin Configurator Code Generator has the following features Code generating function The Code Generator can output not only device driver programs in accordance with the information configured using the GUI but also a build environment such as sample programs containing main functions and link directive files Source code output by Code Generator conforms to the MISRA C Guidelines for the Use of the C Language in Vehicle Based Software coding convention Reporting function You can output configured information using Pin Configurator Code Generator as files in various formats for use as design documents Renaming function The user can change default names assigned to the files output by Co
114. er specified by the parameter rxbuf 2 Actual UART reception starts after this API function is called and UART6_Siart is then called Classification CG_serial c Syntax include CG macrodriver h MD_STATUS UART6_ReceiveData UCHAR rxbuf USHORT rxnum Argumeni s Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Remark You can only set 2 for the total rxnum of the receiving data in case the serial interface UART6 operates in DALI mode Example Below is an example of UART reception of four bytes of fixed length data one time CG_main c include CG _macrodriver h BOOL gFlag Reception complete flag void main void UCHAR rxbuf 10 USHORT rxnum 4 Initialize reception complete flag UART6_ReceiveData amp rxbuf rxnum Start UART data reception UART6_Start Start UART communication R20UT0006EJ0100 Rev 1 00 tENESAS Page 153 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS while gFlag Wait for rxnum receptions CG_serial_user c include CG macrodriver h extern BOOL gFlag Reception complete flag _ interrupt void MD_INTSR6 void Interrupt processing for INTSR6 gUartoRxLen gt guartORxCnt gUartoRxLen guartoRxCnt UART6_ReceiveEndCallback Call callback routine void UART6 ReceiveEndCallback void Callback routine for INTSR6 gFlag 0 Set
115. erinit void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 138 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INT_MaskablelnterruptEnable Disables enables the acceptance of the maskable interrupts Classification CG_int c Syntax include CG Macrodriver h include CG ant sh MD_STATUS INT MaskableInterruptEnable enum MaskableSource name BOOL enableflag Argumeni s enum MaskableSource name Maskable interrupt type INT _xxx Maskable interrupt BOOL enableflag Acceptance enabled disabled MD_TRUE Acceptance enabled MD_FALSE Acceptance disabled Remark See the header file CG_int h for details about the maskable interrupt type INT_xxx Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example 1 Below is an example of disabling acceptance of the maskable interrupt INTPO CG_main c include CG macrodriver h include CG snc hi void Main void INT_MaskableInterruptEnable INT_INTPO MD_FALSE Disable acceptance of maskable interrupt INTPO R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 139 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Example 2 Below is an example of enabling acceptance of the maskable interrupt INTPO CG_main c Tine lade CG macrodriver hi include CG intan void main void INT_MaskableInterruptE
116. ext menu Remark _ If this panel is already open selecting a different file in the Code Generator Preview panel changes the con tent displayed accordingly Description of each area 1 File Information category This area allows you to view the information Default File name on and change the setting for the file selected in the Code Generator Preview panel Default name Views or selects the setting that determines whether the name of the file selected in the Code Generator Preview panel is a default name or not The file name is a default name Changing this area from No to Yes changes the name of the file to its default name The file name is not a default name Displays or change the name of the file selected on the Code Generator Preview panel File name R20UT0006EJ0100 Rev 1 00 tENESAS Page 62 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Device Pin List panel This panel allows you to enter information on each pin of the microcontroller Figure A 11 Device Pin List Panel Device Pin List tha e Pin Number A Pin Name A Function 4 LO 4 N ch 4 Detin A PROASCLAOY SC Free k11 INTF1 P 1 SDAA0 ST1 Free AINTP10 P62 SO11 INTPS Free External Peripheral The following items are explained here How to open Description of each area File menu Device Pin List panel dedicated items Help menu Device Pin List panel dedicate
117. external peripheral controller level a First layer The following are the columns comprising the device pin list Column Heading Column Heading s External Peripheral co e the name of the external peripheral controller To change the name select this field and then press the F2 key Displays the total number of pins allocated for connection with the microcontrol ler R20UT0006EJ0100 Rev 1 00 tENESAS Page 69 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE b Second layer Displays the pin number of the pin Function This area allows you to select which function to use when the pin has more than one functions This area allows you to select the I O mode of the pin N ch This area allows you to select which output mode to apply when using the pin in the output mode This area allows you to assign a user defined pin name to the pin Displays the summary of function of the pin Recommend Connection For Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Func tion column Attention Displays the precaution on using the pin Remarks 1 You cannot add information in the External Peripheral Name Connected Pins Pin Number Pin Name Description Recommend Connection For Unused and Attention columns because they contain fixed information 2 Ifthe Free in the
118. ey interrupts INTKR R20UT0006EJ0100 Rev 1 00 tENESAS Page 134 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTP Init Performs initialization necessary to control the external interrupt INTPn functions Classification CG_int c Syntax void INTP_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 135 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTP_Userlnit Performs user defined initialization relating to the external interrupt INTPn functions Remark This API function is called as the INTP_ Init callback routine Classification CG_int_user c Syntax void INTP_UserInit void Argument s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 136 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS KEY Init Performs initialization necessary to control the key interrupt INTKR functions Classification CG_int c Syntax void KEY_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 137 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS KEY Userlnit Performs user defined initialization relating to the key interrupt INTKR functions Remark This API function is called as the KEY_ Init callback routine Classification CG_int_user c Syntax void KEY Us
119. fCPU gt gt Internal high speed oscillation clock fPRS gt gt High spped system clock SYSX1CLK fCPU fPRS gt gt X1 clock SYSEXTCLK fCPU fPRS gt gt External main system clock SUBXT1CLK fCPU gt gt XT1 clock SUBEXTCLK fCPU gt gt External subsystem clock Remark SUBXT1CLK and SUBEXTCLK can only be specified when the target device is a 78K0 KC2 L Return value MD_OK Normal completion MD_ERROR 1 Exit with error abend Cannot change fCPU fPRS to the internal high speed osillation clock MD_ERROR2 Exit with error abend Cannot change fCPU to the internal high speed oscillation clock Cannot change fPRS to the high speed system clock MD_ERROR3 Exit with error abend Cannot change fCPU fPRS to the X1 clock MD_ERROR4 Exit with error abend Cannot change fCPU fPRS to the external main system clock MD_ERROR5 Exit with error abend Kx2 L Cannot change fCPU to the XT1 clock MD_ERROR6 Exit with error abend Kx2 L Cannot change fCPU to the external subsystem clock MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 120 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Remark The values MD_ERROR5 and MD_ERRORE6 will only be returned when the target device is a 78K0 KC2 L R20UTO006EJ0100 Rev 1 00 tENESAS Page 121 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_ChangeFrequency Changes the division
120. fication CG_comparator c Syntax void Comparatorn_Start void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 198 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Comparatorn_ Stop Ends the operation of comparator Classification CG_comparatorn c Syntax void Comparatorn_Stop void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 199 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 7 A D Below is a list of API functions output by Code Generator for A D converter use Table C 8 API Functions A D AD_ Stop Ends A D conversion AD_SelectADChannel Configures the analog voltage input pin for A D conversion AD_Read Reads the results of A D conversion 10 bits AD_ReadByte Reads the results of A D conversion 8 bits most significant 8 bits of 10 bit resolution R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 200 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs initialization necessary to control A D converter functions Classification CG_ad c Syntax void AD_Init void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 201 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs user defi
121. file If a file with the same name exists a new file is merged with the existing file Only the section between Start user code Do not edit comment generated here and End user code Do not edit comment generated here will be merged Do nothin if file exists If a file with the same name exists a new file will not be output R20UT0006JJ0100 Rev 1 00 tENESAS Page 36 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 5 Change output destination folder The Code Generator is used to change the output destination folder for the source code by selecting Generation tab gt gt Output folder in the Property panel To change the output destination use the Browse For Folder dialog box which opens by pressing the button in the Output folder Figure 3 11 Change Output Destination Folder Browse For Folder Desktop E My Documents of My Computer E3 My Network Places 2 Unused Desktop Shortcuts Make New Folder o Cancel R20UT0006JJ0100 Rev 1 00 tENESAS Page 37 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 6 Output Report Files Output report files a file containing information configured using Code Generator and a file containing information regarding the source code by first activating the Code Generator panel or Code Generator Preview panel then selecting File menu gt gt Save Code Generator Repor
122. g of the icon displayed to the left of the string representing the peripheral Operation in the corresponding Code Generator panel has been carried out Operation in the corresponding Code Generator panel has not been carried out function node The problem occurs on the settings became the manipulation to the other peripheral function node influences R20UT0006EJ0100 Rev 1 00 tENESAS Page 47 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Help menu Project Tree panel dedicated items Open Help for Project Tree Panel Displays the help of this panel Context menu The following context menu items are displayed by right clicking the mouse Return to Reset Value Restores the information for the selected peripheral function node to its default state Property Opens the Property pane containing the information for the selected node Pin Configurator Design Tool or Code Generator Design Tool R20UT0006EJ0100 Rev 1 00 tENESAS Page 48 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Property panel This panel allows you to view the information on and change the setting for the node selected in the Project Tree panel the peripheral function button pressed in the Code Generator panel or the file selected in the Code Generator Preview panel Figure A 3 Property Panel Selected Pin Configurator Design Tool Property A Fin Configurator Property El P
123. h Change L O by software F Unused Oh Out Pull up SMBus buffer L N ch Ghanee VO by software gt How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Port Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 78 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE INT This panel allows you to configure the information necessary to control the interrupt functions and the key interrupt function provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 19 Example of INT External Interrupt Key Interrupt INTPO setting l E M INTPO Valid edge Priority INTP1 setting VJINTP1 Walid edge Priority z gt How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt INT Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 79 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Serial This panel allows you to configure the information necessary to contr
124. ing data in case the serial interface UART6 operates in DALI mode Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of sending a UART transmission of four bytes of fixed length data one time CG_main c include CG _macrodriver h BOOL gFlag Transmission complete flag void main void UCHAR txbuf ABCD USHORT txnum 4 Initialize transmission complete flag UART6_Start Start UART communication UART6_SendData amp txbuf txnum Start UART data transmission R20UT0006EJ0100 Rev 1 00 tENESAS Page 151 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS while gFlag Wait for txnum transmissions CG_serial_user c include CG _macrodriver h extern BOOL gFlag Transmission complete flag _ interrupt void MD_INTST6 void Interrupt processing for INTST6 if gUart TxCnt gt 0 4 UART6_SendEndCallback Call callback routine void UART6 SendEndCallback void Callback routine for INTST6 7 gFlag Q Set transmission complete flag R20UT0006EJ0100 Rev 1 00 tENESAS Page 152 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_ReceiveData Starts UART data reception Remarks 1 This API function performs byte level UART reception the number of times specified by the parameter rxnum and stores the data in the buff
125. ing to the alarm interrupt INTRTC Classification CG_rtc_user c Syntax void RTC AlarminterruptCallback void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 264 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_IntervalStart Starts the interval interrupt function Remark After setting the cycle of the interrupts INTRTCI call RTC_IntervallnterruptEnable to start the interval inter rupt function Classification CG_rtc c Syntax void RTC_IntervalStart void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 265 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_IntervalStop Ends the interval interrupt function Classification CG_rtc c Syntax void RIC _Intervalstop void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 266 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_IntervallnterruptEnable Sets the cycle of the interrupts INTRTCI then starts the interval interrupt function Remark Call RIC_IntervalStart to start the interval interrupt function without setting the cycle of the interrupts INTRTCI Classification CG_rtc c Syntax include CG rite MD STATUS RTC_IntervaliInterruptEnable enum RTCINTInterval interval Argumeni s enum RTCINTInterv
126. is the channel number Argumeni s Ce ee Pointer to a buffer to store the received data USHORT rxnum Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of receiving a CSI10 transmission of four bytes of fixed length data from channel 10 one time CG_main c include CG Macrodriver hh BOOL gFlag Reception complete flag void Main void UCHAR rxbuf 10 USHORT rxnum 4 1 Initialize reception complete flag csIl0_Start Start CSI10 communication CSI10_ReceiveData amp rxbuf rxnum Start CSI10 reception while gFlag Wait for rxnum receptions R20UTO006EJ0100 Rev 1 00 tENESAS Page 164 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_serial_user c include CG macrodriver h extern BOOL gF lag Reception complete flag __ interrupt void MD_INTCSI10 void Interrupt processing for INTCSI10 if gCsilORxCnt lt gCsilORxLen gCsilORxCnt gCsilORxLen CSI10_ReceiveEndCallback Call callback routine void CSI10 ReceiveEndCallback void Callback routine for INTCSI10 gFlag Q Set reception complete flag R20UT0006EJ0100 Rev 1 00 tENESAS Page 165 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSIi1n_SendReceiveData Starts CSlin data transmission reception
127. kage Package type Package type Select package image displayed in the device top view panel Pin Configurator Settings Remark Selection of the shape of the microcontroller is made using the order name such as GC and GF R20UT0006JJ0100 Rev 1 00 tENESAS Page 19 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 2 Select color Select the colors used to distinguish the type of pins power pins special pins unused pins etc whose information is displayed in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the color to be displayed select the desired color in the color palette that opens by clicking Device Top View Settings tab gt gt Color in the Property panel Figure 2 8 Select Color Property af Device Top View Property El Color Power ping Special ping Unused pins Used ping Device Highlight Macro highlight External peripheral highlight El ToolTip Tool tip El Fin Name Display Define name Pin functor C Firebrick Power pins Select test calor of power pinis Device Top Yiew Settings Remark Select the colors to be displayed for the following eight types of items Table 2 2 Select Color Selects the display color for power pins pins whose use is limited to power Selects the display color for special pins pins with specified uses Selects the display color for unused pins
128. l Displays the help of this panel Context menu The following context menu items are displayed by right clicking the mouse 1 While the item is being edited Cancels the effect of an edit operation to restore the previous state Cut Sends the character string or lines selected with range selection to the clipboard and deletes them R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 50 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Sends the character string or lines selected with range selection to the clipboard Inserts the contents of the clipboard at the caret position Deletes the character string or the lines selected with the range selection Select All Selects all strings displayed in the item being edited 2 While the item is not being edited Property Reset to Default Restores the selected item to its default state Property Reset All to Default Restores all items to their default state R20UT0006EJ0100 Rev 1 00 tENESAS Page 51 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Pin Configurator Settings tab This tab displays information Product Information Use of Pin Configurator Panels and Package on the Pin Configura tor Design Tool selected in the Project Tree panel Figure A 4 Pin Configurator Settings Tab Property A Fin Configurator Property El Product Information El Use of Pin Configurator Panek Use pin configurator panels No
129. layed accordingly 2 If this panel is already open pressing a different type of peripheral function button etc in the Code Generator panel changes the content displayed accordingly Description of each area 1 Macro Information category This area allows you to view the information Macro name on and change the setting for the peripheral function node System Port etc selected in the Project Tree panel or the peripheral function button pressed in the Code Generator panel Macro name Displays the type of peripheral function node selected in the Project Tree panel or the type of peripheral function button pressed in the Code Generator panel R20UT0006EJ0100 Rev 1 00 tENESAS Page 61 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE File Setting tab This tab allows you to view the information File Information on and change the setting for the file selected in the Code Generator Preview panel Figure A 10 File Setting Tab Property Code Generator Property El File Information 1 Default name Yes File name CO mainc Default Default operation File Setting The following items are explained here How to open Description of each area How to open On the Code Generator Preview panel select a file and then select Property from the View menu On the Code Generator Preview panel select a file and then select Property from the cont
130. lback Performs processing in response to the CSI1n communication complete interrupt INTCSI1n CSl1n_ReceiveEndCallback Performs processing in response to the CSI1n communication complete interrupt INTCSI1n ICA_Init Performs initialization of the serial interface IICA IICA_UserlInit Performs user defined initialization of the serial inter face IICA ICA Stop Ends IICA communication R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 109 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_MasterErrorCalloback Performs processing in response to detection of error in IICA master communication ICA _SlaveSendStart Starts IICA slave transmission IICA_SlaveReceiveStart Starts IICA slave reception ICA_SlaveSendEndCalloack Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICAO IICA_SlaveErrorCallback Performs processing in response to detection of error in IICA slave communication IICA_GetStopConditionCallback Performs processing in response to detection of stop condition in IICA slave communication Operational Amplifier OPAM
131. lect the type of the file to be output EME emf EMF format Function buttons Save Outputs a file having the name specified in the File name and Save as type to the folder specified in the Save in Cancel Cancel Ignores the setting and closes this dialog box Ignores the setting and closes this dialog box setting and closes this dialog box R20UTO006EJ0100 Rev 1 00 tENESAS Page 102 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES APPENDIX B OUTPUT FILES This appendix describes the files output by Code Generator B 1 Overview Below is a list of files output by Code Generator Table B 1 File List Project Option bytes secures ROM for MINICUBE2 CG_systeminit c Call initial function of peripheral function Call CG_ReadResetSource CG_macrodriver h Defines common macros used by all source files CG_user_define h Empty file for user definitions CG_lIk dir Link directive B 2 Output File Below are the files peripheral function output by Code Generator Table B 2 File List PeripheralFunction Peripheral Function Source File Name Names of API Functions Included CG_system c CLOCK_Init CG_ChangeClockMode CG_ChangeFrequency CG_SelectPowerSaveMode CG_SelectStabTime CG_ChangePllMode CG_system_user c CLOCK Userlnit CG_ReadResetSource CG_port c PORT Init PORT_ChangePmnInput PORT _ChangePmnOutput CG_port_user c PORT_Userlnit INT CG_int c INTP_Init KEY_Init
132. lization relating to the operational amplifier Remark This API function is called as the OPAMP _ Init callback routine Classification CG_opamp_user c Syntax void OPAMP UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 187 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Starts the operation of operational amplifier PGA mode Classification CG_opamp c Syntax void PGA Start void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 188 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PGA_Stop Ends the operation of operational amplifier PGA mode Classification CG_opamp c Syntax void PGA Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 189 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PGA_ChangePGAFactor Sets the input voltage amplification factor of a operational amplifier PGA mode Remark The value specified in parameter factor is set to operational amplifier control register AMPOM Classification CG_opamp c Syntax include CG_macrodriver h include CG_opamp h MD_STATUS PGA_ChangePGAFactor enum PGAFactor factor Argumeni s enum PGAFactor factor Input voltage amplification factor PGAFACTORO x4 PGAFACTOR1 x8
133. lue None R20UTO006EJ0100 Rev 1 00 tENESAS Page 219 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_ Start Starts the count for 16 bit timer event counter 00 Remark The time from the call to this API function to the start of counting depends on the type of the function in question e g interval timer square wave output or external event counter Classification CG_timer c Syntax void TMOO Start void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 220 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO0O_ Stop Ends the count for 16 bit timer event counter OO Classification CG_timer c Syntax void TM0O0_Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 221 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMO0O_ChangeTimerCondition Changes the value of 16 bit timer capture compare control register OnO CROn0 Remark To change the contents of CROn0 you must call TMOO0_Stop before calling this API function Classification CG_timer c Syntax include CG_macrodriver h include CG_timer h MD_STATUS TMOO_ChangeTimerCondition USHORT array_reg USHORT array_num Argumeni s USHORT array rege Pointer to the area storing the value to set in the target register USHORT array_num
134. mation Version and Release date on Pin Configurator Version Displays the version of Pin Configurator Release date Displays the release date of Pin Configurator R20UT0006EJ0100 Rev 1 00 tENESAS Page 54 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Device Top View Settings tab This tab allows you to view the information Color Tool Tip and Pin Name Display on and change the setting for the Device Top View selected in the Project Tree panel Figure A 6 Device Top View Settings Tab Property af Device Top Yiew Property El Color Power ping Red Special pins Green Unused pins Black Used pins Blue Device Lightlaray Highlight Red Macro highlight elow External peripheral highlight M Green Tool Tip Tool tip Display all Pin Name Display Define name Display Pin functor Dsiplay all Power pins Select text color of power pins i Device Top Yiew Settings The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the context menu Remark If this panel is already open selecting a different
135. ment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics especially with respect to the maximum rating operating supply voltage range movement power voltage range heat radiation characteristics installation and other product characteristics Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges Although Renesas Electronics endeavors to improve the quality and reliability of its products semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certai
136. n CG_timer c Syntax void TMOO_SoftwareTriggerOn void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 224 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO_ChangeDuty Changes the duty ratio of the signal output to the TOOO pin Remark This API function can only be called when the 16 bit timer event counter 00 is being used for PPG output Classification CG_timer c Syntax include CG macrodriver h void TMOO_ChangeDuty UCHAR ratio Argumeni s Remark The value set to duty ratio ratio must be in base 10 notation Return value None Example The example below shows changing the duty ratio to 25 CG_main c include CG_macrodriver h void main void UCHAR ratio 25 TMOO_Start Start count TMOO_ChangeDuty ratio Change duty ratio R20UTO006EJ0100 Rev 1 00 tENESAS Page 225 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMOO GetPulseWidth Captures the high low level width measured for the signal pulses input to the TIOnO pin Remark This API function can only be called when the 16 bit timer event counter 00 is being used for pulse width measurement Classification CG_timer c Syntax include CG Macrodriver h include CG timer h void TMOO_GetPulseWidth ULONG highwidth ULONG lowwidth enum TMChannel channel
137. n list is specified in the Save As dialog box which opens by selecting File menu gt gt Save Pin List As Figure 2 12 Output Device Pin List Save As Save IF My Documents w E pi mj Amy Music oe My Pictures My Recent Documents i sample _ se T Desktop May Documents Mp Network File name Places i Save at lype Microsoft Office Excel Bool Remarks 1 If a device pin list has been already output that list will be overwritten by selecting File menu gt gt Save Pin List 2 The output format for the device pin list is limited to Microsoft Office Excel Book R20UT0006JJ0100 Rev 1 00 tENESAS Page 24 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 5 2 Output device top view Select File menu gt gt Save Top View As to output a report file a file containing information configured using Pin Configurator device top view The destination folder for the device top view is specified in the Save As dialog box which opens by selecting File menu gt gt Save Top View As Save As Save IF My Documents w My Recent Documents T Desktop May Documents May Computer P biy Network Places Remark Top View Figure 2 13 Output Device Top View HM Videos sample File name wt gt p E Save If a device top view has been already output that view will be overwritten by s
138. n use conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system manufactured by you Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances including without limitation the EU RoHS Directive Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics
139. nable INT_INTPO MD_TRUE Enable acceptance of maskable interrupt INTPO R20UTO006EJ0100 Rev 1 00 tENESAS Page 140 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTPn_Disable Disables the acceptance of the maskable interrupts INTPn external interrupt requests Classification CG_int c Syntax void INTPn_Disable void Remark nis the interrupt factor number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 141 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTPn_Enable Enables the acceptance of the maskable interrupts INTPn external interrupt requests Classification CG_int c Syntax void INTPn_Enable void Remark nis the interrupt factor number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 142 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS KEY Disable Disables the acceptance of the key interrupts INTKR Classification CG_int c Syntax void KEY Disable void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 143 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS KEY Enable Enables the acceptance of the key interrupts INTKR Classification CG_int c Syntax void KEY_Enable void Argument s None Return valu
140. ned initialization relating to the A D converter Remark This API function is called as the AD_ Init callback routine Classification CG_ad_user c Syntax void AD UseriInit void gt Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 202 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_ComparatorOn Enables operation of voltage converter Remark About 1 microsecond of stabilization time is required when changing the voltage converter from operation stopped to operation enabled status Consequently about 1 micro second must be left free between the call to this API function and the call to AD_ Start Classification CG_ad c Syntax void AD ComparatorOn void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 203 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_ComparatorOff Disables operation of voltage converter Classification CG_ad c Syntax void AD_ComparatorOff void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 204 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Starts A D conversion Remark About 1 micro second of stabilization time is required when changing the voltage converter from operation stopped to operation enabled status Consequently about 1 micro second must
141. nformation configured in the Code Generator panel 6 Output Source Code Output the source code device driver program to the specified folder 7 Output Report Files Output report files a file containing information configured using Code Generator and a file containing information regarding the source code to the specified folder 8 Save project Save a project Remark See CubeSuite Start User s Manual for details on Save project R20UT0006JJ0100 Rev 1 00 tENESAS Page 26 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 2 Open Code Generator Panel Open the Code Generator panel to configure the information necessary to control the peripheral functions clock gener ator port functions etc To open the Code Generator panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral function node System Port etc in the Project Tree panel Figure 3 1 Open Code Generator Panel Code Generator A Reflect in Pin S Generate Code 1 t gt T A Gi Cy gat FE 4 Power voltage VOD setting a7 vis VDD lt 55 iv 18 Oo s VOD lt 27 Main s stem clock selection Internal high speed oscillation 1H High speed system clock fH Internal high speed oscillation clock setting Operation Frequency MHz High speed system clock setting XI oscillation Ei External clock input fFEXCLE Frequency MHz Stable time 13107
142. ng Pin Configurator device pin list Save Top View Device Top View panel dedicated item Saves a report file a file containing information configured using Pin Configura tor device top view overwriting the existing file Save Top View As Device Top View panel dedicated item Opens the Save As dialog box for naming and saving a report file a file con taining information configured using Pin Configurator device top view Save Code Generator Report Code Generator panel Code Generator Preview panel dedicated item Outputs report files a file containing information configured using Code Gener ator and a file containing information regarding the source code The output format for the report file either HTML or CSV is selected by click ing Generation tab gt gt Report type in the Property panel The destination folder for the report file is specified by clicking Generation tab gt gt Output folder in the Property panel Save Output Tab Name Output panel dedicated item Saves the message corresponding to the specified tab overwriting the existing file Save Output Tab Name As Output panel dedicated item Opens the Save As dialog box for naming and saving the message correspond ing to the specified tab b Edit menu Undo Property panel dedicated item Cancels the effect of an edit operation to restore the previous state Cut Property panel dedicated item Sends the character string or lines selecte
143. ns selected via the device pin list s Function feature in parentheses Selected function only Only display functions selected via the device pin list s Function feature in the device top view R20UT0006EJ0100 Rev 1 00 tENESAS Page 57 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Generation tab This tab allows you to view the information Product Information Generate File Mode and Pin Configurator Reflect Mode on and change the setting for the Code Generator Design Tool selected in the Project Tree panel Figure A 8 Generation Tab Property gt Gode Generator Property El Product Information Werzion Release date El Generate File Mode Generate file Meree file Output tolder C Documents and Settings Report type HTML file Register files Output files to project El Pin Configurator Reflect Mode Mode Reflected Version The version information of the product i displayed Genaration The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the context menu Remark _ If this panel is already open selecting a different Code Generator
144. nts main function AFIlib GodeGenerator for TEKOKx2L E1 00c O5 May 2009 OF AMP r Timer Watchdog Timer RTG Glock Output LWI Device uPOFeFObSS 48 Compiler CAYaKO Creation date 2009 06 26 OE EE OR e E E Remarks 1 You can change the source code to be displayed by selecting the source file name or API function name in the Code Generator Preview panel 2 The following table displays the meaning of the color of the source code text displayed in the Code Generator Preview panel Table 3 3 Color of Source Code Cr 3 You cannot edit the source code within the Code Generator Preview panel 4 For some of the API functions such as API functions for serial array units values such as the SFR register value are calculated and finalized when the source code is generated when the i Generate Code button on the Code Generator panel is pressed For this reason the source code displayed in the Code Generator Preview panel may not be the same as that would actually be generated R20UTOO06JJ0100 Rev 1 00 tENESAS Sep 01 2010 Page 31 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 Output Source Code Output the source code device driver program by pressing the Generate Code button on the Code Generator panel The destination folder for the source code is specified by clicking Generation tab gt gt Output folder in the Property panel Figur
145. o Mame Total Used User A Fa AD Converter 400 0 Jatte unction A P1425010 Free PITS Oars Free R20UT0006EJ0100 Rev 1 00 tENESAS Page 97 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Figure A 37 Operational Object External Peripheral Tab First Layer Device Pin List oe hi POO SCLADY 5 7 Free Ea Serna Peripheral a Total i 2 Displayed item selection area Select whether or not to display the item selected in the Operational object selection area in the device pin list Checked Displays the selected item in the device pin list Not checked Hides the selected item in the device pin list Function buttons Opens the New Column dialog box for adding columns to the device pin list Delete Column Deletes the selected columns from the device pin list You can only delete the column which you added using the New Column dialog box Default Restores the column order to the default settings the column order to the default Restores the column order to the default settings ae Closes this dialog box R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 98 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE New Column dialog box This dialog box allows you to add your own column to the device pin list Figure A 39 New Column Dialog Box Hew Column Functon batons The following items are explained here How to open Descripti
146. o control 8 bit timer event counter 5n functions TM5n_User Init Performs user defined initialization relating to the 8 bit timer event counter 5n R20UTO006EJ0100 Rev 1 00 tENESAS Page 111 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Timer TM5n_ Start Starts the count for 8 bit timer event counter 5n TM5n_Stop Ends the count for 8 bit timer event counter 5n TM5n_ChangeTimerCondition TM5n_ChangeDuty Changes the value of 8 bit timer compare register 5n CR5n Changes the duty ratio of the PWM signal output to the TO5n pin TMHn_ Init TMHn_UserlInit Performs initialization necessary to control 8 bit timer Hn functions Performs user defined initialization relating to the 8 bit timer Hn TMHn_ Start Starts the count for 8 bit timer Hn TMHn_Stop Ends the count for 8 bit timer Hn TMHn_ChangeTimerCondition TMHn_ChangeDuty TMH1_CarrierOutputEnable TMH1_CarrierOutputDisable Changes the value of 8 bit timer H compare register 0n 1n CMPOn CMP1n Changes the duty ratio of the PWM signal output to the TOH pin Begins carrier pulse output of the 8 bit timer H1 carrier generator mode Ends carrier pulse output of the 8 bit timer H1 carrier generator mode Watchdog Timer WDT_ Restart RTC RTC_Init RTC_Userlnit Clears the watchdog timer counter and resumes count ing Performs initialization necessary to control real time counter functions Perfo
147. o the UART reception complete interrupt INTSR6 Remark This API function is called as the callback routine of interrupt process MD_INTSR6 corresponding to the UART reception complete interrupt INTSR6 process performed when the amount of data received is greater than the parameter rxnum specified for UART6_ReceiveData Classification CG_serial_ user c Syntax Ix2 void UART6_SoftOverRunCallback USHORT rx data Kx2 L void UART6_SoftOverRunCallback UCHAR rx data Argument s USHORT rx data Received data data received greater than the number specified in the parameter rxnum for UART6_ReceiveData UCHAR rx data Received data data received greater than the number specified in the parameter rxnum for UART6_ReceiveData Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 157 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_ErrorCallback Performs processing in response to the UART communication error interrupt INTSRE6 Remark This API function is called as the callback routine of interrupt process MD_INTSRE6 corresponding to the UART communication error interrupt INTSRE6 Classification CG_serial_user c Syntax include CG_macrodriver h void UART6_ErrorCallback UCHAR err type Argument s UCHAR err type Trigger for UART communication error interrupt 00000xx1B Overrun error 00000x1xB Framing error 000001xxB Parity error
148. ode Generator panel This panel allows you to configure the information necessary to control the peripheral functions provided by the microcontroller Code Generator Preview panel This panel allows you to confirm or configure on a per API function basis the setting that determines whether or not the source code device driver program is generated when the Generate Code button is pressed in the Code Generator panel It also allows you to confirm the source code that reflects the information configured in the Code Generator panel Output panel This panel displays operation logs for various components design tool build tool etc provided by CubeSuite Column Chooser dialog box This dialog box allows you to choose whether or not to display the item listed in this dialog box in the device pin list and add columns to or delete columns from the device pin list New Column dialog box This dialog box allows you to add your own column to the device pin list Browse For Folder dialog box This dialog box allows you to specify the output destination for files source code report file etc Save As dialog box AS Save As dialog box box This dialog box allows you to name and save a file Such as a report file R20UT0006EJ0100 Rev 1 00 tENESAS Page 42 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE This is the first window to open when CubeSuite is launched This window is used to operate various componen
149. of pointers to global variables start with a gp and use Camel Case Names of elements in enum statements are in ALL CAPS C 2 Output Function Below is a list of API functions output by Code Generator Table C 1 API Function List CLOCK_Init Performs initialization required to control the clock gen erator on chip debug and etc CLOCK_Userlnit Performs user defined initialization relating to the clock generator on chip debug and etc CG_ReadResetSource Performs processing in response to RESET signal CG_ChangeClockMode Changes the CPU clock peripheral hardware clock CG_ChangeFrequency Changes the division ratio of the CPU clock peripheral hardware clock CG_SelectPowerSaveMode Configures the CPU s standby function CG_SelectStabTime Configures the oscillation stabilization time of the X1 clock CG_ChangePIllMode Controls the operation of PLL function PORT_Init Performs initialization necessary to control port func tions PORT_Userlnit Performs user defined initialization relating to the port PORT_ChangePmnInput Switches the pin s I O mode from output mode to input mode PORT_ChangePmnOutput Switches the pin s I O mode from input mode to output mode INT INTP_Init Performs initialization necessary to control the external interrupt INTPn functions INTP_UserlInit Performs user defined initialization relating to the exter nal interrupt INTP functions KEY_Init Performs initialization necessary to control
150. ol the functions of serial array unit and functions of serial interface provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 20 Example of Serial DARTS S01 ICA Transfer mode Unused O UARTS transmission mode CO UARTE reception mode O UART6 transmission reception mode O DALI communication mode How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Serial Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 80 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Operational Amplifier This panel allows you to configure the information necessary to control the functions of operational amplifier provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 21 Example of Operational Amplifier P operation setting Unused Used FGA mode gain selection AMPO operation setting Unused O Used AMPI operation setting Unused O Used How to open On the Project Tree panel select Project name Project gt gt Code Generator Design
151. on SYSPLLOFF Stop operation Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 126 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 2 Port Below is a list of API functions output by Code Generator for port use Table C 3 API Functions Port PORT Init Performs initialization necessary to control port functions PORT_Userlnit Performs user defined initialization relating to the port PORT_ChangePmnInput Switches the pin s I O mode from output mode to input mode PORT_ChangePmnOutput Switches the pin s I O mode from input mode to output mode R20UTO006EJ0100 Rev 1 00 tENESAS Page 127 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PORT Init Performs initialization necessary to control port functions Classification CG_port c Syntax void PORT_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 128 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PORT_Userlnit Performs user defined initialization relating to the port Remark This API function is called as the PORT Init callback routine Classification CG_port_user c Syntax void PORT_UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 129 of 300 Sep 01 2010 CubeSuite Ver
152. on tab 58 Macro Setting tab 61 Pin Configurator Information tab 54 Pin Configurator Settings tab 52 R AMP_Stop 192 RTC 86 OPAMP _Init 186 RTC 243 OPAMP_Userlnit 187 RTC_AlarmDisable 259 PGA_ChangePGAFactor 190 RTC_AlarmEnable 258 PGA_Start 188 RTC_AlarmGet 263 PGA_Stop 189 RTC_AlarmInterruptCallback 264 Output panel 92 RTC_AlarmSet 260 All Output Messages tab 94 RTC_ChangeCorrectionValue 276 Code Generator tab 95 RTC_ConstPeriodInterruptCallback 257 p RTC_ConstPeriodInterruptDisable 256 PCL_ChangeFreq 282 RTC_ConstPeriodInterruptEnable 255 PCL Init 278 RTC _CounterDisable 248 PCL Start 280 RTC_CounterEnable 247 PCL Stop 281 RTC_CounterGet 253 PCL Userinit 279 RTC_CounterSet 251 R20UTOOO6EJ0100 Rev 1 00 2CENESAS Page 293 of 300 CubeSuite Ver 1 40 APPENDIX D INDEX RTC_Init 244 S RTC_IntervallnterruptDisable 269 Save As dialog box 101 RTC_IntervallnterruptEnable 267 Serial 80 RTC_IntervalStart 265 Serial 145 RTC_IntervalStop 266 CSlin_Init 160 RTC_PowerOff 246 CSlin_ReceiveData 164 RTC_RTC1HZ_OutputDisable 271 CSlin_ReceiveEndCallback 169 RTC_RTC1HZ_OutputEnable 270 CSl1in_SendEndCallback 168 RTC _RTCCL_OutputDisable 273 CSl1n_SendReceiveData 166 RTC_RTCCL_OutputEnable 272 CSlin_Start 162 RTC_RTC
153. on of each area Function buttons How to open Click the New Column button in the Column Chooser dialog box Description of each area 1 Name This area allows you to enter column headings of the columns added to the device pin list 2 Type Select the input format of the column to add to the device pin list Only character strings can be entered in the column Cehck box Adds a column of check boxes Whole number Only integers can be entered in the column Only real numbers can be entered in the column Only dates in YYYYMMDD format can be entered in the column Function buttons Button Function OK Adds a column that has the column heading specified in the Name to the right end of the device pin list Ignores the setting and closes this dialog box R20UT0006EJ0100 Rev 1 00 tENESAS Page 99 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Browse For Folder dialog box This dialog box allows you to specify the output destination for files Source code report file etc Figure A 40 Browse For Folder Dialog Box Browse For Folder Desktop 4 i My Documents 1 E3 H My Computer E3 My Network Places 9 Unused Desktop Shortcuts Function buttons i i The following items are explained here How to open Description of each area Function buttons How to open In the Generation tab of the Property panel click the button in
154. onding to the CSI1n communication complete interrupt INTCSI1n performed when number of received data specified by CSlin_ReceiveData parameter rxnum has been completed Classification CG_serial_ user c Syntax void CSIln_ReceiveEndCallback void Remark nis the channel number Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 169 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA Init Performs initialization of the serial interface IICA Classification CG_serial c Syntax void IICA_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 170 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA_Userlnit Performs user defined initialization of the serial interface IICA Remark This API function is called as the IICA_ Init callback routine Classification CG_serial_ user c Syntax void IICA_UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 171 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_Stop Ends IICA communication Classification CG_serial c Syntax void LICK Stop void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 172 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS I
155. onverter provided by the microcontroller Changes the content displayed in the Information setting area to the Timer for configuring the information necessary to control the functions of timer array unit pro vided by the microcontroller Changes the content displayed in the Information setting area to the Watchdog Timer for configuring the information necessary to control the functions of watchdog timer provided by the microcontroller Changes the content displayed in the Information setting area to the RTC for con figuring the information necessary to control the functions of real time counter pro vided by the microcontroller Changes the content displayed in the Information setting area to the Clock Output for configuring the information necessary to control the functions of clock output con troller provided by the microcontroller Changes the content displayed in the Information setting area to the LVI for config uring the information necessary to control the functions of low voltage detector pro vided by the microcontroller R20UTO006EJ0100 Rev 1 00 tENESAS Page 75 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 2 Information setting area The content displayed in this area differs depending on the peripheral function node or peripheral function but ton selected or pressed when opening this panel See the following sections for details on this area System Port
156. ort 2UPORT1 2 S wire Serial OWM Csn1 ii o Pin Number Macro External Peripheral DE EE Pi Device Pin List Macro Name 4 0 Converter ADG On chip Debug Function OCO Port FORTI 2 3 wire Serial 0110501 iii EHE E E Macro Name H Used Total 4 0 Converteri ADC 4 On chip Debug Function OGO Port 2UPORT1 2 S wire Serial 01110501 ii o Pin Number Macro External Peripheral EEN R20UT0006JJ0100 Rev 1 00 tENESAS Page 15 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator Remark To change the display order click the button in the upper left of the device pin list The Column Chooser dialog box opens Drag an item displayed in the dialog s select Items to display area and drop it to the desired destination in the device pin list This will change the display order 2 2 3 Add column The Pin Configurator is used to add the user s own column to the device pin list using the New Column button in the Column Chooser dialog box that opens by pressing the button in the upper left corner of the device pin list To add a column use the New Column dialog box that opens by pressing the New Column button in the Column Chooser dialog box Figure 2 4 Add Column Hew Column Remark On the device pin list adding columns to the first level of Macro tab External Peripheral tab is restricted R20UT0006
157. ource code must be generated it is impossible to change the icon to Source code for the currently selected API function is gener ated Source code for the currently selected API function is not generated 2 Source code display area This area allows you to confirm the source code device driver program that reflects the information configured in the Code Generator panel The following table displays the meaning of the color of the source code text displayed in this area Table A 3 Color of Source Code C Remarks 1 You cannot edit the source code within this panel 2 For some of the API functions such as API functions for serial array units values such as the SFR register value are calculated and finalized when the source code is generated when the ij Generate Code button on the Code Generator panel is pressed For this reason the source code displayed in this panel may not be the same as that would actually be generated 3 You can change the source code to be displayed by selecting the source file name or API function name in the preview tree File menu Code Generator Preview panel dedicated items Save Code Generator Report Outputs report files a file containing information configured using Code Generator and a file containing information regarding the source code R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 90 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Rem
158. pen On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Clock Output Remark Ifthe Code Generator panel is already open pressing the in button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 87 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE LVI This panel allows you to configure the information necessary to control the functions of low voltage detector provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 28 Example of LVI Low voltage detector operation setting O Unused Used LVI is ON by default on power applilcation Option Byte Voltage detection setting Power voltage detection WOD 492 01 aj O External voltage detection EXLYD eae Operation mode setting Generate interrupt signal INTLYT Prior ity Lowy t O Generate internal reset sienal How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt LVI Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 88 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Code Generator Preview panel This p
159. pletion MD_ARGERROR Invalid argument specification R20UTO006EJ0100 Rev 1 00 tENESAS Page 207 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD Read Reads the results of A D conversion 10 bits Remark The contents of the 10 bit A D conversion result register ADCR are stored in the area specified by param eter buffer Classification CG_ad c Syntax include CG macrodriver h void AD Read USHORT buffer Argumeni s USHORT buffer Pointer to area in which to store read results of A D conversion Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 208 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD ReadByte Reads the results of A D conversion 8 bits most significant 8 bits of 10 bit resolution Remark The contents of the 8 bit A D conversion result register H ADCRH are stored in the area specified by parameter buffer Classification CG_ad c Syntax include CG_macrodriver h void AD_ReadByte UCHAR buffer Argumeni s UCHAR buffer Pointer to area in which to store the results of A D conversion Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 209 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 8 Timer Below is a list of API functions output by Code Generator for timer array unit use Table C 9 API Functions Timer Generates the trigger software trigge
160. ponse to detection of error in IICA master communication Classification CG_serial_ user c Syntax include CG macrodriver h void TICA_ MasterErrorCallback MD_STATUS flag Argumeni s MD_STATUS flag Cause of communication error MD_SPT Stop condition detected MD_NACK Acknowledge not detected Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 178 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_SlaveSendStart Starts IICA slave transmission Remark This API function repeats the byte level IICA slave transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum Classification CG_serial c Syntax include CG_macrodriver h void IICA SlavesendsStart UCHAR txbuf USHORT txnum Argument s EE UCHAR txbuf Pointer to a buffer storing the transmission data Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 179 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_SlaveReceiveStart Starts IICA slave reception Remark This API function performs byte level IICA slave reception the number of times specified by the parameter rxnum and stores the data in the buffer specified by the parameter rxbuf Classification CG_serial c Syntax include CG_macrodriver h void IICA_SlaveReceiveStart UCHAR rxbuf USHORT rxnum Argument s
161. products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics How to Use This Manual This manual describes the role of the CubeSuite integrated development environment for developing applications and systems for 78KO microcontrollers and provides an outline of its features CubeSuite is an integrated development environment IDE for 78KO microcontrollers integrating the necessary tools for the development phase of software e g design implementation and debugging into a single platform By providing an integrated environment it is possible to perform all development using just this product without the need to use many different tools separately Readers This manual is intended for users who wish to understand the functions of the CubeSuite and design software and hardware application systems Purpose This manual is intended to give users an understanding of the functions of the Cubesuite to use for reference in developing the hardware or software of systems using these devices Organization This manual can be broadly divided into the following units CHAPTER 1 GENERAL CHAPTER 2 FUNCTIONS Pin Configurator CHAPTER 3 FUNCTIONS Code Generator APPENDIX A WINDOW REFERENCE APPEN
162. r for one shot pulse output TMOO_GetPulseWidth Captures the high low level width measured for the signal pulses input to the TIOnO pin Changes the value of 8 bit timer H compare register 0n 1n CMPOn CMP1n R20UTO006EJ0100 Rev 1 00 tENESAS Page 210 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMX Init Performs initialization necessary to control 16 bit timer Xn functions Classification CG_timer c Syntax void TMX Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 211 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMXn_ Start Starts the count for 16 bit timer Xn Remark The time from the call to this API function to the start of counting depends on the type of the function in question e g PWMoutput or A D conversion start timing signal output Classification CG_timer c Syntax void TMXn Start void Remark nis the channel number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 212 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TMXn_Stop Ends the count for 16 bit timer Xn Classification CG_timer c Syntax void TMXn Stop void Remark nis the channel number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 213 of 300 Sep 01 2010 CubeSuite Ver
163. r Message Displays help for the message on the current caret location This only applies to warning messages and error messages R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 93 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE All Output Messages tab This tab displays operation logs for all components design tool build tool etc provided by CubeSuite Figure A 31 All Output Messages Tab The following items are explained here How to open Description of each area How to open From the View menu select Output Description of each area 1 Message area This area displays operation logs for all components design tool build tool etc provided by CubeSuite The following table displays the meaning of the color of the message text displayed in this area Table A 5 Color of Message Text Background Black White Information message Displayed with information notices Blue Standard Color Warning message Displayed with warnings about operations Red LightGray Fatal error message Displayed when there is a fatal error or when execution is not possible due to a operational mistake R20UT0006EJ0100 Rev 1 00 tENESAS Page 94 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Code Generator tab This tab displays only operation logs for Code Generator out of those for various components design tool build tool etc provided by Cube
164. reby under any patents copyrights or other intellectual property rights of Renesas Electronics or others You should not alter modify copy or otherwise misappropriate any Renesas Electronics product whether in whole or in part Descriptions of circuits software and other related information in this document are provided only to illustrate the operation of semiconductor products and application examples You are fully responsible for the incorporation of these circuits software and information in the design of your equipment Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits software or information When exporting the products or technology described in this document you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture use or sale is prohibited under any applicable domestic or foreign laws or regulations Renesas Electronics has used reasonable care in preparing the information included in this document but Renes
165. reception complete flag R20UTO006EJ0100 Rev 1 00 tENESAS Page 154 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_SendEndCallback Performs processing in response to the UART transmission complete interrupt INTST6 Remark This API function is called as the callback routine of interrupt process MD_INTST6 corresponding to the UART transmission complete interrupt INTST6 performed when number of transmission data specified by UART6_SendData parameter txnum has been completed Classification CG_serial_ user c Syntax void UART6_SendEndCallback void Argument s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 155 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_ReceiveEndCallback Performs processing in response to the UART reception complete interrupt INTSR6 Remark This API function is called as the callback routine of interrupt process MD_INTSR6 corresponding to the UART reception complete interrupt INTSR6 performed when number of received data specified by UART6_ReceiveData parameter rxnum has been completed Classification CG_serial_ user c Syntax void UART6_ReceiveEndCallback void Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 156 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UART6_SoftOverRunCallback Performs processing in response t
166. resistance yes SMBus input buffer none is changed as follows I O mode type Input mode Built in pull up resistance used No CG_main c include CG macrodriver h void Main void 4 PORT_ChangePOOInput MD_FALSE Switch I O mode Example 3 Below is shown an example where pin P04 built in pull up resistance yes SMBus input buffer yes is changed as fol lows I O mode type Input mode Built in pull up resistance used No Input buffer type SMBus input buffer CG_main c include CG macrodriver h void Main void PORT_ChangeP04Input MD_FALSE MD_TRUE Switch I O mode R20UT0006EJ0100 Rev 1 00 tENESAS Page 131 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PORT_ChangePmnOutput Switches the pin s I O mode from input mode to output mode Classification CG_port c Syntax The format for specifying this API function differs according to whether the target pin conducts N ch open drain output N ch open drain output none include CG_macrodriver h void PORT_ChangePmnOutput BOOL initialvalue N ch open drain output yes include CG_macrodriver h void PORT_ChangePmnOutput BOOL enablench BOOL initialvalue Remark nm is the port number Argumeni s BOOL enablench Output mode type MD_TRUE N ch open drain output Vpop withstand voltage mode MD_FALSE Normal output mode BOOL initialvalue Initial output value
167. rms user defined initialization relating to the real time counter RTC_PowerOff Halts the clock supplied to the real time counter RTC_CounterEnable RTC_CounterDisable RTC_SetHourSystem RTC_CounterSet RTC_CounterGet RTC_ConstPeriodinterruptEnable Starts the count of the real time counter year month weekday day hour minute second Ends the count of the real time counter year month weekday day hour minute second Sets the clock type 12 hour or 24 hour clock of the real time counter Sets the counter value year month weekday day hour minute second of the real time counter Reads the counter value year month weekday day hour minute second of the real time counter Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function RTC_ConstPeriodinterruptDisable Ends the cyclic interrupt function RTC_ConstPeriodIinterruptCallback Performs processing in response to the cyclic interrupt INTRTC RTC_AlarmEnable Starts the alarm interrupt function R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 112 of 300 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Sets the alarm conditions weekday hour minute Reads the alarm conditions weekday hour minute RTC_AlarmInterruptCallback Performs processing in response to the alarm interrupt INTRTC RTC_IntervalStart Starts the interval interrupt function RTC_IntervalStop Ends the inter
168. roduct Informaton El Use of Pin Configurator Panek Use pin configurator panels No El Package Package type GC Version Pin configurator version information Pin Configurator Settings The following items are explained here How to open Description of each area Edit menu Property panel dedicated items Help menu Property panel dedicated items Context menu How to open On the Project Tree panel select a node Pin Configurator Design Tool Device Pin List Device Top View Code Generator Design Tool peripheral function node System Port etc and then select Property from the View menu On the Project Tree panel select a node Pin Configurator Design Tool Device Pin List Device Top View Code Generator Design Tool peripheral function node System Port etc and then select Property from the context menu On the Code Generator Preview panel select a file and then select Property from the View menu On the Code Generator Preview panel select a file and then select Property from the context menu Remarks 1 _ If this panel is already open selecting a different node Pin Configurator Design Tool Device Pin List Device Top View Code Generator Design Tool or peripheral function node System Port etc in the Project Tree panel changes the content displayed in the Detail information display change area and Explana
169. s the Serial for configuring the information necessary to control the func tions of serial array unit and functions of serial interface provided by the micro controller Operational Amplifier Opens the Operational Amplifier for configuring the information necessary to control the functions of comparator programmable gain amplifier provided by the microcontroller Comparator Opens the Comparator for configuring the information necessary to control the functions of comparator provided by the microcontroller A D Opens the A D for configuring the information necessary to control the func tion of A D converter provided by the microcontroller Timer Opens the Timer for configuring the information necessary to control the func tions of timer array unit provided by the microcontroller Watchdog Timer Opens the Watchdog Timer for configuring the information necessary to con trol the functions of watchdog timer provided by the microcontroller RTC Opens the RIC for configuring the information necessary to control the func tions of real time counter provided by the microcontroller Clock Output Opens the Clock Output for configuring the information necessary to control the functions of clock output controller provided by the microcontroller LVI Opens the LVI for configuring the information necessary to control the func tions of low voltage detector provided by the microcontroller c Icons The table below displays the meanin
170. se Table C 12 API Functions Clock Output PCL_Init Performs initialization necessary to control clock output control circuit functions PCL_UserlInit Performs user defined initialization relating to the clock output control circuits PCL_Start Starts clock output PCL_Stop Ends clock output PCL_ChangeFreq Changes the output clock to the PCL pin R20UTO006EJ0100 Rev 1 00 tENESAS Page 277 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCL_Init Performs initialization necessary to control clock output control circuit functions Classification CG_pcl c Syntax void PCL_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 278 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCL_Userlnit Performs user defined initialization relating to the clock output control circuits Remark This API function is called as the PCL Init callback routine Classification CG_pcl_user c Syntax void PCL Userinit void Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 279 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCL Start Starts clock output Classification CG_pcl c Syntax void PCl Start void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 280 of 300 Sep 01 2010 Cube
171. selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired col umn to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which opens by pressing the button in the upper left corner of the device pin list R20UT0006EJ0100 Rev 1 00 RENESAS Page 68 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE External Peripheral tab This tab displays information about the pins connected to external peripherals in order grouped at the external periph eral component level Figure A 14 External Peripheral Tab Device Pin List External Peripheral Total User Deine User Detfinet2 User Detinets Pin Number The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins connected to external peripheral parts Note that items in this area s device pin list are sorted by groups at the
172. stion e g interval timer or external event counter Classification CG_timer c Syntax void TMS Stare lt void Remark nis the channel number Argumeni s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 229 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n_Stop Ends the count for 8 bit timer event counter 5n Classification CG_timer c Syntax void TM5n_Stop void Remark nis the channel number Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 230 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n_ChangeTimerCondition Changes the value of 8 bit timer compare register 5n CR5n Remark To change the contents of CR5n you must call TM5n_Stop before calling this API function Classification CG_timer c Syntax Remark nis the channel number Argumeni s a UCHAR valueg The value to set in CR5n Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 231 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TM5n_ChangeDuty Changes the duty ratio of the PWM signal output to the TO5n pin Remark This API function can only be called when the 8 bit timer event counter 5n is being used for PWM output Classification CG_timer c Syntax include CG macrodriver h void TM5n_ChangeDuty UCHAR ratio Rem
173. t The destination folder for the report file is specified by clicking Generation tab gt gt Output folder in the Property panel Remarks 1 You can only use macro or function as a name of the report file Table 3 6 Output Report Files macro A file that contains the information configured using Code Generator function A file that contains the information regarding the source code 2 The output mode for the report file is fixed to Overwrite file Figure 3 12 Output Example of Report File macro Macro list Windows Internet Explorer Sel File Edit wiew Favorites Tools Help dur e Macro list MCU name NEC SBROKG 2L Chip name uPD 78F0588_ 446 X1 oscillation fX o MHz AT1 oscillation fAT 32 7 68 KHz og My Computer io R20UT0006JJ0100 Rev 1 00 tENESAS Page 38 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator Figure 3 13 Output Example of Report File function gt Function list Windows Internet Explorer SEE G x iveseacr e ce Edit wiew Favorites Tools Help abr 6 Function list MCU name NEC SBROKG 2L Chip name uPD 78F0588_ 48 Module File Macro Function Default Status CG_main c systeminit Used hdwinit Used CG_macrodriver h CG_macrodriver h Used CG_userdefine h CG_userdefine h Used CG_Ik dr CG_Ik dr Used CG_option asm CG_option asm Used CG_system c face sys
174. t The following items are explained here How to open Description of each area Function buttons How to open In the Pin Number tab of the Device Pin List panel click the Eg button In the Macro tab of the Device Pin List panel click the button In the External Peripheral tab of the Device Pin List panel click the button Description of each area 1 Operational object selection area This area allows you to select the device pin list to be configured in this dialog box Configures the device pin list corresponding to the Pin Number tab Configures the device pin list belonging to the first layer of the Macro tab Configures the device pin list belonging to the second layer of the Macro tab External Peripheral Configures the device pin list belonging to the first layer of the External Peripheral tab External Peripheral Pin Configures the device pin list belonging to the second layer of the External Periph eral tab R20UT0006EJ0100 Rev 1 00 sLENESAS Page 96 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Figure A 34 Operational Object Pin Number Tab Device Pin List PAOASGCLAOY SG E11 4INTP11 Pa SDAAO SIT1 INTPIO Used User A at Debug Function OGO Pott PORTI 2 3 wire Serial 011iC501 AG Powert POWER Ssbit Timer Event Counter OCTM50 _ Port APORTA eS m mmm 1 m roo or oe ee a aes a 0 q 0 0 0 4 0 0 Macr
175. t number symbol Hiragana Katakana Kanji and 1 byte Kata kana EUC JP 2 byte alphabet number symbol Hiragana Katakana Kanji and 1 byte Kata kana UTF 8 2 byte alphabet number symbol Hiragana Katakana Kanji include Chinese character and 1 byte Katakana 2 Number Notations allowed when entering numbers are as follows Table 3 2 List of Notation C Notation o puting number A numeric value that starts with a number between 1 and 9 and followed es numbers between 0 and 9 and the numeric value 0 Hex number A numeric value that starts with Ox and followed by a combination of numbers from 0 to 9 and characters from A to F characters are not case sensitive R20UT0006JJ0100 Rev 1 00 tENESAS Page 28 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 3 2 Icon indicating incorrect entry When performing code generation if you enter an invalid string in the Code Generator panel or a required input is missing thena J icon displays next to the incorrect input and the text is displayed in red to warn that there is a problem with the input Remark Ifthe mouse cursor is moved over the J icon information regarding the string that should be entered tips for correcting the entry popups Figure 3 2 Icon Indicating Incorrect Entry Code Generator 2 Reflect in Pin Generate Code T tgp a T M Gi Gy gat FE 4 Power voltage VDD setting 27 lt 2 VDD 55 1
176. tem c 4 My Computer R20UT0006JJ0100 Rev 1 00 tENESAS Page 39 of 300 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 6 1 Change output format The Code Generator is used to change the output format HTML file or CSV file of the report file by selecting Genera tion tab gt gt Report type in the Property panel Figure 3 14 Change Output Format Property ee Code Generator Property El Product Information El Generate File Mode Generate tile Merge file Output folder C Documents and Settings Report type HTML file Register tiles El Pin Configurator Reftle Mode Reflected Report type The format of report file i displayed Genaration Remark Output format is selected from the following two types Table 3 7 Output Mode of Source Code HTML file Outputs a report file in HTML format CSV file Outputs a report file in CSV format R20UTOO06JJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 40 of 300 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 6 2 Change output destination The Code Generator is used to change the output destination folder for the report file by selecting Generation tab gt gt Output folder in the Property panel To change the output destination use the Browse For Folder dialog box which opens by pressing the button in the Output folder Figure 3 15 Change Output Destination Browse For Folder Desktop E
177. the Property panel that contains the information for the currently selected file R20UT0006EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 91 of 300 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Output panel This panel displays operation logs for various components design tool build tool etc provided by CubeSuite Figure A 30 Output Panel Output The following items are explained here How to open Description of each area File menu Output panel dedicated items Edit menu Output panel dedicated items Help menu Output panel dedicated items Context menu How to open From the View menu select Output Description of each area 1 Message area This area displays operation logs for various components design tool build tool etc provided by CubeSuite The following table displays the meaning of the color of the message text displayed in this area Table A 4 Color of Message Text Background Block White Information message Displayed with information notices Blue Standard color Warning message Displayed with warnings about operations Red LightGray Fatal error message Displayed when there is a fatal error or when execution is not possible due to a operational mistake Remark See the sections All Output Messages tab and Code Generator tab for details on the content dis played in this area 2 Tab selection area Select the source of message
178. the key interrupt INTKR functions R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 108 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS KEY_UserlInit Performs user defined initialization relating to the key interrupt INTKR functions INT _MaskablelnterruptEnable Disables enables the acceptance of the maskable inter rupts INTPn_Disable Disables the acceptance of the maskable interrupts INTPn external interrupt requests INTPn_Enable Enables the acceptance of the maskable interrupts INTPn external interrupt requests KEY_ Disable Disables the acceptance of the key interrupts INTKR KEY Enable Enables the acceptance of the key interrupts INTKR Serial UARTE6_Init Performs initialization of the serial interface UART6 channel UART6_UserlInit Performs user defined initialization of the serial inter face UART6 UART6_SendEndCallback Performs processing in response to the UART trans mission complete interrupt INTST6 UART6_ReceiveEndCallback Performs processing in response to the UART recep tion complete interrupt INTSR6 UART6_SoftOverRunCallback Performs processing in response to the UART recep tion complete interrupt INTSR6 UART6_ErrorCallback Performs processing in response to the UART commu nication error interrupt INTSRE6 CSlin_Init Performs initialization of the serial interface CSI1n channel CSlin_Userlnit Performs user defined initialization of the serial inter face CSl1n CSl1n_SendEndCal
179. tion area accordingly 2 If this panel is already open pressing a different peripheral function button im etc in the Code Generator panel changes the content displayed in the Detail information display change area and Explanation area accordingly 3 If this panel is already open selecting a different file in the Code Generator Preview panel changes the content displayed in the Detail information display change area and Explanation area accordingly R20UT0006EJ0100 Rev 1 00 tENESAS Page 49 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Description of each area 1 Detail information display change area This area allows you to view the information on and change the setting for the node Pin Configurator Design Tool Device Pin List Device Top View Code Generator Design Tool or peripheral function node System Port etc selected in the Project Tree panel the peripheral function button E etc pressed in the Code Generator panel or the file selected in the Code Generator Preview panel The content displayed in this area differs depending on the node selected in the Project Tree panel the peripheral function button pressed in the Code Generator panel or the file selected in the Code Generator Preview panel The following table displays the meaning of H and amp displayed to the left of each category Indicates that the items within the category are displayed as a collapse
180. ts design tool build tool etc provided by CubeSuite Figure A 1 O sample CubeSuite Project Tree File Edit Gi start ail oe G5 em eH A View Project sample Proj mE Po a Code Generator Design Tool 4 CATSKO Build Tool es 78KO Simulator Debug Tool pE QB Programmer Flash Programming Tool w O File F3 F FRO The following items are explained here How to open Description of each area How to open Build Debug Flash Tool SENN E Main Window Window Help re yy E My Gre Ce Cre See File name This is the name of the file to which the Information of this main project i to be Sayed Project f All Output Messages Fa ra titi til fic 2 Disconnected From the start menu select All Programs gt gt NEC Electronics CubeSuite gt gt CubeSuite Description of each area 1 Menu bar This area consists of the following menu items R20UTOOO6EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 43 of 300 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE a File menu Save Pin List Device Pin List panel dedicated item Saves a report file a file containing information configured using Pin Configura tor device pin list overwriting the existing file Save Pin List As Device Pin List panel dedicated item Opens the Save As dialog box for naming and saving a report file a file con taining information configured usi
181. txnum transmissions receptions CG_serial_user c include CG macrodriver h extern BOOL gsilag Transmission complete flag iInterrupt void MD INTCSI10 void 4 Interrupt processing for INTCSI10 if gCsil0TxCnt gt Oy else CSI10_SendEndCallback Call callback routine void CSILO SendindCallback void 4 Callback routine for INTCSI10 gSflag 0 Set transmission complete flag R20UTOOO6EJ0100 Rev 1 00 2CENESAS Page 167 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSI1n_SendEndCallback Performs processing in response to the CSI1n communication complete interrupt INTCSI1n Remark This API function is called as the callback routine of interrupt process MD_INTCSI1n corresponding to the CSI1n communication complete interrupt INTCSI1n performed when number of transmission data speci fied by CSlin_SendReceiveData parameter txnum has been completed Classification CG_serial_ user c Syntax void CSIln_SendEndCallback void Remark nis the channel number Argumeni s None Return value None R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 168 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSI1n_ReceiveEndCallback Performs processing in response to the CSI1n communication complete interrupt INTCSI1n Remark This API function is called as the callback routine of interrupt process MD_INTCSI1n corresp
182. unction Set alarm initial value Week day sunday Monday Tuesday Wednesday Thursday Friday saturday Hour Minute 00 00 Counter correction function setting Use correction tunction When the second digits are at 00 20 or 40 us Interrupt setting Used as constant period interrupt function INTRTG Used az alarm interrupt function INTRTC Prior ity Lowy et Interval interrupt function INTRTCI 1953125 2 GASU ms Priority Lowy et ATCO RTGGL output setting No output Enable output of RICO pin Output 512 Hz al Enable output of RTCGL pin 32 kHz How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt RTC Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 86 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Clock Output This panel allows you to configure the information necessary to control the functions of clock output controller provided by the microcontroller Screen Structure may be different depending on the kinds of target microcontrollers See user s manual for details on target microcontrollers Figure A 27 Example of Clock Output Glock output operation setting O Unused Used Output clock setting FGL output clack selection 5000 fPRS kHz How to o
183. v 1 00 tENESAS Page 194 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 6 Comparator Below is a list of API functions output by Code Generator for comparator use Table C 7 API Functions Comparator Comparator_Init Performs initialization necessary to control comparator functions Comparator Userlnit Performs user defined initialization relating to the comparator Comparatorn_Start Starts the operation of comparator n Comparatorn_Stop Ends the operation of comparator n R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 195 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Comparator_Init Performs initialization necessary to control comparator functions Classification CG_comparator c Syntax void Comparator_Init void Argument s None Return value None R20UT0006EJ0100 Rev 1 00 tENESAS Page 196 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Comparator_Userlnit Performs user defined initialization relating to the comparator Remark This API function is called as the Comparator _Init callback routine Classification CG_comparator_user c Syntax void Comparator_UserInit void Argument s None Return value None R20UTO006EJ0100 Rev 1 00 tENESAS Page 197 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Comparatorn_Start Starts the operation of comparator n Classi
184. val interrupt function RTC_IntervallnterruptEnable Sets the cycle of the interrupts then starts the interval interrupt INTRTCI function RTC_IntervallnterruptDisable Ends the interval interrupt function RTC_RTC1HZ_OutputEnable Enables output of the real time counter correction clock 1 Hz to the RTC1HZ pin RTC_RTC1HZ_ OutputDisable Disables output of the real time counter correction clock 1 Hz to the RTC1HZ pin RTC_RTCCL_OutputEnable Enables output of the real time counter clock 32 kHz source to the RTCCL pin RTC_RTCCL_OutputDisable Disables output of the real time counter clock 32 kHz source to the RTCCL pin RTC_RTCDIV_OutputEnable Enables output of the real time counter clock 32 kHz cycle to the RTCDIV pin RTC_RTCDIV_OutputDisable Disables output of the real time counter clock 32 kHz cycle to the RTCDIV pin RTC_ChangeCorrectionValue Changes the timing and correction value for correcting clock errors Clock Output PCL_Init Performs initialization necessary to control clock output control circuit functions PCL_Userlnit Performs user defined initialization relating to the clock output control circuits PCL_Start Starts clock output PCL_Stop Ends clock output PCL_ChangeFreq Changes the output clock to the PCL pin LVI LVI_Init Performs initialization necessary to control low voltage detector functions LVI_Userlnit Performs user defined initialization relating to the low voltage detector
185. verts back to the arrow Rotates the content in the Device top view area 90 degrees counter clockwise Rotates the content in the Device top view area 90 degrees clockwise Expands or reduces the content in the Device top view area Kd lt I 2 User Define area Drag and drop the button from this area to the Device top view area to creat and display an external peripheral controller 3 Device top view area This area displays the pin assignment of the microcontroller Settings of the pin assignment are displayed using the colors specified by selecting Device Top View Settings tab gt gt Color in the Property panel Remark Ifthe pin name in the diagram is double clicked the Device Pin List panel opens and the focus moves to the clicked pin in the list File menu Device Top View panel dedicated items Save Top View Saves a report file a file containing information configured using Pin Configurator device top view overwriting the existing file Save Top View As Opens the Save As dialog box for naming and saving a report file a file containing infor mation configured using Pin Configurator device top view Help menu Device Top View panel dedicated items Open Help for Device Top View Displays the help of this panel Panel Context menu When you right click on a pin or external peripheral controller in the Device top view area the following context menu displays R20UT0006EJ0100 Rev
186. vice Top View panel 3 Package category Change the shape package type and settings of the microcontroller to display as the device top view in the Device Top View panel Package type Selects the shape of the microcontroller displayed in the device top view R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 53 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Pin Configurator Information tab This tab displays information Product information on the Device Pin List selected in the Project Tree panel Figure A 5 Pin Configurator Information Tab Property Device Pin List Property El Product Informabon Version Fin configurator version information q Pin Configurator Information F The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then select Property from the context menu Remark _ If this panel is already open selecting a different Device Pin List in the Project Tree panel changes the content displayed accordingly Description of each area 1 Product Information category This area displays product infor
187. which output mode to apply when using the pin in the output mode This area allows you to assign a user defined pin name to the pin Displays the summary of function of the pin R20UTOOO6EJ0100 Rev 1 00 tENESAS Page 65 of 300 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Recommend Connection For Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Function column Attention Displays the precaution on using the pin External Parts This area is for selecting which external peripheral controller to connect the pin to Remarks 1 You cannot add information in the Pin Number column Pin Name column Description col umn Recommend Connection For Unused column and Attention column because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired column to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which
Download Pdf Manuals
Related Search
Related Contents
Wiley Teach Yourself VISUALLY Microsoft Office 2007 Vogel's PFB 3405 Interface bar Samsung D988 User Manual Philips GC1115 Steam iron MANUAL DE USUARIO Philips SpotOn 取扱説明書(1.0 MB) Z-E3215 取扱説明書 Copyright © All rights reserved.
Failed to retrieve file