📄 ecp_power.lst
字号:
###############################################################################
# #
# IAR Systems MSP430 Assembler V3.42A/W32 29/Jun/2007 14:46:00 #
# Copyright 1996-2006 IAR Systems. All rights reserved. #
# #
# Target option = MSP430 #
# Source file = C:\Data\DM350MSP430\VA3\ecp_power.s43 #
# List file = C:\Data\DM350MSP430\VA3\Debug\List\ecp_power.lst #
# Object file = C:\Data\DM350MSP430\VA3\Debug\Obj\ecp_power.r43 #
# Command line = C:\Data\DM350MSP430\VA3\ecp_power.s43 #
# -OC:\Data\DM350MSP430\VA3\Debug\Obj\ -s+ -M<> #
# -w+ -LC:\Data\DM350MSP430\VA3\Debug\List\ -t8 #
# -r -D__MSP430F155__ #
# -IC:\Program Files\IAR Systems\Embedded Workbench 4.0\430\INC\ #
# #
###############################################################################
1 000000 #include <msp430x15x.h>
2 000000 #include "ECP.h"
3 000000
4 000000 EXTERN SWDelay100ms
5 000000 EXTERN SWDelay500ms
6 000000
7 000000 EXTERN Volts1V3
8 000000 EXTERN Volts1V8
9 000000 EXTERN Volts3V3
10 000000 EXTERN VoltsECP
11 000000 EXTERN PowerStatus
12 000000 EXTERN ECPStatus
13 000000 EXTERN PowerState
14 000000
15 000000 RSEG POWER_CODE
16 000000 ; **********************************************
******************************
17 000000 ; Function: CheckPowerState
18 000000 ;
19 000000 ; Purpose: Checks whether MSP430 is operating
on battery or line power
20 000000 ;
21 000000 ; Inputs: None
22 000000 ;
23 000000 ; Returns: PowerState is modified to reflect
power state
24 000000 ; **********************************************
******************************
25 000000 0412 CheckPowerState push R4
; Save regs
26 000002 54423400 mov.b &P6IN,R4
; Read in
port 6
27 000006 74F0F800 and.b #SW10+SW11+SW12+SW13+SW1
4,R4 ; Mask switches
28 00000A 0424 jz BATTERYPOWER
; If all 0, on battery
29 00000C C043.... mov.b #LINE,PowerState
; On 5V input
30 000010 3441 pop R4
; Restore regs
31 000012 3041 ret
32 000014 D043.... BATTERYPOWER mov.b #BATTERY,PowerState
; Battery power
33 000018 3441 pop R4
; Restore Regs
34 00001A 3041 ret
35 00001C
36 00001C
37 00001C ; **********************************************
******************************
38 00001C ; Function: SetupSVS
39 00001C ;
40 00001C ; Purpose: Sets up the MSP430 supply voltage
supervisor to ensure
41 00001C ; the power supply stays good. If the
power supply drops
42 00001C ; too low, an ECP hard reset is
created.
43 00001C ;
44 00001C ; Inputs: None
45 00001C ;
46 00001C ; Returns: None
47 00001C ; **********************************************
******************************
48 000000 PUBLIC SetupSVS
49 00001C 0412 SetupSVS push R4
; Save R4
50 00001E F2D028005500 bis.b #VLD1+PORON, &SVSCTL
; Threshold 2.1V,
51 000024
; turn on SVS
52 000024 54425500 SVSLoop mov.b &SVSCTL, R4
; SVS
state
53 000028 64F2 and.b #SVSON, R4
; Is the SVS on?
54 00002A FC27 jz SVSLoop
; Nope
55 00002C D2C35500 bic.b #SVSFG,&SVSCTL
; Clear the SVS Flag
56 000030 3441 pop R4
; Restore R4
57 000032 3041 ret
58 000034 ; **********************************************
******************************
59 000034 ; Function: DriveIOPorts
60 000034 ;
61 000034 ; Purpose: Enables ECP output drivers that are
dependant on the 3V3 supply
62 000034 ; being enabled
63 000034 ;
64 000034 ; Inputs: None
65 000034 ;
66 000034 ; Returns: None
67 000034 ; **********************************************
******************************
68 000000 PUBLIC DriveIOPorts
69 000034 DriveIOPorts // Port 1 3.3V Dependant
Outputs
70 000034 F2D22200 bis.b #DEEPSLEEP,&P1DIR
; Enable output
71 000038 F2D010002200 bis.b #ETHERNET_RSTz,&P1DIR
; Enable output
72 00003E F2D020002200 bis.b #SYSTEM_RSTz,&P1DIR
; Enable output
73 000044
74 000044 // Port 2 3.3V Dependant
Outputs
75 000044 F2D040002A00 bis.b #DM350_RST_OUTz, &P2DIR
; Enable output
76 00004A F2D080002A00 bis.b #AIC33_RSTz, &P2DIR
; Enable output
77 000050
78 000050 // Port 3 3.3V Dependant
Outputs
79 000050 D2D31A00 bis.b #DC5_RSTz, &P3DIR
; Enable output
80 000054 E2D21A00 bis.b #TV_RSTz, &P3DIR
; Enable output
81 000058 F2D010001A00 bis.b #NOR_FLASH_RSTz, &P3DIR
; Enable output
82 00005E F2D020001A00 bis.b #IMAGER_RSTz, &P3DIR
; Enable output
83 000064 F2D040001A00 bis.b #CPLD_RSTz, &P3DIR
; Enable output
84 00006A F2D080001A00 bis.b #MUX_IMAG_5146z, &P3DIR
; Enable output
85 000070
86 000070 // Port 4 3.3V Dependant
Outputs - None
87 000070
88 000070 // Port 5 3.3V Dependant
Outputs
89 000070 F2D020003200 bis.b #MSP430_INT, &P5DIR
; Enable output
90 000076 F2D040003200 bis.b #CPLD_OPT, &P5DIR
; Enable output
91 00007C
92 00007C // Port 6 3.3V Dependant
Outputs - None
93 00007C 3041 ret
94 00007E ; **********************************************
******************************
95 00007E ; Function: DoNotDriveIOPorts
96 00007E ;
97 00007E ; Purpose: Disables ECP output drivers that are
dependant on the 3V3 supply
98 00007E ; being enabled
99 00007E ;
100 00007E ; Inputs: None
101 00007E ;
102 00007E ; Returns: None
103 00007E ; **********************************************
******************************
104 000000 PUBLIC DoNotDriveIOPorts
105 00007E DoNotDriveIOPorts // Port 1 3.3V Dependant
Outputs
106 00007E F2C22200 bic.b #DEEPSLEEP,&P1DIR
; Disable output
107 000082 F2C010002200 bic.b #ETHERNET_RSTz,&P1DIR
; Disable output
108 000088 F2C020002200 bic.b #SYSTEM_RSTz,&P1DIR
; Disable output
109 00008E
110 00008E // Port 2 3.3V Dependant
Outputs
111 00008E F2C040002A00 bic.b #DM350_RST_OUTz, &P2DIR
; Disable output
112 000094 F2C080002A00 bic.b #AIC33_RSTz, &P2DIR
; Disable output
113 00009A
114 00009A // Port 3 3.3V Dependant
Outputs
115 00009A D2C31A00 bic.b #DC5_RSTz, &P3DIR
; Disable output
116 00009E E2C21A00 bic.b #TV_RSTz, &P3DIR
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -