############################################################################### # # # IAR Assembler V5.30.1.50284/W32 for MSP430 25/Jan/2014 07:20:40 # # Copyright 1996-2011 IAR Systems AB. # # # # Target option = MSP430 # # Source file = C:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\4e-init430G2553.s43# # List file = C:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\Debug\List\4e-init430G2553.lst# # Object file = C:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\Debug\Obj\4e-init430G2553.r43# # Command line = C:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\4e-init430G2553.s43 # # -OC:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\Debug\Obj\ # # -s+ -M<> -w+ # # -LC:\Dokumente und Einstellungen\All Users\Dokumente\4e4th\Debug\List\ # # -t8 -r -D__MSP430G2553__ # # -IC:\Programme\IAR Systems\Embedded Workbench 6.0 Kickstart\430\INC\ # # # ############################################################################### 1 000000 ; ---------------------------------------------- ------------------------ 2 000000 ; 4e4th is a Forth based on CamelForth 3 000000 ; for the Texas Instruments MSP430 4 000000 ; 5 000000 ; This program is free software; you can redistribute it and/or modify 6 000000 ; it under the terms of the GNU General Public License as published by 7 000000 ; the Free Software Foundation; either version 3 of the License, or 8 000000 ; (at your option) any later version. 9 000000 ; 10 000000 ; This program is distributed in the hope that it will be useful, 11 000000 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 000000 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 000000 ; GNU General Public License for more details. 14 000000 ; 15 000000 ; You should have received a copy of the GNU General Public License 16 000000 ; along with this program. If not, see . 17 000000 ; 18 000000 ; See LICENSE TERMS in Brads file readme.txt as well. 19 000000 20 000000 ; ---------------------------------------------- ------------------------ 21 000000 ; 4e-init430G2553.s43 - reset interupt service routine - MSP430G2553 22 000000 ; ---------------------------------------------- ------------------------ 23 000000 24 000000 ; 4e4th RAM memory map: 25 000000 ; UP User Pointer, 2 bytes 26 000000 ; UAREA User area, 36 bytes 27 000000 ; UAREA+20h HOLD area, 40 bytes, grows down from end 28 000000 ; UAREA+48h PAD buffer, 88 bytes, must follow HOLD area 29 000000 ; UAREA+A0h Parameter stack, 128 B, grows down from end 30 000000 ; UAREA+120h Return stack, 128 B, grows down from end 31 000000 ; UAREA+1A0h TIB Terminal Input Buffer, 88 bytes 32 000000 33 000000 ; Note all must be word-aligned. 34 000000 ; See also the definitions of U0, S0, and R0 in the "system variables & 35 000000 ; constants" area. A task w/o terminal input requires 200h bytes. 36 000000 ; Double all except TIB and PAD for 32-bit CPUs. 37 000000 38 000000 39 000000 ; RAM map 40 000000 ; name celles comment 41 000000 ; ----- 42 000000 ;UAREA_SIZE = 16 ; UAREA 43 000012 UAREA_SIZE = 18 ; UAREA 44 000000 ; ----- 45 000000 ; | LSTACK: leave stack 46 000000 ; | grows up 47 000000 ; | 48 000000 ; V 49 000000 ; 50 000000 ; ^ 51 000000 ; | 52 000000 ; | grows down 53 000036 PSTACK_SIZE = 54 ; | PSTACK: top of parameter stack area. 54 000000 ; ----- 55 000000 ; 56 000000 ; ^ 57 000000 ; | 58 000000 ; | grows down 59 000036 RSTACK_SIZE = 54 ; | RSTACK: top of return stack area. 60 000000 61 000000 ; aligned buffers only required for terminal tasks. 62 000000 ; names bytes 63 000000 ; ^ 64 000000 ; | 65 000000 ; | grows down 66 000022 HOLD_SIZE = 34 ; | HOLDAREA: 67 000000 ; ----- 68 000054 PAD_SIZE = 84 ; scratch pad 69 000000 ; ----- 70 000054 TIB_SIZE = 84 ; terminal input buffer 71 000000 ; ----- 72 000000 ; <-- HERE 73 000010 VAR_SIZE = 16 ; variable area SAVEed in INFO-C 74 000000 ; ----- 75 000000 76 000000 77 000000 ; PUBLIC UP,UAREA,PADAREA,LSTACK,PSTACK, RSTACK 78 000000 PUBLIC PADAREA,LSTACK,PSTACK,RSTACK 79 000000 PUBLIC TIBAREA,TIB_SIZE,UAREA_SIZE,VARA REA,VAR_SIZE 80 000000 PUBLIC reset,main 81 000000 PUBLIC UAREA,UP,cor 82 000000 PUBLIC ROMDICT,RAMDICT 83 000000 84 000000 EXTERN lastword,fenceadr,NOOP 85 000000 ; EXTERN runmagic,runsmal 86 000000 EXTERN lastword 87 000000 EXTERN COLDIP,BOOTIP 88 000000 ; EXTERN DEBUGIP 89 000000 90 000000 RSEG DATA16_Z ; uninitialized RAM segment 91 000000 92 000000 ; RAM user area - system label, holds active user area 93 000000 ; initialiesed by BOOT 94 000000 ; see hilvl UINIT 95 000000 96 000000 UP: DS16 1 97 000002 UAREA: DS16 UAREA_SIZE 98 000026 99 000026 ; cor - cause of reset variable, copy of IFG1 100 000026 cor: DS16 1 101 000028 102 000028 ; LSTACK - start leave stack 103 000028 LSTACK: 104 000028 DS16 PSTACK_SIZE ; allocate parameter stack 105 000094 ; PSTACK - top of parameter stack 106 000094 PSTACK: 107 000094 DS16 RSTACK_SIZE ; allocate return stack 108 000100 ; RSTACK - top of return stack 109 000100 RSTACK: 110 000100 DS8 HOLD_SIZE ; allocate hold area 111 000122 ; HOLDAREA - top of hold adrea 112 000122 HOLDAREA: 113 000122 114 000122 ; PADAREA - start scratch pad; must follow HOLDAREA 115 000122 PADAREA: DS8 PAD_SIZE 116 000176 117 000176 ; TIBAREA - start Terminal Input Buffer 118 000176 TIBAREA: DS8 TIB_SIZE 119 0001CA 120 0001CA /* 121 0001CA ; WASAREA - 4 variables for Assembler WAS 122 0001CA WASAREA: 123 0001CA PUBLIC X1ADR,X2ADR,OPCADR,EXTADR 124 0001CA X1ADR: DS16 1 125 0001CA X2ADR: DS16 1 126 0001CA OPCADR: DS16 1 127 0001CA EXTADR: DS16 1 128 0001CA */ 129 0001CA 130 0001CA ; RAMDICT - end of system areas, start of free RAM 131 0001CA RAMDICT: 132 0001CA 133 0001CA ; Variable Area is free RAM. 134 0001CA ; But it is saved to INFO-C when you SAVE an app. 135 0001CA ; So your app will start with your variables set. 136 0001CA ; VARAREA - start Variable Area 137 0001CA VARAREA: DS16 VAR_SIZE 138 0001EA 139 0001EA ; ---------------------------------------------- ------------------------ 140 0001EA ; POWER ON RESET AND INITIALIZATION 141 0001EA 142 0001EA #include "msp430G2553.h" ; #define controlled include file 143 0001EA #include "4e-CF430G2553forth.h" ; header macros and register defs 144 0001EA 145 000000 RSEG CODE ; place init in 'CODE' segment 146 000000 147 000000 ; ---------------------------------------------- ------------------------ 148 000000 ; MSP430G2553 Initialize system 149 000000 ; (original: FR_EXP.lst and some of mecrisp (Koch) 150 000000 ; for LaunchPad 151 000000 152 000000 ; main - start_init, reset service routine 153 000000 main: ; Debugger requires the 'main' symbol. 154 000000 reset: ; forth requires the reset symbol. 155 000000 start_init: ; I require the start_init symbol. ;-) 156 000000 157 000000 B240805A2001 MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer 158 000006 159 000006 D2420200.... MOV.B &IFG1,&cor ; save IFG1 to cor low byte 160 00000C C243.... MOV.B #0,&(cor+1) ; clr hi byte 161 000010 162 000010 163 000010 /* 164 000010 ; 1MHz 165 000010 mov.b &CALBC1_1MHZ, &BCSCTL1 ; Set DCO 166 000010 mov.b &CALDCO_1MHZ, &DCOCTL ; to 1 MHz. 167 000010 168 000010 mov.b #006h, &P1SEL ; Use P1.1/P1.2 for USCI_A0 169 000010 mov.b #006h, &P1SEL2 ; Use P1.1/P1.2 for USCI_A0 170 000010 171 000010 ; Configure UART 172 000010 bis.b #UCSSEL_2,&UCA0CTL1 ;db2 SMCLK 173 000010 mov.b #0x68,&UCA0BR0 ;db3 1MHz 9600 Insgesamt &104 = $068 174 000010 mov.b #0x0,&UCA0BR1 ;db4 1MHz 9600 175 000010 mov.b #UCBRS_1,&UCA0MCTL ;db5 Modulation UCBRSx = 1 176 000010 bic.b #UCSWRST,&UCA0CTL1 ;db6 **Initialize USCI state machine** 177 000010 */ 178 000010 179 000010 180 000010 ;/* 181 000010 ; 8MHz 182 000010 D242FD105700 mov.b &CALBC1_8MHZ, &BCSCTL1 ; Set DCO 183 000016 D242FC105600 mov.b &CALDCO_8MHZ, &DCOCTL ; to 8 MHz. 184 00001C 185 00001C F24006002600 mov.b #006h, &P1SEL ; Use P1.1/P1.2 for USCI_A0 186 000022 F24006004100 mov.b #006h, &P1SEL2 ; Use P1.1/P1.2 for USCI_A0 187 000028 188 000028 ; Configure UART (Koch) 189 000028 F2D080006100 bis.b #UCSSEL_2,&UCA0CTL1 ;db2 SMCLK 190 00002E F24041006200 mov.b #65,&UCA0BR0 ;db3 8MHz 9600 Insgesamt &833 = $341 191 000034 F24003006300 mov.b #3,&UCA0BR1 ;db4 8MHz 9600 192 00003A E2426400 mov.b #UCBRS_2,&UCA0MCTL ;db5 Modulation UCBRSx = 2 193 00003E D2C36100 bic.b #UCSWRST,&UCA0CTL1 ;db6 **Initializ e USCI state machine** 194 000042 */ 195 000042 196 000042 /* 197 000042 ; Prozessortakt 16 MHz 198 000042 mov.b &CALBC1_16MHZ, &BCSCTL1 ; Set DCO 199 000042 mov.b &CALDCO_16MHZ, &DCOCTL ; 200 000042 201 000042 mov.b #006h, &P1SEL ; Use P1.1/P1.2 for USCI_A0 202 000042 mov.b #006h, &P1SEL2 ; Use P1.1/P1.2 for USCI_A0 203 000042 204 000042 ; Configure UART 205 000042 bis.b #006h, &P1SEL ; Use P1.1/P1.2 for USCI_A0 206 000042 bis.b #006h, &P1SEL2 ; Use P1.1/P1.2 for USCI_A0 207 000042 bis.b #UCSSEL_2,&UCA0CTL1 ;db2 SMCLK 208 000042 mov.b #0x82,&UCA0BR0 ;db3 16MHz 9600 Insgesamt &1666 = $682 209 000042 mov.b #0x06,&UCA0BR1 ;db4 16MHz 9600 210 000042 mov.b #UCBRS_2,&UCA0MCTL ;db5 Modulation UCBRSx = 2 211 000042 bic.b #UCSWRST,&UCA0CTL1 ;db6 **Initialize USCI state machine** 212 000042 */ 213 000042 214 000042 215 000042 216 000042 217 000042 ; clr.b &IE1 ; Lösche die Interrupt-Flags von Oscillator Fault, 218 000042 ; ; NMI, Flash-Violation. 219 000042 E2C30000 bic.b #OFIE,&IE1 220 000046 B24000A52801 mov.w #FWKEY, &FCTL1 ; Schreib- & Loeschzugr iffe ausgeschal tet. 221 00004C B24053A52A01 mov.w #FWKEY|FSSEL_1|19, &FCTL2 ; MCLK/20 for Flash Timing Generator 222 000052 223 000052 B24010A52C01 mov.w #FWKEY+LOCK, &FCTL3 ; Lock Flash memory against writing 224 000058 225 000058 ; Enable port1 on Launchpad 226 000058 ; P1.0 = LED1 red 227 000058 ; P1.3 = button 228 000058 ; P1.4 = free out (may be speaker+ ) 229 000058 ; P1.5 = free out (amy be speaker- ) 230 000058 ; P1.6 = LED2 green 231 000058 F2D071002200 BIS.B #(BIT6+BIT5+BIT4+BIT0), &P1DIR 232 00005E F2D079002100 BIS.B #(BIT6+BIT5+BIT4+BIT3+BIT0), &P1OUT 233 000064 F2D22700 BIS.B #(BIT3),&P1REN ; pullup for S2 234 000068 235 000068 ; setup forth registers 236 000068 3140.... MOV #RSTACK,SP ; set up return stack 237 00006C 3440.... MOV #PSTACK,PSP ; set up parameter stack 238 000070 B240........ MOV #UAREA,&UP ; initial user pointer 239 000076 0743 MOV #0,TOS ; clear top of pstack 240 000078 3540.... MOV #COLDIP,IP ; set IP of starting word 241 00007C 242 00007C ; MOV #COLDIP,IP ; set IP of starting word 243 00007C 3540.... MOV #BOOTIP,IP ; set IP of starting word 244 000080 ; MOV #DEBUGIP,IP ; set IP of starting word 245 000080 246 000080 NEXT ; enter virtual forth maschine now 246.1 000080 3645 MOV @IP+,W // ; fetch word address into W 246.2 000082 3046 MOV @W+,PC // ; fetch code address into PC, W=PFA 246.3 000084 ENDM 247 000084 248 000084 init_end: 249 000084 250 000084 ; ---------------------------------------------- ------------------------ 251 000084 ; DEFAULT INTERRUPT HANDLER nullirq 252 000000 PUBLIC isr_null 253 000084 254 000084 32C2 isr_null: DINT 255 000086 0013 RETI 256 000088 isr_null_end: 257 000088 258 000088 ROMDICT: 259 000088 END ############################## # CRC:6169 # # Errors: 0 # # Warnings: 0 # # Bytes: 136 # ##############################