Home
CubeSuite Ver.1.40 Integrated Development Environment User`s
Contents
1. Remark To restore the default file name defined by Code Generator select Default from the context menu R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 34 of 375 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 Figure 3 9 Change API Function Name Code Generator Preview H File E i Common fk Ef cG mainc EE EE E EE E EE E E E E EE E EE E E E E EE E E E E EE E EE E EE E E E E EE E E E E EE E E E E EE E E E E EE E CG_systeminitc okk kkk alg r agma directive ppke kkk efault SOOO ee OG _Ik dr Start user code for pragma Do not edit comment generated here thei oyster End user code Do not edit comment generated here thm Port Fi E NT TEE EEE E E E E E E E EOE E E E EE E E E EE E E E EE EE E E E EE E EE E E E E E EE EE E E E E E E EE E E E E EA Hi Serial aokk kkk me A D Include files theme Timer SOOO IOC E E E E E GOR E E GCG RG RICCI CEE OR EGE RFR EE E E E RE E Watchdog Timer SSSR Heme Clock Output k hme DMA inc lude CG macrodriver h Cet Ll I include CG systemh include OG wdth Start user code for include Do not edit comment generated here 1 End user code Do not edit comment generated here include CO
2. Read count value R20UT0007EJ0100 Rev 1 00 tENESAS Page 304 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS R20UT0007EJ0100 Rev 1 00 tENESAS Page 305 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 306 of 375 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
3. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 63 of 375 Sep 01 2010 CubeSuite 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
4. R20UT0007EJ0100 Rev 1 00 tENESAS Page 123 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 124 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 125 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 126 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG _ReadResetSource Perform
5. include CG macrodriver h extern BOOL gFlag Reception complete flag _ interrupt void MD_INTSRO void Interrupt processing for INTSRO gUartORxLen gt guartORxCnt gUartORxLen guUartORxCnt UARTO_ReceiveEndCallback Call callback routine void UARTO ReceiveEndCallback void Callback routine for INTSRO gFlag 0 Set reception complete flag R20UT0007EJ0100 Rev 1 00 tENESAS Page 169 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_SendEndCallback Performs processing in response to the UART transmission complete interrupt INTSTn Remark This API function is called as the callback routine of interrupt process MD_INTST n corresponding to the UART transmission complete interrupt INTSTn performed when number of transmission data specified by UARTn_SendData parameter txnum has been completed Classification CG_serial_ user c Syntax void UARTn_SendEndCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 170 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_ReceiveEndCallback Performs processing in response to the UART reception complete interrupt INTSRn Remark This API function is called as the callback routine of interrupt process MD_INTSRn corresponding to the UART reception complete interrupt INTSRn performed when number of
6. 265 AD_ReadByte 266 AD_SelectADChannel 264 AD_Start 260 AD_Stop 263 AD_Userlnit 256 All Output Messages tab 99 AMPn_Start 244 AMPn_Stop 245 API functions 114 A D 254 Clock Output 328 Clock Output Buzzer Output 334 Comparator PGA 246 D A 267 DMA 348 External Bus 135 INT 146 LVI 358 Operational Amplifier 241 Port 139 APPENDIX D INDEX RTC 294 Serial 157 System 124 Timer 276 Watchdog Timer 290 B Browse For Folder dialog box 105 BUS Init 136 BUS PowerOff 138 BUS Userlnit 137 C CG_ChangeClockMode 128 CG_ChangeFrequency 130 CG_ReadResetSource 127 CG_SelectPowerSaveMode 132 CG_SelectStabTime 134 CLOCK Init 125 Clock Output 89 Clock Output 328 PCL_ChangeFreg 333 PCL Init 329 PCL_Start 331 PCL_Stop 332 PCL_Userlnit 330 Clock Output Buzzer Output 90 Clock Output Buzzer Output 334 PCLBUZn_ ChangeFreg 339 PCLBUZn_Init 335 PCLBUZn_Start 337 PCLBUZn_Stop 338 PCLBUZn_Userlnit 336 CLOCK Userlnit 126 CMPPGA_ChangeCMPnRefVoltage 252 CMPPGA_ChangePGAFactor 253 CMPPGA Init 247 CMPPGA_PowerOff 249 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 365 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX CMPPGA_ Start 250 CMPPGA_Stop 251 CMPPGA_Userlnit 248 Code Generator panel
7. R20UT0007EJ0100 Rev 1 00 tENESAS Page 358 of 375 Sep 01 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 359 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 360 of 375 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 LV
8. 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_ k dir Link directive B 2 Output File Below are the files peripheral function output by Code Generator Table B 2 File List Peripheral Function Peripheral Function Source File Name Names of API Functions Included CG_system c CLOCK_Init CG_ChangeClockMode CG_ChangeFrequency CG_SelectPowerSaveMode CG_SelectStab Time CG_system_user c CLOCK Userlnit CG_ReadResetSource External Bus CG_bus c BUS _Init BUS PowerOff CG_port c PORT_Init PORT_ChangePmnInput PORT _ChangePmnOutput R20UT0007EJ0100 Rev 1 00 tENESAS Page 108 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included INTP_Init KEY_Init INT_MaskablelnterruptEnable INTPn_Disable INTPn_Enable KEY_ Disable KEY Enable MD_INTPn MD_INTKR INTP_Userlnit KEY_Userlnit CG_int_user c C SAUm_ Init SAUm_PowerOff UARTn_Init UARTn_ Start UARTn_Stop UARTn_SendData UARTn_ReceiveData CSImn_Init CSImn_ Start CSImn_Stop CSImn_SendData CSImn_ReceiveData CSImn_SendReceiveData IlCmn_lnit IICmn_Stop IlI
9. R20UT0007EJ0100 Rev 1 00 tENESAS Page 91 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE DMA This panel allows you to configure the information necessary to control the functions of DMA Direct Memory Access 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 32 Example of DMA DMAD pMat DMA operation setting Unused Used Transter direction setting SFR to internal ROM Internal RAM to SFR Transter data size setting 8 bits 16 bits Transfer address and count setting FR address RAM address Transter byte court start source setting Trigger signal Interrupt setting DMAD transfer end interrupt INTOMAD Prine ity Lowy st How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt DMA Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 92 of 375 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 micro
10. 316 RTC_IntervalStop 317 RTC_PowerOff 297 RTC_RTC1HZ_OutputDisable 322 RTC_RTC1HZ_OutputEnable 321 RTC _RTCCL_ OutputDisable 324 RTC _RTCCL_ OutputEnable 323 RTC_RTCDIV_OutputDisable 326 RTC_RTCDIV_OutputEnable 325 RTC _SetHourSystem 300 RTC_Userlnit 296 S SAUm _Init 160 SAUm_PowerOff 162 SAUm_Userlnit 161 Save As dialog box 106 Serial 81 Serial 157 CSImn_ErrorCallback 186 CSlImn_Init 175 CSIlmn_ReceiveData 180 CSlmn_ReceiveEndCallback 185 CSImn_SendData 178 CSImn_SendEndCallback 184 CSlmn_SendReceiveData 182 CSlmn_Start 176 CSlmn_Stop 177 IICA_GetStopConditionCallback 226 ICA_Init 211 IICA_MasterErrorCallback 220 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 369 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX IICA_MasterReceiveEndCallback 219 IICA_MasterReceiveStart 216 IICA_MasterSendEndCallback 218 IICA_MasterSendStart 215 IICA_PowerOff 213 IICA_SlaveErrorCallback 225 IICA_SlaveReceiveEndCallback 224 ICA _SlaveReceiveStart 222 ICA _SlaveSendEndCallback 223 IICA_SlaveSendStart 221 IICA_Stop 214 IICA_StopCondition 217 IICA _Userlnit 212 lWCmn_Init 187 l1Cmn_MasterErrorCallback 195 IC mn_MasterReceiveEndCallback 194 lICmn_MasterReceiveStart 190 IICmn_MasterSendEndCallback 193 l1Cmn_MasterSendStart 18
11. C OD D me o lt S C D CubeSuite Ver 1 40 Integrated Development Environment User s Manual 78KOR Design Target Device 78KOR 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
12. Change 1 0 by software 4 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 79 of 375 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 20 Example of INT External Interrupt Key Interrupt Ps INTPO setting J INTPO Valid edge Priority 7 INTP1 setting J INTP Valid edge Priority a 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 R20UTO0007EJ0100 Rev 1 00 tENESAS Page 80 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Serial This panel allows you to configure the information necessary to control the functions of serial array unit and functions of serial interface provided by the microcontroller
13. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 154 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 155 of 375 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 value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 156 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 5 Serial Below is a list of API functions output by Code Generator for serial array unit and serial interface use Table C 6 API Functions Serial SAUm_ Init Performs initialization necessary to control the serial array unit and serial interface functions SAUm_Userlnit Performs user defined initialization related to the serial array unit and serial interface functions SAUm_PowerOff Halts the clock supplied to the serial array unit UARTn_Init Perf
14. MD_OK Normal completion MD_ARGERROR Invalid argument specification Kx3 None R20UT0007EJ0100 Rev 1 00 tENESAS Page 264 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD Read Reads the results of A D conversion Remark Ifthe target device is 78KOR Fx3 78KOR Kx3 78KOR Kx3 L then the results of A D conversion will be 10 bits If the target device is 78KOR Kx3 A 78KOR Lx3 then the results of A D conversion will be 12 bits 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 265 of 375 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 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 8 bits most significant 8 bits of 10 bit resolution Remark Below is an example of the results of A D conversion to be stored in buffer Fx3 x3 Kx3 Kx3 L 15 8 7 0 B10 B9 B8 B7 B6 B5 B4 B3 B2 Bi _ Results of A D conversion to be stored in buffer Kx3 A Lx3 15 12 11 4 3 0 B12 B11 B10 B9 B8 B7 B6 B5 B
15. None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 291 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS WDT_Userlnit Performs user defined initialization relating to the watchdog timer Remark This API function is called as the WDT_ Init callback routine Classification CG_wat_user c Syntax void WDT_UserInit void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 292 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 293 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 12 RTC Below is a list of API functions output by Code Generator for real time counter use Table C 13 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
16. 73 A D 84 Clock Output 89 Clock Output Buzzer Output 90 Comparator PGA 83 D A 85 DMA 92 External Bus 78 INT 80 LCD Controller Driver 91 LVI 93 Operational Amplifier 82 Port 79 RTC 88 Serial 81 System 77 Timer 86 Watchdog Timer 87 Code Generator Preview panel 94 Code Generator tab 100 Column Chooser dialog box 101 Comparator PGA 83 Comparator PGA 246 CMPPGA_ChangeCMPnRefVoltage 252 CMPPGA_ChangePGAFactor 253 CMPPGA Init 247 CMPPGA _PowerOff 249 CMPPGA_ Start 250 CMPPGA_Stop 251 CMPPGA_Userlnit 248 CSImn_ErrorCallback 186 CSlmn_Init 175 CSIimn_ReceiveData 180 CSlmn_ReceiveEndCallback 185 CSlmn_SendData 178 CSlmn_SendEndCallback 184 CSlmn_SendReceiveData 182 CSlmn_Start 176 CSlmn_Stop 177 D D A 85 D A 267 DA_Init 268 DAn_Seti2BitsValue 275 DAn_Set8BitsValue 274 DAn_SetValue 273 DAn_Start 271 DAn_ Stop 272 DA_PowerOff 270 DA Userlnit 269 DA_Init 268 DAn_Seti2BitsValue 275 DAn_Set8BitsValue 274 DAn_SetValue 273 DAn_Start 271 DAn_ Stop 272 DA_PowerOff 270 DA Userlnit 269 Device Pin List panel 62 External Peripheral tab 68 Macro tab 66 Pin Number tab 64 Device Top View panel 70 Device Top View Settings tab 55
17. CG_pclbuz_user c Syntax void PCLBUZn_UserInit void Remark nis the output pin Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 336 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCLBUZn Start Starts clock buzzer output Classification CG_pclbuz c Syntax void PCLBUAnN Start void Remark nis the output pin Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 337 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCLBUZn_ Stop Ends clock buzzer output Classification CG_pclbuz c Syntax void PCLBUZn_Stop void Remark nis the output pin Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 338 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCLBUZn_ ChangeFreq Changes the output clock to the PCLBUZn pin Remark The value specified in parameter clock is set to clock output select register n CKSn Classification CG_pclbuz c Syntax include CG pelbuz h MD STATUS PCLBUZn_ChangeFregq enum PCLBUZclock clock Remark nis the output pin Argumeni s enum PCLBUZclock clock MAINCLOCK MAIN2 MAIN4 MAINS MAIN16 MAIN2048 MAIN4096 MAIN8192 SUBCLOCK SUB2 SUB4 SUB8 SUB16 SUB32 SUB64 SUB128 Output clock type fMAIN fMAIN 2 fMAIN 4
18. Classification CG_rtc c Syntax include CG mMmacrodriver h include CG FLGsh MD STATUS RTC_CounterSet 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 302 of 375 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 RT
19. Example Below is an example of sending and receiving a CSI transmission of four bytes of fixed length data from channel 00 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 182 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Initialize flag CSIO0 Start Start CSI communication CSI00_SendReceiveData amp txbuf txnum amp rxbuf Start CSI send receive while gSlag Wait for txnum transmissions receptions CG_serial_user c include CG Macrodriver 1 extern BOOL gsilag Transmission complete flag _ interrupt void MD INTCSIOU void 4 Interrupt processing for INTCSI00 if gCsi0OTxCnt gt 0 else CSI0OO0_SendEndCallback Call callback routine void CSIO0O0_SendEndCallback void 4 Callback routine for INTCSIOO gSflag 0 Set transmission complete flag R20UTO007EJ0100 Rev 1 00 stENESAS Page 183 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSImn_SendEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn Remark This API function is called as the callback routine of interrupt process MD_INTCSImn corresponding to the CSI communication complete interrupt IN
20. External main system clock FILCLK Internal low speed oscillation clock Ix3 HIOCLK Internal high speed oscillation clock HIO40CLK 40 MHz internal high speed oscillation clock SYSX1CLK X1 clock SYSEXTCLK External main system clock SUBCLK Subsystem clock Kx3 HIOCLK Internal high speed oscillation clock SYSX1CLK X1 clock SYSEXTCLK External main system clock SUBCLK Subsystem clock Kx3 A Kx3 L Lx3 HIOCLK Internal high speed oscillation clock HIO20CLK 20 MHz internal high speed oscillation clock SYSX1CLK X1 clock SYSEXTCLK External main system clock SUBCLK Subsystem clock Return value MD_OK Normal completion R20UT0007EJ0100 Rev 1 00 tENESAS Page 128 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS MD_ERROR1 MD_ERROR2 MD_ERROR3 MD_ERROR4 MD_ARGERROR Exit with error abend Fx3 Kx3 Cannot change to the X1 clock Exit with error abend Ix3 Cannot change to the 40 MHz internal high speed oscillation clock Exit with error abend Kx3 A Kx3 L Lx3 Cannot change to the 20 MHz internal high speed oscillation clock Exit with error abend Fx3 Kx3 Cannot change to the external main system clock Exit with error abend Ix3 Kx3 A Kx3 L Lx3 Cannot change to the X1 clock Exit with error abend Fx3 Cannot change to the internal low speed oscillation clock Exit with error abend Ix3 Kx3 A Kx3 L Lx3 Cannot chan
21. None R20UT0007EJ0100 Rev 1 00 tENESAS Page 307 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 308 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 309 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 310 of 375 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 s
22. You can set whether or not 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 ff File hee Common ok i Cl4_main c aooo kkk i KEE Generate code active Not generate code Joa GGG GSC GCSE i z CK CG kar f system Start user code for pragma Do not edit comment generated here Part End user code Do not edit comment generated here INT i Serial Joao aocisaa aa aca ac aac aC GRACE 4 D SOIR Timer Ticlude tiles Watchdog Timer JOSS GCG EEE EE E E E E E E E E E E E E S E E E E E e Clock Output SSSR DMA k LY inc lude CG macrodriver h include OG systemh include OG wdth Start user code for include Do not edit comment generated here End user code Do not edit comment generated here LL l l 1 ms ams tor 1 oi CGCCccccre 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 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
23. tENESAS Page 162 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn Init Performs initialization of the serial interface UART channel Remark This API function is used as an internal function of SAUm_ Init For this reason there is normally no need to call it from a user program Classification CG_serial c Syntax void UARTn_Init void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 163 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn Start Sets UART communication to standby mode Classification CG_serial c Syntax void UARTn_Start void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 164 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_Stop Ends UART communication Classification CG_serial c Syntax void UARTn_Stop void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 165 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_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 perfor
24. then outputs the ground level signal from the segment common pin Classification CG_lcd c Syntax void LCD_VoltageOff void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 347 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 16 DMA Below is a list of API functions output by Code Generator for DMA Direct Memory Access controller use Table C 17 API Functions DMA DMAn_Hold Holds a DMA start request DMAn_ Restart Releases hold on a DMA start request DMAn_CheckStatus Reads the transfer status transfer complete transfer ongoing DMAn_SetData Sets the RAM address of the transfer source destination and the number of times the data has been transferred DMAn_ SoftwareTriggerOn Starts DMA transfer when DMA operation is enabled DMA transfer when DMA Starts DMA transfer when DMA operation is enabled is enabled R20UT0007EJ0100 Rev 1 00 tENESAS Page 348 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs initialization necessary to control DMA controller functions Classification CG_dma c Syntax void DMAn_Init void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 349 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_Userlnit Performs user defined initialization relating to the DMA
25. 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 149 of 375 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 Userinit void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 150 of 375 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 Fx3 Ix3 Kx3 A Kx3 L Lx3 include CG macrodriver h include CG_int h MD_STATUS INT_MaskableInterruptEnable enum MaskableSource name BOOL enableflag Kx3 include CG macrodriver h include CG_int h void INT_MaskableInterruptEnable enum MaskableSource name BOOL enableflag Argument s enum MaskableSource name Maskable interrupt type INT_xxXx Maskable interrupt BOOL enableflag Acceptance enabled disabled MD_TRUE Acceptance enabled MD_FALSE Acceptance di
26. 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 8 fx STLEVEL1 2 9 fx STLEVEL2 2 10 fx STLEVEL3 2 11 fx STLEVEL4 2 13 fx STLEVEL5S 2 15 fx STLEVEL6 2 17 fx STLEVEL7 2 18 fx Remark fx signifies the frequency of the X1 clock Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 134 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 2 External Bus Below is a list of API functions output by Code Generator for external bus interface use Table C 3 API Functions External Bus API Function Name Function BUS Init Performs initialization necessary to control external bus interface functions functions to connect an external bus to areas other than onboard ROM ROM and RAM BUS_Userlnit Performs user defined initialization relating to the external bus interface BUS_PowerOff Halts the clock supplied to the external bus interface R20UT0007EJ0100 Rev 1 00 tENESAS Page 135 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs initialization necessary to control extern
27. A 12 Pin Number Tab Device Pin List 4a Function a IO a N ch Define A SGL 1 P141 POLBUE1 INTP P140 POGLBUZO INTPO ti 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 Tris area allows you to select the I O mode of the pin area allows This area allows you to select the I O mode of the pin 0 to select the I O mode of the pin 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 64 of 375 Se
28. API function repeats the byte level IICn 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 IICn_SlaveSendStart UCHAR txbuf USHORT txnum Remark nis the channel number Argument s pI UCHAR exbut Pointer to a buffer storing the transmission data EE USHORT txnum Total amount of data to send Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 235 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_SlaveReceiveStart Starts IICn slave reception Remark This API function performs byte level IICn 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 IICn_SlaveReceiveStart UCHAR rxbuf USHORT rxnum Remark nis the channel number Argument s Co Tocar sur Pointer to a buffer to store the received data EE USHORT rxnum Total amount of data to receive Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 236 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_SlaveSendEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn Remark This API function is called as the call
29. DMA 92 DMA 348 DMAn_CheckStatus 355 DMAn_Disable 352 DMAn_Enable 351 DMAn_Hold 353 DMAn_Init 349 DMAn_ Restart 354 DMAn_SetData 356 DMAn_SoftwareTriggerOn 357 DMAn_Userlnit 350 DMAn_CheckStatus 355 DMAn_Disable 352 DMAn_Enable 351 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 366 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX DMAn_Hold 353 DMAn_Init 349 DMAn_ Restart 354 DMAn_SetData 356 DMAn_SoftwareTriggerOn 357 DMAn_Userlnit 350 E External Bus 78 External Bus 135 BUS Init 136 BUS PowerOff 138 BUS Userlnit 137 External Peripheral tab 68 F File Setting tab 61 Functions 11 26 Code Generator 26 Pin Configurator 11 G Generation tab 58 IICA_GetStopConditionCallback 226 ICA_Init 211 I1CA_MasterErrorCallback 220 IICA_MasterReceiveEndCallback 219 IICA_MasterReceiveStart 216 IICA_MasterSendEndCallback 218 IICA_MasterSendStart 215 IICA_PowerOff 213 IICA_SlaveErrorCallback 225 IICA_SlaveReceiveEndCallback 224 IICA_SlaveReceiveStart 222 ICA _SlaveSendEndCallback 223 IICA_SlaveSendStart 221 IICA_Stop 214 IICA_StopCondition 217 IICA _Userlnit 212 lWCmn_Init 187 II1Cmn_MasterErrorCallback 195 lICmn_MasterReceiveEndCallback 194 l1Cmn_MasterReceiveStart 190 II1Cmn_MasterSendEndCallbac
30. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 99 of 375 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 CubeSuite Figure A 37 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 Dis
31. Device Pin List panel Remark If Not reflected is selected then the H Reflect in Pin button will be grayed out deselected R20UT0007EJ0100 Rev 1 00 tENESAS Page 59 of 375 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 displayed accordingly 2 If this panel is already o
32. Kx3 A Kx3 L Lx3 include CG_macrodriver h MD_STATUS DMAn_SetData USHORT sfraddr USHORT ramaddr USHORT count Kx3 include CG macrodriver h MD_STATUS DMAn_SetData USHORT ramaddr USHORT count Remark nis the channel number Argument s op me o O D pe Reacts esse ee e eee OOO Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 356 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_SoftwareTriggerOn Starts DMA transfer when DMA operation is enabled Classification CG_dma c Syntax void DMAn_SoftwareTriggerOn void Remark nis the channel number Argument s None Return value None Example Below is an example of software trigger as a DMA transfer start trigger CG_main c void main void DMAO_Enable Change to operation enabled status DMAO_SoftwareTriggerOn Start DMA transfer R20UT0007EJ0100 Rev 1 00 tENESAS Page 357 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 17 LVI Below is a list of API functions output by Code Generator for low voltage detector use Table C 18 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
33. None R20UT0007EJ0100 Rev 1 00 tENESAS Page 324 of 375 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 None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 325 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 326 of 375 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
34. Panel Device lop View G GOGG O GGG OADD OAG D DGG D at te Pa CTE HALA AE G dia et Te TPE DIEF Agee EDLY G aHa EPD tE eae te L Mess G CHEF Eri AE GPN ER A Ah Hiii G OPFER Aik K Eley cee PIA ERE eae PETOT G CPIM ERIE PH THAL g GFE DR Piili TSKORVK GS pleted laa EE G COPIER ARCS Hiti G uUFDFSF TEE _ A CPIM ERAT Hiv ili GPRNEH AiR GPR EH PREBLE Da EH Malis CRAM EN ites CaPeHENM BEHE a cuPey EM Biase ch core FEN I CRSWEM BRR HEIR Biisi witi AN AEN ILI D BEiihdi PAW ED FAYED PEIN FRIED FMIED 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 18 of 375 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 Package Package type Package type Select package image displayed in the device top view panel Pin Confi
35. Performs processing in response to the transmission interrupt INTLTn Remark This API function is called as the callback routine of interrupt process MD_INTLTn corresponding to the transmission interrupt INTLTn performed when number of transmission data specified by UARTFn_SendData parameter txnum has been completed Classification CG_serial_ user c Syntax void UARTFn_SendEndCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 205 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_ReceiveEndCallback Performs processing in response to the reception complete interrupt INTLRn Remark This API function is called as the callback routine of interrupt process MD_INTLRn corresponding to the reception complete interrupt INTLRn performed when number of received data specified by UARTFn_ReceiveData parameter rxnum has been completed Classification CG_serial_ user c Syntax void UARTFn_ReceiveEndCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 206 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_SoftOverRunCallback Performs processing in response to the reception complete interrupt INTLRn Remark This API function is called as the callback routine of interrupt process MD_INT
36. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 24 of 375 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 selecting File menu gt gt Save R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 25 of 375 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
37. Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 320 of 375 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 void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 321 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 322 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 323 of 375 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
38. 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 Serial SAUD SAUT SAU2 UARTFO UARTFI Channel l Function Channel 0 Channel 1 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 81 of 375 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 22 Example of Operatioal Amplifier AMPU operation setting Unused Used AMFI operation setting Unused Used GMP operation setting Unused Used How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Operational Amplifier Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UTO0007EJ0100 Rev 1 00 tEN
39. Start User s Manual for details on Save project R20UT0007EJ0100 Rev 1 00 tENESAS Page 26 of 375 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 Ts in Pin Steg PG oy at dTa Reflect in Pin i Generate Code co Fie ge ST 4 Go a F Glock setting On chip debug setting Confirming reset source Main system clock MAINI setting Internal high speed oscillation WIH High speed system clock iM Internal high speed oscillation clock setting Frequency MHz High speed system clock setting Operation 1 oscillation 3 O External clock input EX Frequency MHz Stable time us Subsystem clock SUB setting Unused External subclock input WES Frequency kHz Internal low speed oscillation clock ILI setting Operation Frequency kHz stops internal low speed oscillation in STOP mode Enables internal low speed oscillation IL operation setting for system clack OLEI CPU and peripheral clock setting PLL clock frequency PLL 16 CPLL mode fPLL fMAI
40. as files in various formats for use as design documents Renaming function The user can change default names assigned to the files output by Code Generator and the API functions con tained in the source code R20UT0007EJ0100 Rev 1 00 tENESAS Page 10 of 375 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
41. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 104 of 375 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 45 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 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 105 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Save As dialog box This dialog box allows you t
42. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 67 of 375 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 Let TEEF B E mee Peripheral Total 1 Pin Number Fin Mame Function Pld SCEA SC Free rr I iI 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 external peripheral controller level a First layer The following are the columns comprising the device pin list ColumnHeading ColumnHeading putting External Peripheral a the name of the external peripheral cont
43. component level R20UT0007EJ0100 Rev 1 00 tENESAS Page 13 of 375 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 14 of 375 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 Let E Macro Name A Total 4 Used A Used in Other Macro 4 P A D Converte ADC Clock Generator CG DA Converter DACTL Exter
44. controller Remark This API function is called as the DMAn_ Init callback routine Classification CG_dma_user c Syntax void DMAn UserInit void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 350 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn _ Enable Enables operation of channel n Classification CG_dma c Syntax void DMAn Enable void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 351 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_Disable Disables operation of channel n Remarks 1 This API function does not forcibly terminate DMA transfer 2 Before using this API function you must confirm that transmission has ended via DMAn_CheckStatus Classification CG_dma c Syntax void DMAn Disable void Remark nis the channel number Argumeni s None Return value None Example The example below shows setting the operation mode of channel 0 to disabled CG_main c include CG_macrodriver h void main void while MD_COMPLETED DMA0_CheckStatus Check transfer status DMAO0_Disable Change to operation disabled status R20UT0007EJ0100 Rev 1 00 tENESAS Page 352 of 375 Sep 01 2010 CubeSuite Ver 1 40 AP
45. counter Classification CG_timer c Syntax void TAUm_Channeln_Start void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 280 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_Stop Ends the count for channel n Classification CG_timer c Syntax void TAUM Channeln Stop void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 281 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_ChangeCondition Changes the counter value Remarks 1 The value specified in parameter regvalue is set to timer data register mn TDRmn 2 The timing for calling these API functions differs as follows depending on the type of function e g interval timer square wave output or external event counter Classification CG_timer c Syntax include CG mecrodriver kh void TAUm_Channeln_ChangeCondition USHORT regvalue Remark mis the unit number and nis the channel number Argumeni s Return value None Example The example below shows changing the interval time to one half In this example channel 0 has been selected for the interval timer CG_main c R20UT0007EJ0100 Rev 1 00 tENESAS Page 282 of 375 Se
46. fMAIN 8 fMAIN 16 fMAIN 2048 fMAIN 4096 fMAIN 8192 fSUB fSUB 2 fSUB 4 fSUB 8 f SUB 16 f SUB 32 f SUB 64 f SUB 128 fMAIN is the main system clock frequency fSUB is the subsystem clock frequency Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 339 of 375 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Example Below is an example of changing the output clock of pin PCLBUZO each time an externally connected button is pressed in a system that generates the interrupt INTPO each time the button is pressed CG_main c include CG_macrodriver h include CG_pceclbuz h BOOL gFlag Button pressed flag define PCLBUZ FREQUENCY 8 Total number of output clock types const enum PCLBUZclock gClock PCLBUZ_ FREQUENCY Output clock type PCLBUZ_OUTCLK_fSUBO0 PCLBUZ_OUTCLK_fSUB1 PCLBUZ_OUTCLK_fSUB2 PCLBUZ_OUTCLK_fSUB3 PCLBUZ_OUTCLK_fSUB4 PCLBUZ_OUTCLK TSUBS PCLBUZ_OUTCLK_fSUB6 PCLBUZ_OUTCLK_fSUB7 J void main void index 0 Initialize button pressed flag PCLBUZO_Start Start clock buzzer output while 1 if gFlag Wait for INTPO PCLBUZ_ChangeFreg gClock indext Change output clock if index gt PCLBUZ_ FREQUENCY index 0 l gFlag 0 Clear button pressed flag CG_int_user c include CG macrodriver h extern BOOL gFlag Butt
47. from the context menu Remark _ If this panel is already open selecting a different 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 55 of 375 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 Palet
48. function is called as the LCD_ Init callback routine Classification CG_lIcd_user c Syntax void LCD Userinit void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 343 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD_DisplayOn Sets the LCD controller driver to display on status Classification CG_lcd c Syntax void LCD_DisplayOn void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 344 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD_DisplayOff Sets the LCD controller driver to display off status Classification CG_lcd c Syntax void LCD DisplayOrr void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 345 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD_VoltageOn Enables operation of the LCD controller driver s voltage boost circuit and capacitor split circuit then outputs the dese lect signal from the segment pin Classification CG_lcd c Syntax void LCD_VoltageOn void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 346 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD_VoltageOff Halts operation of the LCD controller driver s voltage boost circuit and capacitor split circuit
49. generated it is impossible to change the icon to FE Source code for the currently selected API function is gener ated Source code for the currently selected API function is not gen erated R20UT0007EJ0100 Rev 1 00 tENESAS Page 33 of 375 Sep 01 2010 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 Code Generator Preview H File at Common Default Properties Ga Hm Port hme INT Gt Serial GEH A D hte Timer theme Watchdog Timer E Clock Output E DMA m Ly Figure 3 8 Change File Name okk EEEE E E E E E EE E Fragma directive EEEE E E E E E E E E EE E E E E E EE EE E E E E E E EE E E E EE E E E E E E E E E E EE E E E E E E E E E E E EEEE E E E E E EE E Start user code for pragma Do not edit comment generated here End user code Do not edit comment generated here oppo gigi gigi o kkk E k Tnclude files bainan t a E a E a cacao OOOO IORI ee E n E a e CER RR e e e SOIR EF include GG_macrodriver h include CG system h inc lude CGG wdth Start user code for include Do not edit comment generated here End user code Do not edit comment generated here au l l VE ams os tor Ls
50. mMacrodriver h void IICmn_MasterReceiveStart UCHAR adr UCHAR rxbuf USHORT rxnum Remark mis the unit number and nis the channel number Argumeni s e a UCHAR rxbuf Pointer to a buffer to store the received data USHORT rxnum Total amount of data to receive Remark Below is shown the format for specifying device address aar 7 0 B7 B6 B5 B4 B3 B2 B1 BO Adii gt Slave address Device type 7 _ Device address Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 190 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_StartCondition Generates start conditions Remark This API function is used as an internal function of Cmn_MasterSendSiart and Cmn_MasterReceiveSiart For this reason there is normally no need to call it from a user program Classification CG_serial c Syntax void IiCmn_StartCondition void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 191 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_StopCondition Generates stop conditions Classification CG_serial c Syntax void IICmn_StopCondition void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 192 of 375 Sep 01 2010
51. microcontroller design tool build tool etc in a tree structure Figure A 2 Project Tree Panel Fx3 Project Tree E sample Project E WPOPSF1166 40 Microcontroller oA Pin Configurator Design Tool et Device Pin List E Device Top View i Gode Generator Design Tool we System Port W INT W Serial a A D Timer we Watchdog Timer W Clock Output DMA W LY I AY CAIKOR Build Tool ce FSKOR Simulator Debug Tool pE QB Programmer Flash Programming Tool O File The following items are explained here How to open 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 Device Pin List Opens the Device Pin List panel for entering information on the pins of the microcontroller R20UT0007EJ0100 Rev 1 00 tENESAS Page 46 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 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
52. of A D converter provided by the microcontroller D A Opens the D A for configuring the information necessary to control the func tion of D A 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 RTC 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 Clock Output Buzzer Output Opens the Clock Output Buzzer Output for configuring the information neces sary to control the functions of clock output buzzer output controller provided by the microcontroller LCD Controller Driver Opens the LCD Controller Driver for configuring the information necessary to control the function of LCD controller driver provided by the microcontroller Opens the DMA for configuring the information necessary to control the func tions of DMA Direct Memory Access controller provided by the microcontrol ler R20UT0007EJ0100 Rev 1 00 tENESAS Page 47 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW R
53. received data specified by UARTn_ReceiveData parameter rxnum has been completed Classification CG_serial_ user c Syntax void UARTn_ReceiveEndCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 171 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_SoftOverRunCallback Performs processing in response to the UART reception complete interrupt INTSRn Remark This API function is called as the callback routine of interrupt process MD_INTSRn corresponding to the UART reception complete interrupt INTSRn process performed when the amount of data received is greater than the parameter rxnum specified for UARTn_ReceiveData Classification CG_serial_ user c Syntax Fx3 void UARTn_SoftOverRunCallback void Ix3 Kx3 Kx3 A Kx3 L Lx3 include CG macrodriver h void UARTn_SoftOverRunCallback UCHAR rx data Remark nis the channel number Argumeni s Fx3 None Ix3 Kx3 Kx3 A Kx3 L Lx3 UCHAR rx data Receive data greater than the parameter rxnum specified for UARTn_ReceiveData Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 172 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_ErrorCallback Performs processing in response to the UART communication error interrupt INTSREn Remark This API func
54. selection 4000 EMAIN gt kHz How to open 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 button changes the content displayed accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 89 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Clock Output Buzzer Output This panel allows you to configure the information necessary to control the functions of clock output buzzer output con troller 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 30 Example of Clock Output Buzzer Output POLBUZO PGLBLZ1 Glock output Buzzer output operation setting Unused Used Output clock setting PGLBUZO output clack selection 8000 MAIN kHz How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Clock Output Buzzer Output Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 90 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE LCD Controller Driver This panel allows you to configure the information neces
55. 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 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 95 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 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 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 Preview panel dedicated items Open Help for Code Generator Displays the help of this panel Preview Panel Context menu The following context menu items are displayed by right clicking the mouse Generate code Makes a setting so that t
56. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 221 of 375 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 Ea UCHAR rxbuf Pointer to a buffer to store the received data USHORT rxnum Total amount of data to receive Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 222 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_SlaveSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA Remark This API function is called as the callback routine of interrupt process MD_INTIICA corresponding to the IICA communication complete interrupt INTIICA Classification CG_serial_user c Syntax void IICA_SlaveS
57. the content displayed in the Detail information display change area and Explanation 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 49 of 375 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 T 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
58. value None Example 1 Below is an example of starting analog voltage via the conversion start pin selected in the Code Generator panel A D then converting the analog voltage from the ANI1 input pin to digital In the example Stop is selected in the Com parator operation setting area of the Code Generator panel A D when performing the call to AD _ComparatorOn CG_main c include CG_macrodriver h include CG_ad h BOOL gFlag A D conversion complete flag void main void USHORT buffer 0 wait 100 l Initialize A D conversion complete flag AD_ComparatorOn Move to operation enabled status while wait Ensure stabilization time at least 1 micro second AD_Start Start A D conversion while gFlag Wait for INTAD AD_Read amp buffer Read results of A D conversion AD_SelectADChannel ADCHANNEL1 Switch input pins gFlag 1 Initialize A D conversion complete flag while gFlag Wait for INTAD AD Read amp buffer Read results of A D conversion R20UT0007EJ0100 Rev 1 00 tENESAS Page 260 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD _SelectADChannel ADCHANNELI1 Switch input pins gFlag 1 Initialize A D conversion complete flag while gFlag Wait for INTAD AD Read amp buffer Read results of A D conversion AD_Stop End A D co
59. 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 Code 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 p
60. void TAUM Init void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 277 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Userlnit Performs user defined initialization relating to the timer array unit Remark This API function is called as the AUm_ Init callback routine Classification CG_timer_user c Syntax void TAUm_UserInit void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 278 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_PowerOff Halts the clock supplied to the timer array unit Remark Calling this API function changes the timer array unit to reset status For this reason writes to the control registers e g timer clock select register 0 TPSO after this API function is called are ignored Classification CG_timer c Syntax void TAUm_PowerOff void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 279 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_ Start Starts the count for channel n 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
61. 0UT0007EJ0100 Rev 1 00 tENESAS Page 179 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSimn_ReceiveData Starts CSI data reception Remarks 1 This API function performs byte level CSI 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 CSI reception CSlmn_Start must be called before this API function is called Classification CG_serial c Syntax include CG macrodriver h MD SIATUS CSImn_ReceiveData UCHAR rxbuf USHORT rxnum Remark mis the unit number and nis the channel number Argumeni s op moe e pene 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 CSI transmission of four bytes of fixed length data from channel 00 one time CG_main c include CG_macrodriver h BOOL gFlag Reception complete flag void Main void UCHAR rxbuf 10 USHORT rxnum 4 1 Initialize reception complete flag CS100 Start Start CSI communication CSIO00_ReceiveData amp rxbuf rxnum Start CSI reception while gFlag Wait for rxnum receptions R20UT0007EJ0100 Rev 1 00 tENESAS Page 180 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_seri
62. 0x1 0x40 or 0x41 Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 327 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 13 Clock Output Below is a list of API functions output by Code Generator for clock output use Table C 14 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 328 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 329 of 375 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 R20UT0007EJ0100
63. 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liC mn_MasterErrorCallback Performs processing in response to detection of parity error ACK error in simple IIC communication Classification CG_serial_ user c Syntax include CG macrodriver hi void TiCmn_MasterErrorCallback MD_STATUS flag Remark mis the unit number and nis the channel number Argumeni s MD_STATUS flag Cause of communication error MD_NACK Acknowledge not detected Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 195 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn Init Performs initialization of the serial interface UARTFn Classification CG_serial c Syntax void UARTFn_Init void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 196 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_PowerOff Halts the clock supplied to the serial interface UARTFn Remark Calling this API function changes the serial interface UARTFn to reset status For this reason writes to the control registers e g LIN UARTn status register UFnSTR after this API function is called are ignored Classification CG_serial c Syntax void UARTFn_PowerOff void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 t
64. 39 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_GetStopConditionCallback Performs processing in response to detection of stop condition in IICn slave communication Classification CG_serial_ user c Syntax void IICn_GetStopConditionCallback void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 240 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 6 Operational Amplifier Below is a list of API functions output by Code Generator for operational amplifiers use Table C 7 API Functions Operational Amplifier OPAMP_Init Performs initialization necessary to control operational amplifier functions OPAMP_Userlnit Performs user defined initialization relating to the operational amplifier AMPn_ Start Starts the operation of opeational amplifier n single AMP mode AMPn_Stop Ends the operation of operational amplifier n single AMP mode R20UT0007EJ0100 Rev 1 00 tENESAS Page 241 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 242 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS OPAMP
65. 4 B3 B2 B1 Results of A D conversion to be stored in buffer Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 266 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 9 D A Below is a list of API functions output by Code Generator for D A converter use Table C 10 API Functions D A Sets the initial analog voltage 8 bits output to the ANOn pin Sets the initial analog voltage 12 bits output to the ANOn pin R20UT0007EJ0100 Rev 1 00 tENESAS Page 267 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs initialization necessary to control D A converter functions Classification CG_da c Syntax void DA Init void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 268 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs user defined initialization relating to the D A converter Remark This API function is called as the DA _ Init callback routine Classification CG_da_user c Syntax void DA_UserInit void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 269 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DA_PowerOff Halts the clock supplied to the D A converter Remark Calling this API function changes the D A converter to reset status For this reason writes to the control re
66. 4 hour et Set real time counter initial value 00 01 01 00 00 00 Saturday Alarm detection tunctian zetting Use alarm detection function set alarm initial value Week day Sunday Tuesday Thursday saturday Monday Wednesday Friday Hour Minute 00 00 Counter correction tunction setting Use correction function When the second digits are at 00 20 40 syt us Interrupt setting Used as constant period interrupt function INTRTG Used az alarm interrupt function INTRTG Prior ity Lowy al Interval interrupt function INTRTCI 1953125 2 6 4SUB ma Priority Low at How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt RTC button changes the content displayed Remark Ifthe Code Generator panel is already open pressing the accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 88 of 375 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 29 Example of Clock Output Glock output operation setting Unused Used FGL default output enable Option Byte Output clock setting FGL output clack
67. 40utput MD_TRUE MD_CLEAR Switch I O mode R20UT0007EJ0100 Rev 1 00 tENESAS Page 145 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 4 INT Below is a list of API functions output by Code Generator for interrupt and key interrupt use Table C 5 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 mee Enables the acceptance of the key interrupts INTKR R20UT0007EJ0100 Rev 1 00 tENESAS Page 146 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 147 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 148 of
68. 59 LVI_InterruptModeStart 361 LVI_ResetModeStart 362 LVI_SetLViLevel 364 LVI_ Stop 363 LVI Userlnit 360 LVI_Init 359 LVI_InterruptModeStart 361 LVI_ResetModeStart 362 LVI_SetLViLevel 364 LVI_ Stop 363 LVI_Userlnit 360 M Macro Setting tab 60 Macro tab 66 Main window 43 N New Column dialog box 104 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 APPENDIX D INDEX O OPAMP Init 242 OPAMP _Userlnit 243 Operational Amplifier 82 Operational Amplifier 241 AMPn_Start 244 AMPn_Stop 245 OPAMP Init 242 OPAMP _Userlnit 243 Output panel 97 All Output Messages tab 99 Code Generator tab 100 P PCLBUZn_ChangeFreq 339 PCLBUZn_Init 335 PCLBUZn_Start 337 PCLBUZn_Stop 338 PCLBUZn_Userlnit 336 PCL_ChangeFreg 333 PCL Init 329 PCL_Start 331 PCL_Stop 332 PCL_Userlnit 330 Pin Configurator Information tab 54 Pin Configurator Settings tab 52 Pin Number tab 64 Port 79 Port 139 PORT ChangePmninput 142 PORT _ChangePmnOutput 144 PORT_Init 140 PORT _UserlInit 141 PORT ChangePmninput 142 PORT ChangePmnOutput 144 PORT_Init 140 PORT _Userlnit 141 Project Tree panel 46 Property panel 49 Device Top View Settings tab 55 File Setting tab 61 tENESAS Page 368 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX
69. 9 lICmn_StartCondition 191 IICmn_Stop 188 ll1Cmn_StopCondition 192 lI1Cn_GetStopConditionCallback 240 IWCn_Init 227 I1Cn_MasterErrorCallback 234 lICn_MasterReceiveEndCallback 233 l1Cn_MasterReceiveStart 231 l1Cn_MasterSendEndCallback 232 l1Cn_MasterSendStart 230 IICn_SlaveErrorCallback 239 IICn_SlaveReceiveEndCallback 238 IICn_SlaveReceiveStart 236 lWCn_SlaveSendEndCallback 237 lWCn_SlaveSendStart 235 Cn _Stop 229 llCn_Userlnit 228 SAUm_Init 160 SAUm_PowerOff 162 SAUm_Userlnit 161 UARTFn_DataComparisonDisable 204 UARTFn_DataComparisonEnable 203 UARTFn_ErrorCallback 210 UARTFn_ExpBitCetectCallback 208 UARTFn_IDMatchCallback 209 UARTFn_Init 196 UARTFn_PowerOff 197 UARTFn_ReceiveData 201 UARTFn_ReceiveEndCallback 206 UARTFn_SendData 200 UARTFn_SendEndCallback 205 UARTFn_SetComparisonData 202 UARTFn_SoftOverRunCallback 207 UARTFn_Start 198 UARTFn_Stop 199 UARTn_ErrorCallback 173 UARTn_Init 163 UARTn_ReceiveData 168 UARTn_ReceiveEndCallback 171 UARTn_SendData 166 UARTn_SendEndCallback 170 UARTn_SoftOverRunCallback 172 UARTn_Start 164 UARTn_Stop 165 System 77 System 124 7 CG_ChangeClockMode 128 CG_ChangeFrequency 130 CG_ReadResetSource 127 CG_SelectPowerSaveMode 132 CG_SelectStabTime 134 CLOCK_Init 125 CLOCK
70. A D for con figuring the information necessary to control the function of A D converter provided by the microcontroller Changes the content displayed in the Information setting area to the D A for con figuring the information necessary to control the function of D A converter 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 74 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 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 Clock Output Buzzer Output for configuring the information necessary to control the functions of clock output buzzer output co
71. Built in pull up resistance yes TLL input buffer none include CG_macrodriver h void PORT_ChangePmnInput BOOL enablepu Built in pull up resistance yes TLL input buffer yes include CG_macrodriver h void PORT_ChangePmnInput BOOL enablepu BOOL enablettl Remark mn is the port number Argument s BOOL enablepu Built in pull up resistance used MD_TRUE Yes MD_FALSE No BOOL enablettl Input buffer type MD_TRUE TTL 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 TLL input buffer none is changed as fol lows I O mode type Input mode Built in pull up resistance used Yes R20UTO007EJ0100 Rev 1 00 2CENESAS Page 142 of 375 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 resistance yes TLL input buffer none is changed as fol lows 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 TLL input buffer yes is changed as fol lows I O mode type Input mode Built i
72. C_CounterDisable void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 299 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 300 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS R20UT0007EJ0100 Rev 1 00 tENESAS Page 301 of 375 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
73. C_SetHourSystem HOUR24 RTC_CounterSet Week Hour Ae RTCCounterValue counterwriteval Year 0x08 Month 0x12 Day 0x25 0x05 0x17 Min 0x30 Sec 0 Start count Set clock type counterwriteval Set counter value R20UTO007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 303 of 375 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
74. Cmn_MasterSendStart IlCmn_MasterReceiveStart IlCmn_StartCondition IICmn_StopCondition UARTFn_Init UARTFn_PowerOff UARTFn_ Start UARTFn_Stop UARTFn_SendData UARTFn_ReceiveData UARTFn_SetComparisonData UARTFn_DataComparisonEnable UARTFn_DataComparisonDisable ICA_Init IICA_PowerOff IICA _Stop IICA_MasterSendStart IICA_MasterReceiveStart IICA_StopCondition IICA_SlaveSendStart R20UT0007EJ0100 Rev 1 00 tENESAS Page 109 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included Serial CG_serial c CG_serial_user c IICA_SlaveReceiveStart IlCn_Init IICn_Stop IICn_MasterSendStart I1Cn_MasterReceiveStart IICn_SlaveSendStart IICn_SlaveReceiveStart MD_INTSRn MD_INTSREn MD_INTSTn MD_INTCSImn MD_INTIICmn MD_INTLTn MD_INTLRn MD_INTLSn MD_INTIICn MD_INTIICA SAUm_Userlnit UARTn_SendEndCallback UARTn_ReceiveEndCallback UARTn_SoftOverRunCallback UARTn_ErrorCallback CSIlmn_SendEndCallback CSImn_ReceiveEndCallback CSImn_ErrorCallback II1Cmn_MasterSendEndCallback II1Cmn_MasterReceiveEndCallback II1Cmn_MasterErrorCallback UARTFn_SendEndCallback UARTFn_ReceiveEndCallback UARTFn_SoftOverRunCallback UARTFn_ExpBitCetectCallback UARTFn_IDMatchCallback UARTFn_ErrorCallback IICA _Userlnit IICA_MasterSendEndCallback IICA_MasterReceiveEndCallback IICA_MasterErrorCallback IICA_SlaveSendEndCallback IICA_SlaveReceiveEndCallbac
75. CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_MasterSendEndCallback Performs processing in response to the simple IICmn communication complete interrupt INTIIC mn Remark This API function is called as the callback routine of interrupt process MD_INTIICmn corresponding to the simple IC mn communication complete interrupt INTIICmn performed when number of transmission data specified by Cmn_MasterSendSiart parameter txnum has been completed Classification CG_serial_ user c Syntax void IiCmn_MasterSendEndCallback void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 193 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_MasterReceiveEndCallback Performs processing in response to the simple IICmn communication complete interrupt INTIIC mn Remark This API function is called as the callback routine of interrupt process MD_INTIIC mn corresponding to the simple IC mn communication complete interrupt INTIICmn performed when number of received data spec ified by Cmn_MasterReceiveStart parameter rxnum has been completed Classification CG_serial_ user c Syntax void IIiCmn_MasterReceiveEndCallback void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 194 of 375 Sep 01
76. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 22 of 375 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 2 FUNCTIONS Pin Configurator 2 4 Enter Information 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 If the 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 repre senti
77. EFERENCE 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 meaning of the icon displayed to the left of the string representing the peripheral function node Operation in the corresponding Code Generator panel has been carried out Operation in the corresponding Code Generator panel has not been carried out The problem occurs on the settings became the manipulation to the other peripheral function node influences 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 48 of 375 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 Selecte
78. ENESAS Page 197 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn Start Sets UARTF communication to standby mode Classification CG_serial c Syntax void UARTEF mn Start void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 198 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_Stop Ends UARTF communication Classification CG_serial c Syntax void VARTEn Stop void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 199 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_SendData Starts UARTF data transmission Remarks 1 This API function repeats the byte level UARTF transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum 2 When performing a UARTF transmission UARTFn_Siart must be called before this API function is called 3 Ifthe serial interface UARTFn is used in expansion bit mode then store the data to send in the buffer specified by parameter txbuf in the following format 8 bit data Expansion bit 8 bit data Expansion bit Classification CG_serial c Syntax include CG_macrodriver h MD_STATUS UARTFn_SendData UCHAR txbuf USHORT txnum Remark nis the channel num
79. ESAS Page 82 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Comparator PGA This panel allows you to configure the information necessary to control the functions of comparator programmable gain 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 23 Example of Comparator PGA Comparator PGA select PGA setting Gomparator0 setting Comparator setting Comparator PGA select O Unused O Use only PGA Use only comparator Use comparator and PGA Comparator 0 1 and PGA How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Comparator PGA Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 83 of 375 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 24 Example of A D 4 0 convertor operation setting O Unused Used Comparator operation sett
80. G userdetine h Remark To restore the default name of the API function defined by Code Generator select Default from the context menu R20UT0007EJ0100 Rev 1 00 tENESAS Page 35 of 375 Sep 01 2010 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 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 R20UT0007EJ0100 Rev 1 00 tENE
81. Generation tab 58 Macro Setting tab 60 Pin Configurator Information tab 54 Pin Configurator Settings tab 52 R RTC 88 RTC 294 RTC_AlarmDisable 310 RTC_AlarmEnable 309 RTC_AlarmGet 314 RTC_AlarmIinterruptCallback 315 RTC_AlarmSet 311 RTC_ChangeCorrectionValue 327 RTC_ConstPeriodinterruptCallback 308 RTC_ConstPeriodInterruptDisable 307 RTC_ConstPeriodInterruptEnable 306 RTC_CounterDisable 299 RTC _CounterEnable 298 RTC_CounterGet 304 RTC_CounterSet 302 RTC_Init 295 RTC_IntervallnterruptDisable 320 RTC_IntervallnterruptEnable 318 RTC_IntervalStart 316 RTC_IntervalStop 317 RTC_PowerOff 297 RTC_RTC1HZ_OutputDisable 322 RTC_RTC1HZ_ OutputEnable 321 RTC _RTCCL OutputDisable 324 RTC_RTCCL_OutputEnable 323 RTC_RTCDIV_OutputDisable 326 RTC_RTCDIV_OutputEnable 325 RTC _SetHourSystem 300 RTC _Userlnit 296 RTC_AlarmDisable 310 RTC_AlarmEnable 309 RTC_AlarmGet 314 RTC_AlarmInterruptCallback 315 RTC_AlarmSet 311 RTC_ChangeCorrectionValue 327 RTC_ConstPeriodInterruptCallback 308 RTC _ConstPeriodIinterruptDisable 307 RTC_ConstPeriodInterruptEnable 306 RTC_CounterDisable 299 RTC _CounterEnable 298 RTC _CounterGet 304 RTC _CounterSet 302 RTC_Init 295 RTC_IntervallnterruptDisable 320 RTC_IntervallnterruptEnable 318 RTC_IntervalStart
82. IF flag Handle case when power voltage Vpp lt detected voltage V y detected Handle case when power voltage Vpp gt detected voltage V y detected R20UT0007EJ0100 Rev 1 00 tENESAS Page 361 of 375 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 program is configured to not use the low voltage detector function 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 362 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 363 of 375 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 th
83. IICA Classification CG_serial_user c Syntax void IIcA_MasterSendEndCallback void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 218 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA Remark This API function is called as the callback routine of interrupt process MD_INTIICA corresponding to the IICA communication complete interrupt INTIICA Classification CG_serial_user c Syntax void IIcA_MasterReceiveEndCallback void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 219 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_MasterErrorCallback Performs processing in response 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 220 of 375 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
84. LRn corresponding to the reception complete interrupt INTLRn process performed when the amount of data received is greater than the parameter rxnum specified for UARTFn_ReceiveData Classification CG_serial_ user c Syntax void UARTFn_SoftOverRunCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 207 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_ExpBitCetectCallback Performs processing in response to the status interrupt INTLSn Remark This API function is called as the callback routine of interrupt process MD_INTLSn corresponding to the status interrupt INTLSn processing when the expansion bit is received Classification CG_serial_user c Syntax void UARTFn_ExpBitCetectCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 208 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_IDMatchCallback Performs processing in response to the status interrupt INTLSn Remark This API function is called as the callback routine of interrupt process MD_INTLSn corresponding to the status interrupt INTLSn Classification CG_serial_user c Syntax void UARTFn_IDMatchCallback void Remark nis the channel number Argumeni s None Return value None R20
85. N 4 MHz PLL lockup time 128 20MIN tus CPU and peripheral clack fGLE S000 PLLA kHz Clock monitor setting Unused Used RESOUT pin setting Unused Used F130 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 27 of 375 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 alphabet 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 by
86. PENDIX C API FUNCTIONS DMAn Hold Holds a DMA start request Remark Call DMAn_ Restart to release the hold on DMA start requests Classification CG_dma c Syntax void DMAn_Hold void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 353 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_ Restart Releases hold on a DMA start request Classification CG_dma c Syntax void DMAn Restart void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 354 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_CheckStatus Reads the transfer status transfer complete transfer ongoing Classification CG_dma c Syntax include CG macrodriver h MD_STATUS DMAn_ CheckStatus void Remark nis the channel number Argumeni s None Return value MD_UNDEREXEC Transfer ongoing MD_COMPLETED Transfer complete R20UT0007EJ0100 Rev 1 00 tENESAS Page 355 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DMAn_SetData Sets the RAM address of the transfer source destination and the number of times the data has been transferred Remark Calling this API function while a transfer is ongoing will end the transfer Classification CG_dma c Syntax Fx3 Ix3
87. PPENDIX 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 v850 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 microcontrolle
88. Rev 1 00 tENESAS Page 330 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 331 of 375 Sep 01 2010 CubeSuite 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 332 of 375 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_pclbuz h void PCL_ChangeFreq enum PCLclock clock Argumeni s PCLceclock clock MAINCLOCK MAIN2 MAIN4 MAINS MAIN16 MAIN2048 MAIN4096 MAIN8192 PLLCLOCK PLL2 PLL4 PLL8 PLL16 PLL2048 PLL4096 PLL8192 ILCLOCK SUBCLOCK Output clock type fMAIN fMAIN 2 fMAIN 4 fMAIN 8 fMAIN 16 fMAIN 2048 fMAIN 4096 fMAIN 8192 fPLL fPLL 2 fPLL 4 fPLL 8 fPLL 16 fPLL 2048 fPLL 4096 fPLL 8192 fIL fSUB Remark fMAIN is the main system clock frequency fPLL is the PLL clock frequency fIL is the internal low speed oscillation clock frequency fSUB is the subs
89. S Page 285 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_GetPulseWidth Captures the high low level width measured between pulses of the signal pulses input to the Tlmn pin Classification CG_timer c Syntax include CG macrodriver h void TAUm_Channeln_GetPulseWidth ULONG width Remark mis the unit number and nis the channel number Argumeni s O urong wiath Pointer to an area to store the measurement width 0x0 to Ox1ffff Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 286 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_ChangeDuty Changes the duty ratio of the PWM signal output to the TOmn pin Remark The timing for calling these API functions differs as follows depending on the type of function e g interval timer Square wave output or external event counter Classification CG_timer c Syntax include CG_macrodriver h void TAUm_Channeln_ChangeDuty UCHAR ratio Remark mis the unit number and nis the slave side 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 In this example channels 0 and 1 have been selected for PWM output or multiplex PWM output R20UT0007EJ0100 Rev 1 00 tENESAS Page 287 of 375 Sep 01 2010 CubeS
90. SAS Page 36 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 37 of 375 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 Report 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
91. TCSImn performed when number of transmission data specified by CSlmn_SendData parameter txnum has been completed Classification CG_serial_ user c Syntax void CSImn_SendEndCallback void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 184 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSimn_ReceiveEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn Remark This API function is called as the callback routine of interrupt process MD_INTCSImn corresponding to the CSI communication complete interrupt INTCSImn performed when number of received data specified by CSlmn_ReceiveData parameter rxnum has been completed Classification CG_serial_ user c Syntax void CSImn_ReceiveEndCallback void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 185 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSimn_ErrorCallback Performs processing in response to the CSI communication error interrupt INTSREn Remark This API function is called as the callback routine of interrupt process MD_INTSREn corresponding to the UART communication error interrupt INTSREn Classification CG_serial_user c Syntax include CG_macrodr
92. TC_Userlnit Performs user defined initialization relating to the real time counter Remark This API function is called as the RI C_ Init callback routine Classification CG_rtc_user c Syntax void RTC Userinity void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 296 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 297 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 298 of 375 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 RT
93. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 21 of 375 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 name Display Fin function Display Not display D efine name Select to show or hide the define name
94. UT0007EJ0100 Rev 1 00 tENESAS Page 209 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_ErrorCallback Performs processing in response to the status interrupt INTLSn Remark This API function is called as the callback routine of interrupt process MD_INTLSn corresponding to the status interrupt INTLSn Classification CG_serial_user c Syntax include CG_macrodriver h void UARTFn_ErrorCallback UCHAR err_ type Remark nis the channel number Argument s UCHAR err_type Trigger for status interrupt 00000xx1B Overrun errot 00000x1xB Framing error 000001xxB Parity error Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 210 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 211 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 212 of 375 Sep 01 2010 Cu
95. UZn pin LCD Controller Driver LCD_Init Performs initialization necessary to control LCD controller driver functions LCD_UserlInit Performs user defined initialization relating to the LCD controller driver LCD_DisplayOn Sets the LCD controller driver to display on status LCD_DisplayOff Sets the LCD controller driver to display off status LCD_VoltageOn Enables operation of the LCD controller driver s voltage boost circuit and capacitor split circuit then outputs the deselect signal from the segment pin LCD_VoltageOff Halts operation of the LCD controller driver s voltage boost circuit and capacitor split circuit then outputs the groundlevel signal from the segment common pin DMAn_Init Performs initialization necessary to control DMA con troller functions DMAn_UserInit Performs user defined initialization relating to the DMA controller DMAn_CheckStatus Reads the transfer status transfer complete transfer ongoing DMAn_SetData Sets the RAM address of the transfer source destina tion and the number of times the data has been trans ferred DMAn_ Software TriggerOn Starts DMA transfer when DMA operation is enabled LVI LVI_Init Performs initialization necessary to control low voltage detector functions LVI_Userlnit Performs user defined initialization relating to the low voltage detector LVI_InterruptModeStart Starts low voltage detection when in interrupt genera tion mo
96. Userinit Performs user defined initialization 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 243 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 244 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 245 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 7 Comparator PGA Below is a list of API functions output by Code Generator for comparator programmable gain amplifiers use Table C 8 API Functions Comparator PGA CMPPGA_Init Performs initialization necessary to control comparator programmable gain amplifiers functions CMPPGA_Userlnit Performs user defined initialization relating to the compara
97. Userlnit 126 TAUm_Channeln_ChangeCondition 282 TAUm_Channeln_ChangeDuty 287 TAUm_Channeln_ChangeTimerCondition 284 TAUm_Channeln_GetPulseWidth 286 TAUm_Channeln_SoftWareTriggerOn 289 TAUm_Channeln_Start 280 TAUm_Channeln_Stop 281 TAUm Init 277 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 370 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX TAUm_PowerOff 279 TAUm_Userlnit 278 Timer 86 Timer 276 TAUm_Channeln_ChangeCondition 282 TAUm_Channeln_ChangeDuty 287 TAUm_Channeln_ChangeTimerCondition 284 TAUm_Channeln_GetPulseWidth 286 TAUm_Channeln_SoftWareTriggerOn 289 TAUm_Channeln_ Start 280 TAUm_Channeln_Stop 281 TAUm Init 277 TAUm_PowerOff 279 TAUm_Userlnit 278 U UARTFn_DataComparisonDisable 204 UARTFn_DataComparisonEnable 203 UARTFn_ErrorCallback 210 UARTFn_ExpBitCetectCallback 208 UARTFn_IDMatchCallback 209 UARTFn_Init 196 UARTFn_PowerOff 197 UARTFn_ReceiveData 201 UARTFn_ReceiveEndCallback 206 UARTFn_SendData 200 UARTFn_SendEndCallback 205 UARTFn_SetComparisonData 202 UARTFn_SoftOverRunCallback 207 UARTFn_Start 198 UARTFn_Stop 199 UARTn_ErrorCallback 173 UARTn_Init 163 UARTn_ReceiveData 168 UARTn_ReceiveEndCallback 171 UARTn_SendData 166 UARTn_SendEndCallback 170 UARTn_SoftOverRunCallback 172 UARTn_Start 164 UART
98. Watchdog Timer RTG Clock Gutput Buzzer DMA W na E na E na na na w E a Ga Ei Sk Copyrighti NEC Electronics Corporation 2008 All rights reserved by NEC 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 CubeSurte code part for TAKOURK a 16 Bit Sinele Chip Microcontrollers Filename CG manc Abstract This tile implements main function AFIlib GubeSuite code part for TAKORK W3 EO S0r 2008 03 91 Device uPO eF1166_40 Compiler CA TSKOR Creation date 2008 04 09 xf ik SOOO GOGO E E E E E E E E E EE E E E E E E E E E E E E E E E OKIE IEC Pragma directive BOIOIIOIIOIGOGIGR ICICI ICICI ES SET TET SETTET IE IIE ICG OE TES DE TES IE OE FORCE ECC OR CAR BCR OE 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 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 94 of 375 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Description of each area 1 Preview tree This area allows you to confirm or configure on
99. _INTDMAn DMAn_Userlnit LVI CG_lvi c LVI_Init LVI_InterruptModeStart LVI_ResetModeStart LVI_Stop LVI_SetLVILevel CG_lvi_user c MD_INTLVI LVI Userlnit R20UT0007EJ0100 Rev 1 00 tENESAS Page 113 of 375 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 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 cloc
100. 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 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 source 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
101. adding columns to the first level of Macro tab External Peripheral tab is restricted R20UT0007EJ0100 Rev 1 00 tENESAS Page 16 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 17 of 375 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
102. ain 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 Electronic
103. al bus interface functions functions to connect an external bus to areas other than onboard ROM ROM and RAM Classification CG_bus c Syntax void BUS_Init void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 136 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS BUS Userlnit Performs user defined initialization relating to the external bus interface Remark This API function is called as the BUS _Init callback routine Classification CG_bus_user c Syntax void BUS_UserInit void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 137 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS BUS PowerOff Halts the clock supplied to the external bus interface Remark Calling this API function changes the external bus interface to reset status For this reason writes to the control registers memory extension mode control register MEM after this API function is called are ignored Classification CG_bus c Syntax void BUS_PowerOoff void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 138 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 3 Port Below is a list of API functions output by Code Generator for port use Table C 4 API Functions Port PORT Init Performs initialization neces
104. al_user c include CG mMacrodriver i extern BOOL gF lag Reception complete flag _ interrupt void MD_INTCSIOO void Interrupt processing for INTCSIOO if gCsi100RuCnt lt gCsi00RxLen gCsi00RxCnt gCsi0OORxLen CSI00_ReceiveEndCallback Call callback routine void CSIO0O ReceiveEndCallback void Callback routine for INTCSIOO gFlag Q Set reception complete flag R20UT0007EJ0100 Rev 1 00 tENESAS Page 181 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSimn_SendReceiveData Starts CSI data transmission reception Remarks 1 This API function repeats the byte level CSI transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum 2 This API function performs byte level CSI 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 CSI reception CSIlmn_ Start must be called before this API function is called Classification CG_serial c Syntax include CG Mactodriver i MD SIATUS CSImn_SendReceiveData UCHAR txbuf USHORT txnum UCHAR rxbuf Remark mis the unit number and 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
105. b 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 R20UT0007EJ0100 Rev 1 00 sLENESAS Page 101 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Figure A 39 Operational Object Pin Number Tab Device Pin List Pin Numb Pa P14 POLBUZ1 INTP Free ock Generator Co DA ConvertelDACT LI External Hemon EME M N lash n Block FCB lekornink ComteolloarflhI TRAST A MT Figure A 41 Operational Object Macro Tab Second Layer Device Pin Lit ae Used Used in Other Macro 4 AVBEFO AYREFO AWSS ASS a Macro A OOT R20UT0007EJ0100 Rev 1 00 tENESAS Page 102 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Figure A 42 Operational Object External Peripheral Tab First Layer Device Pin Lit Ta H 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 New Column Colu
106. back void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 226 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_Init Performs initialization of the serial interface IICn Classification CG_serial c Syntax void lCr Init void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 227 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_Userlnit Performs user defined initialization of the serial interface IICn Remark This API function is called as the Cn_ Init callback routine Classification CG_serial_ user c Syntax void IICn_UserInit void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 228 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_Stop Ends IICn communication Classification CG_serial c Syntax void IICn_Stop void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 229 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_MasterSendStart Starts IICn master transmission Remark This API function repeats the byte level IICn master transmission from the buffer specified in parameter txbuf the nu
107. back routine of interrupt process MD_INTIICn corresponding to the IlCn communication complete interrupt INTIICn Classification CG_serial_user c Syntax void IICn_SlaveSendEndCallback void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 237 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_SlaveReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn Remark This API function is called as the callback routine of interrupt process MD_INTIICn corresponding to the IlCn communication complete interrupt INTIICn Classification CG_serial_user c Syntax void IICn_SlaveReceiveEndCallback void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 238 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_SlaveErrorCallback Performs processing in response to detection of error in IlCn slave communication Classification CG_serial_ user c Syntax include CG macrodriver h void IiCn_SlaveErrorCallback MD_STATUS flag Remark nis the channel number Argumeni s MD_STATUS flag Cause of communication error MD ERROR Address mismatch detected MD_NACK Acknowledge not detected Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 2
108. be called before this API function is called Classification CG_serial c Syntax include CG macrodriver h MD STATUS Colmn SendData UCHAR txburf USHORT txnum Remark mis the unit number and nis the channel number Argumeni s op oe o CO Pointer to a buffer storing the wansmision data USHORT txnum Total amount of data to send Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification Example Below is an example of sending a CSI transmission of four bytes of fixed length data from channel 00 one time CG_main c include CG Macrodriver hh BOOL gFlag Transmission complete flag void Main void 4 UCHAR txbuf ABCD USHORT txnum 4 1 Initialize transmission complete flag CSLI00 Start Start CSI communication CSI00_SendData amp txbuf txnum Start CSI transmission while gFlag Wait for txnum transmissions R20UT0007EJ0100 Rev 1 00 tENESAS Page 178 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_serial_user c include CG mMacrodriver kh extern BOOL gFlag Transmission complete flag __ interrupt void MD_INTCSI0OO void Interrupt processing for INTCS100 if gCsi0OTxCnt gt O CSI00_SendEndCallback Call callback routine void CSIO0O SendEndCallback void Callback routine for INTCSIOO gFlag 0 Set transmission complete flag R2
109. beSuite Start User s Manual for details on Save project R20UT0007EJ0100 Rev 1 00 tENESAS Page 12 of 375 Sep 01 2010 CubeSuite Ver 1 40 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 Figure 2 1 Open Device Pin List Panel Device Pin List ce oe Pin Numb Pin Name 4a Function a IVO N ch Define A icici A EEKE P14 POLBUZT INTP Free P140 PCLBUZO INTPE i A 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
110. beSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_PowerOff Halts the clock supplied to the serial interface IICA Remark Calling this API function changes the serial interface IICA to reset status For this reason writes to the control registers e g IICA control register n IICCTLn after this API function is called are ignored Classification CG_serial c Syntax void IICA_PowerOff void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 213 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 214 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA_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 re
111. ber Argument s Cr Toc sesu Pointer to a bufer storing the wanemission data Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification MD_DATAEXISTS Executing transmission process R20UT0007EJ0100 Rev 1 00 tENESAS Page 200 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_ReceiveData Starts UARTF data reception Remarks 1 This API function performs byte level UARTF reception the number of times specified by the parameter rxnum and stores the data in the buffer specified by the parameter rxbuf 2 Actual UARTF reception starts after this API function is called and UARTFn_ Start is then called 3 Ifthe serial interface UARTFn is used in expansion bit mode then the received data is stored in the buffer specified by parameter rxbuf in the following format 8 bit data Expansion bit 8 bit data Expansion bit Classification CG_serial c Syntax include CG macrodriver h MD_STATUS UARTFn_ReceiveData UCHAR rxbuf USHORT rxnum Remark nis the channel number Argumeni s CO os ae 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 201 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_SetComparisonData Sets the data to com
112. category Indicates that the items within the category are displayed as a collapsed 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 ed
113. ce code and report files which are output when the Generate 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 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 not reflect Code Generator panel settings in the
114. controllers See user s manual for details on target microcontrollers Figure A 33 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 307 01 TMG O External voltage detection EXLV1 ae Operation mode setting Generate interrupt signal INTLYT Prior ity Lowy ial gt Generate internal reset signal 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 93 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 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 5 Generate Code 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 34 Code Generator Preview Panel Kx3 Code Generator Preview File J i Common i ERE 5 F cG systeminite F OG_macrodriverh F CG userdefineh T cG kdr system External Bus Port INT Ser lal r DA Timer
115. conversion complete flag __interrupt void MD_INTAD void Interrupt processing for INTAD gFlag 0 Set A D conversion complete flag R20UT0007EJ0100 Rev 1 00 2tENESAS Page 262 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 263 of 375 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 Fx3 Ix3 Kx3 A Kx3 L Lx3 include CG 40 MD STATUS AD_SelectADChannel enum ADChannel channel Kx3 include CG adh void AD_SelectADChannel enum ADChannel channel Argumeni s enum ADChannel channel Analog voltage input pin ADCHANNELn Input pin Remark See the header file CG_ad h for details about the analog voltage input pin ADCHANNEL n Return value Fx3 Ix3 Kx3 A Kx3 L Lx3
116. counter value year month weekday day hour minute second of the real time counter RTC_ConstPeriodIinterruptDisable 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 294 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 295 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS R
117. ct Informaton El Use of Pin Configurator Panek Use pin configurator panels No H 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 52 of 375 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 Devic
118. d Pin Configurator Design Tool Property A Fin Configurator Property El Product Informaton El Use of Pin Configurator Panek Use pin configurator panels No El Package Package type GC Version Fin 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
119. d 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 69 of 375 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 lop View Quy anos aL PchL Tlie E Pia aN HALA AE G diy Pidpa TPE J DIEF Ade TALI G GHA PD tE Flake L LT a L ETLE CHEF Eri AE OPNE Ah Hii G OPFER Aik Le PH cee GMHSEH E AINIIN PETOT G CPIM ERT AN PH THAL g cHPiWER ADR Pe TELE TKR EG COPIERS EiL EE G COPIER ARTS Hiti G uUFDFSF 166_ A0 COPIER MiS TiK EE k E GPRNEH AiR GFR EH PREBLE G GFR EHI Malis CAME ites CaPeWEM ao cuPe EM Baa o core FENH I G REWER BI 5 HEIR aaa wes Bel ILI D Eiti PAWED FRIED FMIED FYE FIWEI 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 O
120. d 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 for Message Displays help for the message on the current caret location This only applies to warning messages and error messages R20UT0007EJ0100 Rev 1 00 tENESAS Page 98 of 375 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 36 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
121. dStart Starts simple IIC master transmission IlICmn_MasterReceiveStart Starts simple IIC master reception IlICmn_StartCondition Generates start conditions IICmn_StopCondition Generates stop conditions IICmn_MasterSendEndCallback Performs processing in response to the simple IIC mn communication complete inter rupt INTIICmn IICmn_MasterReceiveEndCallback Performs processing in response to the simple IIC mn communication complete inter rupt INTIICmn R20UT0007EJ0100 Rev 1 00 tENESAS Page 157 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS I Cmn_MasterErrorCallback Performs processing in response to detection of parity error ACK error in simple IIC communication PUARTFn Init Init Performs initialization of the serial interface UARTFn Ci a O IICA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTI ICA IICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTI IICA_MasterErrorCallback Performs processing in response to detection of error in IICA master communication IICA_SlaveSendStart Starts IICA slave transmission IICA_SlaveReceiveStart Starts IICA slave reception IICA_SlaveSendEndCallback Performs processing in response to the IICA communication complete interrupt INTI ICA IICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complet
122. de 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 121 of 375 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 2 Outline Outlines the functions of the API function 3 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 122 of 375 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 b Description Description of return value 7 Example Shows an example of the API function in use
123. e Below is an example of setting analog voltage to channels 0 and 1 CG_main c void Main void 4 DAO Stare Start D A conversion DA1 Start Start D A conversion DAO_Set12BitsValue Oxlff Set analog voltage CG_timer_user c include CG macrodriver h UCHAR gValue 0 _ interrupt void MD_INTTMO5 void Interrupt processing for INTTMO5 DA1_ Set12BitsValue gValue t Set analog voltage R20UT0007EJ0100 Rev 1 00 tENESAS Page 275 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 10 Timer Below is a list of API functions output by Code Generator for timer array unit use Table C 11 API Functions Timer TAUm_Channeln_ChangeCondition Changes the counter value TAUm_Channeln_ChangeTimerCond Changes the counter value ition TAUm_Channeln_GetPulseWidth Captures the high low level width measured between pulses of the signal pulses input to the Tlmn pin TAUm TAUm_Channeln_ChangeDuty TAUm_Channeln_ChangeDuty Changes the duty ratio of the PWM signal output to the TOmn pin TAUm_Channeln_SoftWareTriggerOn Generates the trigger software trigger for one shot pulse output R20UT0007EJ0100 Rev 1 00 tENESAS Page 276 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm Init Performs initialization necessary to control timer array unit functions Classification CG_timer c Syntax
124. e Pin List panel and Device Top View panel Hides the Device Pin List panel and Device 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 53 of 375 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
125. e flag R20UT0007EJ0100 Rev 1 00 tENESAS Page 167 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTn_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 buffer specified by the parameter rxbuf 2 Actual UART reception starts after this API function is called and UARTn_ Start is then called Classification CG_serial c Syntax include CG macrodriver h MD_STATUS UARTn_ReceiveData UCHAR rxbuf USHORT rxnum Remark nis the channel number Argumeni s op moe e pene 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 UART reception of four bytes of fixed length data from channel 0 one time CG_main c include CG_macrodriver h BOOL gFlag Reception complete flag void Main void UCHAR rxbuf 10 USHORT rxnum 4 1 Initialize reception complete flag UARTO_ReceiveData amp rxbuf rxnum Start UART data reception UARTO_Start Start UART communication while gFlag Wait for rxnum receptions R20UT0007EJ0100 Rev 1 00 tENESAS Page 168 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_serial_user c
126. e for include Do not edit comment generated here End user code Do not edit comment generated here LL l l 1 ms ams ed 1 oi 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 C 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 Generate Code button on the Code Generator panel is pressed For this reason the source R20UTO007EJ0100 Rev 1 00 tENESAS Sep 01 2010 Page 31 of 375 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator code displayed in the Code Generator Preview panel may not be the same as that would actually be generated 3 5 Output Source Code Output the source code device driver program by pressing the panel Generate Code button on the Code Generator The destination folder for the source code is specified by clicking Generation tab gt gt Output folder in the Property panel Figure 3 5 Output Source Code Proj Tree E a sample Project UPOV8F1845_ 40 M
127. e interrupt INTI ICA 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 IICn_Init Performs initialization of the serial interface IICn R20UT0007EJ0100 Rev 1 00 m l ENESAS Page 158 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS I1Cn_MasterSendEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn IlCn_MasterReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn IlCn_MasterErrorCallback Performs processing in response to detection of error in IICn master communication IICn_SlaveSendStart Starts IICn slave transmission IICn_SlaveReceiveStart Starts IICn slave reception IlCn_SlaveSendEndCallback Performs processing in response to the IIC n communication complete interrupt INTIICn IlCn_SlaveReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn 1Cn_SlaveErrorCallback _SlaveErrorCallback Performs processing in response to detection of error in IICn slave communication Performs processing in response to detection of error in IICn slave communication in response to detection of error in IlCn slave communication ae _GetStopConditionCallback Performs processing in response to detection of s
128. eSuite Ver 1 40 APPENDIX C API FUNCTIONS Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 131 of 375 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 If the CPU is operating by a subsystem clock XT1 oscillator then STOP mode cannot be speci fied MD_ARGERROR Invalid argument specification 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 MD_STATUS FOGI TAUO_PowerOff Stop clock supply ret CG_SelectPowerSaveMode PSSTOP Change to STOP mode if ret MD_OK while 3 TAUO Tmt Initialize timer array unit R20UT0007EJ0100 Rev 1 00 tENESAS Page 132 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUO Channel 0 Stare Starts the channel 0 count R20UT0007EJ0100 Rev 1 00 tENESAS Page 133 of 375 Sep 01 2010 CubeSuite Ver 1
129. ed O h O Out Pull up Pii WO40S004 The following conflicts have been detected You must change the setting in that module betore Unused Oh WOU can use it for other purpose rile P11 was used as Rx DO Unused Oh Cut L R20UT0007EJ0100 Rev 1 00 tENESAS Page 30 of 375 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 i eee are OG_systeminitc J OG_macrodriverh f CG_ueerdetineh J OG_k dr System Fort IMT Serial A D Timer Watchdog Timer Clock Output DMA Li l Figure 3 4 Confirm Source Code ok oo kkk AE Ek Pragma directive EEEE E E E E EE EEE EE E E E E R E E E E E E E E E E EE E E EE E E E E E EE E E E E E E E EE E EE E E E E E E E EEEE E E OR k Start user code for pragma Do not edit comment generated here End user code Do not edit comment generated here ok ooo o o o o o kkk EEEE OR Include tiles soo E E E E EEE E EE E E E OGG E E E E E E E EE OCG CSO COI E E E E EE E EE E E EE E E E SSSR inc lude CG macrodriver h include OG systemh inc lude OG wdth Start user cod
130. en 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 61 of 375 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 P14 POLBUZ1 INTP P140 POGLBUZO INTPO 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 dedicated 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 t
131. endEndCallback void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 223 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA Remark This API function is called as the callback routine of interrupt process MD_INTIICA corresponding to the IICA communication complete interrupt INTIICA Classification CG_serial_user c Syntax void IICcCA_SlaveReceiveEndCallback void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 224 of 375 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 Classification 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 225 of 375 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 GetStopConditronCall
132. ep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Serial CSImn_ReceiveEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn CSImn_ErrorCallback Performs processing in response to the CSI communi cation error interrupt INTSREn IlCmn_lnit Performs initialization of the serial interface simple IIC channel IlCmn_MasterSendEndCallback Performs processing in response to the IICmn communication complete interrupt INTIIC mn IICmn_MasterReceiveEndCallback Performs processing in response to the IICmn communication complete interrupt INTIIC mn IICmn_MasterErrorCallback Performs processing in response to detection of parity error ACK error in simple IIC communication UARTFn_Init Performs initialization of the serial interface UARTFn UARTFn_PowerOff Halts the clock supplied to the serial interface UARTFn UARTFn_SendEndCallback Performs processing in response to the transmission interrupt INTLTn UARTFn_ReceiveEndCallback Performs processing in response to the reception com plete interrupt INTLRn UARTFn_SoftOverRunCallback Performs processing in response to the reception com plete interrupt INTLRn UARTFn_ExpBitCetectCallback Performs processing in response to the status interrupt INTLSn UARTFn_ DMatchCallback Performs processing in response to the status interrupt INTLSn UARTFn_ErrorCalloback Performs processing in response to the status inter
133. er Remarks 1 About 1 microsecond of stabilization time is required when changing the voltage converter from opera tion 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 2 Onthe Code Generator panel A D in the Comparator operation setting area if Operation is selected then the voltage converter will be switched to always on There is thus no need to call this API function in this case Classification CG_ad c Syntax void AD_ComparatorOn void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 258 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 259 of 375 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 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
134. er 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 selected 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 44 of 375 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 fo
135. er c include CG macrodriver h UCHAR gValue 0 _ interrupt void MD_INTTMO5 void Interrupt processing for INTTMO5 DA SetValue gValuet Set analog voltage R20UT0007EJ0100 Rev 1 00 tENESAS Page 273 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DAn_Set8BitsValue Sets the analog voltage 8 bits output to the ANOn pin Classification CG_da c Syntax include CG macrodriver h void DAn Set8BitsValue UCHAR value Remark nis the channel number Argumeni s Return value None Example Below is an example of setting analog voltage to channels 0 and 1 CG_main c void Main void 4 DAO Stare Start D A conversion DAl Start Start D A conversion DAO_Set8BitsValue Ox7f Set analog voltage CG_timer_user c include CG macrodriver h UCHAR gValue 0 _ interrupt void MD_INTTMO5 void Interrupt processing for INTTMO5 DA1_ Set8BitsValue gValue Set analog voltage R20UT0007EJ0100 Rev 1 00 tENESAS Page 274 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DAn_Set12BitsValue Sets the analog voltage 12 bits output to the ANOn pin Classification CG_da c Syntax include CG macrodriver h void DAn Set12BitsValue UCHAR value Remark nis the channel number Argumeni s Return value None Exampl
136. er control register OAM after this API function is called are ignored Classification CG_cmppga c Syntax void CMPPGA_PowerOff void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 249 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_ Start Starts the operation of comparator programmable gain amplifier Classification CG_cmppga c Syntax void CMPPGA_Start void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 250 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_ Stop Ends the operation of comparator programmable gain amplifier Classification CG_cmppga c Syntax void CMPPGA_Stop void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 251 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_ChangeCMPnRefVoltage Sets comparator n internal reference voltage Remark The value specified in parameter voltage is set to comparator n internal reference voltage setting register CnRVM Classification CG_cmppga c Syntax include CG Macrodriver h include CG_cmppga h MD_STATUS CMPPGA_ChangeCMPnRefVoltage enum CMPRefVoltage voltage Remark nis the channel number Argumeni s enum CMPRefVoltage voltage Comparator n internal reference volta
137. esas 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 equ
138. esults of A D conversion 8 bits most significant 8 bits of 10 bit resolution R20UT0007EJ0100 Rev 1 00 tENESAS Page 254 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 255 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs user defined 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 256 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_PowerOff Halts the clock supplied to the A D converter Remark Calling this API function changes the A D converter to reset status For this reason writes to the control reg isters e g A D converter mode register ADCM after this API function is called are ignored Classification CG_ad c Syntax void AD_PowerOff void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 257 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS AD_ComparatorOn Enables operation of voltage convert
139. forms user defined initialization relating to the com parator programmable gain amplifiers CMPPGA_PowerOff Halts the clock supplied to the comparator programma ble gain amplifiers CMPPGA_ Start Starts the operation of comparator programmable gain amplifier CMPPGA_ Stop Ends the operation of comparator programmable gain amplifier CMPPGA_ChangeCMPnRefVoltage Sets comparator n internal reference voltage CMPPGA_ChangePGAFactor Sets the input voltage amplification factor of a program mable gain amplifier 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_PowerOff Halts the clock supplied 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 AD Reads the results of A D conversion 8 bits most signif fo feemre S 8 bits of 10 bit resolution DA_Init Performs initialization necessary to control D A con verter functions DA_Userlnit Performs user defined initialization relating to the D A converter DA_PowerOff Halts the clock supplied to the D A converter R20UT0007EJ0100 Rev 1 00 tENESAS Page 118 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS D A DAn_ Stop Ends D A conversion DAn_ SetValue Sets the initial analog voltage output to the ANOn pin DAn_Set8BitsValue Set
140. g isters e g D A converter mode register DAM after this API function is called are ignored Classification CG_da c Syntax void DA _PowerOff void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 270 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Starts D A conversion Classification CG_da c Syntax void DAn_Start void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 271 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DAn_Stop Ends D A conversion Classification CG_da c Syntax void DAn_Stop void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 272 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS DAn_SetValue Sets the analog voltage output to the ANOn pin Classification CG_da c Syntax include CG macrodriver h void DAn SetValue UCHAR value Remark nis the channel number Argumeni s Return value None Example Below is an example of setting analog voltage to channels 0 and 1 CG_main c void Main void 4 DAO Stare Start D A conversion DA1 Start Start D A conversion DAO SetValue Ox7f Set analog voltage CG_timer_us
141. g 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 75 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Help menu Code Generator panel dedicated items Open Help for Code Generator Displays the help of this panel Panel R20UT0007EJ0100 Rev 1 00 tENESAS Page 76 of 375 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 Glock setting On chip debug setting Confirming reset source Main evstem clack MAINI setting Internal high speed oscillation IH High speed system clock iMi Internal high speed oscillation clock setting Frequency MHz High speed system clock setting Operation 1 oscillation fF O External clock input EX Frequency MHz Stable time us Subsystem clock SUB sett
142. ge n 0 In the case of the channel 0 CMPREFVOLO 2AVREF 16 CMPREFVOL1 4AVREF 16 CMPREFVOL2 6AVREF 16 CMPREFVOL3 8AVREF 16 CMPREFVOL4 10AVREF 16 CMPREFVOL5 12AVREF 16 n 1 In the case of the channel 1 CMPREFVOLO 3AVREF 16 CMPREFVOL1 5AVREF 16 CMPREFVOL2 7AVREF 16 CMPREFVOL3 9QAVREF 16 CMPREFVOL4 11AVREF 16 CMPREFVOL5 13AVREF 16 Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 252 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_ChangePGAFactor Sets the input voltage amplification factor of a programmable gain amplifier Remark The value specified in parameter voltage is set to programmable gain amplifier control register OAM Classification CG_cmppga c Syntax include CG_macrodriver h include CG_cmppga h MD_STATUS CMPPGA ChangePGAFactor enum PGAFactor factor Argumeni s enum PGAFactor factor Input voltage amplification factor PGAFACTORO x4 PGAFACTOR1 x6 PGAFACTOR2 x8 PGAFACTOR3 PGAFACTOR4 Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 253 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 8 A D Below is a list of API functions output by Code Generator for A D converter use Table C 9 API Functions A D AD_ReadByte Reads the r
143. ge to the external main system clock Exit with error abend Kx3 Cannot change to the subsystem clock because the XT1 and XT2 pins are in input mode Exit with error abend x3 Kx3 A Kx3 L Lx3 Cannot change to the subsystem clock Invalid argument specification R20UT0007EJ0100 Rev 1 00 tENESAS Page 129 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_ChangeFrequency Changes the division 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 Fx3 SYSTEMCLOCK fPLL SYSONEHALF fPLL 2 SYSONEFOURTH fPLL 4 SYSONEEIGHTH fPLL 8 SYSONESIXTEENTH fPLL 16 SYSONETHIRTYSECOND fPLL 32 1x3 Kx3 Kx3 L SYSTEMCLOCK fMAIN SYSONEHALF fMAIN 2 SYSONEFOURTH fMAIN 4 SYSONEEIGHTH fMAIN 8 SYSONESIXTEENTH fMAIN 16 SYSONETHIRTYSECOND fMAIN 32 Kx3 A Lx3 SYSTEMCLOCK fMAIN SYSONEHALF fMAIN 2 SYSONEFOURTH fMAIN 4 SYSONEEIGHTH fMAIN 8 SYSONESIXTEENTH fMAIN 16 SYSONETHIRTYSECOND fMAIN 32 SUB fSUB SUBONEHALF fSUB 2 Remark fPLL signifies the frequency of the PLL clock fMAIN signifies the frequency of the main system clock and fSUB signifies the frequency of the subsystem clock R20UT0007EJ0100 Rev 1 00 tENESAS Page 130 of 375 Sep 01 2010 Cub
144. gurator Settings Remark Selection of the shape of the microcontroller is made using the order name such as GC and GF R20UT0007EJ0100 Rev 1 00 tENESAS Page 19 of 375 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 dual use pins with no use set in the Device Pin List panel Selects the display color for used pins dual
145. he 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 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 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 62 of 375 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 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
146. he following menu items R20UT0007EJ0100 Rev 1 00 tENESAS Page 43 of 375 Sep 01 2010 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 using 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 fold
147. he 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 Not generate code 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 Rename 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 the Property panel that contains the information for the currently selected file R20UT0007EJ0100 Rev 1 00 tENESAS Page 96 of 375 Sep 01 2010 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 35 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 pane
148. hereby 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 Ren
149. ication complete interrupt INTIICn IICn_MasterReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn I Cn_MasterErrorCallback Performs processing in response to detection of error in IICn master communication IICn_SlaveSendStart Starts IICn slave transmission IICn_SlaveReceiveStart Starts IICn slave reception IICn_SlaveSendEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn IICn_SlaveReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn IICn_SlaveErrorCallback Performs processing in response to detection of error in IlICn slave communication R20UT0007EJ0100 Rev 1 00 tENESAS Page 117 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Serial IICn_GetStopConditionCallback Performs processing in response to detection of stop condition in IIGn slave communication Operational Amplifier OPAMP_Init Performs initialization necessary to control operational amplifier functions OPAMP_Userlnit Performs user defined initialization relating to the operational amplifier AMPn_ Start Starts the operation of opeational amplifier n single AMP mode AMPn_Stop Ends the operation of operational amplifier n single AMP mode Comparator PGA CMPPGA_Init Performs initialization necessary to control comparator programmable gain amplifiers functions CMPPGA_Userlnit Per
150. icrocontroller a Pin Configurator Design Tool a Gode Generator Design Tooli Ay GATSKOR Build Tool che TAKOR Simulator Debug Tool ey Program nalyzer Analyze Tool y LIB Programmer Flash Programming Tool Proj ao Tree A GATSKOR Build Tool cas FEKOOR Simulator Debug Tool ey Program nalyzer Analyze Tool pE LIB Programmer Flash Programming Tool El Ei File Es E File S1 Startup al El Build Tool Output Files s otartup LI CodeGener ator Bie GG lk dir 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 gt 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 files Output files to project we El Pin Contieurator Retlea min E e Mode Mot output files to project Register files The register mode of the output files is displayed Genaration F R20UT0007EJ0100 Rev 1 00 tENESAS Sep 01 2010 Page 32 of 375 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator 3 5 1 Setting that determines whether or not to generate source code
151. in 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 42 of 375 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 components design tool build tool etc provided by CubeSuite Figure A 1 Main Window o sample CubeSuite Project Tree File Edit wiew Project Build Debug Flash Tool Window Help GO start AL N ER S a a ae Ge hy ie Oy MORC My Ge Ce Ks ie A CAFSKOR Build Tool ce FEKOOR Simulator Debug Tool File name ey Program Analyzer Analyze Tool This E the name of the file bo which the Information of this main project i to be IH OB Proerammer Flash Programming Tool Rae E3 E File Project All Output Messages Fa e s e ea ea a pe Fn e J Disconnected The following items are explained here How to open Description of each area How to open 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 t
152. 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 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 11 of 375 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 Cu
153. ing Stop Operation Trigger mode setting O Software trigger mode External trigger mode Falling edge et Timer trigger mode Operation mode setting O Continuous select mode Continuous scan mode O One shot select mode gt One shot scan mode 4 0 pins analog input selection ANIDO ll 4 0 channel selection AMIDO st Conversion time setting Normal mode gt High speed mode 1 High speed mode 2 Discharge function enabled Select conversion time 13500 277fCLE tues Interrupt setting Use AD interrupt INTAD Interrupt generated mode For each channel 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 84 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE D A This panel allows you to configure the information necessary to control the function of D A 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 25 Example of D A Channel Channel 1 Operation setting Unused Used Operation mode setting Normal mode Real time output mode Conversion value sett
154. ing Unused External subclock input EXS Frequency 32768 kHz Internal low speed oscillation clock IL setting Operation Frequency kHz stops internal low speed oscillation im STOP mode Enables internal low speed oscillation IL operation setting for system clack OLEI CPU and peripheral clock setting PLL clock frequency fPLL 16 PLL mode PLL MAIN 4 CMH PLL lockup time 128 2 gF MAIN we Cus CPU and peripheral clack fGLE S000 PLLA kHz Clock monitor setting Unused Used RESOUT pin setting Unused Used P130 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 77 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE External Bus This panel allows you to configure the information necessary to control the functions of external bus interface functions to connect an external bus to the area other than the built in ROM RAM or SFR 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 External Bus Operation setting Unused Used Mode setting Multiplexed bus m
155. ing Conversion value How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt D A Remark Ifthe Code Generator panel is already open pressing the button changes the content displayed accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 85 of 375 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 26 Example of Timer TAUO TALI TAU WAKEUP TM General setting amm Functions Channel 0 Unused Channel Unused Channel 2 Unused Channel 3 Unused Channel 4 Unused Channel 5 Unused Channel 6 Unused Channel 7 Unused reit 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 86 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Watchdog Timer This panel allows
156. initc CG systeminit c use void systeminit void systeminit use void hdwinit void hdwinit use Cs macrodriver h CG macrodriver h use CG_userdefine h CG_userdefineh use CG_Ik dr CG lk dr use System CG system c CG system c use void Clock_Init void Clock_Init use CG system hA CG system hA use Extemal Bus CG bus c CG bus c nol use void BUS_Init void BUS_Init Ls use void BUS_PowerOff void BUS_PowerOff CG_bus h CG_bus h Le use Port Cs porte CG ponte use void PORT_Init void PORT_ Init use 3 _ porth CG _porth use INT CG inte CG inte use void INTP_Init vaid INTP_Init Lig use void KEY_Init void KEY_Init es Fr R20UTO007EJ0100 Rev 1 00 m Q ENESAS Page 39 of 375 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 forma
157. ipment 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 cert
158. is API function 2 The value specified in parameter evel is set to low voltage detection level select register LVIS Classification CG _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 Ifthe target device is 78KOR Fx3 or 78KOR Ix3 then keyword that can be specified for evel is limited to LVILEVELO to LVILEVEL9 Return value MD_OK Normal completion MD ERROR Exit with error abend MD_ARGERROR Invalid argument specification R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 364 of 375 CubeSuite Ver 1 40 APPENDIX D INDEX A A D 84 A D 254 AD_ComparatorOff 259 AD_ComparatorOn 258 AD_Init 255 AD_PowerOff 257 AD_Read 265 AD_ReadByte 266 AD_SelectADChannel 264 AD_Start 260 AD_Stop 263 AD_Userlnit 256 AD_ComparatorOff 259 AD_ComparatorOn 258 AD_Init 255 AD_PowerOff 257 AD_Read
159. ited Help menu Property panel dedicated items Open Help for Property Panel 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 50 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 51 of 375 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 Produ
160. iver h void CSImn_ErrorCallback UCHAR err type Remark mis the unit number and nis the channel number Argument s UCHAR err _ type Trigger for error interrupt 00000xx1B Overrun error Return value None Example Below are examples of callback processing by the trigger for the CSI communication error interrupt CG_serial_user c include CG macrodriver h _ interrupt void MD_INTSREO void 4 Interrupt processing for INTSREO UCHAR err_type CSsI00_ErrorCallback err_type Call callback routine void CSIO0O0O_ErrorCallback UCHAR err_ type Callback routine for INTSREO if err_type amp 0x1 4 Determine trigger Callback processing in response to overrun error R20UT0007EJ0100 Rev 1 00 tENESAS Page 186 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_Init Performs initialization of the serial interface simple IIC channel Remark This API function is used as an internal function of SAUm_ Init For this reason there is normally no need to call it from a user program Classification CG_serial c Syntax void LiCmn Init void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 187 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_Stop Ends simple IIC communication Classificatio
161. k 193 IICmn_MasterSendStart 189 lICmn_StartCondition 191 IICmn_Stop 188 l1Cmn_StopCondition 192 II1Cn_GetStopConditionCallback 240 HWCn_Init 227 I1Cn_MasterErrorCallback 234 lI1Cn_MasterReceiveEndCallback 233 l1Cn_MasterReceiveStart 231 l1Cn_MasterSendEndCallback 232 lI1Cn_MasterSendStart 230 l1Cn_SlaveErrorCallback 239 IICn_SlaveReceiveEndCallback 238 lICn_SlaveReceiveStart 236 lWCn_SlaveSendEndCallback 237 lWCn_SlaveSendStart 235 IICn_Stop 229 lWCn_UserInit 228 INT 80 INT 146 INT MaskablelnterruptEnable 151 INTP_Init 147 INTPn_Disable 153 INTPn Enable 154 INTP_Userlnit 148 KEY Disable 155 KEY Enable 156 KEY Init 149 KEY Userlnit 150 INT MaskablelnterruptEnable 151 INTP_Init 147 INTPn_Disable 153 INTPn_ Enable 154 INTP_Userlnit 148 K KEY Disable 155 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 367 of 375 CubeSuite Ver 1 40 KEY Enable 156 KEY Init 149 KEY Userlnit 150 L LCD Controller Driver 91 LCD Controller Driver LCD_DisplayOff 345 LCD_DisplayOn 344 LCD _Init 342 LCD_UserlInit 343 LCD VoltageOff 347 LCD _VoltageOn 346 LCD_DisplayOff 345 LCD _DisplayOn 344 LCD _Init 342 LCD_UserlInit 343 LCD _VoltageOff 347 LCD _VoltageOn 346 LVI 93 LVI 358 LVI_Init 3
162. k IICA_SlaveErrorCallback IICA_GetStopConditionCallback l1Cn_Userlnit lI1Cn_MasterSendEndCallback IICn_MasterReceiveEndCallback IICn_MasterErrorCallback IICn_SlaveSendEndCallback R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 110 of 375 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES Peripheral Function Source File Name Names of API Functions Included Serial CG_serial_user c IICn_SlaveReceiveEndCallback l1Cn_SlaveErrorCallback II1Cn_GetStopConditionCallback on Operational Amplifier CG_opamp c OPAMP Init AMPn_ Start AMPn_ Stop CG_opamp_user c OPAMP _Userlnit Comparator PGA CG_cmppga c CMPPGA _lnit CMPPGA_PowerOff CMPPGA_ Start CMPPGA_ Stop CMPPGA_ChangeCMPnRefVoltage CMPPGA_ChangePGAFactor CG_cmppga_user c MD_INTCMPn CMPPGA_UserInit CG_ad c AD_Init AD_PowerOff AD_ComparatorOn AD_ComparatorOff AD_ Start AD_ Stop AD_SelectADChannel AD_Read AD_ReadByte CG_ad_user c MD_INTAD AD_UserInit D A CG_da c DA_Init DA_PowerOff DAn_ Start DAn_ Stop DAn_ SetValue DAn_Set8BitsValue DAn_Set12BitsValue Timer CG_timer c TAUm_ Init TAUm_PowerOff TAUm_Channeln_ Start TAUm_Channeln_Stop TAUm_Channeln_ChangeCondition R20UT0007EJ0100 Rev 1 00 tENESAS Page 111 of 375 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 TAUm_Channeln_ChangeTimerCondition TAUm_Channeln_GetPulseWidth TAU
163. k peripheral hardware clock CG_SelectPowerSaveMode Configures the CPU s standby function CG_SelectStabTime Configures the oscillation stabilization time of the X1 clock External Bus BUS Init Performs initialization necessary to control external bus interface functions functions to connect an external bus to areas other than onboard ROM ROM and RAM BUS_Userlnit Performs user defined initialization relating to the exter nal bus interface BUS PowerOh PowerOff Halts the clock supplied to the external bus interface the clock Halts the clock supplied to the external bus interface to the external bus interface 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 114 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTP_UserlInit Performs user defined initialization relating to the exter nal interrupt INTPn functions KEY_Init Performs initialization necessary to control the key interrupt INTKR functions KEY _Userlnit Performs user defined initialization relating to the key interrupt INTKR functions INT _Ma
164. l 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 Remark When the new message is output mark is displayed to the left of the tab name R20UT0007EJ0100 Rev 1 00 tENESAS Page 97 of 375 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 selecte
165. leased status R20UT0007EJ0100 Rev 1 00 tENESAS Page 215 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 216 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS lICA_StopCondition Generates stop conditions Classification CG_serial c Syntax void IICA_StopCondition void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 217 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA Remark This API function is called as the callback routine of interrupt process MD_INTIICA corresponding to the IICA communication complete interrupt INT
166. mSet alarmval Set conditions R20UT0007EJ0100 Rev 1 00 tENESAS Page 312 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX 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 alarmval Alarmww 0x41 RTC_AlarmSet alarmval Change conditions R20UTO007EJ0100 Rev 1 00 2tENESAS Page 313 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 314 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS RTC_AlarminterruptCallback Perfo
167. m_Channeln_ChangeDuty TAUm_Channeln_SoftWareTriggerOn CG_timer_user c MD_INTTMmn TAUm_UserlInit C Watchdog Timer CG_wdt c WDT_Init WDT_Restart CG_wadt_user c MD_INTWDTI WDT_Userlnit 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 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 RTC_Userlnit RTC_ConstPeriodinterruptCallback RTC_AlarmInterruptCalloack ems Clock Output CG_pcl c PCL_Init PCL_ Start PCL_Stop R20UT0007EJ0100 Rev 1 00 tENESAS Page 112 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES eon Clock Output Buzzer Out CG_pclbuz c PCLBUZn_Init put PCLBUZn_ Start PCLBUZn_Stop PCLBUZn_ChangeFreq CG_pclbuz_user c PCLBUZn_Userlnit LCD Controller Driver CG_lIcd c LCD_Init LCD_DisplayOn LCD_DisplayOff LCD_VoltageOn LCD_VoltageOff CG_lIcd_user c LCD_UserInit CG_dma c DMAn_Init DMAn_ Enable DMAn_ Disable DMAn_Hold DMAn_ Restart DMAn_CheckStatus DMAn_SetData DMAn_ Software TriggerOn CG_dma_user c MD
168. mber of times specified in parameter txnum Classification CG_serial c Syntax include CG_macrodriver h MD_STATUS TICn_MasterSendStart UCHAR adr UCHAR txbuf USHORT txnum UCHAR wait Remark nis the channel number Argument s pe e eeo Return value MD_OK Normal completion MD_ERROR Exit with error abend R20UT0007EJ0100 Rev 1 00 tENESAS Page 230 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_MasterReceiveStart Starts IICn master reception Remark This API function performs byte level IICn 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 IICn_MasterReceiveStart UCHAR adr UCHAR rxbuf USHORT rxnum UCHAR wait Remark nis the channel number Argument s o pe e eee Return value MD_OK Normal completion MD_ERROR Exit with error abend R20UT0007EJ0100 Rev 1 00 tENESAS Page 231 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_MasterSendEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn Remark This API function is called as the callback routine of interrupt process MD_INTIICn corresponding to the IlCn communication complete interrupt INTIICn Classification CG_serial_u
169. ming a UART transmission UARTn_Siart must be called before this API function is called Classification CG_serial c Syntax include CG macrodri ver h MD SIATUS UARTnN SendDatae UCHAR txbuf USHORT txnum Remark nis the channel number Argumeni s o awe ee ee Pointer oa buffer storing the wansmission data USHORT txnum Total amount of data to send 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 from channel 0 one time CG_main c include CG Macrodriver hh BOOL gFlag Transmission complete flag void Main void 4 UCHAR txbuf ABCD USHORT txnum 4 1 Initialize transmission complete flag UARTO_Start Start UART communication UARTO_SendData amp txbuf txnum Start UART data transmission while gFlag Wait for txnum transmissions R20UT0007EJ0100 Rev 1 00 tENESAS Page 166 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_serial_user c include CG mMacrodriver kh extern BOOL gFlag Transmission complete flag _ interrupt void MD_INTSTO void Interrupt processing for INTSTO if gUartO0TxCnt gt O UARTO_SendEndCallback Call callback routine void UARTO_SendEndCallback void Callback routine for INTSTO gFlag 0 Set transmission complet
170. mn New Column Opens the New Column dialog box for adding columns to the device pin list Opens the New Column dialog box for adding columns to the device pin list 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 Defaut Restores the column order to the default settings the column order to the default Restores the column order to the default settings R20UT0007EJ0100 Rev 1 00 tENESAS Page 103 of 375 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 44 New Column Dialog Box Hew Column Functon batons The following items are explained here How to open Description 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
171. n CG_serial c Syntax void LiCmn Stop void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 188 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_MasterSendStart Starts simple IIC master transmission Remark This API function repeats the byte level simple IIC master transmission from the buffer specified in parame ter txbuf the number of times specified in parameter txnum Classification CG_serial c Syntax include CG_macrodriver h void IICmn_MasterSendStart UCHAR adr UCHAR txbuf USHORT txnum Remark mis the unit number and nis the channel number Argument s e ee ooo UCHAR txbuf Pointer to a buffer storing the transmission data Remark Below is shown the format for specifying device address aar 7 0 B7 B6 B5 B4 B3 B2 B1 BO Adii gt Slave address Device type 7 _ Device address Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 189 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCmn_MasterReceiveStart Starts simple IIC master reception Remark This API function performs byte level simple IIC 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
172. n pull up resistance used No Inout buffer type TTL input buffer CG_main c include CG macrodriver h void Main void PORT_ChangeP04Input MD_FALSE MD_TRUE Switch I O mode R20UT0007EJ0100 Rev 1 00 tENESAS Page 143 of 375 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 If the target device is a 78KOR Fx3 then the format for specifying this API function differs depending on whether N ch open drain output is being performed via the target pin and whether slow mode is specified N ch open drain output none Slow mode none Fx3 include CG macrodriver h void PORT_ChangePmnOutput BOOL initialvalue N ch open drain output yes Slow mode none Fx3 include CG_macrodriver h void PORT_ChangePmnOutput BOOL enablench BOOL initialvalue N ch open drain output none Slow mode yes Fx3 include CG_macrodriver h void PORT_ChangePmnOutput BOOL enableslow BOOL initialvalue N ch open drain output yes Slow mode yes Fx3 include CG_macrodriver h void PORT_ChangePmnOutput BOOL enablench BOOL enableslow BOOL initialvalue If the target device is 78KOR Ix3 78KOR Kx3 78KOR Kx3 A 78KOR Kx3 L or 78KOR Lx3 then the format for specify ing this API function differs according to whether the target pin conducts N ch o
173. n selected from the device pin list s Function feature 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 57 of 375 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 on and change the setting for the Code Generator Design Tool selected in the Project Tree panel Figure A 8 Generation Tab Property H Gode Generator Property El Product Information Werzion Release date El Generate File Mode Generate file Werge file Output folder C Documents and Settings Report type HTML file Register files Output files to project El Fin Contieurator Reflect Mode Mode Reflected Version The version information of the product is 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 i
174. n 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 70 of 375 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 reverts 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 a
175. n_Stop 165 W Watchdog Timer 87 Watchdog Timer 290 WDT_Init 291 WDT_ Restart 293 WDT_Userlnit 292 WDT_Init 291 WDT_Restart 293 WDT_Userlnit 292 Window reference 42 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 371 of 375 Revision Record Description Sep 01 2010 Sep 01 2010 2010 P First Edition issued CubeSuite Ver 1 40 User s Manual 78KOR Design Publication Date Rev 1 00 Sep 1 2010 Published by Renesas Electronics Corporation CENESAS SALES OFFICES 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 L
176. nal Memon Es MEM 36 E Macro Name 4 Total Used Used in Other Maco 4 P A D ConverterADC Clock Generator CG B 0 D A Converter DACTL 3 Total External Memon Es MEM 36 U ii Macro Name Total 4 Used Used in Other Me oo Converte ADC ee ay eis Clock Generator CG B 0 0 DA ConverterDACTL 3 0 External Memon Es MEM 36 U U Li External Peripheral Macro Name A Used A Used in Other Macro 4 P A D Converte ADC Clock Generator CG DA Converter DACTL External Memory EXMeE ha nT k Pin Number A Macro A External Peripheral R20UT0007EJ0100 Rev 1 00 tENESAS Page 15 of 375 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
177. ng 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 lop View Device Top View PT ELEELE km 7 mr _ZE cE BEZE RFR EERE G amp G a CF To l E r P Ci E ii i G o defi Te E r T m F m eS T E T Aas ali g ip a a a LM PPL G i C PRL Pid PLR Pe Ji PRUE RCH Cii Aiii ALI G d HLY Ei iE H JR Heni Tes G td rik Hiili 1 20H Gi Adee O aL ath Piai G F aiH Pe Teed E iH re R20UTO007EJ0100 Rev 1 00 2tENESAS Page 23 of 375 Sep 01 2010 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 pin 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
178. nges the content displayed in the Information setting area to the External Bus for configuring the information necessary to control the functions of external bus interface functions to connect an external bus to the area other than the built in ROM RAM or SFR 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 operational amplifier provided by the microcontroller Changes the content displayed in the Information setting area to the Comparator PGA for configuring the information necessary to control the functions of compara tor programmable gain amplifier provided by the microcontroller Changes the content displayed in the Information setting area to the
179. nitialization of the serial interface CSI channel Remark This API function is used as an internal function of SAUm_ Init For this reason there is normally no need to call it from a user program Classification CG_serial c Syntax void CSImn_Init void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 175 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSimn_Start Sets CSI communication to standby mode Classification CG_serial c Syntax void CSimn Stare void 3 Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 176 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSImn_Stop Ends CSI communication Classification CG_serial c Syntax void CSimn Stop void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 177 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSiImn_SendData Starts CSI data transmission Remarks 1 This API function repeats the byte level CSI transmission from the buffer specified in parameter txbuf the number of times specified in parameter txnum 2 When performing a CSI transmission CSlmn_Siart must
180. ntroller provided by the microcontroller Changes the content displayed in the Information setting area to the LCD Control ler Driver for configuring the information necessary to control the function of LCD controller driver provided by the microcontroller Changes the content displayed in the Information setting area to the DMA for con figuring the information necessary to control the functions of DMA Direct Memory Access controller 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 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 External Bus Port INT Serial Operational Amplifier Comparator PGA A D D A Timer Watchdog Timer RTC Clock Output Clock Output Buzzer Output LCD Controller Driver DMA 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 containin
181. nversion AD_ComparatorOoff Move to operation disabled status CG_ad_user c include CG_macrodriver h extern BOOL gFlag A D conversion complete flag __ interrupt void MD_INTAD void Interrupt processing for INTAD gFlag 0 Set A D conversion complete flag Example 2 Below is an example of starting analog voltage via the conversion start pin selected in the Code Generator panel A D then converting the analog voltage from the ANI1 input pin to digital In the example Operation is selected in the Comparator operation setting area of the Code Generator panel A D when not performing the call to AD_ComparatorOn CG_main c include CG _Macrodriver A include CG_ad h BOOL gFlag A D conversion complete flag void main void USHORT buffer 0 Initialize A D conversion complete flag AD Start Start A D conversion while gFlag Wait for INTAD AD Read amp buffer Read results of A D conversion AD_SelectADChannel ADCHANNEL1 Switch input pins gFlag 1 Initialize A D conversion complete flag while gFlag Wait for INTAD AD Read amp buffer Read results of A D conversion AD Stop End A D conversion CG_ad_user c include CG Mactodriver bh R20UT0007EJ0100 Rev 1 00 tENESAS Page 261 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS extern BOOL gF lag A D
182. o name and save a file such as a report file Figure A 46 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 106 of 375 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 Select 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 107 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX B OUTPUT FILES APPENDIX B OUTPUT FILES This appendix describes the files output by Code Generator
183. ock Output Buzzer Output 334 C 3 15 LCD Controller Driver 341 C 3 16 DMA 348 C 3 17 LVI 358 APPENDIX D INDEX 365 CubeSuite Ver 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
184. ode Separate bus mode Width setting 8 bits 16 bits External memory area setting J56 byte extension mode 8 address bus pins are used 4 KB extension mode 12 address bus pins are used 64 KB extension mode 16 address bus pins are used Full address mode 20 address bus ping are used GLEOQUT output clock setting Glock value MHz Wait function setting External wait pin enable How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt External Bus accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 78 of 375 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 19 Example of Port PortO Porti Porta Port4 Porth Port Port Porta Porta PortlO Portl2 Portia Porti4 Porti5 ss Unused In Out Pull up Change LO by software P71 Unused In Out Pull up Change LO by software Pra Unused In Out Pull up Change LO by software PT Unused Oh Out PFPul up TTL buffer _ N ch _ Change 10 by software Prd Unused Oh Out Full up Slow mode
185. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 54 of 375 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 Device Top iew 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
186. on CG_rtc c Syntax Ix3 excluding IB3 Kx3 A Kx3 L Lx3 include CG og eo aia MD STATUS RTC_IntervaliInterruptEnable enum RTCINTInterval interval Kx3 include CG_rtc h void RTC_IntervalInterruptEnable enum RTCINTInterval interval Argument s enum RTCINTInterval interval Interrupt INTRTCI cycle INTERVALO 2 6 fXT INTERVAL1 247 fXT INTERVAL2 248 fXT INTERVAL3 2 9 fXT INTERVAL4 2410 fXT INTERVALS 2411 fXT INTERVALE6 2412 fXT Remark fXT is the frequency of the subsystem clock Return value Ix3 excluding IB3 Kx3 A Kx3 L Lx3 MD_OK Normal completion MD_ARGERROR Invalid argument specification Kx3 None R20UT0007EJ0100 Rev 1 00 tENESAS Page 318 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Example Below is an example of changing the interval the restarting the interval interrupt function CG_main c include CG_rte h void main void ee Start interval interrupt function ees 3 End interval interrupt function RTC_IntervalInterruptEnable INTERVAL6 Start interval interrupt function R20UT0007EJ0100 Rev 1 00 tENESAS Page 319 of 375 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
187. on pressed flag __interrupt void MD_INTPO void Interrupt processing for INTPO gFlag 1 Set button pressed flag R20UT0007EJ0100 Rev 1 00 tENESAS Page 340 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 15 LCD Controller Driver Below is a list of API functions output by Code Generator for LCD controller driver use Table C 16 API Functions LCD Controller Driver Sets the LCD controller driver to display on status LCD_DisplayOff Sets the LCD controller driver to display off status LCD_VoltageOn Enables operation of the LCD controller driver s voltage boost circuit and capacitor split circuit then outputs the deselect signal from the segment pin LCD_VoltageOff Halts operation of the LCD controller driver s voltage boost circuit and capacitor split circuit then outputs the groundlevel signal from the segment common pin R20UT0007EJ0100 Rev 1 00 tENESAS Page 341 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD Init Performs initialization necessary to control LCD controller driver functions Classification CG_lcd c Syntax void LCD_Init void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 342 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS LCD_Userlnit Performs user defined initialization relating to the LCD controller driver Remark This API
188. orms initialization of the serial interface UART channel UARTn_ Start Sets UART communication to standby mode UARTn_Stop Ends UART communication UARTn_SendData Starts UART data transmission UARTn_ReceiveData Starts UART data reception UARTn_SendEndCallback Performs processing in response to the UART transmission complete interrupt INTSTn UARTn_ReceiveEndCallback Performs processing in response to the UART reception complete interrupt INTSRn UARTn_SoftOverRunCallback Performs processing in response to the serial transfer end interrupt INTSRn UARTn_ErrorCalloack Performs processing in response to the UART communication error interrupt INTSREn CSImn_Init Performs initialization of the serial interface CSI channel CSImn_Start Sets CSI communication to standby mode CSImn_Stop Ends CSI communication CSIlmn_SendData Starts CSI data transmission CSlImn_ReceiveData Starts CSI data reception CSImn_SendReceiveData Starts CSI data transmission reception CSImn_SendEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn CSImn_ReceiveEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn CSImn_ErrorCallback Performs processing in response to the CSI communication error interrupt INTSREn IlCmn_lnit Performs initialization of the serial interface simple IIC channel IICmn_Stop Ends simple IIC communication IlCmn_MasterSen
189. p 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 opens by pressing the button in the upper left corner of the device pin list R20UT0007EJ0100 Rev 1 00 tENESAS Page 65 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Macro tab This tab displa
190. p 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS void Main void 4 USHORT value TAU_TDROO_VALUE gt gt 1 TAU_TDROO_VALUE Current interval time E eee Start count a cuss erececeenen cies value Change counter value a R20UT0007EJ0100 Rev 1 00 tENESAS Page 283 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_ChangeTimerCondition Changes the counter value Remarks 1 The value specified in parameter regvalue is set to timer data register mn TDRmn 2 The timing for calling these API functions differs as follows depending on the type of function e g interval timer square wave output or external event counter Classification CG_timer c Syntax include CG_macrodriver h void TAUm_Channeln_ChangeTimerCondition USHORT regvalue j Remark mis the unit number and nis the channel number Argumeni s Return value None Example The example below shows changing the interval time to one half In this example channel 0 has been selected for the interval timer CG_main c R20UT0007EJ0100 Rev 1 00 tENESAS Page 284 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS void Main void 4 USHORT value TAU_TDROO_VALUE gt gt 1 TAU_TDROO_VALUE Current interval time E eee Stare count E ie eens value Change counter value a R20UT0007EJ0100 Rev 1 00 tENESA
191. pare to the received data Remark The value specified in parameter comdata is set to LIN UARTn ID setting register UF nID Classification CG_serial c Syntax include CG_macrodriver h void UARTFn_SetComparisonData UCHAR comdata Remark nis the channel number Argumeni s a UCHAR comdata Data to compare Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 202 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_DataComparisonEnable Starts the data comparison Remark Calling this API function switches the serial interface UARTFn to expansion bit mode with data compari son Classification CG_serial_user c Syntax void UARTFEn_DataComparisonEnable void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 203 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_DataComparisonDisable Ends the data comparison Remark Calling this API function switches the serial interface UARTFn to expansion bit mode no data compari son Classification CG_serial_user c Syntax void UARTFn_DataComparisonDisable void Remark nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 204 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS UARTFn_SendEndCallback
192. pen 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 60 of 375 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 context menu Remark _ If this panel is already op
193. pen drain output N ch open drain output none 1x3 Kx3 Kx3 A Kx3 L Lx3 include CG_macrodriver h void PORT_ChangePmnOutput BOOL initialvalue N ch open drain output yes Ix3 Kx3 Kx3 A Kx3 L Lx3 include CG macrodriver h void PORT_ChangePmnOutput BOOL enablench BOOL initialvalue Remark nm is the port number R20UT0007EJ0100 Rev 1 00 tENESAS Page 144 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Argumeni s enablench Output mode type MD_TRUE N ch open drain output Vpop withstand voltage mode MD_FALSE Normal output mode enableslow Output mode type MD_TRUE Slow mode MD_FALSE Normal mode initialvalue Initial output value 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 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 PORT_ChangeP0
194. pheral controller R20UT0007EJ0100 Rev 1 00 tENESAS Page 72 of 375 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 5 Generate Code Pa se g a 4 hii GG te ae Tn g if Glock gettin On chip debug setting Confirming reset source Main system clock MAINI setting Internal high speed oscillation WIH High speed system clock thi Internal high speed oscillation clock setting Frequency MHz High speed system clock setting Operation 1 oscillation i External clack input EX Frequency et MHz Stable time 5442080 18AM ips Subsystem clock fSUB setting Unused External subclock input EWS Frequency 32768 kHz Internal low speed oscillation clock IL setting Operation Frequency kHz stops internal low speed oscillation im STOP mode Enables internal low speed oscillation KHIL operation setting for system clack LKI CPU and peripheral clock setting FLL clock frequency fPLL 16 PLL mode PLL MAIN X 4 CMH FLL lockup time 128 2 O F MAIN w uS CPU and peripheral clock KOLEK 8000 PLLA t tkHei Clock monitor setting Unused Used RESOUT pin setting Unused Used P1303 The following items are explained here How to open Desc
195. 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 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
196. played 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 100 of 375 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 38 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 Default 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 ta
197. 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 information 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
198. r 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 108 B 1 Overview 108 B 2 Output File 108 APPENDIX C API FUNCTIONS 114 C 1 Overview 114 C 2 Output Function 114 C 3 Function Reference 122 C 3 1 System 124 C 3 2 External Bus 135 C 3 3 Port 139 C 3 4 INT 146 C 3 5 Serial 157 C 3 6 Operational Amplifier 241 C 3 7 Comparator PGA 246 C 3 8 A D 254 C 3 9 D A 267 C 3 10 Timer 276 C 3 11 Watchdog Timer 290 C 3 12 RTC 294 C 3 13 Clock Output 328 C 3 14 Cl
199. r 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 the 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 R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 45 of 375 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Project Tree panel This panel displays components of the project
200. rea 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 71 of 375 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 peri
201. ription 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 etc changes the Yel content displayed in the Information setting area accordingly R20UT0007EJ0100 Rev 1 00 tENESAS Page 73 of 375 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 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 Cha
202. rms processing in response to the alarm interrupt INTRTC Remark This API function is called as the callback routine of interrupt process MD_INTRTC corresponding to the alarm interrupt INTRTC Classification CG_rtc_user c Syntax void RTC AlarminterruptCallback void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 315 of 375 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 RT C_IntervallnterruptEnable to start the interval inter rupt function Classification CG_rtc c Syntax void RTC_IntervalStart void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 316 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 317 of 375 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 Classificati
203. roller 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 b Second layer Displays the pin number of the pin R20UT0007EJ0100 Rev 1 00 tENESAS Page 68 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE Column Heading Outline Function This area allows you to select which function to use when the pin has more than one functions O 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 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 use
204. rupt INTLSn ICA_Init Performs initialization of the serial interface IICA IICA_UserlInit Performs user defined initialization of the serial inter face IICA R20UT0007EJ0100 Rev 1 00 tENESAS Page 116 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS IICA_MasterSendEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA IICA_MasterReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA IICA_MasterErrorCallback Performs processing in response to detection of error in IICA master communication IICA_SlaveSendStart Starts IICA slave transmission IICA_SlaveReceiveStart Starts IICA slave reception IICA_SlaveSendEndCalloack Performs processing in response to the IICA communication complete interrupt INTIICA IICA_SlaveReceiveEndCallback Performs processing in response to the IICA communication complete interrupt INTIICA 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 ICn_Init Performs initialization of the serial interface IICn IICn_Userlnit Performs user defined initialization of the serial inter face IICn Ends IlCn communication IICn_MasterSendEndCallback Performs processing in response to the IICn commun
205. s already open selecting a different Code Generator 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 Version Displays the version of Code Generator Release date Displays the release date of Code Generator R20UT0007EJ0100 Rev 1 00 tENESAS Page 58 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE 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 Oe mam eS 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 sour
206. s 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 WDRF flag Internal reset request by watchdog timer else if flag amp 0x80 Trigger identification Check TRAP flag Internal reset request by execution of illegal instruction R20UT0007EJ0100 Rev 1 00 tENESAS Page 127 of 375 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 Clock generator type Fx3 HIOCLK Internal high speed oscillation clock SYSX1CLK X1 clock SYSEXTCLK
207. s 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 78KOR microcontrollers and provides an outline of its features CubeSuite is an integrated development environment IDE for 78KOR 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 A
208. s the initial analog voltage 8 bits output to the ANOn pin DAn_Set12BitsValue Sets the initial analog voltage 12 bits output to the ANOn pin Timer TAUm_Init Performs initialization necessary to control timer array unit functions TAUm_UserInit Performs user defined initialization relating to the timer array unit TAUm_Channeln_ChangeTimerCond Changes the counter value ition TAUm_Channeln_GetPulseWidth Captures the high low level width measured between pulses of the signal pulses input to the Tlmn pin TAUm_Channeln_ChangeDuty Changes the duty ratio of the PWM signal output to the TOmn pin TAUm_Channeln_SoftWareTriggerOn Generates the trigger software trigger for one shot pulse output Watchdog Timer WDT_Init Performs initialization necessary to control watchdog timer functions WDT_Userlnit Performs user defined initialization relating to the watchdog timer WDT_Restart Clears the watchdog timer counter and resumes count ing RTC RTC_Init Performs initialization necessary to control real time counter functions RTC_Userlnit Performs user defined initialization relating to the real time counter RTC_PowerOff Halts the clock supplied to the real time counter RTC_CounterEnable Starts the count of the real time counter year month weekday day hour minute second RTC_CounterDisable Ends the count of the real time counter year month weekday day hour minute second RTC_SetHourS
209. sabled Remark See the header file CG_int h for details about the maskable interrupt type INT_xxx Return value Fx3 Ix3 Kx3 A Kx3 L Lx3 MD_OK Normal completion MD_ARGERROR Invalid argument specification Kx3 None Example 1 Below is an example of disabling acceptance of the maskable interrupt INTPO R20UT0007EJ0100 Rev 1 00 tENESAS Page 151 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CG_main c include CG macrodriver h include CG int n void main void INT_MaskableInterruptEnable INT_INTPO MD_FALSE Disable acceptance of maskable interrupt INTPO Example 2 Below is an example of enabling acceptance of the maskable interrupt INTPO CG_main c include Co macrodri ver i include CG ant void main void INT_MaskableInterruptEnable INT_INTPO MD_TRUE Enable acceptance of maskable interrupt INTPO R20UT0007EJ0100 Rev 1 00 tENESAS Page 152 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 153 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS INTPn_Enable
210. sary 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 139 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 140 of 375 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 141 of 375 Sep 01 2010 CubeSuite Ver 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 TLL input buffer Built in pull up resistance none TLL input buffer none void PORT_ChangePmnInput void
211. sary to control the functions of LCD controller driver 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 31 Example of LCD Controller Driver LOD operation setting O Unused Used Drive voltage generator setting External resistance division method Internal voltage boosting method O Capacitor split method Display mode setting Number of time slices 4017 3 bias mode Reference voltage setting VLCO voltage wv Display data area setting Displaying an 4 pattern area data lower four bits of LOD display data memory Displaying a B pattern area data higher four bits of LOD display data memory O Alternately displaying amp pattern and B pattern area data blinking display corresponding to the INTRTG interrupt timing of the real time couter Segment output pin setting SEGU EGI SEG SECS ECa4 SEGS SEGE SEG SEGS 11 SEG1I2 14 EGIS sEGl6 19 SECO SECZ4 2 F SEG LE SEGS2 35 SEGS8 39 Clock setting Source clock LCD selection k Hz Clock LGDCL selection He Gurrent frame frequency is 1221 Hz How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt LCD Controller Driver Remark Ifthe Code Generator panel is already open pressing the i button changes the content displayed accordingly
212. ser c Syntax void IICn_MasterSendEndCallback void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 232 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_MasterReceiveEndCallback Performs processing in response to the IICn communication complete interrupt INTIICn Remark This API function is called as the callback routine of interrupt process MD_INTIICn corresponding to the IlCn communication complete interrupt INTIICn Classification CG_serial_user c Syntax void IICn_MasterReceiveEndCallback void Remark nis the channel number Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 233 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_MasterErrorCallback Performs processing in response to detection of error in IICn master communication Classification CG_serial_ user c Syntax include CG macrodriver h void IiCn_MasterErrorCallback MD_STATUS flag Remark nis the channel number Argumeni s MD_STATUS flag Cause of communication error MD_SPT Stop condition detected MD_NACK Acknowledge not detected Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 234 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS liCn_SlaveSendStart Starts IlCn slave transmission Remark This
213. skablelnterruptEnable 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 SAUm_Init Performs initialization necessary to control the serial array unit and serial interface functions SAUm_Userlnit Performs user defined initialization related to the serial array unit and serial interface functions SAUm_PowerOff Halts the clock supplied to the serial array unit UARTn_Init Performs initialization of the serial interface UART channel UARTn_SendEndCallback Performs processing in response to the UART trans mission complete interrupt INTSTn UARTn_ReceiveEndCallback Performs processing in response to the UART recep tion complete interrupt INTSRn UARTn_SoftOverRunCallback Performs processing in response to the UART recep tion complete interrupt INTSRn UARTn_ErrorCalloack Performs processing in response to the UART commu nication error interrupt INTSREn CSImn_Init il initialization of the serial interface CSI chan CSIlmn_SendEndCallback Performs processing in response to the CSI communication complete interrupt INTCSImn R20UT0007EJ0100 Rev 1 00 tENESAS Page 115 of 375 S
214. t CSV file Outputs a report file in CSV format R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 40 of 375 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 My Documents of My Computer E3 My Network Places 2 Unused Desktop Shortcuts Make New Folder o Cancel R20UT0007EJ0100 Rev 1 00 tENESAS Page 41 of 375 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
215. 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 External Bus Opens the External Bus for configuring the information necessary to control the functions of external bus interface functions to connect an external bus to the area other than the built in ROM RAM or SFR provided by the microcon troller 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 Opens 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 operational amplifier provided by the microcontroller Comparator PGA Opens the Comparator PGA for configuring the information necessary to con trol the functions of comparator programmable gain amplifier provided by the microcontroller A D Opens the A D for configuring the information necessary to control the func tion
216. te Custom Web System mi TEETE E EEEE E LLALL LLL BEEBE EEE EERE EERE 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 56 of 375 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 bee
217. te 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 28 of 375 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 Reflect inPin Generate Code t ge PG D ga ho 2 Glock setting On chip debug setting Confirming reset source Main system clock EMAIN setting Internal high speed oscillation WIH High speed system clock iMi Internal high speed oscillation clock setting Frequency MHz High speed ystem clock setting Operation 1 oscillation ii External clock inp
218. 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 File Edit wiew Favorites Tools Help w cnr e Macro list MCU name NEC EKOREKGS Chip name uPD 6F 1166 A0 Module Macro Sub Seting Status O OOOO System Used system Used Main system clock selection High speed internal oscillator flH High speed internal oscillator H 8 MHz Operation Used High speed system clock setting X1 oscillation fX Stable time 52428 80 2 16MxX Us Frenquency 5 MHz sub clock mode u nused CPU and peripheral clock fCLK 4000 IHI KHz Frenquency fiL 240 kHz Li On chip debug setting Unused Security ID setting Used i ir R20UT0007EJ0100 Rev 1 00 tENESAS Page 38 of 375 Sep 01 2010 CubeSuite Ver 1 40 CHAPTER 3 FUNCTIONS Code Generator Figure 3 13 Output Example of Report File function Function list Windows Internet Explorer Sil EJ E c sample Function html Saline aan X P File Edit wiew Favorites Tools Help w k Function list l ai ic A MCU name NEC 78KORKG3 E Chip name uPD78F1166_A0 Module File Macro Function Default Status Common CG main c CG main c use void main void main oh use CG system
219. tion is called as the callback routine of interrupt process MD_INTSREn corresponding to the UART communication error interrupt INTSREn Classification CG_serial_user c Syntax include CG_macrodriver h void UARTn_ErrorCallback UCHAR err type Remark nis the channel number Argument s UCHAR err_type Trigger for error interrupt 00000xx1B Overrun error 00000x1xB Parity error 000001xxB Framing error 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 INTSREO void Interrupt processing for INTSREO UCHAR err_type UARTO_ErrorCallback err_type Call callback routine void UARTO_ErrorCallback UCHAR err_type Callback routine for INTSREO if efe type amp Ox1 4 Determine trigger Callback processing in response to overrun error err_type amp 0x2 Determine trigger Callback processing in response to parity error else if err type amp 0x4 Determine trigger R20UT0007EJ0100 Rev 1 00 tENESAS Page 173 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS So rae ee Callback processing in response to framing error R20UT0007EJ0100 Rev 1 00 tENESAS Page 174 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CSImn_Init Performs i
220. top condition in IICn slave communi cation R20UT0007EJ0100 Rev 1 00 tENESAS Page 159 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs initialization necessary to control the serial array unit and serial interface functions Classification CG_serial c Syntax void SAUm_Init void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 160 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Performs user defined initialization related to the serial array unit and serial interface functions Remark This API function is called as the SAUm_ Init callback routine Classification CG_serial_ user c Syntax void SAUm_UserInit void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 161 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS SAUm_PowerOff Halts the clock supplied to the serial array unit Remark Calling this API function changes the serial array unit to reset status For this reason writes to the control registers e g serial clock select register n SPSn after this API function is called are ignored Classification CG_serial c Syntax void SAUm_PowerOff void Remark mis the unit number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00
221. tor programmable gain amplifiers CMPPGA PowerOff PPGA_PowerOff Halts the clock supplied to the comparator programmable gain amplifiers the clock Halts the clock supplied to the comparator programmable gain amplifiers to the comparator programmable gain amplifiers R20UT0007EJ0100 Rev 1 00 tENESAS Page 246 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA Init Performs initialization necessary to control comparator programmable gain amplifiers functions Classification CG_cmppga c Syntax void CMPPGA_Init void Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 247 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_Userlnit Performs user defined initialization relating to the comparator programmable gain amplifiers Remark This API function is called as the CMPPGA _ Init callback routine Classification CG_cmppga_user c Syntax void CMPPGA_UserInit void Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 248 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS CMPPGA_PowerOff Halts the clock supplied to the comparator programmable gain amplifiers Remark Calling this API function changes the comparator programmable gain amplifiers to reset status For this rea son writes to the control registers e g programmable gain amplifi
222. truct RTCAlarmValue alarmval Alarm conditions weekday hour minute Remark Below is shown the structure RTCAlarmValue 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 gt BCD code minute digit 1 BCD code minute digit 10 0 Fixed 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 311 of 375 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 teat ate 1 Sunday ret 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_Alar
223. uite Ver 1 40 APPENDIX C API FUNCTIONS CG_main c include CG macrodriver h void main void UCHAR ratio 25 TAUO_ChannelO_Start TAUO_Channell_ChangeDuty Start count ratio Change duty ratio R20UT0007EJ0100 Rev 1 00 Sep 01 2010 tENESAS Page 288 of 375 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS TAUm_Channeln_SoftWareTriggerOn Generates the trigger software trigger for one shot pulse output Classification CG_timer c Syntax void TAUm_Channeln_SoftWareTriggerOn void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 289 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 11 Watchdog Timer Below is a list of API functions output by Code Generator for watchdog timer use Table C 12 API Functions Watchdog Timer WDT_Init Performs initialization necessary to control watchdog timer functions WDT _Userlnit Performs user defined initialization relating to the watchdog timer WDT_Restart Clears the watchdog timer counter and resumes counting R20UT0007EJ0100 Rev 1 00 tENESAS Page 290 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS WDT Init Performs initialization necessary to control watchdog timer functions Classification CG_wdt c Syntax void WDT_Init void Argument s
224. ujiazui 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 6213 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 R20UT0007EJ0100
225. 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 20 of 375 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 Pin function Attention only Not display Tooltip Select contents displayed in the toal tip Device
226. ut EX Frequency MHz Stable time we Information of valid Subsystem clack fSUB setting Unused External subclock input EAS Frequency 32768 kHz Internal low speed oscillation clack IL setting Operation Frequency kHz stops internal low speed oscillation im STOP mode Enables internal low speed oscillation HIL operation setting for system clack GLE CPU and peripheral clock setting PLL clock frequency fPLL 16 PLL mode fPLL MAIN 44 MHz PLL lockup time 128 2 OF MAIN us CPU and peripheral clock KOLEK S000 fPLL 2 t kHz Clock monitor setting Unused Used RESOUT pin setting Unused Used F130 R20UT0007EJ0100 Rev 1 00 tENESAS Page 29 of 375 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 J 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 4p icon information regarding the conflict between the pins tips for avoiding the conflict popups Figure 3 3 Icon Indicating Pin Conflict Code Generator Ay Reflect in Pin 24 Generate Code t a T 4 D av o e D Port Fort Porta Port Port4 Porth Port Port Port Port Portl 2 F10 Unused Oh O Out Pull up P11 Unus
227. utputDisable 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 Clock Output Buzzer Out PCLBUZn_Init Performs initialization necessary to control clock buzzer put output control circuit functions PCLBUZn_Userlnit Performs user defined initialization relating to the clock buzzer output control circuits PCLBUZn_ Start Starts clock buzzer output R20UT0007EJ0100 Rev 1 00 tENESAS Page 120 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS Clock Output Buzzer Out PCLBUZn_Stop Ends clock buzzer output t PCLBUZn_ChangeFreq Changes the output clock to the PCLB
228. 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 27 Example of Watchdog Timer Watchdog timer operation setting O Unused Used Operation in HALT STOP mode setting Enabled O Stopped Overflow time setting Overflow time A569 2 20 FIL imal Window open period setting Window open period E Interrupt setting Enable interval interrupt when 75 of overflow time NTWOTD Prior ity Lowy et 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 87 of 375 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 28 Example of RTC Real time counter operation setting gt Unused Used Real time counter setting Hour sy stem selection 2
229. ys information on each pin of the microcontroller in the order it was grouped into peripheral functions Figure A 13 Macro Tab Device Pin Lit EEE H ee Sg Macro Name Used 4 Used in Other Macro 4 Pin Number 4 Fin Ha A Function 1 ra AVAEFO AVAREFO AWSS ASS Pin Number Macro 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 the pins were grouped into peripheral functions a First layer The following are the columns comprising the device pin list Displays the name of the peripheral function Displays the total number of pins assigned to the peripheral function Used Displays the total number of pins for which the purpose has been set Used in Other Macro Displays the total number of pins for which the purpose has been set by other peripheral functions R20UT0007EJ0100 Rev 1 00 tENESAS Page 66 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX A WINDOW REFERENCE b Second layer Displays the pin number of the
230. ystem 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 R20UT0007EJ0100 Rev 1 00 tENESAS Page 119 of 375 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 RTC_ConstPeriodInterruptDisable Ends the cyclic interrupt function RTC_ConstPeriodInterruptCalloback Performs processing in response to the cyclic interrupt INTRTC RTC_AlarmEnable Starts the alarm interrupt function RTC_AlarmDisable Ends the alarm interrupt function RTC_AlarmSet Sets the alarm conditions weekday hour minute RTC_AlarmGet Reads the alarm conditions weekday hour minute RTC_AlarmInterruptCalloack Performs processing in response to the alarm interrupt INTRTC RTC_IntervalStart Starts the interval interrupt function RTC_IntervalStop Ends the interval interrupt function RTC_IntervallnterruptEnable Sets the cycle of the interrupts INTRTCIl then starts the interval interrupt 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_ O
231. ystem clock frequency Return value None R20UTO007EJ0100 Rev 1 00 tENESAS Sep 01 2010 Page 333 of 375 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS C 3 14 Clock Output Buzzer Output Below is a list of API functions output by Code Generator for clock output obuzzer output use Table C 15 API Functions Clock Output Buzzer Output API Function Name Function PCLBUZn_Init Performs initialization necessary to control clock buzzer output control circuit func tions PCLBUZn_Userlnit Performs user defined initialization relating to the clock buzzer output control circuits PCLBUZn_ Start Starts clock buzzer output PCLBUZn_Stop Ends clock buzzer output PCLBUZn_ChangeFreq Changes the output clock to the PCLBUZn pin R20UT0007EJ0100 Rev 1 00 tENESAS Page 334 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCLBUZn Init Performs initialization necessary to control clock ouzzer output control circuit functions Classification CG_pclbuz c Syntax void PCLBUAn Init void Remark nis the output pin Argument s None Return value None R20UT0007EJ0100 Rev 1 00 tENESAS Page 335 of 375 Sep 01 2010 CubeSuite Ver 1 40 APPENDIX C API FUNCTIONS PCLBUZn_ Userlnit Performs user defined initialization relating to the clock ouzzer output control circuits Remark This API function is called as the PCLBUZn_Init callback routine Classification
Download Pdf Manuals
Related Search
Related Contents
取扱説明書 Neff K9514 fridge-freezer CS-32 Software User Guide EHT… JVC LT-32P300 User's Manual HP iPAQ Product Guide MANUALE UTENTE USER MANUAL Biggest Quadra User Manual TracVision M5/M7 User`s Guide, Control Panel Configuration ASUS UX303LA User's Manual Copyright © All rights reserved.
Failed to retrieve file