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

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
JA2

JA2

  • 厂商:

    RENESAS(瑞萨)

  • 封装:

  • 描述:

    JA2 - Sample Program (Electronic Desktop Calculator) - Renesas Technology Corp

  • 数据手册
  • 价格&库存
JA2 数据手册
Application Notes M16C/26A Group Sample Program (Electronic Desktop Calculator) 1. Summary This sample program provides the functionality of an electronic desktop calculator by using the Renesas Starter Kit for M16C/26A (R0K33026AS000BE) and an extension board. 0 Input key Calculation result display The extension board used here is a product from PI System Co., Ltd. 2. Introduction The example described in this document applies to the microcomputers listed below: Microcomputers: M16C26A 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 circuit diagram on page 15 and then connect it to the Starter Kit. 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.) REJ05B0812-0120 Rev.1.20 2007.11 Page 1 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 3. Port Arrangement The key matrix and the buzzer are the facilities mounted on an extension board for the Renesas Starter Kit. To use these facilities, connect an extension board to the Starter Kit. LCD P74 Key matrix P75 P76 P77 P104 P105 P106 P107 10MHz Xin P91 P90 P63 P62 P61 P60 LCD E LCD RS LCD D7 LCD D6 LCD D5 LCD D4 ca l c 0 M30260F8AGP REJ05B0812-0120 Rev.1.20 2007.11 Page 2 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 4. Operational Outline Calculation results are shown on liquid crystal display. The display shows the result of operation when calculation results are within 7 digits (from −9999999 to 9999999) or “E” when calculation results are equal to or more than 8 digits. For example, when you enter “1234  5678 =,” the display will show “6912.” Or when you enter “1234567  8901234,” the display will show “E.” When a key is depressed, the buzzer sounds. Note: In this program, pressing two or more switches at the same time has no effect (i.e., ignored). This function is materialized 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, key scan, and LCD display management are performed using this timer. • Timer A1 (pulse modulation mode, buzzer output) This timer outputs a waveform with different high and low pulse widths using the main clock of the microcomputer as the count source. It is used to sound a buzzer each time a key is touched. REJ05B0812-0120 Rev.1.20 2007.11 Page 3 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 5. Operational Specification Example for 1  20 = 21 (1) The display shows the string “calc” and the numeral “0” immediately after the reset switch is pressed. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + ca l c 0 (2) The “1” key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + Shows the numeral “1” ca l c 1 (3) The “” key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + ca l c 1 (4) The “2” key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + Shows the numeral “2” ca l c 2 REJ05B0812-0120 Rev.1.20 2007.11 Page 4 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) (5) The “0” key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + Shows the numeral “20” ca l c 20 (6) The “=“ key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + Shows the calculation result ca l c 21 (7) The “AC” key is entered. 7 4 1 0 8 5 2 AC 9 6 3 = ÷ × + Clears the display ca l c 0 REJ05B0812-0120 Rev.1.20 2007.11 Page 5 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 6. Definition of the RSK Functionality and the RSK_LIB APIs and Common Functions Used by the Calculator 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 _USE_KEY /* A key matrix continues pushing and existence is defined.*/ /*When not using -USE_KEY_CONTINU is made a comment. */ //#define _USE_KEY_CONTINU #if defined _USE_KEY_CONTINU #else #define _CONTINU_SW1 #define _CONTINU_SW2 #define _CONTINU_SW3 #define _CONTINU_SW4 #define _CONTINU_SW5 #define _CONTINU_SW6 #define _CONTINU_SW7 #define _CONTINU_SW8 #define _CONTINU_SW9 #define _CONTINU_SW10 #define _CONTINU_SW11 #define _CONTINU_SW12 #define _CONTINU_SW13 #define _CONTINU_SW14 #define _CONTINU_SW15 #define _CONTINU_SW16 #endif Continuous key depression is not used in this application. _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF _KEY_CONTEINU_OFF REJ05B0812-0120 Rev.1.20 2007.11 Page 6 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 6.2 APIs and Common Functions Used ApiStatusType RL_SetTimerReq( unsigned int TimerValue, char TimerMode, int *TimerNo, int *ERcode ); ApiStatusType RL_StartTimer( int TimerNo, int *ERcode ); ApiStatusType RL_CheckTimer( int TimerNo, int *ERcode ); ApiStatusType RL_Get_Key( int *Inkey, int *ERcode ); ApiStatusType RL_Start_Buzzer( char freqNo, int *ERcode ); ApiStatusType RL_Stop_Buzzer( int *ERcode ); ApiStatusType RL_Putc_Lcd( char Ylocation, char outc, int *ERcode ); ApiStatusType RL_Puts_LcdLoc( char Xlocation, char Ylocation, char RvTime, const char far* outc, int *ERcode ); void RL_LengthCpy( char *Dest, char far *Strm, char Len ); void RL_ErrorHook( int FuncNo, int ErrorNo ); For details about the APIs and common functions used by the sample program (electronic desktop calculator), see the Renesas Starter Kit Library V.1.00 Reference Manual. REJ05B0812-0120 Rev.1.20 2007.11 Page 7 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 7. Flowchart Electronic desktop Clear display on LCD Show the initial screen Request timer setup Start timers Input keys Process buzzer Process calculations Process calculation results REJ05B0812-0120 Rev.1.20 2007.11 Page 8 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 8. 1 Tutorial Launch the HEW by double-clicking its icon. 2 Change the session name from “default Session” to “SessionM16C_E8_System.” REJ05B0812-0120 Rev.1.20 2007.11 Page 9 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 3 Select “M30260F8A” for Device. Select “Download emulator firmware” for Mode. REJ05B0812-0120 Rev.1.20 2007.11 Page 10 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) Check the box labeled “Power supply is carried out. (MAX 300mA)” and then select “5.0V.” REJ05B0812-0120 Rev.1.20 2007.11 Page 11 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 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. REJ05B0812-0120 Rev.1.20 2007.11 Page 12 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 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. REJ05B0812-0120 Rev.1.20 2007.11 Page 13 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 6 Click “Start after Reset” to start program execution. 7 Please do "Cancellation" when "The file is opened" window opens. REJ05B0812-0120 Rev.1.20 2007.11 Page 14 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 9. Circuit Diagram 10. Part List Part No. SW1 -SW16 D2 - D5 JA1,JA2 Q’ty 16 4 2 Manufacturer OMRON ROHM Molex Type number B3FS-1000P 1SS355TE-17 10-88-1261 26-pin Male, 2-row, vertical type Value Remark Part name Tact switch Switching diode PCB header REJ05B0812-0120 Rev.1.20 2007.11 Page 15 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) 11. Web Sitet Renesas Technology Web site http://www.renesas.com/ REJ05B0812-0120 Rev.1.20 2007.11 Page 16 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) Revision History Rev. 1.00 1.10 1.20 Date of issue 2006.06.30 2007.07.12 2007.11.29 Content of revision Page First revision issued Contents of presentation improved RSK_LIB APIs supported Points REJ05B0812-0120 Rev.1.20 2007.11 Page 17 of 18 M16C/26A Group Sample Program (Electronic Desktop Calculator) REJ05B0812-0120 Rev.1.20 2007.11 Page 18 of 18

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

