本帖最后由 vlinux 于 2012-3-30 16:14 编辑
单片机高手请进!!!!!!!
这是编译警告:
*** WARNING L5: CODE SPACE MEMORY OVERLAP
FROM: 0003H
TO: 0005H
以上两个地址冲突了,我定义了2个外部中断函数,应该是interrupt 0这边出了问题。
看keil help文档半天,还是不知道怎么处理这儿问题,请教会的
void Paper_Position_INT0(void) interrupt 0
{
Advance_Plus++;
}
void Seal_Position_INT1(void) interrupt 2
{
Seal_Run_Plus++;
}
网上的处理方法是去掉 Starup.A51。
Source group组下面的Starup.A51已经删掉,以下是部分M51文件:
///////////////////////////////////////////////////////////////////////////
INPUT MODULES INCLUDED:
Main.obj (MAIN)
Motor.obj (MOTOR)
Function.obj (FUNCTION)
E2rom.obj (E2ROM)
Uart.obj (UART)
C:\KEIL\C51\LIB\C51S.LIB (?C_STARTUP)
C:\KEIL\C51\LIB\C51S.LIB (?C?CLDOPTR)
C:\KEIL\C51\LIB\C51S.LIB (?C?CILDOPTR)
C:\KEIL\C51\LIB\C51S.LIB (?C?CSTOPTR)
C:\KEIL\C51\LIB\C51S.LIB (?C?ULDIV)
C:\KEIL\C51\LIB\C51S.LIB (?C?LIMUL)
C:\KEIL\C51\LIB\C51S.LIB (?C_INIT)
LINK MAP OF MODULE: 新驱动V3.1 (MAIN)
TYPE BASE LENGTH RELOCATION SEGMENT NAME
-----------------------------------------------------
* * * * * * * D A T A M E M O R Y * * * * * * *
REG 0000H 0008H ABSOLUTE "REG BANK 0"
DATA 0008H 000EH UNIT ?DT?E2ROM
DATA 0016H 000AH UNIT ?DT?MAIN
BIT 0020H.0 0000H.1 UNIT ?BI?UART
0020H.1 0000H.7 *** GAP ***
DATA 0021H 0027H UNIT ?DT?UART
DATA 0048H 0006H UNIT ?DT?MOTOR
DATA 004EH 0005H UNIT _DATA_GROUP_
DATA 0053H 0001H UNIT ?DT?FUNCTION
IDATA 0054H 0001H UNIT ?STACK
* * * * * * * C O D E M E M O R Y * * * * * * *
CODE 0000H 0003H ABSOLUTE
CODE 0003H 0003H ABSOLUTE
* OVERLAP * CODE 0003H 0003H ABSOLUTE
CODE 0006H 000DH UNIT ?PR?PAPER_POSITION_INT0?MOTOR
CODE 0013H 0003H ABSOLUTE
CODE 0016H 002DH UNIT ?C_INITSEG
CODE 0043H 0003H ABSOLUTE
CODE 0046H 017DH UNIT ?C?LIB_CODE
CODE 01C3H 0127H UNIT ?PR?UART2_REICEVE?UART
CODE 02EAH 00E0H UNIT ?PR?IAP_INIT?E2ROM
CODE 03CAH 008CH UNIT ?C_C51STARTUP
CODE 0456H 0078H UNIT ?PR?MAIN?MAIN
CODE 04CEH 006EH UNIT ?PR?_SEND_ARRAY?UART
CODE 053CH 0044H UNIT ?PR?LEFT_SEAL_CALIBRATION?MOTOR
CODE 0580H 0044H UNIT ?PR?RIGHT_SEAL_CALIBRATION?MOTOR
CODE 05C4H 002CH UNIT ?PR?MOTOR_INIT?MOTOR
CODE 05F0H 0024H UNIT ?PR?_BYTE_READ?E2ROM
BL51 BANKED LINKER/LOCATER V6.22 03/30/2012 16:01:42 PAGE 2
CODE 0614H 0021H UNIT ?PR?_SPEED_TO_TIMER?MOTOR
CODE 0635H 0020H UNIT ?PR?_DELAY?FUNCTION
CODE 0655H 0020H UNIT ?PR?_BYTE_PROGRAM?E2ROM
CODE 0675H 001AH UNIT ?PR?_SECTOR_ERASE?E2ROM
CODE 068FH 0014H UNIT ?PR?_UART2_SEND?UART
CODE 06A3H 0012H UNIT ?PR?UART_INIT?UART
CODE 06B5H 0011H UNIT ?PR?IO_INIT?FUNCTION
CODE 06C6H 000DH UNIT ?PR?SEAL_POSITION_INT1?MOTOR
CODE 06D3H 000CH UNIT ?PR?INIT?FUNCTION
CODE 06DFH 000CH UNIT ?PR?IAP_DISABLE?E2ROM
CODE 06EBH 0001H UNIT ?PR?INT0_PAPERPOSTION?FUNCTION
OVERLAY MAP OF MODULE: 新驱动V3.1 (MAIN)
SEGMENT DATA_GROUP
+--> CALLED SEGMENT START LENGTH
--------------------------------------------------------
?PR?UART2_REICEVE?UART ----- -----
+--> ?PR?_UART2_SEND?UART
*** NEW ROOT ***************************************************
?C_C51STARTUP ----- -----
+--> ?PR?MAIN?MAIN
+--> ?C_INITSEG
?PR?MAIN?MAIN ----- -----
+--> ?PR?INIT?FUNCTION
+--> ?PR?_DELAY?FUNCTION
+--> ?PR?LEFT_SEAL_CALIBRATION?MOTOR
+--> ?PR?RIGHT_SEAL_CALIBRATION?MOTOR
+--> ?PR?_SEND_ARRAY?UART
?PR?INIT?FUNCTION ----- -----
+--> ?PR?IAP_INIT?E2ROM
+--> ?PR?IO_INIT?FUNCTION
+--> ?PR?UART_INIT?UART
+--> ?PR?MOTOR_INIT?MOTOR
?PR?IAP_INIT?E2ROM 004EH 0001H
+--> ?PR?_BYTE_READ?E2ROM
+--> ?PR?_SECTOR_ERASE?E2ROM
+--> ?PR?_BYTE_PROGRAM?E2ROM
?PR?_BYTE_READ?E2ROM ----- -----
+--> ?PR?IAP_DISABLE?E2ROM
?PR?_SECTOR_ERASE?E2ROM ----- -----
+--> ?PR?IAP_DISABLE?E2ROM
?PR?_BYTE_PROGRAM?E2ROM ----- -----
+--> ?PR?IAP_DISABLE?E2ROM
?PR?MOTOR_INIT?MOTOR ----- -----
BL51 BANKED LINKER/LOCATER V6.22 03/30/2012 16:01:42 PAGE 3
+--> ?PR?_SPEED_TO_TIMER?MOTOR
?PR?LEFT_SEAL_CALIBRATION?MOTOR ----- -----
+--> ?PR?_SPEED_TO_TIMER?MOTOR
?PR?RIGHT_SEAL_CALIBRATION?MOTOR ----- -----
+--> ?PR?_SPEED_TO_TIMER?MOTOR
?PR?_SEND_ARRAY?UART 004EH 0005H
+--> ?PR?_UART2_SEND?UART
SYMBOL TABLE OF MODULE: 新驱动V3.1 (MAIN)
VALUE TYPE NAME
----------------------------------
------- MODULE MAIN
C:0000H SYMBOL _ICE_DUMMY_
D:0080H PUBLIC P0
D:0090H PUBLIC P1
D:00A0H PUBLIC P2
D:00B0H PUBLIC P3
D:00C0H PUBLIC P4
D:00A8H PUBLIC IE
D:00B8H PUBLIC IP
D:00D8H PUBLIC CCON
C:0456H PUBLIC main
D:0098H PUBLIC SCON
D:0088H PUBLIC TCON
D:0016H PUBLIC run
D:0018H PUBLIC Buff_Send
D:00D0H PUBLIC PSW
------- PROC MAIN
C:0456H LINE# 29
C:0456H LINE# 30
C:0456H LINE# 31
C:0459H LINE# 32
C:0460H LINE# 33
C:0461H LINE# 34
C:0461H LINE# 35
C:0461H LINE# 36
C:0464H LINE# 37
C:0464H LINE# 38
C:0466H LINE# 40
C:0472H LINE# 41
C:0472H LINE# 42
C:0472H LINE# 43
C:0472H LINE# 44
C:0472H LINE# 45
C:0472H LINE# 46
C:0472H LINE# 49
C:047AH LINE# 50
C:0482H LINE# 51
C:048AH LINE# 54
C:0496H LINE# 55
BL51 BANKED LINKER/LOCATER V6.22 03/30/2012 16:01:42 PAGE 4
C:0496H LINE# 56
C:0499H LINE# 57
C:049CH LINE# 58
C:049FH LINE# 59
C:04A2H LINE# 60
C:04A5H LINE# 61
C:04A8H LINE# 62
C:04A8H LINE# 63
C:04A8H LINE# 64
C:04AAH LINE# 66
C:04AAH LINE# 67
C:04ADH LINE# 68
C:04B0H LINE# 69
C:04B3H LINE# 70
C:04B6H LINE# 71
C:04B9H LINE# 72
C:04BBH LINE# 73
C:04BEH LINE# 74
C:04C8H LINE# 75
C:04C8H LINE# 78
C:04C8H LINE# 79
C:04C8H LINE# 81
C:04C8H LINE# 83
C:04C8H LINE# 84
C:04C8H LINE# 86
C:04C8H LINE# 88
C:04C8H LINE# 89
C:04C8H LINE# 91
C:04C8H LINE# 93
C:04CCH LINE# 94
C:04CCH LINE# 96
C:04CCH LINE# 97
C:04CCH LINE# 102
C:04CCH LINE# 103
C:04CCH LINE# 105
------- ENDPROC MAIN
------- ENDMOD MAIN
------- MODULE MOTOR
C:0000H SYMBOL _ICE_DUMMY_
D:0080H PUBLIC P0
B:0080H.1 PUBLIC OPT_LEFT
D:0090H PUBLIC P1
D:00A0H PUBLIC P2
D:00B0H PUBLIC P3
D:00C0H PUBLIC P4
B:00A8H.7 PUBLIC EA
C:05C4H PUBLIC Motor_Init
D:00A8H PUBLIC IE
D:00B8H PUBLIC IP
D:00D8H PUBLIC CCON
D:0048H PUBLIC Seal_Run_Plus
C:0006H PUBLIC Paper_Position_INT0
D:0098H PUBLIC SCON
D:008FH PUBLIC WAKE_CLKO
D:0089H PUBLIC TMOD
D:0088H PUBLIC TCON
BL51 BANKED LINKER/LOCATER V6.22 03/30/2012 16:01:42 PAGE 5
B:00B0H.6 PUBLIC MOTOR2_START
B:00A0H.3 PUBLIC MOTOR3_START
C:0580H PUBLIC Right_Seal_Calibration
D:004AH PUBLIC Advance_Plus
C:06C6H PUBLIC Seal_Position_INT1
D:008EH PUBLIC AUXR
C:053CH PUBLIC Left_Seal_Calibration
B:00B0H.7 PUBLIC MOTOR2_FREE
B:00A0H.4 PUBLIC MOTOR3_FREE
D:008CH PUBLIC TH0
D:008DH PUBLIC TH1
B:0088H.0 PUBLIC IT0
B:00A8H.0 PUBLIC EX0
B:0088H.2 PUBLIC IT1
B:00A8H.2 PUBLIC EX1
B:0090H.1 PUBLIC OPT_RIGHT
B:0088H.4 PUBLIC TR0
B:0088H.6 PUBLIC TR1
B:00C0H.0 PUBLIC MOTOR2_DOOR
C:061FH PUBLIC _Speed_TO_Timer
B:00A0H.0 PUBLIC MOTOR3_DOOR
D:004CH PUBLIC Position_Plus
D:00D0H PUBLIC PSW
------- PROC MOTOR_INIT |