13.07.2015 Views

MC8121 - abov.co.kr

MC8121 - abov.co.kr

MC8121 - abov.co.kr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>MC8121</strong>REVISION 1.61Published by Design Team2013 ABOV Semi<strong>co</strong>nductor Co., Ltd. All rights reserved.Additional information of this manual may be served by ABOV Semi<strong>co</strong>nductor offices in Korea orDistributors.ABOV Semi<strong>co</strong>nductor reserves the right to make changes to any information here in at any time withoutnotice.The information, diagrams and other data in this manual are <strong>co</strong>rrect and reliable; however, ABOVSemi<strong>co</strong>nductor is in no way responsible for any violations of patents or other rights of the third partygenerated by the use of this manual.May 2013 REV1.61 3


<strong>MC8121</strong>List of FiguresFigure 1-1 Block Diagram of <strong>MC8121</strong> ................................................................................................... 7Figure 1-2 Pinout – ODFN 2X2 6L(COL).............................................................................................. 8Figure 1-3 Package Dimension – ODFN 2X2 6L(COL) ........................................................................ 8Figure 1-4 Definition of ti rity ming for fast mode devices on the I2C bus .......................................... 11Figure 1-5 Spectral response of <strong>MC8121</strong> ............................................................................................. 12Figure 2-1 Bit Transfer on the I 2 C-Bus ................................................................................................. 13Figure 2-2 START and STOP Condition .............................................................................................. 14Figure 2-3 STOP or Repeated START Condition ................................................................................ 14Figure 2-4 Acknowledge on the I 2 C-Bus .............................................................................................. 15Figure 2-5 I2C Write Proto<strong>co</strong>l .............................................................................................................. 16Figure 2-6 I2C Read Proto<strong>co</strong>l ............................................................................................................... 16Figure 2-7 ALS Operation .................................................................................................................... 23Figure 2-8 ALS CH0 / CH1 Sequential Operation ............................................................................... 23Figure 2-9 ALS CH0 Interrupt output (level or pulse interrupt) ........................................................... 24Figure 2-10 ALS Interrupt Output (APER=1 or 2 & INTEDGE=0) .................................................... 24Figure 2-11 Operating Modes ............................................................................................................... 26Figure 3-1 Hardware pin <strong>co</strong>nnection diagram ...................................................................................... 27Figure 3-2 I2C write example ............................................................................................................... 28Figure 3-3 I2C read example ................................................................................................................ 28May 2013 REV1.61 5


<strong>MC8121</strong><strong>MC8121</strong>Digital Ambient Light Sensor1. OVERVIEW1.1 DESCRIPTIONThe <strong>MC8121</strong> is an advanced digital ambient light sensor (ALS) IC that transforms illuminance (lightintensity) to a digital signal output. For ambient light sensing, <strong>MC8121</strong> has two openedphotodiodes(CH0/CH1). One is an whole ray responding photodiode and the other is a visible rayresponding photodiode. The visible ray responding photodiode is <strong>co</strong>ated with Infra Red cut off filter ona CMOS integrated circuit. The photovoltaic responses are <strong>co</strong>nverted into digital <strong>co</strong>unter values bytwo internal ALS ADCs of 16-bit resolution. It closely approximates the human eye spectral responseof visible wavelength. The operation voltage ranges from 2.4 to 3.6 volt.The ALS features are ideal for reducing power <strong>co</strong>nsumption and adjusting brightness of displayequipments like LCD, PDP, LED, virtual keyboard and portable projector, etc.1.2 FEATURES• CMOS technology• Independently programmable exposure time for ALS CH0 and CH1 ADCsAmbient Light Sensing• Convert incident light intensity to digital data• 16-bit ALS ADC resolution• Automatic light flickering cancellation supporting• Block off IR(Infrared) by IR cut off filter <strong>co</strong>ating(CH0)• Spectral response close to human eye• Linear ALS response for easy design• Low dark noiseAdditional Features• I 2 C proto<strong>co</strong>l interface• Low stand-by current, 1uA typical• Operating range 2.4 ~ 3.6V6 May 2013 REV1.61


<strong>MC8121</strong>1.3 ORDERING INFORMATIONDEVICE NAME PACKAGE−LEADS CH0 CH1<strong>MC8121</strong> chip sale IR cut off filter on wafer Visible + IR ray<strong>MC8121</strong>FN ODFN 6L IR cut off filter on wafer Visible + IR rayTable 1-1 Ordering Information1.4 APPLICATIONS• Cell phone• Display-equipped portable devices,etc..1.5 BLOCK DIAGRAMVDDVSSCH0 : Visible rayCOMMANDCONTROLALS CH0ADCADDRDECODEADDRADCCounterINTERRUPTINTALS CH1ADCDATAREGISTERCH1 : Visible + IR rayfor calibrationI2C I/FSCLSDAMEMORY(OTP)OSC 690kHzTimingControllerVPPFigure 1-1 Block Diagram of <strong>MC8121</strong>May 2013 REV1.61 7


