13.07.2015 Views

MC8201 - abov.co.kr

MC8201 - abov.co.kr

MC8201 - abov.co.kr

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>MC8201</strong>1.7 PKG DIAGRAMFigure 1-3 PKG DIMENSION수정!!!수정!!!March 2012 REV1.5 9


<strong>MC8201</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 LEDOUT LED driver for proximity emitter – up to 180mA O(Open Drain)5 LEDA LED Anode, <strong>co</strong>nnect to VDD or V BATT on PCB I6 SCL I 2 C Serial Clock Line Input7 INT ALS, PS Interrupt O(Open Drain)8 SDA I 2 C Serial Data Line O(Open Drain)Table 1-2 Pin Description1.9 SLAVE ADDRESSADDRSLAVE ADDRESSLOW / OPEN 1011_100HIGH 0110_011Table 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 2,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.10 March 2012 REV1.5


<strong>MC8201</strong>(VDD =3.0V, VSS =0V, TA=+25℃±10%)Parameter Symbol NOTE2 Min Max UnitSCL clock frequency t 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 timing for fast mode devices on the I2C bus1.10.5 OPTICAL CHARACTERISTICSA. Response linearity by light source<strong>MC8201</strong> has high linearity performance by light illuminace in multi lighting booth system thatcan emit various lights by <strong>co</strong>ntrolled its <strong>co</strong>lor temperature.A .1. Fluorescent lamp 1Color temperature (6500K)12 March 2012 REV1.5


<strong>MC8201</strong>Measurement Illuminace : 0~1,855lx(graph 1. Spectrum of 6500K lamp )Result under 6500K daylightA .2. Fluorescent lamp 2Color temperature (4200K)Measurement Illuminace : 0~422lxResult under 4200K fluorescent lampA .3. Incandescent lampColor temperature (2856K)Illuminace : 0 ~ 1,960lx(graph 2. Spectrum of 2856K lamp )Result under 2856K fluorescent lampB. Spectral responseSpectrum of <strong>MC8201</strong> is the below curve by using monochrometer and integrated sphere.March 2012 REV1.5 13


<strong>MC8201</strong>NOTE : Optical characteristics/data are included after full evaluation.14 March 2012 REV1.5


<strong>MC8201</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.March 2012 REV1.5 15


<strong>MC8201</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.SDAPMSB AcknowledgementSignal form SlaveByte Complete,Interrupt within DeviceAcknowledgementSignal form SlaveClock line held low whileinterrupts are served.SrSCL1 9 1 9ACKACKSorSrSTART or RepeatedSTART ConditionSrorPSTOP 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.16 March 2012 REV1.5


<strong>MC8201</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>MC8201</strong>’s I 2 C slave address is <strong>co</strong>nfigured as “1011100 B ” or “0100011 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>MC8201</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.March 2012 REV1.5 17


<strong>MC8201</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>MC8201</strong> acknowledges by pulling down the SDA lineat the 9th 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>MC8201</strong> is <strong>co</strong>ntrolled and monitored by 23 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.18 March 2012 REV1.5


