Blame | Last modification | View Log | Download | RSS feed
ifndef regmspinc ; avoid multiple inclusionregmspinc equ 1savelisting off ; no listing over this file;****************************************************************************;* *;* AS 1.42 - File REGMSP.INC *;* *;* Contains Macro and Register Definitions for MSP430 *;* *;****************************************************************************if (MOMCPUNAME<>"MSP430")&&(MOMCPUNAME<>"MSP430X")fatal "wrong target selected: only MSP430(X) supported"endifif MOMPASS=1message "MSP430 Register Definitionen (C) 1996/2007 Alfred Arnold, Jose Da Silva"endif;----------------------------------------------------------------------------; General Memory Layout; ----------------------;; 0000 - 000f : Special Function Registers; 0010 - 00ff : 8bit Peripheral Modules; 0100 - 01ff : 16bit Peripheral Modules; 0200 - .... : RAM Memory; .... - ffdf : Flash Memory; ffe0 - ffff : Interrupt Vector Table;;----------------------------------------------------------------------------;----------------------------------------------------------------------------; Status RegisterSCG1 equ 128 ; System Clock Generator 1. 1=Turn_Off_SMCLKSCG0 equ 64 ; System Clock Generator 0. 1=Turn_Off_DCOOSCOFF equ 32 ; Oscillator Off. 1=Turn_Off_LFXT1CLKCPUOFF equ 16 ; CPU Off. 1=Turn_Off_CPU (SR)GIE equ 8 ; General Interrupt Enable (SR);----------------------------------------------------------------------------; Special Function Register of MSP430x1xx Family, Byte AccessIE1 equ 000h ; Interrupt EnableACCVIE equ 32 ; Flash Access Interrupt Enable (IE1.5)NMIIE equ 16 ; NMI Enable (IE1.4)OFIE equ 2 ; Osc Fault Interrupt Enable (IE1.1)WDTIE equ 1 ; Watchdog Interrupt Enable (IE1.0)IFG1 equ 002h ; Interrupt FlagNMIIFG equ 16 ; Set Via !RST/NMI Pin (IFG1.4)RSTIFG equ 8 ; External Reset Interrupt Flag (IFG1.3)PORIFG equ 4 ; Power-on-Reset Interrupt Flag (IFG1.2)OFIFG equ 2 ; Flag on Oscillator Fault (IFG1.1)WDTIFG equ 1 ; Watchdog or Security Key Violation (IFG1.0)ME1 equ 004h ; Module Enable; MSP43012xx devices only, only for MSP43012xx devices.IE2 equ 001hUTXIE0 equ 2 ; USART0 Transmit Int-Enable Bit (IE2.2)URXIE0 equ 1 ; USART0 Receive Int-Enable Bit (IE2.1)IFG2 equ 003hUTXIFG0 equ 2 ; USART0 and SPI Transmit Flag (IFG2.1)URXIFG0 equ 1 ; USART0 and SPI Receive Flag (IFG2.0)ME2 equ 005hUTXE0 equ 2 ; USART0 Transmit Enable Bit (ME2.1)URXE0 equ 1 ; USART0 Receive Enable Bit (ME2.0)USPIE0 equ 1 ; SPI Transmit+Receive Enable (ME2.0);----------------------------------------------------------------------------; Digital I/O, Byte AccessP0IN equ 010h ; Read Register (Pin State)P0OUT equ 011h ; Write Register (Latches)P0DIR equ 012h ; Direction RegisterP0IFG equ 013h ; Interrupt FlagsP0IES equ 014h ; Interrupt Edge SelectionP0IE equ 015h ; Interrupt EnablesP3IN equ 018h ; Input RegisterP3OUT equ 019h ; Output RegisterP3DIR equ 01Ah ; Direction RegisterP3SEL equ 01Bh ; Function SelectP4IN equ 01Ch ; Input RegisterP4OUT equ 01Dh ; Output RegisterP4DIR equ 01Eh ; Direction RegisterP4SEL equ 01Fh ; Function SelectP1IN equ 020h ; Input RegisterP1OUT equ 021h ; Output RegisterP1DIR equ 022h ; Direction RegisterP1IFG equ 023h ; Interrupt FlagsP1IES equ 024h ; Interrupt Edge SelectP1IE equ 025h ; Interrupt EnableP1SEL equ 026h ; Function SelectP2IN equ 028h ; Input RegisterP2OUT equ 029h ; Output RegisterP2DIR equ 02Ah ; Direction RegisterP2IFG equ 02Bh ; Interrupt FlagsP2IES equ 02Ch ; Interrupt Edge SelectP2IE equ 02Dh ; Interrupt EnableP2SEL equ 02Eh ; Function SelectP5IN equ 030h ; Input RegisterP5OUT equ 031h ; Output RegisterP5DIR equ 032h ; Direction RegisterP5SEL equ 033h ; Function SelectP6IN equ 034h ; Input RegisterP6OUT equ 035h ; Output RegisterP6DIR equ 036h ; Direction RegisterP6SEL equ 037h ; Function Select;----------------------------------------------------------------------------; LCD-InterfaceLCDCTL equ 030h ; ControlLCD_Start equ 031h ; Start AddressLCD_Stop equ 03fh ; End Address__TMP set 1 ; Individual Definitionsrept 9LCD{"\{__TMP}"} equ 030h+__TMP__TMP set __TMP+1endmrept 6LCD1{"\{__TMP-10}"} equ 030h+__TMP__TMP set __TMP+1endm;----------------------------------------------------------------------------; TimerBTCTL equ 040h ; Timer 1 Basic Control RegisterTCCTL equ 042hTCPLD equ 043h ; Preaload ValueTCDAT equ 044h ; Count ValueBTCNT1 equ 046h ; Count RegisterBTCNT2 equ 047hTPCTL equ 04Bh ; Timer/Port Control RegisterTPCNT1 equ 04Ch ; Count RegisterTPCNT2 equ 04DhTPD equ 04Eh ; Data RegisterTPE equ 04Fh ; Enable Register;----------------------------------------------------------------------------; Clock GeneratorSCFI0 equ 050h ; IntegratorSCFI1 equ 051hSCFQCTL equ 052h ; Crystal Frequency MultiplicatorCBCTL equ 053h ; Buffer Control;----------------------------------------------------------------------------; EPROM Control Registers, Byte AccessEPCTL equ 054h ; EPROM Control;----------------------------------------------------------------------------; Basic Clock Registers, Byte AccessDCOCTL equ 056hDCO2 equ 128 ; DCO Freq Select, see RSELx (DCOCTL.7)DCO1 equ 64 ; (DCOCTL.6)DCO0 equ 32 ; (DCOCTL.5)MOD4 equ 16 ; Modulator Selection (DCOCTL.4)MOD3 equ 8 ; (DCOCTL.3)MOD2 equ 4 ; (DCOCTL.2)MOD1 equ 2 ; (DCOCTL.1)MOD0 equ 1 ; (DCOCTL.0)BCSCTL1 equ 057hXT2OFF equ 128 ; XT2 Off. Turn Off XT2 Oscil (BCSCTL1.7)XTS equ 64 ; LFXT1 Mode. 0=LowFreq,1=HiFreq (BCSCTL1.6)DIVA1 equ 32 ; Divider for ACLK. (BCSCTL1.5)DIVA0 equ 16 ; 00=/1, 01=/2, 10=/4, 11=/8 (BCSCTL1.4)XT5V equ 8 ; Unused. Always Reset to Zero (BCSCTL1.3)RSEL2 equ 4 ; Resistor Select. Internal R (BCSCTL1.2)RSEL1 equ 2 ; Lowest R=0 (BCSCTL1.1)RSEL0 equ 1 ; (BCSCTL1.0)RSEL_7 equ 7 ; (BCSCTL1.0-2)RSEL_6 equ 6 ; (BCSCTL1.0-2)RSEL_5 equ 5 ; (BCSCTL1.0-2)RSEL_4 equ 4 ; (BCSCTL1.0-2)RSEL_3 equ 3 ; (BCSCTL1.0-2)RSEL_2 equ 2 ; (BCSCTL1.0-2)RSEL_1 equ 1 ; (BCSCTL1.0-2)RSEL_0 equ 0 ; (BCSCTL1.0-2)BCSCTL2 equ 058hSELM_3 equ 128+64 ; Select MCLK. 11=LFXT1CLK (BCSCTL2.6.7)SELM_2 equ 128 ; MCLK 10=XT2CLK or LFXT1CLK (BCSCTL2.6.7)SELM_1 equ 64 ; Select MCLK. 01=DCOCLK (BCSCTL2.6.7)SELM_0 equ 0 ; Select MCLK. 00=DCOCLK (BCSCTL2.6.7)SELM1 equ 128 ; Select MCLK. 00=01=DCOCLK (BCSCTL2.7)SELM0 equ 64 ; 10=XT2CLK or LFXT1CLK=11 (BCSCTL2.6)DIVM1 equ 32 ; Divider for MCLK, (BCSCTL2.5)DIVM0 equ 16 ; 00=/1, 01=/2, 10=/4, 11=/8 (BCSCTL2.4)SELS equ 8 ; Select SMCLK 0=DCOCLK,1=XT2CLK (BCSCTL2.3)DIVS1 equ 4 ; Divider for SMCLK, (BCSCTL2.2)DIVS0 equ 2 ; 00=/1, 01=/2, 10=/4, 11=/8 (BCSCTL2.1)DCOR equ 1 ; DCO Resistor. 0=Intern,1=1xtn (BCSCTL2.0);----------------------------------------------------------------------------; Comparator_A Registers, Byte AccessCACTL1 equ 059h ; Comparator A Control Register 1CACTL2 equ 05Ah ; Comparator A Control Register 2CAPD equ 05Bh ; Comparator A Port Disable;----------------------------------------------------------------------------; PWMPWMCTL equ 058h ; Count ValuePWMDTB equ 059h ; Pulse Width (Buffer)PWMDTR equ 05Ah ; Pulse WidthPWMCNT equ 05Bh ; Control;----------------------------------------------------------------------------; USART 0U0CTL equ 070hU0TCTL equ 071hU0RCTL equ 072hU0MCTL equ 073hU0BR0 equ 074hU0BR1 equ 075hU0RXBUF equ 076hU0TXBUF equ 077h;----------------------------------------------------------------------------; USART 1U1CTL equ 078hU1TCTL equ 079hU1RCTL equ 07AhU1MCTL equ 07BhU1BR0 equ 07ChU1BR1 equ 07DhU1RXBUF equ 07EhU1TXBUF equ 07Fh;----------------------------------------------------------------------------; USART Register BitsFE equ 128 ; Framing Error (low stop bit) (UxRCTL.7)PE equ 64 ; Parity Error (PE=0 if PENA=0) (UxRCTL.6)OE equ 32 ; Overrun Error (Buffer Overrun) (UxRCTL.5)BRK equ 16 ; Break Detect Flag (UxRCTL.4)URXEIE equ 8 ; Rec Err Chars Sets URXIFG) (UxRCTL.3)URXWIE equ 4 ; Rec Wakeup Int Enable (URXIFG) (UxRCTL.2)RXWAKE equ 2 ; Rec Wakeup Flag (UxRCTL.1)RXERR equ 1 ; Rec Error Flag (FE,PE,OE,BRK) (UxRCTL.0)CKPL equ 64 ; Clock Polarity 0=UCLKI=UCLK (UxTCTL.6)SSEL1 equ 32 ; Source 00=UCLKI, 01=ACLK (UxTCTL.5)SSEL0 equ 16 ; Source 10=SMCLKI, 11=SMCLK (UxTCTL.4)URXSE equ 8 ; Receive Start-Edge, 1=Enabled (UxTCTL.3)TXWAKE equ 4 ; Transmitter Wake, 0=Data,1=Adr (UxTCTL.2)TXEPT equ 1 ; Transmitter Empty Flag (UxTCTL.0)PENA equ 128 ; Parity Enable, 1=Enabled (UxCTL.7)PEV equ 64 ; Parity Select, 1=Even,0=Odd (UxCTL.6)SPB equ 32 ; Stop Bit, 0=1Stop,1=2Stop (UxCTL.5)CHAR equ 16 ; Char Length, 0=7Bit,1=8Bit (UxCTL.4)LISTEN equ 8 ; Listen Enable, 1=Loopback->RX (UxCTL.3)SYNC equ 4 ; Synch Mode, 0=USART,1=SPI (UxCTL.2)MM equ 2 ; Multiprocessor, 1=Use_Protocol (UxCTL.1)SWRST equ 1 ; Software Reset, 1=Held_Reset (UxCTL.0);----------------------------------------------------------------------------; ADC12 Low BytesADC12MCTL0 equ 080hADC12MCTL1 equ 081hADC12MCTL2 equ 082hADC12MCTL3 equ 083hADC12MCTL4 equ 084hADC12MCTL5 equ 085hADC12MCTL6 equ 086hADC12MCTL7 equ 087hADC12MCTL8 equ 088hADC12MCTL9 equ 089hADC12MCTL10 equ 08AhADC12MCTL11 equ 08BhADC12MCTL12 equ 08ChADC12MCTL13 equ 08DhADC12MCTL14 equ 08EhADC12MCTL15 equ 08Fh;----------------------------------------------------------------------------; LCD RegistersLCDC equ 090h__TMP set 1 ; Individual Definitionsrept 19LCDmemory{"\{__TMP}"} equ LCDC+__TMP__TMP set __TMP+1endm;----------------------------------------------------------------------------; A/D-Wandler, Word AccessAIN equ 0110h ; Input RegisterAEN equ 0112h ; Input EnablesACTL equ 0114h ; ControlADAT equ 0118h ; Data;----------------------------------------------------------------------------; Timer_B Interrupt Vector, Word AccessTBIV equ 011Eh;----------------------------------------------------------------------------; Watchdog/Timer, Word AccessWDTCTL equ 0120hWDTHOLD equ 128 ; Watchdog Timer Hold. 1=Stopped (WDTCTL.6)WDTNMIES equ 64 ; NMI Edge Select 0=Rise,1=Fall (WDTCTL.6)WDTNMI equ 32 ; NMI Pin Select, 0=!Reset,1=NMI (WDTCTL.5)WDTTMSEL equ 16 ; Mode Select 0=Watchdog,1=Timer (WDTCTL.4)WDTCNTCL equ 8 ; Counter Clear, 1=Clear_Counter (WDTCTL.3)WDTSSEL equ 4 ; Source Select, 0=SMCLK,1=ACLK (WDTCTL.2)WDTIS1 equ 2 ; Watchdog Timer Interval Select (WDTCTL.1)WDTIS0 equ 1 ; 00=32768,01=8192,10=512,11=64 (WDTCTL.0);----------------------------------------------------------------------------; Timer_A Interrupt Vector, Word AccessTAIV equ 012Eh;----------------------------------------------------------------------------; Flash Control, Word AccessFCTL1 equ 0128hFCTL2 equ 012AhFCTL3 equ 012Ch;----------------------------------------------------------------------------; Hardware Multiplier, Word AccessMPY equ 0130h ; Multiply UnsignedMPYS equ 0132h ; Multiply SignedMAC equ 0134h ; MPY+ACCMACS equ 0136h ; MPYS+ACCOP2 equ 0138h ; Second OperandResLo equ 013Ah ; Result Low WordResHi equ 013Ch ; Result High WordSumExt equ 013Eh ; Sum Extend;----------------------------------------------------------------------------; ADC12 High Bytes, Word AccessADC12MEM0 equ 0140hADC12MEM1 equ 0142hADC12MEM2 equ 0144hADC12MEM3 equ 0146hADC12MEM4 equ 0148hADC12MEM5 equ 014AhADC12MEM6 equ 014ChADC12MEM7 equ 014EhADC12MEM8 equ 0150hADC12MEM9 equ 0152hADC12MEM10 equ 0154hADC12MEM11 equ 0156hADC12MEM12 equ 0158hADC12MEM13 equ 015AhADC12MEM14 equ 015ChADC12MEM15 equ 015Eh;----------------------------------------------------------------------------; Timer_A Registers, Word AccessTACTL equ 0160hCCTL0 equ 0162hCCTL1 equ 0164hCCTL2 equ 0166hCCTL3 equ 0168hCCTL4 equ 016AhTAR equ 0170hCCR0 equ 0172hCCR1 equ 0174hCCR2 equ 0176hCCR3 equ 0178hCCR4 equ 017Ah;----------------------------------------------------------------------------; Timer_B Registers, Word AccessTBCTL equ 0180hTBCCTL0 equ 0182hTBCCTL1 equ 0184hTBCCTL2 equ 0186hTBCCTL3 equ 0188hTBCCTL4 equ 018AhTBCCTL5 equ 018ChTBCCTL6 equ 018EhTBR equ 0190hTBCCR0 equ 0192hTBCCR1 equ 0194hTBCCR2 equ 0196hTBCCR3 equ 0198hTBCCR4 equ 019AhTBCCR5 equ 019ChTBCCR6 equ 019Eh;----------------------------------------------------------------------------; ADC12 Registers, Byte and Word AccessADC12CTL0 equ 01A0hADC12CTL1 equ 01A2hADC12FG equ 01A4hADC12IE equ 01A6h;----------------------------------------------------------------------------restore ; wieder erlaubenendif ; regmspinc