<strong>MC8121</strong>1.6 PIN CONFIGURATIONSTOP VIEW – ODFN 2X2 6L(COL)VDD1 6 SDAADDR25INTVSS34SCLFigure 1-2 Pinout – ODFN 2X2 6L(COL)1.7 PKG DIMENSIONFigure 1-3 Package Dimension – ODFN 2X2 6L(COL)8 May 2013 REV1.61


<strong>MC8121</strong>1.8 PIN DESCRIPTIONPIN Number PIN Name Description I/O1 VDD Power supply : 2.4 to 3.6V Power2 ADDR Address Select Input3 VSS Ground Power4 SCL I 2 C Serial Clock Line Input5 INT ALS Interrupt O(Open Drain)6 SDA I 2 C Serial Data Line O(Open Drain)Table 1-2 Pin Description – ODFN 2X2 6L(COL)1.9 SLAVE ADDRESSADDRSLAVE ADDRESSLOW / OPEN 0101_001HIGH 1010_110Table 1-3 Slave Address Selection1.10 ELELCTRICAL CHARACTERISTICS1.10.1 ABSOLUTE MAXIMUM RATINGSSymbol Parameter Min. Max. Unit. RemarkVDD Supply voltage 0 4.0 VTstg Storage temperature range -40 85 ˚CVO Digital ouput voltage range -0.5 4.0 VIO Digital output current -1 20 mAVHBM ESD tolerance, Human Body Model 8,000 VTable 1-4 Absolute Maximum RatingsNOTE Stresses beyond those listed under “Absolute Maximum Ratings” may cause permanent damage to thedevice. This is a stress rating only and functional operation of the device at any other <strong>co</strong>nditions beyond thoseindicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating<strong>co</strong>nditions for extended periods may affect device reliablility.May 2013 REV1.61 9


<strong>MC8121</strong>1.10.2 RECOMMENDED OPERATING CONDITIONSymbol Parameter Min. Typ. Max. Unit RemarkVDD Supply voltage 2.4 3.0 3.6 VTA Operating temperature -40 85 ˚CVIL SCL,SDA input low voltage 600 mVVIH SCL,SDA input low voltage 1.4 VTable 1-5 Re<strong>co</strong>mmended Operating Condition1.10.3 ELECTRICAL SPECIFICATIONS(VDD =3.0V, VSS =0V, TA=+25℃±10%)Symbol Parameter Min. Typ. Max. Unit RemarkV DD Power Supply 2.4 - 3.6 VI SLEEP Stand-by Current 1 3 uA I 2 C interface enableI DDALS0 Active Current for ALS CH0 80 uAI DDALS1 Active Current for ALS CH1 80 uAI DDALS01λ PCH0λ PCH1Active Current for ALS CH0and CH1Peak Sensitivity wavelengthof ALS CH0Peak Sensitivity wavelengthof ALS CH1120 uA550 nm850 nmf OSC Internal Oscillator Frequency 552 690 828 kHzt INTADC Integration/ConversionTime100 500 ms 16-bit ADC dataV OL INT,SDA ouput low voltage 0 0.4 V 6mA sink currentA0 000LADC Count Value of CH0- 0 2 <strong>co</strong>unts @0Lux, white <strong>co</strong>lor LEDA0 001L PD5 <strong>co</strong>unts @1Lux, white <strong>co</strong>lor LEDA0 200L(ATIME0 = 06 H, INTR[7]=1)980 1090 1200 <strong>co</strong>unts @200Lux, white <strong>co</strong>lor LEDA1 000LADC Count Value of CH1- 0 4 <strong>co</strong>unts @0Lux, white <strong>co</strong>lor LEDA1 001L PD8 <strong>co</strong>unts @1Lux, white <strong>co</strong>lor LEDA1 200L(ATIME0 = 06 H, INTR[7]=1)1334 1640 1975 <strong>co</strong>unts @200Lux, white <strong>co</strong>lor LEDDF ALS0DF ALS1Full Scale ALS CH0 ADCCountFull Scale ALS CH1 ADCCount65535 <strong>co</strong>unts65535 <strong>co</strong>untsTable 1-6 Electrical Specifications10 May 2013 REV1.61


<strong>MC8121</strong>1.10.4 I 2 C CHARACTERISTICSThe following table and figure show the timing <strong>co</strong>dition of SDA and SCL bus lines for fast mode I 2 Cbus devices. NOTE1 .(VDD =3.0V, VSS =0V, TA=+25℃±10%)Parameter Symbol NOTE2 Min Max UnitSCL clock frequency f SCL 0 400 kHzHold time after (repeated) START <strong>co</strong>ndition. Afterthis period, the first clock pulse is generatedt HD;STA 0.6 - usLOW period of the SCL clock t LOW 1.3 - usHIGH period of the SCL clock t HIGH 0.6 - usSetup time for a repeated START <strong>co</strong>ndition t SU;STA 0.6 - usData hold time t HD;DAT 0 0.9 usData setup time t SU;DAT 100 - nsClock/data fall time t F 0 300 nsClock/data rise time t R 0 300 nsSetup time for STOP <strong>co</strong>ndition t SU;STO 0.6 - usBus free time between a STOP and START<strong>co</strong>ndtionTable 1-7 Timing characteristics of I 2 Ct BUF 1.3 - usNOTE1 All timing is shown with respect to 30% VDD and 70% VDD.SDAt Ft Rt SU;DATt HD;DATt Rt BUFt LOWt FSCLt HD;STAt HD;DATt HIGHt SU;STAt SU;STOS Sr PSFigure 1-4 Definition of ti rity ming for fast mode devices on the I2C bus1.10.5 OPTICAL CHARACTERISTICSA. Spectral responseMay 2013 REV1.61 11