<strong>MC8201</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 00 H Interrupt Control RegisterATIME 02 H R/W FF H ALS Integration Time RegisterPTIME 03 H R/W FF H PS Integration Time RegisterWTIME 04 H R/W FF H Wait Time RegisterAILTL 05 H R/W FF H ALS Interrupt Low Threshold Low RegisterAILTH 06 H R/W 03 H ALS Interrupt Low Threshold High RegisterAIHTL 07 H R/W FF H ALS Interrupt High Threshold Low RegisterAIHTH 08 H R/W BF H ALS Interrupt High Threshold High RegisterPILTL 09 H R/W FF H PS Interrupt Low Threshold Low RegisterPILTH 0A H R/W 03 H PS Interrupt Low Threshold High RegisterPIHTL 0B H R/W FF H PS Interrupt High Threshold Low RegisterPIHTH 0C H R/W 03 H PS Interrupt High Threshold High RegisterPERSIST 0D H R/W 00 H ALS/PS Interrupt Persistence RegisterADATAL 0E H R FF H ALS ADC Data Low RegisterADATAH 0F H R FF H ALS ADC Data High RegisterPDATA0L 10 H R 00 H PS ADC Data0 Low RegisterPDATA0H 11 H R 00 H PS ADC Data0 High RegisterPDATA1L 12 H R FF H PS ADC Data1 Low RegisterPDATA1H 13 H R 03 H PS ADC Data1 High RegisterAGC0 14 H R/W 00 H ADC Gain <strong>co</strong>ntrol 0 RegisterAGC1 15 H R/W 00 H ADC Gain <strong>co</strong>ntrol 1 RegisterPLEDC 16 H R/W 00 H PS LED <strong>co</strong>ntrol RegisterTable 2-1 Registers of <strong>MC8201</strong>Caution : Do not access registers addressed between 17 H and 1F H . Writing to these registers mayresult in unexpected function.2.2.3 REGISTER DESCRIPTIONADDRSET (Address Set Register)-- H7 6 5 4 3 2 1 0- - - ADDR4 ADDR3 ADDR2 ADDR1 ADDR0- - - R/W R/W R/W R/W R/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 HMarch 2012 REV1.5 19


<strong>MC8201</strong>7 6 5 4 3 2 1 0ONESHOT SOFTRST PROXSEL IRSEL PSTYPE PAEN AAEN POWERR/W R/W R/W R/W R/W R/W R/W R/WInitial value : 00 HONESHOTSOFTRSTPROXSELIRSELPSTYPEPAENAAENPOWERStops ADC integration on <strong>co</strong>mpletion of one integration cycle.0 Continuous operation.1 Once an integration cycle is over, PS/ALS ADC willautomatically stop and also the PAEN/AAEN bits in CONTROLregister is to be cleared. To resume operation, re-assert PAENor AAEN.Soft reset. This bit is auto-cleared.0 No operation1 Reset internal registersThe INT pin operates as proximity detection output mode.0 INT pin is used as PS or ALS interrupt pin1 INT pin is used as proxmity detection output modeSelects the PDATA0H/L read data.0 PDATA0 holds the value obtained by subtracting IR(LED off)ADC <strong>co</strong>unt from PS(LED on) ADC <strong>co</strong>unt.1 PDATA0 holds the value obtained directly from IR(LED off)ADC <strong>co</strong>unt. Set this bit for test purpose.PS mode select0 PS TYPE 0 mode1 PS TYPE 1 modePS ADC Enable. This bit enables the PS ADC channel to beginintegration. This bit is effective only when POWER bit is set to ‘1’. NOTE0 Disable Photo Diode and PS ADC.1 Enable Photo Diode and PS ADC.ALS ADC Enable. This bit enables the ALS ADC channel to beginintegration. This bit is effective only when POWER bit is set to ‘1’. NOTE0 Disable Photo Diode and ALS ADC.1 Enable Photo Diode and ALS ADC.Power On. Enables internal RC oscillator(Typically 700KHz)0 Turns off the <strong>MC8201</strong>.1 Turns on the <strong>MC8201</strong>.NOTEThe real PAEN and AAEN bits are updated after internal oscillator is enabled. So reading CONTROLregister will return “---- --00 B” when writing ‘1’ to these bits while POWER bit is disabled or enabling PAEN,AAEN and POWER bits simultaneously.By enabling PAEN or AAEN bits individually, <strong>MC8201</strong> operates as PS only mode, ALS only mode orPS-ALS alternating mode.INTR (Interrupt Control Register)01 H7 6 5 4 3 2 1 0PSX4EN ALC_IR PROXDET PINTF AINTF INTEDGE PINTEN AINTENR/W R/W R R R R/W R/W R/WInitial value : 40 HPSX4ENEnable proximity sensing4 times in row.20 March 2012 REV1.5


