Blame | Last modification | View Log | Download | RSS feed
ifndef __regf1680inc__regf1680inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File F1680.INC *;* *;* Contains Bit & Register Definitions for Z8encore F1680 *;* Source: Z8 Encore! XP F1680 Series Product Specification, PS025016-1013*;* *;****************************************************************************include "ez8com.inc";----------------------------------------------------------------------------; System ControlPWRCTL0 sfr 0f80h ; Power Control 0TRAM __z8bit PWRCTL0,7 ; Low-Power Operational Amplifier DisableLVD_VBO __z8bit PWRCTL0,4 ; Low-Voltage Detection/Voltage Brown-Out Detector DisableTEMP __z8bit PWRCTL0,3 ; Temperature Sensor DisableCOMP0 __z8bit PWRCTL0,1 ; Comparator 0 DisableCOMP1 __z8bit PWRCTL0,0 ; Comparator 1 DisableOSCCTL0 sfr 0f86h ; Oscillator Control 0INTEN __z8bit OSCCTL0,7 ; Internal Precision Oscillator EnableXTLEN __z8bit OSCCTL0,6 ; Crystal Oscillator EnableWDTEN __z8bit OSCCTL0,5 ; Watchdog Timer Oscillator EnablePOFEN __z8bit OSCCTL0,4 ; Primary Oscillator Failure Detection EnableWDFEN __z8bit OSCCTL0,3 ; Watchdog Timer Oscillator Failure Detection EnableSCKSEL __z8bfield OSCCTL0,0,3 ; System Clock Oscillator SelectOSCCTL1 sfr 0f87h ; Oscillator Control 1SECEN __z8bit OSCCTL1,7 ; Secondary Oscillator EnableSECRDY __z8bit OSCCTL1,6 ; Secondary Oscillator Ready FlagINTSEL __z8bfield OSCCTL1,0,3 ; Internal Precision Oscillator Frequency SelectTRMADR sfr 0ff6h ; Trim Bit AddressTRMDR sfr 0ff7h ; Trim Data;----------------------------------------------------------------------------; Flash OptionsOPTIONS0 label 0000hWDT_RES __z8cbit OPTIONS0,7 ; Watchdog Timer ResetWDT_AO __z8cbit OPTIONS0,6 ; Watchdog Timer Always OnOSC_SEL __z8cbfield OPTIONS0,4,2 ; Oscillator Mode SelectionVBO_AO __z8cbit OPTIONS0,3 ; Voltage Brown-Out Protection Always OnFRP __z8cbit OPTIONS0,2 ; (Flash) Read ProtectPRAM_M __z8cbit OPTIONS0,1 ; On-Chip Program RAM Mode SelectFWP __z8cbit OPTIONS0,0 ; Flash Write ProtectOPTIONS1 label 0001hEXTLTMG __z8cbfield OPTIONS1,6,2 ; External Crystal Reset TimingFLASH_WR_PRO_EN __z8cbit OPTIONS1,5 ; Flash Write Operation ProtectEXTL_AO __z8cbit OPTIONS1,4 ; External Crystal Always ONX2_Mode __z8cbit OPTIONS1,1 ; Secondary Crystal Mode SelectX2TL_AO __z8cbit OPTIONS1,0 ; Secondary Crystal Always On;----------------------------------------------------------------------------; Interrupts VectorsRESET_vect label 0002h ; Reset (not an interrupt)WDT_vect label 0004h ; Watchdog TimerILL_INST_vect label 0006h ; Illegal Instruction Trap (not an interrupt)TIMER2_vect label 0008h ; Timer 2TIMER1_vect label 000ah ; Timer 1TIMER0_vect label 000ch ; Timer 0UART0_RX_vect label 000eh ; UART 0 ReceiverUART0_TX_vect label 0010h ; UART 0 TransmitterI2C_vect label 0012h ; I2CSPI_vect label 0014h ; SPIADC_vect label 0016h ; ADCA7_vect label 0018h ; Port A7, selectable rising or falling input edge, or LVDA6_vect label 001ah ; Port A6, selectable rising or falling input edge or Comparator 0 OutputA5_vect label 001ch ; Port A5, selectable rising or falling input edge or Comparator 1 OutputA4_vect label 001eh ; Port A4 or Port D4, selectable rising or falling input edgeA3_vect label 0020h ; Port A3 or Port D3, selectable rising or falling input edgeA2_vect label 0022h ; Port A2 or Port D2, selectable rising or falling input edgeA1_vect label 0024h ; Port A1 or Port D1, selectable rising or falling input edgeA0_vect label 0026h ; Port A0, selectable rising or falling input edgeMCT_vect label 002ah ; Multi-Channel TimerUART1_RX_vect label 002ch ; UART 1 ReceiverUART1_TX_vect label 002eh ; UART 1 TransmitterC3_vect label 0030h ; Port C3, both input edgesC2_vect label 0032h ; Port C2, both input edgesC1_vect label 0034h ; Port C1, both input edgesC0_vect label 0036h ; Port C0, both input edges;----------------------------------------------------------------------------; Interrupts__defirq macro NUM,BaseIRQ{NUM} sfr Base+0 ; Interrupt Request nIRQ{NUM}ENH sfr Base+1 ; IRQn Enable High BitIRQ{NUM}ENL sfr Base+2 ; IRQn Enable Low Bitendm__defirq "0",0fc0h__defirq "1",0fc3h__defirq "2",0fc6hT2I __z8bit IRQ0,7 ; Timer 2 Interrupt RequestT1I __z8bit IRQ0,6 ; Timer 1 Interrupt RequestT0I __z8bit IRQ0,5 ; Timer 0 Interrupt RequestU0RXI __z8bit IRQ0,4 ; UART 0 Receiver Interrupt RequestU0TXI __z8bit IRQ0,3 ; UART 0 Transmitter Interrupt RequestI2CI __z8bit IRQ0,2 ; I2C Interrupt RequestSPII __z8bit IRQ0,1 ; SPI Interrupt RequestADCI __z8bit IRQ0,0 ; ADC Interrupt RequestT2ENH __z8bit IRQ0ENH,7 ; Timer 2 Interrupt Enable & PriorityT2ENL __z8bit IRQ0ENL,7T1ENH __z8bit IRQ0ENH,6 ; Timer 1 Interrupt Enable & PriorityT1ENL __z8bit IRQ0ENL,6T0ENH __z8bit IRQ0ENH,5 ; Timer 0 Interrupt Enable & PriorityT0ENL __z8bit IRQ0ENL,5U0RENH __z8bit IRQ0ENH,4 ; UART 0 Receive Interrupt Enable & PriorityU0RENL __z8bit IRQ0ENL,4U0TENH __z8bit IRQ0ENH,3 ; UART 0 Transmit Interrupt Enable & PriorityU0TENL __z8bit IRQ0ENL,3I2CENH __z8bit IRQ0ENH,2 ; I2C Interrupt Enable & PriorityI2CENL __z8bit IRQ0ENL,2SPIENH __z8bit IRQ0ENH,1 ; SPI Interrupt Enable & PrioritySPIENL __z8bit IRQ0ENL,1ADCENH __z8bit IRQ0ENH,0 ; ADC Interrupt Enable & PriorityADCENL __z8bit IRQ0ENL,0PA7VI __z8bit IRQ1,7 ; Port A7 or LVD Interrupt RequestPA6CI __z8bit IRQ1,6 ; Port A6 or Comparator 0 Interrupt RequestPA5CI __z8bit IRQ1,5 ; Port A5 or Comparator 1 Interrupt RequestPAD4I __z8bit IRQ1,4 ; Port A4 or Port D4 Interrupt RequestPAD3I __z8bit IRQ1,3 ; Port A3 or Port D3 Interrupt RequestPAD2I __z8bit IRQ1,2 ; Port A2 or Port D2 Interrupt RequestPAD1I __z8bit IRQ1,1 ; Port A1 or Port D1 Interrupt RequestPA0I __z8bit IRQ1,0 ; Port A0 Interrupt RequestPA7VENH __z8bit IRQ1ENH,7 ; Port A7 or LVD Interrupt Enable & PriorityPA7VENL __z8bit IRQ1ENL,7PA6ENH __z8bit IRQ1ENH,6 ; Port A6 or Comparator 0 Interrupt Enable & PriorityPA6ENL __z8bit IRQ1ENL,6PA5ENH __z8bit IRQ1ENH,5 ; Port A5 or Comparator 1 Interrupt Enable & PriorityPA5ENL __z8bit IRQ1ENL,5PA4ENH __z8bit IRQ1ENH,4 ; Port A4 or Port D4 Interrupt Enable & PriorityPA4ENL __z8bit IRQ1ENL,4PA3ENH __z8bit IRQ1ENH,3 ; Port A3 or Port D3 Interrupt Enable & PriorityPA3ENL __z8bit IRQ1ENL,3PA2ENH __z8bit IRQ1ENH,2 ; Port A2 or Port D2 Interrupt Enable & PriorityPA2ENL __z8bit IRQ1ENL,2PA1ENH __z8bit IRQ1ENH,1 ; Port A1 or Port D1 Interrupt Enable & PriorityPA1ENL __z8bit IRQ1ENL,1PA0ENH __z8bit IRQ1ENH,0 ; Port A0 Interrupt Enable & PriorityPA0ENL __z8bit IRQ1ENL,0MCTI __z8bit IRQ2,6 ; Multi-Channel Timer Interrupt RequestU1RXI __z8bit IRQ2,5 ; UART 1 Receiver Interrupt RequestU1TXI __z8bit IRQ2,4 ; UART 1 Transmitter Interrupt RequestPC3I __z8bit IRQ2,3 ; Port C3 Interrupt RequestPC2I __z8bit IRQ2,2 ; Port C2 Interrupt RequestPC1I __z8bit IRQ2,1 ; Port C1 Interrupt RequestPC0I __z8bit IRQ2,0 ; Port C0 Interrupt RequestMCTENH __z8bit IRQ2ENH,6 ; Multi-Channel Timer Interrupt Enable & PriorityMCTENL __z8bit IRQ2ENL,6U1RENH __z8bit IRQ2ENH,5 ; UART 1 Receive Interrupt Enable & PriorityU1RENL __z8bit IRQ2ENL,5U1TENH __z8bit IRQ2ENH,4 ; UART 1 Transmit Interrupt Enable & PriorityU1TENL __z8bit IRQ2ENL,4C3ENH __z8bit IRQ2ENH,3 ; Port C3 Interrupt Enable & PriorityC3ENL __z8bit IRQ2ENL,3C2ENH __z8bit IRQ2ENH,2 ; Port C2 Interrupt Enable & PriorityC2ENL __z8bit IRQ2ENL,2C1ENH __z8bit IRQ2ENH,1 ; Port C1 Interrupt Enable & PriorityC1ENL __z8bit IRQ2ENL,1C0ENH __z8bit IRQ2ENH,0 ; Port C0 Interrupt Enable & PriorityC0ENL __z8bit IRQ2ENL,0IRQES sfr 0fcdh ; Interrupt Edge SelectIRQSS sfr 0fceh ; Shared Interrupt Select RegisterPA7VS __z8bit IRQSS,7 ; PA7/LVD SelectionPA6CS __z8bit IRQSS,6 ; PA6/Comparator 0 SelectionPA5CS __z8bit IRQSS,5 ; PA5/Comparator 1 SelectionPAD4S __z8bit IRQSS,4 ; PA4/PD4 SelectionPAD3S __z8bit IRQSS,3 ; PA3/PD3 SelectionPAD2S __z8bit IRQSS,2 ; PA2/PD2 SelectionPAD1S __z8bit IRQSS,1 ; PA1/PD1 SelectionIRQCTL sfr 0fcfh ; Interrupt ControlIRQE __z8bit IRQCTL,7 ; Interrupt Request Enable;----------------------------------------------------------------------------; Flash Memory ControlFCTL sfr 0ff8h ; Flash ControlFCMD __z8bfield FCTL,0,8 ; Flash CommandFSTAT sfr 0ff8h ; Flash StatusFPS sfr 0ff9h ; Flash Page SelectINFO_EN __z8bit FPS,7 ; Information Area EnablePAGE __z8bfield FPS,0,7 ; Page SelectFPROT sfr 0ff9h ; Flash Sector ProtectFFREQH sfr 0ffah ; Flash Programming Frequency High ByteFFREQL sfr 0ffbh ; Flash Programming Frequency Low ByteFFREQ sfr FFREQH;----------------------------------------------------------------------------; GPIO__defgpio "A",0fd0h__defgpio "B",0fd4h__defgpio "C",0fd8h__defgpio "D",0fdch__defgpio "E",0fe0h;----------------------------------------------------------------------------; LED ControllerLEDEN sfr 0f82h ; LED Drive EnableLEDLVLH sfr 0f83h ; LED Drive Level HighLEDLVLL sfr 0f84h ; LED Drive Level Low;----------------------------------------------------------------------------; Timer__defmytimer macro NUM,Base,Base2,Base3__deftimer NUM,Base,1,1T{NUM}MODE3 equ T{NUM}MODEHIT{NUM}PWM1H sfr Base2+0 ; Timer PWM1 High ByteT{NUM}PWM1L sfr Base2+1 ; Timer PWM1 Low ByteT{NUM}PWM1 sfr T{NUM}PWM1HT{NUM}CTL2 sfr Base2+2 ; Timer Control 2T{NUM}PWM0UE __z8bit T{NUM}CTL2,5 ; PWM0 Update EnableT{NUM}TPOLHI __z8bit T{NUM}CTL2,4 ; Timer Input/Output Polarity High BitT{NUM}TCLKS __z8bit T{NUM}CTL2,0 ; Timer Clock SourceT{NUM}STAT sfr Base2+3 ; Timer StatusT{NUM}NEF __z8bit T{NUM}STAT,7 ; Noise Event FlagT{NUM}PWM1EO __z8bit T{NUM}STAT,5 ; PWM 1 Event OverrunT{NUM}PWM0EO __z8bit T{NUM}STAT,4 ; PWM 0 Event OverrunT{NUM}RTOEF __z8bit T{NUM}STAT,3 ; Reload Time-Out Event FlagT{NUM}PWM1EF __z8bit T{NUM}STAT,1 ; PWM 1 Event FlagT{NUM}PWM0EF __z8bit T{NUM}STAT,0 ; PWM 0 Event FlagT{NUM}NFC sfr Base3+0 ; Timer Noise Filter ControlT{NUM}NFEN __z8bit T{NUM}NFC,7 ; Noise Filter EnableT{NUM}NFCTL __z8bfield T{NUM}NFC,4,3 ; Noise Filter Controlendm__defmytimer "0",0f00h,0f20h,0f2ch__defmytimer "1",0f08h,0f24h,0f2dh__defmytimer "2",0f10h,0f28h,0f2eh;----------------------------------------------------------------------------; Multi-Channel Timer__defmct;----------------------------------------------------------------------------; LIN UART__deflinuart macro NUM,BaseU{NUM}TXD sfr Base+0 ; LIN UART Transmit DataU{NUM}RXD sfr Base+0 ; LIN UART Receive DataU{NUM}STAT0 sfr Base+1 ; LIN UART Status 0U{NUM}RDA __z8bit U{NUM}STAT0,7 ; Receive Data Available (LIN+UART)U{NUM}PE __z8bit U{NUM}STAT0,6 ; Parity Error (UART)U{NUM}PLE __z8bit U{NUM}STAT0,6 ; Physical Layer Error (LIN)U{NUM}OE __z8bit U{NUM}STAT0,5 ; Overrun Error (LIN+UART)U{NUM}FE __z8bit U{NUM}STAT0,4 ; Framing Error (LIN+UART)U{NUM}BRKD __z8bit U{NUM}STAT0,3 ; Break Detect (LIN+UART)U{NUM}TDRE __z8bit U{NUM}STAT0,2 ; Transmitter Data Register Empty (LIN+UART)U{NUM}TXE __z8bit U{NUM}STAT0,1 ; Transmitter Empty (LIN+UART)U{NUM}CTS __z8bit U{NUM}STAT0,0 ; Clear to Send Signal (UART)U{NUM}ATB __z8bit U{NUM}STAT0,0 ; LIN Slave Autobaud Complete (LIN)U{NUM}CTL0 sfr Base+2 ; LIN UART Control 0U{NUM}TEN __z8bit U{NUM}CTL0,7 ; Transmit EnableU{NUM}REN __z8bit U{NUM}CTL0,6 ; Receive EnableU{NUM}CTSE __z8bit U{NUM}CTL0,5 ; Clear To Send EnableU{NUM}PEN __z8bit U{NUM}CTL0,4 ; Parity EnableU{NUM}PSEL __z8bit U{NUM}CTL0,3 ; Parity SelectU{NUM}SBRK __z8bit U{NUM}CTL0,2 ; Send BreakU{NUM}STOP __z8bit U{NUM}CTL0,1 ; Stop Bit SelectU{NUM}LBEN __z8bit U{NUM}CTL0,0 ; Loop Back EnableU{NUM}CTL1 sfr Base+3 ; LIN UART Control 1U{NUM}MPMD1 __z8bit U{NUM}CTL1,7 ; Multiprocessor Mode (MSEL=000)U{NUM}MPEN __z8bit U{NUM}CTL1,6 ; Multiprocessor Enable (MSEL=000)U{NUM}MPMD0 __z8bit U{NUM}CTL1,5 ; Multiprocessor Mode (MSEL=000)U{NUM}MPBT __z8bit U{NUM}CTL1,4 ; Multiprocessor Bit Transmit (MSEL=000)U{NUM}DEPOL __z8bit U{NUM}CTL1,3 ; Driver Enable Polarity (MSEL=000)U{NUM}BRGCTL __z8bit U{NUM}CTL1,2 ; Baud Rate Generator Control (MSEL=000)U{NUM}RDAIRQ __z8bit U{NUM}CTL1,1 ; Receive Data Interrupt (MSEL=000)U{NUM}IREN __z8bit U{NUM}CTL1,0 ; Loop Back Enable (MSEL=000)U{NUM}NFEN __z8bit U{NUM}CTL1,7 ; Noise Filter Enable (MSEL=001)U{NUM}NFCTL __z8bfield U{NUM}CTL1,4,3 ; Noise Filter Control (MSEL=001)U{NUM}LMST __z8bit U{NUM}CTL1,7 ; LIN MASTER Mode (MSEL=010)U{NUM}LSLV __z8bit U{NUM}CTL1,6 ; LIN SLAVE Mode (MSEL=010)U{NUM}ABEN __z8bit U{NUM}CTL1,5 ; Autobaud Enable (MSEL=010)U{NUM}ABIEN __z8bit U{NUM}CTL1,4 ; Autobaud Interrupt Enable (MSEL=010)U{NUM}LinState __z8bfield U{NUM}CTL1,2,2 ; LIN State Machine (MSEL=010)U{NUM}TxBreakLength __z8bfield U{NUM}CTL1,0,2 ; TxBreakLength (MSEL=010)U{NUM}MDSTAT sfr Base+4 ; LIN UART Mode Select and StatusU{NUM}MSEL __z8bfield U{NUM}MDSTAT,5,3 ; Mode SelectU{NUM}MODESTATUS __z8bfield U{NUM}MDSTAT,0,5 ; Mode StatusU{NUM}ADDR sfr Base+5 ; UART Address CompareU{NUM}BRH sfr Base+6 ; UART Baud Rate High ByteU{NUM}BRL sfr Base+7 ; UART Baud Rate Low ByteU{NUM}BR sfr U{NUM}BRHendm__deflinuart "0",0f40h__deflinuart "1",0f48h;----------------------------------------------------------------------------; I2CI2CDATA sfr 0f50h ; I2C DataI2CSTAT sfr 0f51h ; I2C StatusI2C_TDRE __z8bit I2CSTAT,7 ; Transmit Data Register EmptyRDRF __z8bit I2CSTAT,6 ; Receive Data Register FullSAM __z8bit I2CSTAT,5 ; Slave Address MatchGCA __z8bit I2CSTAT,4 ; General Call AddressRD __z8bit I2CSTAT,3 ; ReadARBLST __z8bit I2CSTAT,2 ; Arbitration LostSPRS __z8bit I2CSTAT,1 ; Stop/Restart Condition InterruptNCKI __z8bit I2CSTAT,0 ; NACK InterruptI2CCTL sfr 0f52h ; I2C ControlIEN __z8bit I2CCTL,7 ; I2C EnableSSTART __z8bit I2CCTL,6 ; Send Start ConditionSSTOP __z8bit I2CCTL,5 ; Send Stop ConditionI2C_BIRQ __z8bit I2CCTL,4 ; Baud Rate Generator Interrupt RequestTXI __z8bit I2CCTL,3 ; Enable TDRE interruptsNAK __z8bit I2CCTL,2 ; Send NAKFLUSH __z8bit I2CCTL,1 ; Flush DataFILTEN __z8bit I2CCTL,0 ; I2C Signal Filter EnableI2CBRH sfr 0f53h ; I2C Baud Rate High ByteI2CBRL sfr 0f54h ; I2C Baud Rate Low ByteI2CBR sfr I2CBRHI2CSTATE sfr 0f55h ; I2C StateI2CSTATE_H __z8bfield I2CSTATE,4,4 ; I2C State (DIAG=1)I2CSTATE_L __z8bfield I2CSTATE,0,4 ; Least Significant Nibble of the I2C State Machine (DIAG=1)ACKV __z8bit I2CSTATE,7 ; ACK Valid (DIAG=0)ACK __z8bit I2CSTATE,6 ; Acknowledge (DIAG=0)AS __z8bit I2CSTATE,5 ; Address State (DIAG=0)DS __z8bit I2CSTATE,4 ; Data State (DIAG=0)I10B __z8bit I2CSTATE,3 ; 10B (DIAG=0)RSTR __z8bit I2CSTATE,2 ; RESTART (DIAG=0)SCLOUT __z8bit I2CSTATE,1 ; Serial Clock Output (DIAG=0)BUSY __z8bit I2CSTATE,0 ; I2C Bus Busy (DIAG=0)I2CMODE sfr 0f56h ; I2C ModeMODE __z8bfield I2CMODE,5,2 ; Selects the I2C Controller Operational ModeIRM __z8bit I2CMODE,4 ; Interactive Receive ModeGCE __z8bit I2CMODE,3 ; General Call Address EnableSLA __z8bfield I2CMODE,1,2 ; Slave Address Bits 9 and 8DIAG __z8bit I2CMODE,0 ; Diagnostic ModeI2CSLVAD sfr 0f57h ; I2C Slave Address Register;----------------------------------------------------------------------------; ESPIESPIDATA sfr 0f60h ; ESPI DataESPITDCR sfr 0f61h ; ESPI Transmit Data CommandCRDR __z8bit ESPITDCR,7 ; Clear Receive Data RegisterRDFLAG __z8bfield ESPITDCR,5,2 ; Receive Data Buffer FlagTEOF __z8bit ESPITDCR,1 ; Transmit End of FrameSSV __z8bit ESPITDCR,0 ; Slave Select ValueESPICTL sfr 0f62h ; ESPI ControlDIRQE __z8bit ESPICTL,7 ; Data Interrupt Request EnableESPIEN1 __z8bit ESPICTL,6 ; ESPI Enable and Direction ControlBRGCTL __z8bit ESPICTL,5 ; Baud Rate Generator ControlPHASE __z8bit ESPICTL,4 ; Phase SelectCLKPOL __z8bit ESPICTL,3 ; Clock PolarityWOR __z8bit ESPICTL,2 ; Wire-OR (Open-Drain) Mode EnabledMMEN __z8bit ESPICTL,1 ; ESPI MASTER Mode EnableESPIEN0 __z8bit ESPICTL,0 ; ESPI Enable and Direction ControlESPIMODE sfr 0f63h ; ESPI ModeSSMD __z8bfield ESPIMODE,5,3 ; Slave Select ModeNUMBITS __z8bfield ESPIMODE,2,3 ; Number of Data Bits Per Character to TransferSSIO __z8bit ESPIMODE,1 ; Slave Select I/OSSPO __z8bit ESPIMODE,0 ; Slave Select PolarityESPISTAT sfr 0f64h ; ESPI StatusTDRE __z8bit ESPISTAT,7 ; Transmit Data Register EmptyTUND __z8bit ESPISTAT,6 ; Transmit UnderrunCOL __z8bit ESPISTAT,5 ; CollisionABT __z8bit ESPISTAT,4 ; SLAVE Mode Transaction AbortROVR __z8bit ESPISTAT,3 ; Receive OverrunRDRNE __z8bit ESPISTAT,2 ; Receive Data Register Not EmptyTFST __z8bit ESPISTAT,1 ; Transfer StatusSLAS __z8bit ESPISTAT,0 ; Slave SelectESPISTATE sfr 0f65h ; ESPI StateSCKI __z8bit ESPISTATE,7 ; Serial Clock InputSDI __z8bit ESPISTATE,6 ; Serial Data InputESPIBRH sfr 0f66h ; ESPI Baud Rate High ByteESPIBRL sfr 0f67h ; ESPI Baud Rate Low ByteESPIBR sfr ESPIBRH ;;----------------------------------------------------------------------------; Analog ComparatorCMP0 sfr 0f90h ; Comparator 0 ControlINPSEL0 __z8bit CMP0,7 ; Signal Select for Positive InputINNSEL0 __z8bit CMP0,6 ; Signal Select for Negative InputREFLVL0 __z8bfield CMP0,2,4 ; Internal Reference Voltage LevelTIMTRG0 __z8bfield CMP0,0,2 ; Timer TriggerCMP1 sfr 0f91h ; Comparator 1 ControlINPSEL1 __z8bit CMP1,7 ; Signal Select for Positive InputINNSEL1 __z8bit CMP1,6 ; Signal Select for Negative InputREFLVL1 __z8bfield CMP1,2,4 ; Internal Reference Voltage LevelTIMTRG1 __z8bfield CMP1,0,2 ; Timer Trigger;----------------------------------------------------------------------------; Analog/Digital ConverterADCCTL0 sfr 0f70h ; ADC Control 0START __z8bit ADCCTL0,7 ; ADC Start/BusyINTREF_SEL __z8bit ADCCTL0,6 ; Internal Reference SelectREFEN __z8bit ADCCTL0,5 ; Reference SelectADCEN __z8bit ADCCTL0,4 ; ADC EneableANAIN __z8bfield ADCCTL0,0,4 ; Analog Input SelectADCRD_H sfr 0f71h ; ADC Raw Data High ByteADCD_H sfr 0f72h ; ADC Data High ByteADCD_L sfr 0f73h ; ADC Data Low BitsOVF __z8bit ADCD_L,0 ; Overflow StatusADCD sfr ADCD_HADCSST sfr 0f74h ; ADC Sample Settling TimeSST __z8bfield ADCSST,0,4 ; Sample Settling TimeADCST sfr 0f75h ; ADC Sample TimeST __z8bfield ADCST,0,6 ; Sample TimeADCCP sfr 0f76h ; ADC Clock Prescale RegisterDIV16 __z8bit ADCCP,3 ; Divide by 16DIV8 __z8bit ADCCP,2 ; Divide by 8DIV4 __z8bit ADCCP,1 ; Divide by 4DIV2 __z8bit ADCCP,0 ; Divide by 2;----------------------------------------------------------------------------; Watchdog TimerRSTSTAT sfr 0ff0h ; Reset StatusPOR_VBO __z8bit RSTSTAT,7 ; Power-On Initiated VBO Reset or General VBO Reset IndicatorSTOP __z8bit RSTSTAT,6 ; Stop Mode Recovery IndicatorWDT __z8bit RSTSTAT,5 ; Watchdog Timer Time-Out IndicatorEXT __z8bit RSTSTAT,4 ; External Reset IndicatorLVD __z8bit RSTSTAT,0 ; Low-Voltage Detection IndicatorWDTH sfr 0ff2h ; Watchdog Timer Reload High ByteWDTL sfr 0ff3h ; Watchdog Timer Reload Low Byte;----------------------------------------------------------------------------restoreendif ; __regf1680inc