<strong>MC8121</strong>Spectrum of <strong>MC8121</strong> is the below curve by using monochrometer and integrated sphere.Figure 1-5 Spectral response of <strong>MC8121</strong>12 May 2013 REV1.61


<strong>MC8121</strong>2. OPERATION2.1 I 2 C2.1.1 OVERVIEWThe I 2 C is one of industrial standard serial <strong>co</strong>mmunication proto<strong>co</strong>ls, and which uses 2 bus linesSerial Data Line (SDA) and Serial Clock Line (SCL) to exchange data. Because both SDA and SCLlines are open-drain output, each line needs pull-up resistor. The features are as shown below.- Compatible with I 2 C interface- Up to 400kHz data transfer speed- Support two 7-bit slave address- Slave operation only2.1.2 I 2 C BIT TRANSFERThe data on the SDA line must be stable during HIGH period of the clock, SCL. The HIGH or LOWstate of the data line can only change when the clock signal on the SCL line is LOW. The exceptionsare START(S), repeated START(Sr) and STOP(P) <strong>co</strong>ndition where data line changes when clock lineis high.SDASCLData line Stable:Data validexept S, Sr, PChange of DataallowedFigure 2-1 Bit Transfer on the I 2 C-Bus2.1.3 START / REPEATED START / STOPOne master can issue a START (S) <strong>co</strong>ndition to notice other devices <strong>co</strong>nnected to the SCL, SDAlines that it will use the bus. A STOP (P) <strong>co</strong>ndition is generated by the master to release the bus linesso that other devices can use it.A high to low transition on the SDA line while SCL is high defines a START (S) <strong>co</strong>ndition.A low to high transition on the SDA line while SCL is high defines a STOP (P) <strong>co</strong>ndition.May 2013 REV1.61 13


<strong>MC8121</strong>START and STOP <strong>co</strong>nditions are always generated by a master. The bus is <strong>co</strong>nsidered to be busyafter START <strong>co</strong>ndition. The bus is <strong>co</strong>nsidered to be free again after STOP <strong>co</strong>ndition, ie, the bus isbusy between START and STOP <strong>co</strong>ndition. If a repeated START <strong>co</strong>ndition (Sr) is generated insteadof STOP <strong>co</strong>ndition, the bus stays busy. So, the START and repeated START <strong>co</strong>nditions arefunctionally identical.SDASCLSSTART ConditionPSTOP ConditionFigure 2-2 START and STOP Condition2.1.4 DATA TRANSFEREvery byte put on the SDA line must be 8-bits long. The number of bytes that can be transmittedper transfer is unlimited. Each byte has to be followed by an acknowledge bit. Data is transferred withthe most significant bit (MSB) first. If a slave can’t receive or transmit another <strong>co</strong>mplete byte of datauntil it has performed some other function, it can hold the clock line SCL LOW to force the master intoa wait state. Data transfer then <strong>co</strong>ntinues when the slave is ready for another byte of data andreleases clock line SCL.SDAPMSBAcknowledgementSignal form SlaveByte Complete,Interrupt within DeviceAcknowledgementSignal form SlaveClock line held low whileinterrupts are served.SrSCLSorSr1 9 1 9ACKACKSrorPSTART or RepeatedSTART ConditionSTOP or RepeatedSTART ConditionFigure 2-3 STOP or Repeated START Condition2.1.5 ACKNOWLEDGEThe acknowledge related clock pulse is generated by the master. The transmitter releases the SDAline (HIGH) during the acknowledge clock pulse. The receiver must pull down the SDA line during theacknowledge clock pulse so that it remains stable LOW during the HIGH period of this clock pulse.When a slave is addressed by a master (Address Packet), and if it is unable to receive or transmitbecause it’s performing some real time function, the data line must be left HIGH by the slave. Andalso, when a slave addressed by a master is unable to receive more data bits, the slave receiver mustrelease the SDA line (Data Packet). The master can then generate either a STOP <strong>co</strong>ndition to abortthe transfer, or a repeated START <strong>co</strong>ndition to start a new transfer.14 May 2013 REV1.61