<strong>MC8201</strong>ALC_IRPROXDETPINTFAINTFINTEDGEPINTENAINTEN0 Proximity sensing is performed once in a ps time1 Proximity sensing is performed 4 times in a ps timeEnable ALC function0 Disable ALC1 Enable ALC (default)Proximity detection result. When PS ADC <strong>co</strong>unter value is greater thanPIHT, this flag is set. When PS ADC <strong>co</strong>unter value is less than PILT, thisflag is cleared. For proper detection result, set PPER greater than 01 H.0 Non-detect (Object is far)1 Detect (Object is near)PS Interrupt Flag. Indicates that the device is asserting an interrupt.Writing 0 to this bit clears PINTF.0 No Interrupt or interrupt cleared.1 PS interrupt requested.ALS 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.4us period. The host needs not to clear interrupt.0 Level interrupt1 Edge interruptEnables PS Interrupt generation.0 PS Interrupt output is disabled.1 PS Interrupt occurs on INT pin.Enables ALS Interrupt generation.0 ALS Interrupt output is disabled.1 ALS Interrupt occurs on INT pin.ATIME (ALS Integration Time Register)02 H7 6 5 4 3 2 1 0ATIME7 ATIME6 ATIME5 ATIME4 ATIME3 ATIME2 ATIME2 ATIME1R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HATIME[7:0]ALS Integration Time. Specifies the integration time in 5.0 ms intervals.ALS Integration time = 5 ms x ATIME[7:0]The maximum ALS integration time is about 1275.0 ms (11111111 B).00000000 Prohibited. Writing “00 H” has no effect.00000001 5.0 ms00000010 10.0 ms00001010 50.0 ms00010100 100.0 ms00101000 200.0 ms01010000 400.0 ms11111111 1275.0 msPTIME (PS Integration Time Register)03 HMarch 2012 REV1.5 21


<strong>MC8201</strong>7 6 5 4 3 2 1 0PTIME7 PTIME6 PTIME5 PTIME4 PTIME3 PTIME2 PTIME2 PTIME1R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HPTIME[7:0]PS Integration Time. Specifies the integration time in 0.37 ms intervals.PS Integration time = 185 us x PTIME[7:0]The maximum PS integration time is about 47.2 ms (11111111 B).00000000 Prohibited. Writing “00 H” has no effect.00000001 0.185 ms00000010000010100.37 ms1.85 ms00010100 3.7 ms00101000 7.4 ms01010000 14.8 ms11111111 47.175 msWTIME (Wait Time Register)04 H7 6 5 4 3 2 1 0WTIME7 WTIME6 WTIME5 WTIME4 WTIME3 WTIME2 WTIME2 WTIME1R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HWTIME[7:0]Wait Time. Specifies the wait time between <strong>co</strong>ntinuous ALS or PSoperations in 5.38 ms intervals.Wait time = 5.38 ms x WTIME[7:0]The maximum wait time is about 1371.9 ms (11111111 B).00000000 No wait00000001 5.38 ms000000100000101010.76 ms53.8 ms00010100 107.6 ms00101000 215.2 ms01111000 645.6 ms11111111 1371.9 msThe WTIME is used to reduce average power <strong>co</strong>nsumption, because the PS and ALS ADC stopintegrating during wait time period.When PSEN=1 and ALSEN=0, the internal operating state machine repeats PS and WAIT state<strong>co</strong>ntinuously.When ALSEN=1 and PSEN=0, the internal operating state machine repeats ALS and WAIT state<strong>co</strong>ntinuously.When PSEN=1 and ALSEN=1, the internal operating mode is as follows : PS—ALS—WAIT—PS—ALS—WAIT—PS—ALS—WAIT…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 Interrupt Low Threshold Low Register)05 H22 March 2012 REV1.5


