? rej05b0811_0110 rev.1.10 2007.11 page 1 of 16 application notes m16c/26a group sample program (lux meter) 1. summary this sample program provides the functionality of a lux, or illu minance meter by using the renesas starter kit for m16c/26a (r0k33026as000be) and an extension board. 2. introduction the example described in this document appl ies 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 example ci rcuit on page 13 and then connect it to the starter kit. this program uses rsk_lib. for details about rsk_lib, see the rs k_lib reference manual. (rsk_lib is the library software provid ed for use with the renesas starter kit for m16c/26a.) the extension board used here is a product from pi system co., ltd. illuminance mete r
? rej05b0811_0110 rev.1.10 2007.11 page 2 of 16 m16c/26a group sample program (lux meter) 3. port arrangement 4. operational outline illuminance levels ( ? 4 to 4) are shown on liquid crystal disp lay 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 f rom 0 to 1, 2, 3 and 4. conversely, when brightness is reduced, the illumi nance level displayed on lcd changes from 0 to ? 1, ? 2, ? 3 and ? 4. ? 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 usi ng this timer. ? ad0 (single-shot mode, illu minance input measurement) analog voltages are converted to digital data using the ma in clock of the microcomputer as a conversion clock. more specifically, the analog voltages output from the illuminance sensor are a/d converted. l e e l v l ? i ? g ? h ? t ? 0 10mhz - $ % p100 xin p60 p61 p62 p63 p90 p91 lcd e lcd rs lcd d7 lcd d6 lcd d5 lcd d4 m30260f8agp luxmeter when light is impinged on illuminance sensor, illuminance level increases. - * ( ) 5 - & |