<strong>MC8121</strong>If a master receiver is involved in a transfer, it must signal the end of data to the slave transmitter bynot generating an acknowledge on the last byte that was clocked out of the slave. The slavetransmitter must release the data line to allow the master to generate a STOP or repeated START<strong>co</strong>ndition.Data OutputBy TransmitterData OutputBy ReceiverNACKACKSCL From MASTER1 2 89Clock pulse for ACKFigure 2-4 Acknowledge on the I 2 C-Bus2.1.6 OPERATIONThe I 2 C is byte-oriented serial proto<strong>co</strong>l and data transfer between master and this slave device isinitiated by a start <strong>co</strong>ndition(S) from master. After start <strong>co</strong>ndition, the master sends 7-bit slave addressand 1-bit read-write <strong>co</strong>ntrol bit. We call these 8-bit data address packet. The next bytes followed byaddress packet are all data packet unless another start <strong>co</strong>ndition is detected before a stop <strong>co</strong>ndition.The 2 nd byte sent from master after address packet with write direction is interpreted as baseregister or memory address byte. And this base address is incremented only when master transmitsmore than 2 bytes after start <strong>co</strong>ndition because the 2 nd byte is register address field.The <strong>MC8121</strong>’s I 2 C slave address is <strong>co</strong>nfigured as “0101001 B ” or “1010110 B ” ac<strong>co</strong>rding to the input<strong>co</strong>ndition of ADDR pin.2.1.6.1 WRITE PROTOCOL (MASTER TRANSMITTER)The master transmits a start <strong>co</strong>ndition(S), slave address and Write bit. If the high 7-bits of addresspacket equal to the device’s slave address, the <strong>MC8121</strong> acknowledges by pulling down the SDA lineat the 9 th SCL clock period. After address packet and acknowledge bit, the master transmits a datawhich is used for base address accessing internal memory or register of the device. The mastertransmits a number of data to be written and the slave always acknowledges for every data received.To finish transfer the master sends a stop <strong>co</strong>ndition regardless of the acknowledgement.The destination address for in<strong>co</strong>ming data byte increments automatically by one data packet. Forexample, if master transmits 5 data bytes including a base address(=register address in the followingfigure) byte and the base address is <strong>co</strong>nfigured as 00 H , the internal address is defined as 00 H for 1 stdata byte, 01 H for 2 nd data byte, 02 H for 3 rd data byte and 03 H for 4 th data byte. This applies to ReadProto<strong>co</strong>l also.May 2013 REV1.61 15


<strong>MC8121</strong>SDASTARTSLAVE ADDRESS W A REGISTER ADDRESS A WRITE BYTE 0 A WRITE BYTE N A STOPSDA INSDA OUTSCL1 9 1 9 1 9 19Figure 2-5 I2C Write Proto<strong>co</strong>l2.1.6.2 READ PROTOCOL (MASTER RECEIVER)The master transmits a start <strong>co</strong>ndition(S), slave address and Write bit. If the high 7-bits of addresspacket equal to the device’s slave address, the <strong>MC8121</strong> acknowledges by pulling down the SDA lineat the 9 th SCL clock period. After address packet and acknowledge bit, the master transmits a datawhich is used for base address accessing internal memory or register of the device. To initiate readoperations, the master sends repeated start <strong>co</strong>ndition and slave address with Read bit. After thisaddress packet, the master reads data bytes until it does not acknowledges. Note that to send a stop<strong>co</strong>ndition after receiving last data byte, the master must generate a NACK(not acknowledging) on thelast data byte received. Like Write Proto<strong>co</strong>l, the read address increases by 1 after every read byte.Note that the transfer direction changes in this proto<strong>co</strong>l.SDASSLAVE ADDRESS W A REGISTER ADDRESS A SrSLAVE ADDRESS R A READ BYTE 0 A BYTE 1SDA INSDA OUTSCL1 9 1 9 1 9 1 9 1Figure 2-6 I2C Read Proto<strong>co</strong>l2.2 REGISTERS2.2.1 OVERVIEWThe <strong>MC8121</strong> is <strong>co</strong>ntrolled and monitored by 17 registers. These registers provide a variety of <strong>co</strong>ntrolfunctions and can be read to determine results of the ADC <strong>co</strong>nversions.16 May 2013 REV1.61


<strong>MC8121</strong>2.2.2 REGISTER MAPName Address Dir Default DescriptionADDRSET - W - Address Set RegisterCONTROL 00 H R/W 00 H Control RegisterINTR 01 H R/W 80 H Interrupt Control RegisterATIME0 02 H R/W FF H ALS CH0 Integration Time RegisterATIME1 03 H R/W FF H ALS CH1 Integration Time RegisterWTIME 04 H R/W 01 H Wait Time RegisterAILTL 05 H R/W FF H ALS CH0 Interrupt Low Threshold Low RegisterAILTH 06 H R/W 03 H ALS CH0 Interrupt Low Threshold High RegisterAIHTL 07 H R/W FF H ALS CH0 Interrupt High Threshold Low RegisterAIHTH 08 H R/W BF H ALS CH0 Interrupt High Threshold High RegisterPERSIST 0D H R/W 00 H ALS Interrupt Persistence RegisterADATA0L 0E H R FF H ALS CH0 ADC Data Low RegisterADATA0H 0F H R FF H ALS CH0 ADC Data High RegisterADATA1L 10 H R FF H ALS CH1 ADC Data Low RegisterADATA1H 11 H R BF H ALS CH1 ADC Data High RegisterID 12 H R A1 H ID Register NOTEAGC0 14 H R/W 01 H ADC Gain <strong>co</strong>ntrol 0 RegisterAGC1 15 H R/W 99 H ADC Gain <strong>co</strong>ntrol 1 RegisterTable 2-1 Registers of <strong>MC8121</strong>Caution : Do not alter registers addressed 1D H to 1F H . Writing to these registers may result inunexpected function.NOTEDefault value is A1 H for <strong>MC8121</strong>.2.2.3 REGISTER DESCRIPTIONADDRSET (Address Set Register)-- H7 6 5 4 3 2 1 0- - - ADDR4 ADDR3 ADDR2 ADDR1 ADDR0- - - W W W W WInitial value : 00 HADDR[4:0]Base address for subsequent register access. When the I2C masterinitiates a write proto<strong>co</strong>l with start bit and slave address transfer, these<strong>co</strong>nd byte is used to <strong>co</strong>nfigure register address.CONTROL (Control Register)00 H7 6 5 4 3 2 1 0ONESHOT SOFTRST - NOTE1 - NOTE1 MODE2 MODE1 MODE0 POWERR/W R/W - - R/W R/W R/W R/WInitial value : 00 HONESHOTStops ADC integration on <strong>co</strong>mpletion of one integration cycle.0 Continuous operation.1 Once an integration cycle is over, ALS ADC will automaticallyMay 2013 REV1.61 17


