📄 spim.lst
字号:
MPASM 03.70.01 Released SPIM.ASM 2-16-2006 19:56:27 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
00001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
00002 ;
00003 ; SPIM.ASM MPB Ver:1.0 13-9-05
00004 ;...............................................................
00005 ;
00006 ; SPI Master program
00007 ;
00008 ; Outputs clock to slave transmitter, receives BCD data
00009 ; and sends it to slave receiver for display
00010 ;
00011 ;
00012 ;
00013 ;
00014 ;
00015 ;
00016 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
00017
00018 PROCESSOR 16F877 ; define MPU
2007 3731 00019 __CONFIG 0x3731 ; XT clock (4MHz)
00020
00021 ; LABEL EQUATES ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
00022
00023 INCLUDE "P16F877.INC" ; Standard register labels
00001 LIST
00002 ; P16F877.INC Standard Header File, Version 1.00 Microchip Technology, Inc.
00373 LIST
00024
00000020 00025 Store EQU 020
00026
00027 ; Initialise ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
00028
0000 00029 ORG 0 ; Place machine code
0000 0000 00030 NOP ; Required for ICD mode
00031
0001 1683 1303 00032 BANKSEL TRISC
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0003 1287 00033 BCF TRISC,5 ; Serial data (SDO) output
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0004 1187 00034 BCF TRISC,3 ; Serial clock (SCK) output
Message[302]: Register in operand not in bank 0. Ensure that bank bits are correct.
0005 1007 00035 BCF TRISC,0 ; Slave select (SS) output
00036
Warning[211]: Extraneous arguments on the line.
0006 0103 00037 CLRW SSPSTAT ; Default clock timing
00038
0007 1283 1303 00039 BANKSEL PORTD
0009 1407 00040 BSF PORTC,0 ; Reset slave transmitter
000A 0194 00041 CLRF SSPCON ; SPI master mode, clock = 1MHz
00042
00043
00044 ; MAIN LOOP ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
00045
000B 1694 00046 BSF SSPCON,SSPEN ; Enable SPI mode
MPASM 03.70.01 Released SPIM.ASM 2-16-2006 19:56:27 PAGE 2
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
000C 1007 00047 again BCF PORTC,0 ; Enable slave transmitter
00048
000D 0093 00049 MOVWF SSPBUF ; Rewrite buffer to start clock
000E 1D8C 00050 waitin BTFSS PIR1,SSPIF ; wait for SPI interrupt
000F 280E 00051 GOTO waitin ; for data recieved
00052
0010 118C 00053 BCF PIR1,SSPIF ; clear interrupt flag
0011 0813 00054 MOVF SSPBUF,W ; read SPI buffer
0012 00A0 00055 MOVWF Store ; store BCD value
00056
0013 1407 00057 BSF PORTC,0 ; Disable slave transmitter
0014 0093 00058 MOVWF SSPBUF ; Reload SPI buffer
00059
0015 1D8C 00060 waits BTFSS PIR1,SSPIF ; wait for SPI interrupt
0016 2815 00061 GOTO waits ; for data sent
0017 118C 00062 BCF PIR1,SSPIF ; clear interrupt flag
00063
0018 280C 00064 GOTO again ; repeat main loop
00065
00066
00067
00068 END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
MPASM 03.70.01 Released SPIM.ASM 2-16-2006 19:56:27 PAGE 3
SYMBOL TABLE
LABEL VALUE
ACKDT 00000005
ACKEN 00000004
ACKSTAT 00000006
ADCON0 0000001F
ADCON1 0000009F
ADCS0 00000006
ADCS1 00000007
ADDEN 00000003
ADFM 00000007
ADIE 00000006
ADIF 00000006
ADON 00000000
ADRESH 0000001E
ADRESL 0000009E
BCLIE 00000003
BCLIF 00000003
BF 00000000
BRGH 00000002
C 00000000
CCP1CON 00000017
CCP1IE 00000002
CCP1IF 00000002
CCP1M0 00000000
CCP1M1 00000001
CCP1M2 00000002
CCP1M3 00000003
CCP1X 00000005
CCP1Y 00000004
CCP2CON 0000001D
CCP2IE 00000000
CCP2IF 00000000
CCP2M0 00000000
CCP2M1 00000001
CCP2M2 00000002
CCP2M3 00000003
CCP2X 00000005
CCP2Y 00000004
CCPR1H 00000016
CCPR1L 00000015
CCPR2H 0000001C
CCPR2L 0000001B
CHS0 00000003
CHS1 00000004
CHS2 00000005
CKE 00000006
CKP 00000004
CREN 00000004
CSRC 00000007
D 00000005
DATA_ADDRESS 00000005
DC 00000001
D_A 00000005
EEADR 0000010D
MPASM 03.70.01 Released SPIM.ASM 2-16-2006 19:56:27 PAGE 4
SYMBOL TABLE
LABEL VALUE
EEADRH 0000010F
EECON1 0000018C
EECON2 0000018D
EEDATA 0000010C
EEDATH 0000010E
EEIE 00000004
EEIF 00000004
EEPGD 00000007
F 00000001
FERR 00000002
FSR 00000004
GCEN 00000007
GIE 00000007
GO 00000002
GO_DONE 00000002
I2C_DATA 00000005
I2C_READ 00000002
I2C_START 00000003
I2C_STOP 00000004
IBF 00000007
IBOV 00000005
INDF 00000000
INTCON 0000000B
INTE 00000004
INTEDG 00000006
INTF 00000001
IRP 00000007
NOT_A 00000005
NOT_ADDRESS 00000005
NOT_BO 00000000
NOT_BOR 00000000
NOT_DONE 00000002
NOT_PD 00000003
NOT_POR 00000001
NOT_RBPU 00000007
NOT_RC8 00000006
NOT_T1SYNC 00000002
NOT_TO 00000004
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -