0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
M16C26A-V

M16C26A-V

  • 厂商:

    RENESAS(瑞萨)

  • 封装:

  • 描述:

    M16C26A-V - Sample Program (Voltmeter) - Renesas Technology Corp

  • 数据手册
  • 价格&库存
M16C26A-V 数据手册
Application Notes M16C/26A Group Sample Program (Voltmeter) 1. Summary This sample program provides the functionality of a voltmeter by using the Renesas Starter Kit for M16C/26A (R0K33026AS000BE). Turning the potentiometer changes the voltage 2. Introduction Microcomputers: M16C26A The example described in this document applies to the microcomputers listed below: This sample program runs on the Renesas Starter Kit for M16C/26A (R0K33026AS000BE). Prepare an extension board available for the Renesas Starter Kit or create a circuit similar to the one shown in the example circuit. This program uses RSK_LIB. For details about RSK_LIB, see the RSK_LIB reference manual. (RSK_LIB is the library software provided for use with the Renesas Starter Kit for M16C/26A.) REJ05B0815-0110 Rev.1.10 2007.12 Page 1 of 15 M16C/26A Group Sample Program (Voltmeter) 3. Port Arrangement LCD VR P93 P91 P90 P63 P62 P61 10MHz Xin P60 LCD E LCD RS LCD D7 LCD D6 LCD D5 LCD D4 v olme 0 . t er 00 0 V M30260F8AGP 4. Operational Outline A voltmeter is displayed on liquid crystal display. Turning the variable resistor (R9) mounted on the board clockwise lowers the voltage, and turning it counterclockwise raises the voltage. Liquid crystal display Volmeter 0.000V Liquid crystal display Volmeter 3.000V Liquid crystal display Volmeter 0.000V M16C26A M16C26A M16C26A R9 SW3 SW2 SW1/ BOOT R9 SW3 SW2 SW1/ BOOT R9 SW3 SW2 SW1/ BOOT Turning R9 counterclockwise raises the voltage displayed on LCD. Turning R9 clockwise lowers the voltage displayed on LCD. The operation described above is accomplished using the following microcomputer facilities: • Timer A0 (timer mode, main 2 ms cycle) This timer counts 2 milliseconds using the main clock of the microcomputer as the count source. It is used as the basic timer of RSK_LIB. Time management, LCD display management and AD input are performed using this timer. • AD24 (single-shot mode, voltage measurement) Analog voltages are converted to digital data using the main clock of the microcomputer as a conversion clock. More specifically, the analog voltages output from the variable resistor (R9) are A/D converted. REJ05B0815-0110 Rev.1.10 2007.12 Page 2 of 15 M16C/26A Group Sample Program (Voltmeter) 5. Operational Specification (1) Immediately after the reset switch is depressed, the LCD shows “0.000V” until an AD value is fixed. (2) Then the LCD shows the input voltage from the variable resistor (R9). * The AD values are set by calling the common function “AD average” (RL_AdVeraging). Within the function, a value is sampled 6 times, and the sampled values except the maximum and minimum values are averaged, the result of which is returned. This average value is acquired 8 times, the average of which is made a fixed value. (1) Reset start v olme 0 . t er 0 0 0V v olme 2 . t er (2) VR (variable resistor) 5 0 0V v olme 5 . t er 0 0 0V REJ05B0815-0110 Rev.1.10 2007.12 Page 3 of 15 M16C/26A Group Sample Program (Voltmeter) 6. Definition of the RSK Functionality and the RSK_LIB APIs and Common Functions Used by Voltmeter 6.1 Definition of the RSK Functionality RSKdefine.h file In this application, the following functionalities (those shown in red) are set. /********************************************************* The boot information on CPU is defined Usually, this mode is used *********************************************************/ #define _CPU_M16C26A_NORMAL_MOD /* Use in low power mode can be performed. */ //#define _CPU_M16C26A_32KHZ_MOD /* Use of access of a flash can be performed. */ //#define _CPU_M16C26A_DATAFLASF_USE /******************************************************** The hardware function which RSK supports is chosen /********************************************************/ //#define _USE_KEY //#define _USE_BUZZER #define _OPTION_USE_AD //#define _OPTION_USE_COM_RX //#define _OPTION_USE_COM_TX //#define _OPTION_USE_INFRAEDRX //#define _OPTION_USE_INFRAEDTX //#define _OPTION_USE_SW //#define _OPTION_USE_LED //#define _OPTION_USE_IO Individual definition of each selected functionality #if defined _OPTION_USE_AD /* Define Illumimeter Adc */ //#define _OPTION_USE_AD0 /* Define Vr Adc */ #define _OPTION_USE_AD24 #endif Potentiometer AD REJ05B0815-0110 Rev.1.10 2007.12 Page 4 of 15 M16C/26A Group Sample Program (Voltmeter) 6.2 APIs and Common Functions Used ApiStatusType RL_Putc_Lcd( char Ylocation, char outc, int *ERcode ); *ERcode ); ApiStatusType RL_Putc_LcdLoc( char Xlocation, char Ylocation, char RvTime, char outc, int *ERcode ); ApiStatusType RL_Puts_LcdLoc( char Xlocation, char Ylocation, char RvTime, const char far* outc, int *ERcode ); ApiStatusType RL_Start_Adc( int AdIdentfier, int *ERcode ); int RL_AdAveraging( int AdLogicalNo, int *AdAverage, int *ERcode ); void RL_ErrorHook( int FuncNo, int ErrorNo ); For details about the APIs and common functions used by the sample program (voltmeter), see the Renesas Starter Kit Library V.1.00 Reference Manual. REJ05B0815-0110 Rev.1.10 2007.12 Page 5 of 15 M16C/26A Group Sample Program (Voltmeter) 7. Flowchart Voltmeter Clear display on LCD Show the initial screen Request AD start Measure potentiometer NO Measured 8 times? YES Process measured value display REJ05B0815-0110 Rev.1.10 2007.12 Page 6 of 15 M16C/26A Group Sample Program (Voltmeter) 8. 1 Tutorial Launch the HEW by double-clicking its icon. 2 Change the session name from “default Session” to “SessionM16C_E8_System.” REJ05B0815-0110 Rev.1.10 2007.12 Page 7 of 15 M16C/26A Group Sample Program (Voltmeter) 3 Select “M30260F8A” for Device. Select “Download emulator firmware” for Mode. REJ05B0815-0110 Rev.1.10 2007.12 Page 8 of 15 M16C/26A Group Sample Program (Voltmeter) Check the box labeled “Power supply is carried out. (MAX 300mA)” and then select “5.0V.” REJ05B0815-0110 Rev.1.10 2007.12 Page 9 of 15 M16C/26A Group Sample Program (Voltmeter) 4 In the program and the work RAM text boxes of Firmware Location Address, enter “FA0” and “0B8” respectively. Leave the box labeled “Debug a program using the WDT” unchecked. REJ05B0815-0110 Rev.1.10 2007.12 Page 10 of 15 M16C/26A Group Sample Program (Voltmeter) 5 Choose Download from the Debug tab and download a module. The upper-side choices for Download show the location from which a project was downloaded. REJ05B0815-0110 Rev.1.10 2007.12 Page 11 of 15 M16C/26A Group Sample Program (Voltmeter) 6 Click “Start after Reset” to start program execution. 7 Please do "Cancellation" when "The file is opened" window opens. REJ05B0815-0110 Rev.1.10 2007.12 Page 12 of 15 M16C/26A Group Sample Program (Voltmeter) 9. Web Sitet Renesas Technology Web site http://www.renesas.com/ REJ05B0815-0110 Rev.1.10 2007.12 Page 13 of 15 M16C/26A Group Sample Program (Voltmeter) Revision History Rev. 1.00 1.10 Date of issue 2006.06.30 2007.12.03 Content of revision Page First revision issued RSK_LIB APIs supported Points REJ05B0815-0110 Rev.1.10 2007.12 Page 14 of 15 M16C/26A Group Sample Program (Voltmeter) REJ05B0815-0110 Rev.1.10 2007.12 Page 15 of 15
M16C26A-V 价格&库存

很抱歉,暂时无法提供与“M16C26A-V”相匹配的价格&库存,您可以联系我们找货

免费人工找货