<strong>MC8121</strong>stop and also the MODE[1:0] bits in CONTROL register is to becleared. To resume operation, re-assert MODE[2:0] bits.SOFTRSTMODE[2:0]POWERSoft reset. This bit is auto-cleared.0 No operation1 Reset internal registersSelect operating mode. These 3 bits determine the operating mode ofthe device. Note that bit 1 and bit 0 are effective only when POWER bitis set to ‘1’. NOTE2000 Disable ALS CH0/CH1 ADCs.001 Enable ALS CH0/CH1 ADCs. CH0 and CH1 ADCs operate<strong>co</strong>ncurrently.010 Reserved (Do not use)011 Reserved (Do not use)100 Reserved (Do not use)101 Enable CH0 ADC only.110 Enable CH1 ADC only.111 Enable ALS CH0/CH1 ADCs. CH0 and CH1 ADCs operatesequentially(CH1 first).Power On. Enables internal RC oscillator(Typically 690KHz)0 Turns off the <strong>MC8121</strong>.1 Turns on the <strong>MC8121</strong>.NOTE1This bit should be written to ‘0’.NOTE 2The real MODE[1] and MODE[0] bits are updated after internal oscillator is enabled. So reading CONTROLregister will return “---- --00 B” right after writing ‘1’ to these bits while POWER bit is disabled or after settingMODE[2:0] bits and POWER bit simultaneously.INTR (Interrupt Control Register)01 H7 6 5 4 3 2 1 0PSX4EN - - - AINTF INTEDGE - AINTENR/W - - - R R/W - R/WInitial value : 80 HPSX4ENAINTFINTEDGEAINTENMake ALS integration time and Wait time step 4 times longer. It isre<strong>co</strong>mmended to change this bit before enabling POWER bit orchanging MODE[2:0] bits.0 ALS integration time and Wait time step are about 4.5ms1 ALS integration time and Wait time step are about 18msALS Interrupt Flag. Indicates that the device is asserting an interrupt.Writing 0 to this bit clears AINTF.0 No Interrupt or interrupt cleared.1 ALS interrupt requested.Interrupt signal is triggered as pulse type at rising edge of internalclock,typically 1.45us period. The host needs not to clear interrupt.0 Level interrupt1 Edge interruptEnables ALS Interrupt generation.0 ALS Interrupt output is disabled.1 ALS Interrupt occurs on INT pin.ATIME0 (ALS CH 0 Integration Time Register)02 H7 6 5 4 3 2 1 018 May 2013 REV1.61


<strong>MC8121</strong>ATIME07 ATIME06 ATIME05 ATIME04 ATIME03 ATIME02 ATIME01 ATIME00R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HATIME0[7:0]ALS CH0 Integration Time. Specifies the integration time in 4.5msintervals. When MODE[2] bit is ‘0’, the CH1 integration time is alsodecided by this register.ALS CH0 Integration time = 4.5ms x ATIME0[7:0] (when PSX4EN=0)ALS CH0 Integration time = 18ms x ATIME0[7:0] (when PSX4EN=1)00000000 Prohibited. Writing “00 H” has no effect.PSX4EN=0PSX4EN=100000001 4.5ms 18ms00000010 9.0ms 36ms00001010 45.0ms 180ms00010100 90.0ms 360ms00101000 180.0ms 720ms01010000 360.0ms 1440ms11111111 1147.5ms 4608msATIME1 (ALS CH1 Integration Time Register)03 H7 6 5 4 3 2 1 0ATIME17 ATIME16 ATIME15 ATIME14 ATIME13 ATIME12 ATIME11 ATIME10R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HATIME1[7:0]ALS CH1 Integration Time. Specifies the integration time in 4.5msintervals. This register value is effective only when MODE[2] bit is ‘1’.ALS CH1 Integration time = 4.5ms x ATIME0[7:0] (when PSX4EN=0)ALS CH1 Integration time = 18ms x ATIME0[7:0] (when PSX4EN=1)00000000 Prohibited. Writing “00 H” has no effect.PSX4EN=0PSX4EN=100000001 4.5ms 18ms00000010 9.0ms 36ms00001010 45.0ms 180ms00010100 90.0ms 360ms00101000 180.0ms 720ms0101000011111111360.0ms1147.5ms1440ms4608msWTIME (Wait Time Register)04 H7 6 5 4 3 2 1 0WTIME7 WTIME6 WTIME5 WTIME4 WTIME3 WTIME2 WTIME1 WTIME0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : 01 HWTIME[7:0]Wait Time. Specifies the wait time between <strong>co</strong>ntinuous ALS operationsin 4.5ms intervals.Wait time = 4.5ms x WTIME[7:0] (when PSX4=0)Wait time = 18ms x WTIME[7:0] (when PSX4=1)PSX4EN=0PSX4EN=100000000 No wait No waitMay 2013 REV1.61 19