免费人工找货
TAJA226K010RNJ
  •  国内价格
  • 5+0.55438
  • 20+0.50428
  • 100+0.45419
  • 500+0.40409
  • 1000+0.38072
  • 2000+0.36402

库存:3151

TAJA226K006RNJ
  •  国内价格
  • 5+0.60576
  • 20+0.54897
  • 100+0.49218
  • 500+0.43539
  • 1000+0.40889
  • 2000+0.38996

库存:18306

TAJA225K016RNJ
  •  国内价格
  • 5+0.46698
  • 20+0.42625
  • 100+0.38553
  • 500+0.3448
  • 1000+0.3258
  • 2000+0.31222

库存:995

TAJA226M010RNJ
  •  国内价格
  • 5+0.6806
  • 20+0.6191
  • 100+0.5576
  • 500+0.4961
  • 1000+0.4674
  • 2000+0.4469

库存:2015

TAJA224K035RNJ
  •  国内价格
  • 5+0.815
  • 20+0.74
  • 100+0.665
  • 500+0.59
  • 1000+0.555
  • 2000+0.53

库存:965

TAJA226M006RNJ
  •  国内价格
  • 5+0.75306
  • 20+0.68376
  • 100+0.61446
  • 500+0.54516
  • 1000+0.51282
  • 2000+0.48972

库存:1564

TAJA225M016RNJ
  •  国内价格
  • 5+0.4428
  • 20+0.4023
  • 100+0.3618
  • 500+0.3213
  • 1000+0.3024
  • 2000+0.2889

库存:524

TAJA225K025RNJ
  •  国内价格
  • 5+0.704
  • 20+0.644
  • 100+0.584
  • 500+0.524
  • 1000+0.496
  • 2000+0.476

库存:0