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

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
JA1

JA1

  • 厂商:

    RENESAS(瑞萨)

  • 封装:

  • 描述:

    JA1 - Sample Program (Lux Meter) - Renesas Technology Corp

  • 数据手册
  • 价格&库存
JA1 数据手册
Application Notes M16C/26A Group Sample Program (Lux Meter) 1. Summary This sample program provides the functionality of a lux, or illuminance meter by using the Renesas Starter Kit for M16C/26A (R0K33026AS000BE) and an extension board. Illuminance meter The extension board used here is a product from PI System Co., Ltd. 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 on page 13 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.) REJ05B0811_0110 Rev.1.10 2007.11 Page 1 of 16 M16C/26A Group Sample Program (Lux Meter) 3. Port Arrangement P100 Luxmeter LCD P91 P90 P63 P62 P61 10MHz Xin P60 LCD E LCD RS LCD D7 LCD D6 LCD D5 LCD D4 L IGHT LEVEL 0 M30260F8AGP 4. Operational Outline Illuminance levels (−4 to 4) are shown on liquid crystal display by using an illuminance sensor. Determine the criterion for brightness in 5 seconds after the pressing the reset switch. Then, when light is impinged on the illuminance sensor to increase brightness, the illuminance level displayed on LCD changes from 0 to 1, 2, 3 and 4. Conversely, when brightness is reduced, the illuminance level displayed on LCD changes from 0 to 1, 2, 3 and 4. Illuminance sensor Liquid crystal display 5seconds elapsed Liquid crystal display LIGHT LEVEL 4 M16C26A M16C26A Reset switch depressed When light is impinged on illuminance sensor, illuminance level increases. • 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. • AD0 (single-shot mode, illuminance input 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 illuminance sensor are A/D converted. REJ05B0811_0110 Rev.1.10 2007.11 Page 2 of 16 M16C/26A Group Sample Program (Lux Meter) 5. Operational Specification (1) The AD value is read-in for 5 seconds after the reset switch is depressed, and the values read during that time are averaged to yield an initial illuminance. (2) The initial illuminance “0” is displayed. The initial illuminance and the current illuminance levels are compared in Table 1. * 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. (2)Initial illuminance displayed (1)After reset switch depressed L I GHT ADJUST (4)5 seconds elapsed L I GHT LEVEL 0 (5) Current illuminance input level changes (3) Changed level displayed L I GHT LEVEL 3 Figure 2. Example of Program Operation Table 1. Initial Illuminance and Current Illuminance Levels Initial illuminance level - 0.70V - 1.10V -4 - 0.10V - 0.40V -3 - 0.30V - 0.60V -2 - 0.50V - 0.80V -1 - 0.60V - 1.00V Displayed level 0 - 0.80V - 1.20V 1 - 1.00V - 1.40V 2 - 1.20V - 1.60V 3 - 1.40V - 1.80V 4 1.40 V 1.80V - 1.60V - 0.90V - 1.10V - 1.30V - 1.50V - 1.70V - 1.90V - 2.10V - 2.30V 2.30V 1.60V - 1.10V - 1.40V - 1.70V - 2.00V - 2.10V - 2.30V - 2.50V - 2.60V 2.60V - REJ05B0811_0110 Rev.1.10 2007.11 Page 3 of 16 M16C/26A Group Sample Program (Lux Meter) 6. Definition of the RSK Functionality and the RSK_LIB APIs and Common Functions Used by the Lux Meter 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 Lux meter input AD REJ05B0811_0110 Rev.1.10 2007.11 Page 4 of 16 M16C/26A Group Sample Program (Lux Meter) 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_CancelTimer( int TimerNo, int *ERcode ); 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 (lux meter), see the Renesas Starter Kit Library V.1.00 Reference Manual. REJ05B0811_0110 Rev.1.10 2007.11 Page 5 of 16 M16C/26A Group Sample Program (Lux Meter) 7. Flowchart Lux meter Clear display on LCD Show the initial screen Request AD start Measure reference illuminance Measure illuminance Process measured value display REJ05B0811_0110 Rev.1.10 2007.11 Page 6 of 16 M16C/26A Group Sample Program (Lux Meter) 8. 1 Tutorial Launch the HEW by double-clicking its icon. 2 Change the session name from “default Session” to “SessionM16C_E8_System.” REJ05B0811_0110 Rev.1.10 2007.11 Page 7 of 16 M16C/26A Group Sample Program (Lux Meter) 3 Select “M30260F8A” for Device. Select “Download emulator firmware” for Mode. REJ05B0811_0110 Rev.1.10 2007.11 Page 8 of 16 M16C/26A Group Sample Program (Lux Meter) Check the box labeled “Power supply is carried out. (MAX 300mA)” and then select “5.0V.” REJ05B0811_0110 Rev.1.10 2007.11 Page 9 of 16 M16C/26A Group Sample Program (Lux Meter) 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. REJ05B0811_0110 Rev.1.10 2007.11 Page 10 of 16 M16C/26A Group Sample Program (Lux Meter) 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. REJ05B0811_0110 Rev.1.10 2007.11 Page 11 of 16 M16C/26A Group Sample Program (Lux Meter) 6 Click “Start after Reset” to start program execution. 7 Please do "Cancellation" when "The file is opened" window opens. REJ05B0811_0110 Rev.1.10 2007.11 Page 12 of 16 M16C/26A Group Sample Program (Lux Meter) 9. Example Circuit 10. Part List Part name Illuminance sensor Op-amp Laminated ceramic capacitor Electrolytic capacitor Chip resistor Chip resistor Chip resistor PCB header R6 R8,R10 R9 JA1,JA2 1 2 1 2 ROHM ROHM ROHM Molex MCR10EZHF102 MCR10EZHF472 MCR10EZHF103 10-88-1261 1k 4.7k 10k 26-pin 1/8W,1%(5% also acceptable) 1/8W,1% 1/8W,1%(5% also acceptable) Male, 2-row, vertical type C9 1 Panasonic ECE-V1HS010SR 1uF/50V Part No. U2 U4 C7 - C8 Q’ty 1 1 2 Manufacturer TOSHIBA TI Panasonic Type number TPS851 LM358PSR ECJ-1VF1H104 100nF/50V Value Remark REJ05B0811_0110 Rev.1.10 2007.11 Page 13 of 16 M16C/26A Group Sample Program (Lux Meter) 11. Web Sitet Renesas Technology Web site http://www.renesas.com/ REJ05B0811_0110 Rev.1.10 2007.11 Page 14 of 16 M16C/26A Group Sample Program (Lux Meter) Revision History Rev. 1.00 1.10 Date of issue 2006.06.30 2007.11.29 Content of revision Page First revision issued RSK_LIB APIs supported Points REJ05B0811_0110 Rev.1.10 2007.11 Page 15 of 16 M16C/26A Group Sample Program (Lux Meter) REJ05B0811_0110 Rev.1.10 2007.11 Page 16 of 16

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

免费人工找货
S2JA-13-F
  •  国内价格
  • 1+0.31944
  • 10+0.29304
  • 30+0.28776
  • 100+0.27192

库存:80

TJA1042T/3/1
  •  国内价格
  • 1+3.2088
  • 10+2.88675
  • 50+2.62911
  • 150+2.45735
  • 300+2.35

库存:622

TJA1044T,118
  •  国内价格
  • 1+2.69697
  • 30+2.60397
  • 100+2.41797
  • 500+2.23198
  • 1000+2.13898

库存:0

CJA1117-1.8
  •  国内价格
  • 1+0.60442
  • 100+0.56413
  • 300+0.52383
  • 500+0.48354
  • 2000+0.46339
  • 5000+0.4513

库存:0

EEE0JA152P
  •  国内价格
  • 5+1.46801
  • 20+1.33694
  • 100+1.20587
  • 500+1.0748
  • 1000+1.01363
  • 2000+0.96994

库存:0

TJA1043T/1J
    •  国内价格
    • 1+4.05799
    • 10+3.74799
    • 30+3.68599
    • 100+3.49999

    库存:2484

    TJA1042T/1J
    •  国内价格
    • 1+3.295
    • 10+3.17
    • 100+2.795
    • 500+2.72

    库存:2666

    TJA1051T/1J
    •  国内价格
    • 1+4.22202
    • 10+3.88402
    • 30+3.81642

    库存:16

    CJA1117B-ADJ
    •  国内价格
    • 1+0.405
    • 100+0.378
    • 300+0.351
    • 500+0.324
    • 2000+0.3105
    • 5000+0.3024

    库存:501

    TJA1042T,118
    •  国内价格
    • 1+4.8
    • 10+4.6

    库存:0