[]TMPT2002/9/12V0.1AJIE:ajie[]2002/9/102002/9/11ADUARTRXUARTTXLCD[]ROMRAM[][][][VISIO][]TIMER1025S1#0FFHCR10TM1INTTM1#0FHTCL1Timerclockselectregister1TCL1.3TCL1.2TCL1.1TCL1.0TIMER1CLOCK0110fx/2pwr20111fx/2pwr31000fx/2pwr41001fx/2pwr51010fx/2pwr61011fx/2pwr71100fx/2pwr81101fx/2pwr91110fx/2pwr101111fx/2pwr12TCL1.7TCL1.6TCL1.5TCL1.4TIMER2CLOCKNOTUSED.DEFINEDAS0000#01HTMC100000TMC12TCE2TCE1TMC1208bit_timerregisterX2channelsmode(TM1TM2)116bit_timerregisterX1channelmode(TM)TCE20operationstop(TM2clearto0)1operationenableTCE10operationstop(TM2clearto0)1operationenable2INTTM10251QTR_SECOND_CNTQTR_SECOND_CNT1QTR_SECOND_CNT4QTR_SECOND_CNTF_ONE_SECONDRAMQTR_SECOND_CNTINIT#00.254FLAGF_ONE_SECONDINIT#012UART_TM_CNT000UART_TM_CNTUART_TM_CNTMSGF_ONE_SECONDUPDATE_TIME1F_ONE_SECOND2ONE_SECOND_CNT115555ADCR_CNT888ADCR_CNTA/D883UPDATE_CLOCK115959RAMSECOND0~59INIT#01bytesHEX2F_SEND_TM_MSGF_ADD_TMPTADCR_CNT59RAMMINUTE0~59INIT#01bytesHEX3123RAMHOUR0~23INIT#01bytesHEX411RAMDATE1~31INIT#11bytesHEX51121RAMMONTH1~12INIT#11bytesHEXA/DRAMONE_SECOND_CNT1,58ADCRADCRADCRADCR_CNT11UART1TD338UARTMSGDECTFP3MSGUARTUART_TIME_CNT120.25s*12=3TIMER1RAMUART_TIME_CNT01TD338UARTMSGDECTFPACKMSGACKMSGUART_TIME_CNTUART_TIME_CNTUART_TIME_CNT03ACKMSG30.25s2UARTDECTFPSEND_TIME_MSGADADANI0100/fxStopconversion#20HADMCSTRGFR1FR0ADM3ADM2ADM1HSCCSA/Dconvertionoperationcontrol0operationstop1operationstartTRGExternaltriggerselection0noexternaltrigger(softwarestarts)1conversionstartsbyexternaltrigger(hardwarestarts)FR1FR0HSC001160/fx01180/fx100100/fx101200/fxADM3ADM2ADM1AnalogInputChannelSelection000~111VSANI0~ANI7#01HADISnumberofanaloginputinputchannelselectionregister0000ADIS3ADIS2ADIS1ADIS0ADIS3ADIS2ADIS1ADIS00000noanaloginputchannel00011channel(ANI0)00102channel(ANI0,ANI1)00113channel(ANI0~ANI2)01004channel(ANI0~ANI3)01015channel(ANI0~ANI4)01106channel(ANI0~ANI5)01117channel(ANI0~ANI6)10008channel(ANI0~ANI7)UPDATE_TIME518A/DA/DAD#1CS5RAMONE_SECOND_CNTINIT#0RAMADCR_CNTINIT#0A/D8ADCR_CNT0INTADADADCRAD_CNV_RESULTADF_NEW_ADCRA/D.RAMAD_CNV_RSLTINIT#01byteFLAGF_NEW_ADCRA/D1ADCR0ADCRLOOKUP_TMPTF_NEW_ADCRAD1ADADCRADCRADCR-6~45ADCRADCR103ET1ADCRADCRADCR40~70ADCRTMPTTMPTHLTMPTROMHL2ADCRADCR70~40AD_CNV_RSLTAD_LAST_CNVTMPT_NOWTMPT_LASTRAMAD_LAST_RSLTINIT#01byteADCRRAMAD_TMPT_RSLTINIT#01byteADCRRAMTMPT_NOWHEXRAMTMPT_LASTHEXBit7Bit6Bit5Bit4Bit3Bit2Bit1Bit0Bit7Bit7=1Bit7=0Bit6~Bit0RECORDRAMTMPT_RECORD_CNT1bytesRAMTMPT_RECORD40bytesADD_TMPT1F_AVERAGE_TMPTRAMTMPTHHEXRAMTMPTLHEXFLAGF_TMPT_SIGN10FLAGF_AVERAGE_TMPT10AVERAGE_TMPTHEXBCDRAMLAST_TMPTHRAMLAST_TMPTLFLAGF_UPDATE_DISPFLAGF_SEND_TMPT_MSGUARTRXNEC780062Serialinterfacechannel2UART289600Theserialchannel2issetto2_wayUARTmodeof8_bit,noparity,1stopbitand9600baudfromtheinternalbaudrategenerator.#00HCSIM2Thisregisterissetwhenserialinterfaceisusedinthe3_wireseriialI/Omode.WhenUARTmodeisselected,CSIM2shouldbesetto00H.#0CBHASIMAsynchronousserialinterfacemoderegister(ASIM)TXERXEPS1PS0CLSLISRMSCKTXEControlOperationControl0Transmitoperationstopped1TransmitoperationenabledRXEReceiveOperationControl0Receiveoperationstopped1ReceiveoperationenabledPS1PS0ParityBitSpecification00Noparity010parityalwaysaddedintransmissionNoparitytestinreception(parityerrornotgenerated)10Oddparity21EvenparityCLCharacterLengthSpecification07bits18bitsSLTransmitDataStopBitLengthSpecification01_bit12_bitISRMControlofReceptionCompletionInterruptinCaseofErrorGeneration0Receptioncompletioninterruptgeneratedincaseoferrorgeneration1ReceptioncompletioninterruptnotgeneratedincaseoferrorgenerationSCKClockSelectioninAsynchronousSerialInterfaceMode0Inputclockfromoff_chiptoASCKpin1Dedicatedbaudrategeneratoroutput#7BHBRGCBaudrategeneratorcontrolregister(BRGC)TPS3TPS2TPS1TPS0MDL3MDL2MDL1MDL0TPL3~TPL0=0000~1110VSk=0~14TPS3~TPS0=0000VSn=11TPS3~TPS0=0101~1110VSn=1~10[Baudrate]=fxx/[(2pwrn)X(k+16)]fxx:MCS=1fxx=fxMCS=0fxx=fx/2INTSRRAMRX_DATAASISF_RX_DATARAMRX_DATA1byteINIT#0FLAGF_RX_DATAINIT#0FRAME_CHECKFLAGF_NEW_MSGINIT#010RAMRX_BUFF16bytesDECODE_MSG1DECTFP1ACK_OKMSGF_UART_KEEPUART_TM_CNTTX_MSG_CNT2ERRORBUSYUndefinedNoResponseBadPPnumber2DECTFP1GET_THG_MSGLength=02Command=0x57Subcommand=0xF0Data=noneTD338PROVIDE_THG_MSGF_SEND_THG_MSGLength=15Command=0x57Subcommand=0xF0Data=temperature(2bytes)andhumidity(1bytes)inchannel1temperature(2bytes)andhumidity(1bytes)inchannel2temperature(2bytes)andhumidity(1bytes)inchannel3temperature(2bytes)andhumidity(1bytes)indoorweather(1bytes)1Data=Channel1temperaturehumidity0x50Channel2temperature#0x00humity0x00Channel3temperature#0x00humity0x00Weather0x06TD338DECTFPACKDECTFPACK_OKACK2GET_TIME_MSGLength=0x02Command=0x54Subcommand=0xE0Data=noneTD338TIME_MSGF_SEND_TM_MSGHEXBCDDECTFPLength=0x07Command=0x54Subcommand=0xE3Data=Second(1byte)Minute(1byte)Hour(1byte)Date(1byte)Month(1byte)TD338DECTFPACK3TIME_MSGHEXLength=0x07Command=0x54Subcommand=0xE3Data=Second(1byte)Minute(1byte)Hour(1byte)Date(1byte)Month(1byte)NOTEACKUARTTXINT_TXTX_BUFFCOUNT0MSGRAMTX_BUFFRAMCOUNT_TX_KEEP=1F_TX_KEEP1F_SEND_THG_MSGPROVIDE_T