<strong>MC8201</strong>7 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 ADC channel interrupt low threshold low register.AILTH (ALS 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 ADC channel interrupt low threshold high register.AIHTL (ALS 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 ADC channel interrupt high threshold low register.AIHTH (ALS 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 ADC channel interrupt high threshold high register.PILTL (PS Interrupt Low Threshold Low Register)09 H7 6 5 4 3 2 1 0PILTL7 PILTL6 PILTL5 PILTL4 PILTL3 PILTL2 PILTL1 PILTL0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HPILTL[7:0]PS ADC channel interrupt low threshold low register.PILTH (PS Interrupt Low Threshold High Register)0A H7 6 5 4 3 2 1 0- - - - - - PILTH1 PILTH0- - - - - - R/W R/WInitial value : 03 HPILTH[1:0]PS ADC channel interrupt low threshold high register.March 2012 REV1.5 23


<strong>MC8201</strong>PIHTL (PS Interrupt High Threshold Low Register)0B H7 6 5 4 3 2 1 0PIHTL7 PIHTL6 PIHTL5 PIHTL4 PIHTL3 PIHTL2 PIHTL1 PIHTL0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : FF HPIHTL[7:0]PS ADC channel interrupt high threshold low register.PIHTH (PS Interrupt High Threshold High Register)0C H7 6 5 4 3 2 1 0- - - - - - PIHTH1 PIHTH0- - - - - - R/W R/WInitial value : 0F HPIHTH[1:0]PS 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 ADC<strong>co</strong>nversion crosses <strong>abov</strong>e the high threshold specified, an interrupt can be asserted on the interruptpin. Note these high and low threshold registers are 16-bit wide for ambient light sensing, 10/8-bitwide for proximity sensing.When the device is in ALS mode, the <strong>co</strong>ncatenated AILTH and AILTL is used as interrupt lowthreshold(=AILT) and the <strong>co</strong>ncatenated AIHTH and AIHTL is used as interrupt high threshold(=AIHT).Similarly, when the device is in PS mode, the <strong>co</strong>ncatenated PILTH and PILTL is used as interrupt lowthreshold(=PILT) and the <strong>co</strong>ncatenated PIHTH and PIHTL is used as interrupt high threshold(=PIHT).When PROXSEL bit is set, the proximity sensing result is output through the INT pin. The INT pingoes LOW when the PS ADC result is greater than or equal to PIHT and goes HIGH when the PSADC result is less than PILT. So for proper operation with PROXSEL bit set to 1, the PILT should benon-zero value, otherwise the INT pin will be held LOW unless PINTF is cleared by host <strong>co</strong>mmand.Caution : Make sure that the PIHTH register and PILTH register are loaded with “00” when PSresolution is set to 8-bit for proper operation.PERSIST (Interrupt Persistence Register)0D H7 6 5 4 3 2 1 0PPER3 PPER2 PPER1 PPER0 APER3 APER2 APER1 APER0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : 00 HPPER[3:0]PS Interrupt persistence. These bit field <strong>co</strong>ntrol the rate of PS interruptrequest to host chip.When PROXSEL bit is set, PPER should be greater than 0000 H forproper operation.0000 Every PS cycle generates an interrupt.0001 1 <strong>co</strong>nsecutive PS ADC value out of range.0010 2 <strong>co</strong>nsecutive PS ADC value out of range.……1111 15 <strong>co</strong>nsecutive PS ADC value out of range.24 March 2012 REV1.5


<strong>MC8201</strong>APER[3:0]ALS Interrupt persistence. These bit field <strong>co</strong>ntrol the rate of ALSinterrupt request to host chip.0000 Every ALS cycle generates an interrupt.0001 1 <strong>co</strong>nsecutive ALS ADC value out of range.0010 2 <strong>co</strong>nsecutive ALS ADC value out of range.……1111 15 <strong>co</strong>nsecutive ALS ADC value out of range.ADATAL (ALS ADC Data Low Register)0E H7 6 5 4 3 2 1 0ADATAL7 ADATAL6 ADATAL5 ADATAL4 ADATAL3 ADATAL2 ADATAL1 ADATAL0R R R R R R R RInitial value : FF HADATAL[7:0]ALS ADC channel data low register.The ALS ADC included in <strong>MC8201</strong> is of 16-bit resolution, and the integrated values appear on tworegisters ADATAL and ADATAH respectively. All ALS ADC data registers are read-only.ADATAH (ALS ADC Data High Register)0F H7 6 5 4 3 2 1 0ADATAH7 ADATAH6 ADATAH5 ADATAH4 ADATAH3 ADATAH2 ADATAH1 ADATAH0R R R R R R R RInitial value : FF HADATAH[7:0]ALS ADC channel data high register.PDATA0L (PS ADC Data 0 Low Register)10 H7 6 5 4 3 2 1 0PDATA0L7 PDATA0L6 PDATA0L5 PDATA0L4 PDATA0L3 PDATA0L2 PDATA0L1 PDATA0L0R R R R R R R RInitial value : 00 HPDATA0L[7:0]PS ADC channel data 0 low register.PDATA0H (PS ADC Data 0 High Register)11 H7 6 5 4 3 2 1 0- - - - - - PDATA0H1 PDATA0H0- - - - - - R RInitial value : 00 HPDATA0H[7:0]PS ADC channel data 0 high register.PDATA1L (PS ADC Data 1 Low Register)12 H7 6 5 4 3 2 1 0PDATA1L7 PDATA1L6 PDATA1L5 PDATA1L4 PDATA1L3 PDATA1L2 PDATA1L1 PDATA1L0March 2012 REV1.5 25


<strong>MC8201</strong>R R R R R R R RInitial value : FF HPDATA1L[7:0]PS ADC channel data 1 low register.PDATA1H (PS ADC Data 1 High Register)13 H7 6 5 4 3 2 1 0- - - - - - PDATA1H1 PDATA1H0- - - - - - R RInitial value : 03 HPDATA1H[3:0]PS ADC channel data 1 high register.The PS ADC included in <strong>MC8201</strong> is of 10/8-bit resolution, and the integrated values appear on tworegisters PDATA0(PDATA0H:PDATA0L) and PDATA1(PDATA1H:PDATA1L) respectively. All PSADC data registers are read-only.The PDATA0H and PDATA0L registers are updated 1 time during 1 PS cycle and the loading data isselected by IRSEL bit in CONTROL register. If IRSEL bit is ‘0’, the result of subtracting IR(LED off)ADC <strong>co</strong>unt from PS(LED on) ADC <strong>co</strong>unt is loaded into PDATA0. If IRSEL bit is ‘1’, the IR(LED off)ADC <strong>co</strong>unt is directly transferred into PDATA0.Caution : The PDATA1L/H registers are used for test purpose.AGC0 (ADC Gain Control 0 Register)14 H7 6 5 4 3 2 1 0PS_RES - - - - - VGAIN1 VGAIN0R/W - - - - - R/W R/WInitial value : 03 HPS_RESVGAIN[1:0]Select PS resolution0 10-bit resolution1 8-bit resolutionADC Voltage Gain Control. This VGAIN affects on both ALS and PSoperations.00 x2.001 x1.41011x1.2x1.0Caution : Do not alter AGC0[7:2]. Writing non-zero value to these bits may result in mal-function.AGC1 (ADC Gain Control 1 Register)15 H7 6 5 4 3 2 1 0PGAIN3 PGAIN2 PGAIN1 PGAIN0 AGAIN3 AGAIN2 AGAIN1 AGAIN0R/W R/W R/W R/W R/W R/W R/W R/WInitial value : 88 HPGAIN[3:0]PS ADC gain <strong>co</strong>ntrol NOTE0000 Not available 1000 x1.026 March 2012 REV1.5


<strong>MC8201</strong>AGAIN[3:0]0001 x8.0 1001 x0.890010 x4.0 1010 x0.800011 x2.67 1011 x0.730100 x2.0 1100 x0.670101 x1.6 1101 x0.620110 x1.33 1110 x0.570111 x1.14 1111 x0.53ALS ADC gain <strong>co</strong>ntrol NOTE0000 Not available 1000 x1.00001 x8.0 1001 x0.890010 x4.0 1010 x0.800011 x2.67 1011 x0.730100 x2.0 1100 x0.670101 x1.6 1101 x0.620110 x1.33 1110 x0.570111 x1.14 1111 x0.53NOTE Grayed gains are not re<strong>co</strong>mmended.PLEDC (PS LED Control Register)16 H7 6 5 4 3 2 1 0LEDCTRL1 LEDCTRL0 - TSSEL1 TSSEL0 - DUTY1 DUTY0R/W R/W - R/W R/W - R/W R/WInitial value : 00 HLEDCTRL[1:0]TSSEL[1:0]DUTY[1:0]LED Drive Control (DC / Duty 50% / Modulation Frequency)00 LED Drive = FREQ01 LED Drive = FREQ/210 LED Drive = DC (ac<strong>co</strong>rding to FREQ, max 8 PS time step)11 LED Drive = 50% duty (ac<strong>co</strong>rding to FREQ, max 8 PS timestep)LED Drive Strength00 not available01 60mA10 120mA11 180mADuty of LED Modulation Frequency00 25% duty cycle01 12.5% duty cycle10 6.25% duty cycle11 3.125 % duty cycleMarch 2012 REV1.5 27


<strong>MC8201</strong>2.3 PS/ALS OPERATION2.3.1 FSMThe following shows detailed flow for the internal state machine. The device starts in shutdown modeafter power-on. It start PS or ALS operation by setting POWER bit in CONTROL register, whichenables internal oscillator.If PAEN bit is set and AAEN bit is cleared, the state machine will step through the proximity states ofAmbient Light Cancellation(ALC), IR and Proxmity sensing(IR and PS). After that, it moves to Ambientlight sensing(ALS) state if AAEN bit is set, or to Wait state(WAIT) if AAEN bit is cleared.If AAEN bit is set and PAEN bit is cleared, the state machine skips IR and Proxmitiy sensing state andgoes directly to Ambient light sensing state.If both PAEN bit and AAEN bit are set, the device starts IR and Proxmity sensing, and <strong>co</strong>ntinues tomove to Ambient light sensing state.If WTIME register is cleared to 00 H , the Wait state is skipped.POWER=1SHUTDOWNPOWER=0 orOONESHOT = 1Wait Count≠0ALCWAITPAEN=1Wait Count=0IDLEIRONESHOT=1PAEN=0 & AAEN=1ONESHOT=1PAEN=1 & AAEN=0PSALSAAEN=1Figure 2-7 PS-ALS Operating State Machine28 March 2012 REV1.5


<strong>MC8201</strong>2.3.2 ALS OPERATIONALS operation is enabled by setting AAEN bit, and after pre-defined ALS period the ALS ADC <strong>co</strong>untervalue is transferred to ADATAH and ADATAL registers which can be read via I2C read transaction.ALSWAITALSADATA adata #0 adata #1* ALS period = 5.00ms * ATIMEWait period = 5.71ms * WTIME* If WTIME is 00 H, no wait period is insertedFigure 2-8 ALS Operation2.3.3 PS OPERATIONAs shown in below figure, a typical PS cycle is <strong>co</strong>mposed of 3 steps, which are ALC(Ambient LightCancellation), IR(IR Sensing) and PS(Proximity Sensing) respectively. When PAEN bit is enabled, thedevice starts proximity sensing and the ALC function is inserted automatically for ambient lightcancellation, which offers superior performance in bright sunlight <strong>co</strong>nditions. During IR sensing period,the PS ADC output is directly proportional to the IR intensity and the ADC result, padc2 is stored intoPDATA1H/L registers. After that, the device starts PS sensing. The PS ADC output(padc3) is directlyproportional to the total IR intensity from the background IR noise and from the IR LED driven by thedevice. After PS step, the result of subtracting padc2 from padc3 is stored into PDATA0H/L registers.ALC(LED Off)IR(LED Off)PS(LED On)WAITALC(LED Off)IR1(LED Off)PS1(LED On)padc1 padc2 padc3 NOTE1 PDATA0 = padc3 – padc2 NOTE2IR LEDPDATA0PDATA0PDATA0 = padc2 NOTE2* PS period = 0.37ms * PTIME * 3Wait period = 5.38ms * WTIME* If WTIME is 00 H, no wait period is inserted* The IR LED modulation frequency is selected from FREQ in PLEDC register.Figure 2-9 PS Type 0 OperationMarch 2012 REV1.5 29


<strong>MC8201</strong>NOTE1In <strong>abov</strong>e figures, padc1 is 1 st ADC(ALC) result with LED on or off ac<strong>co</strong>rding to PSTYPE, padc2 is 2 ndADC(IR) result with LED off and padc3 is 3 rd ADC(PS) result with LED on.NOTE2 When IRSEL bit in CONTROL register is ‘0’, PDATA0H/L = padc3 – padc2. When IRSEL bit is ‘1’,PDATA0H/L = padc3. PDATA1H/L holds temporary PS ADC results.2.3.4 PS-ALS ALTERNATING OPERATIONPS-ALS alternating mode is enabled by setting both AAEN and PAEN bits to 1. In this mode ofoperation, PS operation is done followed by ALS operation and optional WAIT cycle.ALC(LED Off/On)IR(LED Off)PS(LED On)ALSWAITALC(LED Off/On)IR(LED Off)PS(LED On)ALS* PS period = 0.37ms * PTIME * 3ALS period = 5.00ms * ATIMEWait period = 5.38ms * WTIME* If WTIME is 00 H, no wait period is insertedFigure 2-10 ALS-PS Alternating Operation2.3.5 INTERRUPT2.3.5.1 INTERRUPT OUTPUT MODEINT pin operates as interrupt output mode by setting AINTEN or PINTEN bit. In this mode of operation,the PROXSEL bit should be cleared.ALS InterruptAn ALS interrupt can be requested when ALS ADC result is greater than or equal to AITH or less thanAILT after one ALS cycle. If APER(ALS Persistence) value is non-zero, it is needed the ALS ADCresults are out of range APER <strong>co</strong>nsecutive times. The result of interrupt judgement for ALS is storedinto AINTF bit in INTR register.PS InterruptA PS interrupt can be requested when PS ADC result is greater than or equal to PITH or less thanPILT after one PS cycle. If PPER(PS Persistence) value is non-zero, it is needed the PS ADC resultsare out of range PPER <strong>co</strong>nsecutive times. The result of interrupt judgement for PS is stored intoPINTF 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 <strong>co</strong>rresponding interrupt flag(AINTF or PINTF) is cleared. Any interrupt is clearedby writing 0 to it’s flag bit in INTR register.30 March 2012 REV1.5


<strong>MC8201</strong>Interrupt generatedInterrupt clearedINT pin(IEDGE=0)HighLowINT pin(IEDGE=1)HighLowabout 1.4usFigure 2-11 ALS or PS Interrupt output (level or pulse interrupt)NearPIHTPILTFar(PPER=1)INTclear PINTF clear PINTF clear PINTFPINTF0 1 0 1 0 1 01(PPER=2)INTPINTF 0 1 0 1 01Figure 2-12 PS Interrupt Output (PPER=1 or 2 & INTEDGE=0)2.3.5.2 PROXIMITY DETECTION MODEINT pin operates as proximity detection result output mode by setting PROXSEL bit. The sensingresult whether an object is detected or not appears on INT pin.March 2012 REV1.5 31


<strong>MC8201</strong>NearPIHTPILTFar(PPER=1)INTPROXDETclear PROXDET0 1 0 1 0 1 0(PPER=2)INTPROXDET0 1 0 1 0Figure 2-13 PS Detection (PPER=1 or 2)Unlike interrupt output mode, the PS ADC result(padc3-padc2) appears on INT pin directly. That is,the INT pin is LOW(Detection <strong>co</strong>ndition is met) when PS ADC result is greater than or equal to PIHT,the INT pin goes HIGH(Non-detection is occurred) when PS ADC result is less than PILT. If PPERvalue is non-zero, the detection and non-detection <strong>co</strong>nditions are judged when PS ADC results areout of range PPER <strong>co</strong>nsecutive times. Note that the INT pin goes high or is released only when PSADC result is less than PILT. So it is required that the PILT should be a non-zero value.2.3.6 LED DRIVE CONTROL32 March 2012 REV1.5


<strong>MC8201</strong>0 1 2 3 4 5 6 7 8 9 a b6usLEDOUT(DUTY=2’b00)LEDOUT(DUTY=2’b01)LEDOUT(DUTY=2’b10)LEDOUT(DUTY=2’b11)LEDOUT(DUTY=2’b00)185us3usFigure 2-14 PS Detection (PPER=1 or 2)Unlike interrupt output mode, the PS ADC result(padc3-pa0 1 2 3 4 5 6 7 8 9 a b0 1 2 3 4 5 6 7 8 9 a b6us370usLEDOUT(DUTY=2’b00)LEDOUT(DUTY=2’b00)LEDOUT(DUTY=2’b00)LEDOUT(DUTY=2’b00)LEDOUT(DUTY=2’b00)3us3us32pulses in 370usLEDOUT(DUTY=2’b00)March 2012 REV1.5 33


<strong>MC8201</strong>Figure 2-15 PS Detection (PPER=1 or 2)Unlike interrupt output mode, the PS ADC result(padc3-pa2.3.7 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.34 March 2012 REV1.5


<strong>MC8201</strong>2.4 APPLICATION INFORMATION : SOFTWARE2.4.1 OVERVIEWAfter applying VDD, the device will initially be in the power down mode. To start PS or ALS sensingoperation, set the POWER bit in CONTROL register to enable internal RC oscillator. The PTIME,ATIME or WTIME registers should be <strong>co</strong>nfigured for the preferred integration and wait time, and thenthe PAEN or AAEN bits in CONTROL register should be set to 1 to enable each ADC channel.State is automatically changed to POWERDOWN mode after power on.Power SupplyPOWER DOWNModeresetPOWER & ADCEN•Set Integration Time(ATIME/PTIME/WTIME)•Set AGC0/1(ADC Gain <strong>co</strong>ntrol)Set POWER=1Wait 1.4msPS mode ALS mode PS-ALS alternating modeSet PAEN=1Set AAEN=1Set AAEN=1 &PAEN=1Wait ITIME NOTE• Wait Interrupt or•Read Data RegistersNOTENContinue sensing?YITIME = 0.37ms * PTIME * 3 + 5.38ms * WTIME (when PAEN=1) orITIME = 5.00ms * ATIME + 5.38ms * WTIME (when AAEN=1) orITIME = 5.38ms * ATIME + 0.37ms * PTIME * 3 + 5.38ms * WTIME (when PAEN=1 & AAEN=1)Figure 2-16 Operating ModesMarch 2012 REV1.5 35


<strong>MC8201</strong>3. APPENDIXA. Brief Application NoteA capacitor should be located close to VDD pin of <strong>MC8201</strong> to reduce power noise. The pullup resistors of two line serial bus are re<strong>co</strong>mmended to be around 10K ohm, especially a pullup registor for INT <strong>co</strong>nnected to host <strong>co</strong>ntroller must be 100Kohm.VDDR SDAR INTR SCLVDDVDDSDATristateADDRINTHost ProcessorVSSSCLLEDOUTLEDAFigure 3-1 Hardware pin <strong>co</strong>nnection diagramB. NoticeThe below explains matters to be attended to when customer develops a program for <strong>MC8201</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 : 0x5C(1011100) => In Master IIC situation when writing and its value is 0xB8 and when reading , its value is 0xB9Input High : 0x23(0100011) => In Master IIC situation when writing, value is 0x46 andwhen reading, value is 0x47Floating : 0x5C(1011100) => In Master IIC situation when writing, value is 0xB8 andwhen reaing, value is 0xB93) 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(0xB8,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+0xB8+ACK+0x00+ACK+0x33+ACK+STOP36 March 2012 REV1.5


<strong>MC8201</strong>S Slave Address 0 A Word Address A Write Data 1 A Write Data 2 A PB8 HREG_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 PB0 HREG_ADDRB9 HMaster to SlaveSlave to MasterA ACK, NA NACK, S START, P STOP- Multi bytes reading:+Figure 3-3 I2C read exampleSTART(M)+SlaveAddress_W(0xB8,M)+ACK(S)+REG_ADDR(0xxx,M)+ACK(S)+STARTSlaveAddress_R(0xB9,M)+ACK(S)+READ_BYTE0(S)+ACK(M)…+NACK+STOP(M)For example) When ADDR pin is low, you want to read values of ADATALand ADATAH (address 0E H ~0F H ) register. You should followthe below sequence.START+0xB8+ACK+0x0E+ACK+START+0xB9+ACK+??+ACK+…??+NACK+STOP- After sending IIC Read/Write Command, delay time needs about 2msec for proto<strong>co</strong>ltransferring and <strong>MC8201</strong> writing time)March 2012 REV1.5 37

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

Saved successfully!

Ooh no, something went wrong!