Blame | Last modification | View Log | Download | RSS feed
ifndef __regf0822inc__regf0822inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File F0822.INC *;* *;* Contains Bit & Register Definitions for Z8encore F0822 *;* Source: Z8 Encore! XP F0822 Series Product Specification, PS022518-1011*;* *;****************************************************************************include "ez8com.inc";----------------------------------------------------------------------------; System Control;----------------------------------------------------------------------------; 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 0001h;----------------------------------------------------------------------------; 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 TransmitterI2C_vect label 0012h ; I2CSPI_vect label 0014h ; SPIif __hasadcADC_vect label 0016h ; ADCendifA7_vect label 0018h ; Port A7, selectable rising or falling input edgeA6_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 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, 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 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",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 RequestI2CI __z8bit IRQ0,2 ; I2C Interrupt RequestSPII __z8bit IRQ0,1 ; SPI 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,3I2CENH __z8bit IRQ0ENH,2 ; I2C Interrupt Enable & PriorityI2CENL __z8bit IRQ0ENL,2SPIENH __z8bit IRQ0ENH,1 ; SPI Interrupt Enable & PrioritySPIENL __z8bit IRQ0ENL,1if __hasadcADCENH __z8bit IRQ0ENH,0 ; ADC Interrupt Enable & PriorityADCENL __z8bit IRQ0ENL,0endifPA7I __z8bit IRQ1,7 ; Port A7 Interrupt RequestPA6I __z8bit IRQ1,6 ; Port A6 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 RequestPA7ENH __z8bit IRQ1ENH,7 ; Port A7 Interrupt Enable & PriorityPA7ENL __z8bit IRQ1ENL,7PA6ENH __z8bit IRQ1ENH,6 ; Port A6 Interrupt Enable & PriorityPA6ENL __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 SelectIRQCTL 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;----------------------------------------------------------------------------; Timer__deftimer "0",0f00h,0,1__deftimer "1",0f08h,0,1;----------------------------------------------------------------------------; UART__defuart "0",0f40h;----------------------------------------------------------------------------; I2C__defi2c 0f50h;----------------------------------------------------------------------------; SPI__defspi 0f60h;----------------------------------------------------------------------------; Analog/Digital Converterif __hasadcADCCTL sfr 0f70h ; ADC Control 0CEN __z8bit ADCCTL,7 ; Conversion EnableVREF __z8bit ADCCTL,5 ; Voltage ReferenceCONT __z8bit ADCCTL,4 ; Continuous ConversionANAIN __z8bfield ADCCTL,0,3 ; Analog Input 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 TimerWDTCTL 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 ; __regf0822inc