<strong>MC8121</strong>00000001 4.5ms 18ms00000010 9.0ms 36ms00001010 45ms 180ms00010100 90ms 360ms00101000 180ms 720ms01111000 360ms 1440ms11111111 1147.5ms 4608msThe WTIME is used to reduce average power <strong>co</strong>nsumption, because both ALS CH0 and CH1 ADCsstop integrating during wait time period.NOTE Although setting a larger wait time <strong>co</strong>ntributes to reduce average <strong>co</strong>nsumption current, it makes updateperiod and response time longer.AILTL (ALS CH0 Interrupt Low Threshold Low Register)05 H7 6 5 4 3 2 1 0AILTL7 AILTL6 AILTL5 AILTL4 AILTL3 AILTL2 AILTL1 AILTL0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HAILTL[7:0]ALS CH0 ADC channel interrupt low threshold low register.AILTH (ALS CH0 Interrupt Low Threshold High Register)06 H7 6 5 4 3 2 1 0AILTH7 AILTH6 AILTH5 AILTH4 AILTH3 AILTH2 AILTH1 AILTH0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : 03 HAILTH[7:0]ALS CH0 ADC channel interrupt low threshold high register.AIHTL (ALS CH0 Interrupt High Threshold Low Register)07 H7 6 5 4 3 2 1 0AIHTL7 AIHTL6 AIHTL5 AIHTL4 AIHTL3 AIHTL2 AIHTL1 AIHTL0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HAIHTL[7:0]ALS CH0 ADC channel interrupt high threshold low register.AIHTH (ALS CH0 Interrupt High Threshold High Register)08 H7 6 5 4 3 2 1 0AIHTH7 AIHTH6 AIHTH5 AIHTH4 AIHTH3 AIHTH2 AIHTH1 AIHTH0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : BF HAIHTH[7:0]ALS CH0 ADC channel interrupt high threshold high register.The interrupt threshold registers store the values to be used as the high and low trigger points for theadc data registers. If the value of adc data register crosses below or equal to the low thresholdspecified, an interrupt can be asserted on the interrupt pin. Likewise, if the result from ADC20 May 2013 REV1.61


<strong>MC8121</strong><strong>co</strong>nversion crosses <strong>abov</strong>e the high threshold specified, an interrupt can be asserted on the interruptpin. The <strong>co</strong>ncatenated AILTH and AILTL is used as interrupt low threshold(=AILT) and the<strong>co</strong>ncatenated AIHTH and AIHTL is used as interrupt high threshold(=AIHT).PERSIST (Interrupt Persistence Register)0D H7 6 5 4 3 2 1 0- - - - APER3 APER2 APER1 APER0- - - - R/W R/W R/W R/WInitial value : 00 HAPER[3:0]ALS CH0 Interrupt persistence. These bit field <strong>co</strong>ntrol the rate of ALSinterrupt request to host chip.0000 Every ALS CH0 cycle generates an interrupt.0001 1 <strong>co</strong>nsecutive ALS CH0 ADC value out of range.0010 2 <strong>co</strong>nsecutive ALS CH0 ADC value out of range.……1111 15 <strong>co</strong>nsecutive ALS CH0 ADC value out of range.ADATA0L (ALS CH0 ADC Data Low Register)0E H7 6 5 4 3 2 1 0ADATA0L7 ADATA0L6 ADATA0L5 ADATA0L4 ADATA0L3 ADATA0L2 ADATA0L1 ADATA0L0R R R R R R R RInitial value : FF HADATA0L[7:0]ALS CH0 ADC data low register.The ALS ADCs included in <strong>MC8121</strong> are of 16-bit resolution, and the integrated values appear on tworegisters ADATA0L/ADATA0H and ADATA1L/ADATA1H respectively. All ALS ADC data registers areread-only.ADATA0H (ALS CH0 ADC Data High Register)0F H7 6 5 4 3 2 1 0ADATA0H7 ADATA0H6 ADATA0H5 ADATA0H4 ADATA0H3 ADATA0H2 ADATA0H1 ADATA0H0R R R R R R R RInitial value : FF HADATA0H[7:0]ALS CH0 ADC data high register.ADATA1L (ALS CH1 ADC Data Low Register)10 H7 6 5 4 3 2 1 0ADATA1L7 ADATA1L6 ADATA1L5 ADATA1L4 ADATA1L3 ADATA1L2 ADATA1L1 ADATA1L0R R R R R R R RInitial value : 00 HADATA1L[7:0]ALS CH1 ADC data low register.May 2013 REV1.61 21


