|
Tài trợ cho PIC Vietnam |
dsPIC - Bộ điều khiển tín hiệu số 16-bit Theo dự kiến của Microchip, vào khoảng năm 2011 dsPIC sẽ có doanh số lớn hơn PIC |
|
Ðiều Chỉnh | Xếp Bài |
|
28-06-2014, 03:53 PM | #1 |
Nhập môn đệ tử
Tham gia ngày: Jun 2014
Bài gửi: 1
: |
p33FJ06GS101
p33FJ06GS101.gld:1: undefined symbol `__reset' referenced in expression
nhờ mọi người sửa cho em cái lỗi này. em đang code xong tự nhiên bị cái lỗi này không biết sửa sao cả. dưới đây là code của em. /*LIST p=33FJ06GS101*/ #include "p33FJ06GS101.inc" /*__CONFIG _CP_OFF & _WDT_OFF & _BODEN_OFF & _PWRTE_ON & _XT_OSC & _WRT_OFF & _LVP_OFF & _CPD_OFF */ GOTO 0x200 MAIN: BTSS PORTA , #0xF BRA NN, PROGRAM1 BTSS PORTA , #0xE BRA NN, PROGRAM2 BTSS PORTA , #0xD BRA NN, PROGRAM3 BTSS PORTA , #0xC BRA NN , PROGRAM4 GOTO MAIN PROGRAM1: MOV #0x80, W0 MOV #0x0, W1 MOV #0x0, W6 LOOP1: MOV W0, 0x02D4 MOV W1, PORTB MOV W6, 0x02CE BTG W0, #0x6 BTG W0, #0x7 CALL DELAY_1S GOTO LOOP1 PROGRAM2: MOV PORTA , W2 MOV #0xA , W1 MOV #0x100 , W6 DIV.U W6 , W2 MOV W14 , W2 DIV.U W1 , W2 MOV W14 , W10 DIV.S W1 , W2 MOV W15 , W2 DIV.U W1 , W2 MOV W14 , W11 DIV.S W1 , W2 MOV W15 , W2 DIV.U W1 , W2 MOV W14 , W2 MOV W12, PORTB MOV W11, 0x02CE MOV W10, 0x02D4 GOTO PROGRAM2 PROGRAM3: BTSC PORTA, #0x1 BRA NN , TEST1 BTSC PORTA , #0x0 BRA NN , MODE3 GOTO PROGRAM3 TEST1 : BTSC PORTA, #0x0 BRA NN , MODE1 GOTO MODE2 MODE1: MOV #0xA , W0 MOV #0x8 , W1 MOV #0x0 , W2 BSET W2 , #0xB BSET W2 , #0x6 LOOP1.1: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP1.1 MOV #0x1 , W1 BCLR W2 , #0x6 BSET W2 , #0x7 LOOP1.2: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP1.2 MOV #0x8 , W0 MOV #0xA, W1 MOV #0x0 , W2 BSET W2 , #0x8 BSET W2 , #0x9 LOOP1.3: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W1 , W1 DEC W0 , W0 BRA NC , LOOP1.3 MOV #0x1 , W0 BCLR W2 , #0x9 BSET W2 , #0xA LOOP1.4: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP1.4 GOTO MODE1 MODE2: MOV #0xD, W0 MOV #0xF , W1 MOV #0x0 , W2 BSET W2 , #0xB BSET W2 , #0x6 LOOP2.1: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W1 , W1 DEC W0 , W0 BRA NC , LOOP2.1 MOV #0x1 , W0 BCLR W2 , #0x6 BSET W2 , #0x7 LOOP2.2: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP2.2 MOV #0xA , W0 MOV #0x8 , W1 MOV #0x0 , W2 BSET W2 , #0x8 BSET W2 , #0x9 LOOP2.3: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP2.3 MOV #0x1 , W1 BCLR W2 , #0x9 BSET W2 , #0xA LOOP2.4: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP2.4 GOTO MODE2 MODE3: MOV #0x8 , W0 MOV #0xA, W1 MOV #0x0 , W2 BSET W2 , #0xB BSET W2 , #0x6 LOOP3.1: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W1 , W1 DEC W0 , W0 BRA NC , LOOP3.1 MOV #0x1 , W1 BCLR W2 , #0x6 BSET W2 , #0x7 LOOP3.2: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP3.2 MOV #0xF , W0 MOV #0xD , W1 MOV #0x0 , W2 BSET W2 , #0x8 BSET W2 , #0x9 LOOP3.3: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP3.3 MOV #0x1 , W1 BCLR W2 , #0x9 BSET W2 , #0xA LOOP3.4: MOV W2 , 0x02D4 MOV W0 , 0x02CE MOV W1 , PORTB CALL DELAY_1S DEC W0 , W0 DEC W1 , W1 BRA NC , LOOP3.4 GOTO MODE3 PROGRAM4: BTSS PORTA , #0x0 BRA NN , RESET_CT BTSS PORTA , #0x3 BRA NN , LOAD_TIME GOTO RUN RESET: CLR W2 CLR W3 CLR W4 CLR W5 CLR W6 CLR W7 MOV W2 , PORTB MOV W3 , 0x02CE MOV W7 , 0x02D4 GOTO PROGRAM4 LOAD_TIME: BTSS PORTA , #0x2 BRA NN , LOAD_HOUR BTSS PORTA , #0x1 BRA NN , LOAD_MIN GOTO PROGRAM4 LOAD_HOUR: MOV #0x0 , W4 MOV W4 , 0x02D4 MOV W2 , PORTB MOV W3 , 0x02CE CALL DELAY_1S BTSS PORTA , #0xA BRA NN , PROGRAM4 INC W2 , W2 CP W2 , #0x18 BRA NC , FIX_HOUR MOV W2 , PORTB MOV W3 , 0x02CE MOV W4 , 0x02D4 GOTO PROGRAM4 FIX_HOUR: MOV #0x0 , W2 MOV W2 , PORTB MOV W4 , 0x02CE MOV W3 , 0x02D4 GOTO PROGRAM4 LOAD_MIN: MOV #0x3C , W10 MOV #0x0 , W4 MOV W4 , 0x02D4 MOV W3 , 0x02CE MOV W2 , PORTB CALL DELAY_1S BTSS PORTA , #0xA BRA NN , PROGRAM4 INC W3 , W3 CP W3 , W10 BRA NC , FIX_MIN MOV W3 , 0x02CE MOV W2 , PORTB MOV W4 , 0x02D4 GOTO PROGRAM4 FIX_MIN: MOV #0x0 , W3 MOV W3 , 0x02CE MOV W2 , PORTB MOV W4 , 0x02D4 GOTO PROGRAM4 RUN: MOV #0x3C, W10 MOV W7 , 0x02D4 MOV W3 , 0x02CE MOV W2 , PORTB CALL DELAY_1S INC W7 , W7 CP W7 , W10 BRA NC , INC_MIN GOTO PROGRAM4 INC_MIN: MOV #0x0 , W7 INC W3 , W3 CP W3 , W10 BRA NC , INC_HOUR GOTO PROGRAM4 INC_HOUR MOV #0x0 , W3 INC W2 , W2 CP W2 , #0x18 BRA NC , FIX GOTO PROGRAM4 FIX: MOV #0x0 , W2 GOTO PROGRAM4 DELAY_1S: MOV #0x64 , W8 LOOP: MOV #0xC350 , W9 MOV W9 , TMR1 BSET T1CON , #0xF BRA LT , $ BCLR T1CON , #0xF BCLR T1CON , #0x1 DEC W8 , W8 BRA NZ , LOOP RETURN thay đổi nội dung bởi: vanhoaiuh2010, 28-06-2014 lúc 03:54 PM. Lý do: thiếu phần code |
|
|