Blame | Last modification | View Log | Download | RSS feed
ifndef __regf0830inc__regf0830inc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File F0830.INC *;* *;* Contains Bit & Register Definitions for Z8encore F0830 *;* Source: Z8 Encore! F0830 Series Product Specification, PS025113-1212 *;* *;****************************************************************************include "ez8com.inc";----------------------------------------------------------------------------; System ControlPWRCTL0 sfr 0f80h ; Power control 0VBO __z8bit PWRCTL0,4 ; Voltage Brown-Out detector disableCOMP __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 EnablePOFEN __z8bit OSCCTL,4 ; Primary 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 0001hVBO_RES __z8cbit OPTIONS1,7 ; Voltage Brown-Out resetXTLDIS __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 0if __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, 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 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,5if __hasadcADCENH __z8bit IRQ0ENH,0 ; ADC Interrupt Enable & PriorityADCENL __z8bit IRQ0ENL,0endifPA7I __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 RequestPA7ENH __z8bit IRQ1ENH,7 ; Port A7 Interrupt Enable & PriorityPA7ENL __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 selectPA6CS __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;----------------------------------------------------------------------------; 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;----------------------------------------------------------------------------; Analog ComparatorCMP0 sfr 0f90h ; Comparator 0 controlINNSEL __z8bit CMP0,6 ; Signal Select for Negative InputREFLVL __z8bfield CMP0,2,4 ; Internal Reference Voltage Level;----------------------------------------------------------------------------; Analog/Digital Converterif __hasadcADCCTL0 sfr 0f70h ; ADC control 0START __z8bit ADCCTL0,7 ; ADC Start/BusyREFEN __z8bit ADCCTL0,6 ; Reference EnableADCEN __z8bit ADCCTL0,5 ; ADC EnableANAIN __z8bfield ADCCTL0,0,3 ; Analog Input SelectADCD_H sfr 0f72h ; ADC data high byteADCD_L sfr 0f73h ; ADC data low bitsADCD 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 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 ; __regf0830inc