<strong>MC8121</strong>ADATA1H (ALS CH1 ADC Data High Register)11 H7 6 5 4 3 2 1 0ADATA1H7 ADATA1H6 ADATA1H5 ADATA1H4 ADATA1H3 ADATA1H2 ADATA1H1 ADATA1H0R R R R R R R RInitial value : 00 HPDATA0H[7:0]ALS CH1 ADC data high registerID (ID Register)12 H7 6 5 4 3 2 1 0ID4 ID3 ID2 ID1 ID0 REV2 REV1 REV0R R R R R R R RInitial value : A1 HID[4:0]REV[2:0]Device ID10100 <strong>MC8121</strong>Revision numberAGC0 (ADC Gain Control 0 Register)14 H7 6 5 4 3 2 1 0- - - - - - - VGAIN0- - - - - - - R/WInitial value : 01 HVGAIN0ADC Voltage Gain Control NOTE0 x3.0 (not re<strong>co</strong>mmended)1 x2.5 (re<strong>co</strong>mmended)Caution : Do not alter AGC0[7:1]. Writing non-zero value to these bits may result in mal-function.NOTE Grayed voltage gain is not re<strong>co</strong>mmended.AGC1 (ADC Gain Control 1 Register)15 H7 6 5 4 3 2 1 0AGAIN13 AGAIN12 AGAIN11 AGAIN10 AGAIN03 AGAIN02 AGAIN01 AGAIN00R/W R/W R/W R/W R/W R/W R/W R/WInitial value : 99 HAGAIN1[3:0]AGAIN0[3:0]CH1 ADC gain <strong>co</strong>ntrol NOTE1001 x1.8CH0 ADC gain <strong>co</strong>ntrol NOTE1001 x1.8NOTE For ADC CH0 and CH1, gains are fixed to x1.8 after factory calibration. Other gains are not re<strong>co</strong>mmended.22 May 2013 REV1.61


<strong>MC8121</strong>2.3 OPERATION2.3.1 ALS CONCURRENT OPERATIONALS <strong>co</strong>ncurrent operation is enabled by setting MODE[2:0] bits to 001 B , and after pre-defined ALSperiod the ALS CH0 ADC <strong>co</strong>unter value is transferred to ADATA0H/ADATA0L registers and the CH1ADC <strong>co</strong>unter valude is transferred to ADATA1H/ADATA1L registers which can be read via I2C readtransaction.ALSWAITALSADATA0 adata0 #0 adata0 #1ADATA1 adata1 #0 adata1 #1* ALS period = 4.5ms * ATIME0Wait period = 4.5ms * WTIME* If WTIME is 00 H, no wait period is insertedFigure 2-7 ALS Operation2.3.2 ALS CH0 / CH1 SEQUENTIAL OPERATIONALS CH0 / CH1 sequential operation mode is enabled by setting MODE[2] bit to 1. In this mode ofoperation, ALS CH1 operation is done followed by ALS CH0 operation and optional WAIT cycle. ALSCH0 and CH1 integration time is decided by each timing <strong>co</strong>ntrol registers ATIME0 and ATIME1. Insequential operation mode, only CH0 or CH1 ADC can be enabled by setting MODE bits properly,and this can reduce operating power <strong>co</strong>nsumption.ALS CH1ALS CH0WAITALS CH1ALS CH0* ALS CH1 period = 4.5ms * ATIME1ALS CH0 period = 4.5ms * ATIME0Wait period = 4.5ms * WTIME* If WTIME is 00 H, no wait period is insertedFigure 2-8 ALS CH0 / CH1 Sequential Operation2.3.3 INTERRUPT2.3.3.1 INTERRUPT OUTPUT MODEINT pin operates as interrupt output mode by setting AINTEN bit.May 2013 REV1.61 23


<strong>MC8121</strong>ALS InterruptAn ALS interrupt can be requested when ALS CH0 ADC result is greater than or equal to AITH or lessthan AILT after one ALS cycle. If APER(ALS Persistence) value is non-zero, it is needed the ALS CH0ADC results are out of range APER <strong>co</strong>nsecutive times. The result of interrupt judgement for ALS isstored into AINTF bit in INTR register.There are two kinds of output mode, level or pulse interrupt. Below is the description of the levelinterrupt type.Transition from H to L in INT pin means that an interrupt <strong>co</strong>ndition is generated, and the INT pinremains L level until the interrupt flag(AINTF) is cleared. ALS interrupt is cleared by writing 0 to it’sflag bit in INTR register.Interrupt generatedInterrupt clearedINT pin(IEDGE=0)HighLowINT pin(IEDGE=1)HighLowabout 1.4usFigure 2-9 ALS CH0 Interrupt output (level or pulse interrupt)HighAIHTAILTLow(APER=1)INTclear AINTF clear AINTF clear AINTFAINTF0 1 0 1 0 1 01(APER=2)INTAINTF 0 1 0 1 01Figure 2-10 ALS Interrupt Output (APER=1 or 2 & INTEDGE=0)24 May 2013 REV1.61


