Blame | Last modification | View Log | Download | RSS feed
ifndef __regf082ainc__regf082ainc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File F082a.INC *;* *;* Contains Bit & Register Definitions for Z8encore F082a *;* Source: Z8 Encore! XP F082A Series Product Specification, PS022829-0814*;* *;****************************************************************************include "ez8com.inc";----------------------------------------------------------------------------; System ControlPWRCTL0 sfr 0f80h ; Power Control 0LPO __z8bit PWRCTL0,7 ; Low-Power Operational Amplifier DisableVBO __z8bit PWRCTL0,4 ; Voltage Brown-Out Detector DisableTEMP __z8bit PWRCTL0,3 ; Temperature Sensor Disableif __hasadcADC __z8bit PWRCTL0,2 ; Analog-to-Digital Converter DisableendifCOMP __z8bit PWRCTL0,1 ; Comparator DisableOSCCTL sfr 0f86h ; Oscillator ControlINTEN __z8bit OSCCTL,7 ; Internal Precision Oscillator EnableXTLEN __z8bit OSCCTL,6 ; Crystal Oscillator EnableWDTEN __z8bit OSCCTL,5 ; Watchdog Timer Oscillator EnableSOFEN __z8bit OSCCTL,4 ; System Oscillator Failure Detection EnableWDFEN __z8bit OSCCTL,3 ; Watchdog Timer Oscillator Failure Detection EnableSCKSEL __z8bfield OSCCTL,0,3 ; System Clock Oscillator 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 ProtectFWP __z8cbit OPTIONS0,0 ; Flash Write ProtectOPTIONS1 label 0001hXTLDIS __z8cbit OPTIONS1,4 ; State of the Crystal Oscillator at Reset;----------------------------------------------------------------------------; 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)TIMER1_vect label 000ah ; Timer 1TIMER0_vect label 000ch ; Timer 0UART_RX_vect label 000eh ; UART ReceiverUART_TX_vect label 0010h ; UART Transmitterif __hasadcADC_vect label 0016h ; ADCendifA7_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 OutputA5_vect label 001ch ; Port A5, selectable rising or falling input edgeA4_vect label 001eh ; Port A4, selectable rising or falling input edgeA3_vect label 0020h ; Port A3, selectable rising or falling input edgeA2_vect label 0022h ; Port A2, selectable rising or falling input edgeA1_vect label 0024h ; Port A1, selectable rising or falling input edgeA0_vect label 0026h ; Port A0, selectable rising or falling input edgeC3_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 edgesPRIOSC_vect label 003ah ; Primary Oscillator Fail Trap (not an interrupt)WDGOSC_vect label 003ch ; Watchdog Oscillator Fail Trap (not an interrupt);----------------------------------------------------------------------------; 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",0fc6hT1I __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 Requestif __hasadcADCI __z8bit IRQ0,0 ; ADC Interrupt RequestendifT1ENH __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,3if __hasadcADCENH __z8bit IRQ0ENH,0 ; ADC Interrupt Enable & PriorityADCENL __z8bit IRQ0ENL,0endifPA7VI __z8bit IRQ1,7 ; Port A7 Interrupt RequestPA6CI __z8bit IRQ1,6 ; Port A6 or Comparator Interrupt RequestPA5I __z8bit IRQ1,5 ; Port A5 Interrupt RequestPA4I __z8bit IRQ1,4 ; Port A4 Interrupt RequestPA3I __z8bit IRQ1,3 ; Port A3 Interrupt RequestPA2I __z8bit IRQ1,2 ; Port A2 Interrupt RequestPA1I __z8bit IRQ1,1 ; Port A1 Interrupt RequestPA0I __z8bit IRQ1,0 ; Port A0 Interrupt RequestPA7VENH __z8bit IRQ1ENH,7 ; Port A7 Interrupt Enable & PriorityPA7VENL __z8bit IRQ1ENL,7PA6CENH __z8bit IRQ1ENH,6 ; Port A6 Interrupt Enable & PriorityPA6CENL __z8bit IRQ1ENL,6PA5ENH __z8bit IRQ1ENH,5 ; Port A5 Interrupt Enable & PriorityPA5ENL __z8bit IRQ1ENL,5PA4ENH __z8bit IRQ1ENH,4 ; Port A4 Interrupt Enable & PriorityPA4ENL __z8bit IRQ1ENL,4PA3ENH __z8bit IRQ1ENH,3 ; Port A3 Interrupt Enable & PriorityPA3ENL __z8bit IRQ1ENL,3PA2ENH __z8bit IRQ1ENH,2 ; Port A2 Interrupt Enable & PriorityPA2ENL __z8bit IRQ1ENL,2PA1ENH __z8bit IRQ1ENH,1 ; Port A1 Interrupt Enable & PriorityPA1ENL __z8bit IRQ1ENL,1PA0ENH __z8bit IRQ1ENH,0 ; Port A0 Interrupt Enable & PriorityPA0ENL __z8bit IRQ1ENL,0PC3I __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 RequestC3ENH __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 SelectPA7VS __z8bit IRQSS,7 ; PA7/LVD SelectionPA6CS __z8bit IRQSS,6 ; PA6/Comparator 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 ; TODO: PDIN does not exist;----------------------------------------------------------------------------; LED ControllerLEDEN sfr 0f82h ; LED Drive EnableLEDLVLH sfr 0f83h ; LED Drive Level HighLEDLVLL sfr 0f84h ; LED Drive Level Low;----------------------------------------------------------------------------; Timer__deftimer "0",0f00h,1,0__deftimer "1",0f08h,1,0;----------------------------------------------------------------------------; UART__defuart "0",0f40h;----------------------------------------------------------------------------; Analog ComparatorCMP0 sfr 0f90h ; Comparator 0 ControlINPSEL __z8bit CMP0,7 ; Signal Select for Positive InputINNSEL __z8bit CMP0,6 ; Signal Select for Negative InputREFLVL __z8bfield CMP0,0,6 ; Internal Reference Voltage Level (b0/1 only on 8 pin devices);----------------------------------------------------------------------------; Analog/Digital Converterif __hasadcADCCTL0 sfr 0f70h ; ADC Control 0CEN __z8bit ADCCTL0,7 ; Conversion EnableREFSELL __z8bit ADCCTL0,6 ; Voltage Reference Level Select Low BitREFOUT __z8bit ADCCTL0,5 ; Internal Reference Output EnableCONT __z8bit ADCCTL0,4 ; Continuous ConversionANAIN __z8bfield ADCCTL0,0,3 ; Analog Input SelectADCCTL1 sfr 0f71h ; ADC Control 1REFSELH __z8bit ADCCTL1,7 ; Voltage Reference Level Select High BitBUFMODE __z8bfield ADCCTL1,0,2 ; Input Buffer Mode SelectADCD_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,3 ; Sample Settling TimeADCST sfr 0f75h ; ADC sample timeST __z8bfield ADCST,0,6 ; Sample Timeendif ; __hasadc;----------------------------------------------------------------------------; Watchdog TimerRSTSTAT sfr 0ff0h ; Reset StatusPOR __z8bit RSTSTAT,7 ; Power-On Reset IndicatorSTOP __z8bit RSTSTAT,6 ; Stop Mode Recovery IndicatorWDT __z8bit RSTSTAT,5 ; Watchdog Timer Time-Out IndicatorEXT __z8bit RSTSTAT,4 ; External Reset IndicatorLVCD __z8bit RSTSTAT,,0 ; Low Voltage Detection IndicatorWDTCTL sfr 0ff0h ; Watchdog Timer ControlWDTU sfr 0ff1h ; Watchdog Timer Reload Upper ByteWDTH sfr 0ff2h ; Watchdog Timer Reload High ByteWDTL sfr 0ff3h ; Watchdog Timer Reload Low Byte;----------------------------------------------------------------------------restoreendif ; __regf082ainc