<strong>MC8121</strong>2.3.4 POWER CONSUMPTIONPower <strong>co</strong>nsumption can be <strong>co</strong>ntrolled through the use of the wait state timing because the wait state<strong>co</strong>nsumes only 60uA of power.May 2013 REV1.61 25


<strong>MC8121</strong>2.4 APPLICATION INFORMATION : SOFTWARE2.4.1 OVERVIEWAfter applying VDD, the device will initially be in the power down mode. To start ALS sensingoperation, set the POWER bit in CONTROL register to enable internal RC oscillator. The ATIME0,ATIME1 or WTIME registers should be <strong>co</strong>nfigured for the preferred integration and wait time, and thenthe MODE[2:0] bits in CONTROL register should be set to enable each ADC channel.State is automatically changed to POWERDOWN mode after power on.Power SupplyPOWER DOWNModeresetPOWER & MODE[2:0]•Set Integration Time(ATIME0/ATIME1/WTIME)•Set AGC0/1(ADC Gain <strong>co</strong>ntrol)Set POWER=1Wait 1.4msALS <strong>co</strong>ncurrent modeALS sequential modeSet MODE=001 BSet MODE=101 B or110 B or 111 BWait ITIME NOTE• Wait Interrupt or•Read Data RegistersNContinue sensing?YNOTEITIME = 4.5ms * ATIME0 + 4.5ms * WTIME (when MODE[2:0]=101 B) orITIME = 4.5ms * ATIME1 + 4.5ms * WTIME (when MODE[2:0]=110 B) orITIME = 4.5ms * ATIME0 + 4.5ms * ATIME1 + 4.5ms * WTIME (when MODE[2:0]=111 B) orITIME = 4.5ms * ATIME0 + 4.5ms * WTIME (when MODE[2:0]=001 B)Figure 2-11 Operating Modes26 May 2013 REV1.61


<strong>MC8121</strong>3. APPENDIXA. Brief Application NoteA capacitor should be located close to VDD pin of <strong>MC8121</strong> to reduce power noise. The pullup resistors of two line serial bus are re<strong>co</strong>mmended to be around 10kΩ, especially a pull upregistor for INT <strong>co</strong>nnected to host <strong>co</strong>ntroller must be 100kΩ.VDDR SDAR INTR SCLVDDVDDSDATristateADDRINTHost ProcessorVSSSCLVDDFigure 3-1 Hardware pin <strong>co</strong>nnection diagramB. NoticeThe below explains matters to be attended to when customer develops a program for <strong>MC8121</strong>.1) Operation voltage 2.4 to 3.6V2) Set SLAVE address (Determined by ADDR pin <strong>co</strong>ndition during power-up)Input Low : 0x29(0101001) => In Master IIC situation when writing and its value is 0x52 and when reading , its value is 0x53Input High : 0x56(1010110) => In Master IIC situation when writing, value is 0xAC andwhen reading, value is 0xADFloating : 0x29(0101001) => In Master IIC situation when writing, value is 0x52 andwhen reaing, value is 0x533) IIC speed is the standard, about 100kHz.When writing IIC Multi bytes (Single byte read and write rarely is used)- Multi bytes Writing :START(M)+SlaveAddress_W(0x52,M)+ACK(S)+REG_ADDR(0xxx,M)+ACK(S)+WRITE_BYTE0+ACK(S)…+STOP(M)For example) When ADDR pin is low, you want to write 0x33 in CONTROL(address 00 H ) Register. You should follow the below sequence.START+0x52+ACK+0x00+ACK+0x33+ACK+STOPMay 2013 REV1.61 27


<strong>MC8121</strong>S Slave Address 0 A Word Address A Write Data 1 A Write Data 2 A P52 H REG_ADDRMaster to SlaveSlave to MasterA ACK, NA NACK, S START, P STOPFigure 3-2 I2C write exampleWhen reading IIC Multi bytesS Slave Address 0 A Word Address A S Slave Address 1 A Read Data 1 A Read Data 2 NA P52 H REG_ADDR53 HMaster to SlaveSlave to MasterA ACK, NA NACK, S START, P STOP- Multi bytes reading:+Figure 3-3 I2C read exampleSTART(M)+SlaveAddress_W(0x52,M)+ACK(S)+REG_ADDR(0xxx,M)+ACK(S)+STARTSlaveAddress_R(0x53,M)+ACK(S)+READ_BYTE0(S)+ACK(M)…+NACK+STOP(M)For example) When ADDR pin is low, you want to read values of ADATA0Land ADATA0H (address 0E H ~0F H ) register. You should followthe below sequence.START+0x52+ACK+0x0E+ACK+START+0x53+ACK+??+ACK+…??+NACK+STOP- After sending IIC Read/Write Command, delay time needs about 2msec for proto<strong>co</strong>ltransferring and <strong>MC8121</strong> writing time)28 May 2013 REV1.61

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!