⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.lst

📁 胎压监测系统接收端控制器motorolar开发源代码
💻 LST
📖 第 1 页 / 共 5 页
字号:
                                                             ******************
                      147  * Init_Vars                                         
                                                                              *
                      148  * Initialize the RAM variables.                     
                                                                              *
                      149  ****************************************************
                                                             ******************
 E040 [04] 6EFF59     150  Init_Vars:      MOV     #$FF,SWITCH                 
                                             ;Default configuration is for FSK.
 E043 [04] 6EFF5A     151                  MOV     #$FF,LAST_SWITCH
                      152  
 E046 [03] 45E000     153                  LDHX    #FLASHVARS
 E049 [04] 7E62       154                  MOV     X+,THRESHOLD
 E04B [04] 7E63       155                  MOV     X+,LFID
 E04D [04] 7E64       156                  MOV     X+,LFID+1
 E04F [04] 7E65       157                  MOV     X+,LFID+2
 E051 [04] 7E66       158                  MOV     X+,LFID+3
 E053 [04] 7E67       159                  MOV     X+,RFID
 E055 [04] 7E68       160                  MOV     X+,RFID+1
 E057 [04] 7E69       161                  MOV     X+,RFID+2
 E059 [04] 7E6A       162                  MOV     X+,RFID+3
 E05B [04] 7E6B       163                  MOV     X+,LRID
 E05D [04] 7E6C       164                  MOV     X+,LRID+1
 E05F [04] 7E6D       165                  MOV     X+,LRID+2
 E061 [04] 7E6E       166                  MOV     X+,LRID+3
 E063 [04] 7E6F       167                  MOV     X+,RRID
 E065 [04] 7E70       168                  MOV     X+,RRID+1
 E067 [04] 7E71       169                  MOV     X+,RRID+2
 E069 [04] 7E72       170                  MOV     X+,RRID+3
                      171  
 E06B [03] 3F51       172                  CLR     LFCNTH                      
                                                   ;Clear the timeout counters.
 E06D [03] 3F52       173                  CLR     LFCNTL
 E06F [03] 3F55       174                  CLR     LRCNTH
 E071 [03] 3F56       175                  CLR     LRCNTL
 E073 [03] 3F57       176                  CLR     RRCNTH
 E075 [03] 3F58       177                  CLR     RRCNTL
 E077 [03] 3F53       178                  CLR     RFCNTH
 E079 [03] 3F54       179                  CLR     RFCNTL
 E07B [03] 3F5B       180                  CLR     FAST_MODE
 E07D [04] 81         181                  RTS
                      182  
                      183  
                      184  ****************************************************
                                                             ******************
                      185  * Init_KBD                                          
                                                                              *
                      186  * We don't use keyboard or IRQ interrupts in this 


Main.asm               Assembled with CASM08Z  3/12/2003  10:12:03 AM  PAGE 5



                                                           program.           *
                      187  ****************************************************
                                                             ******************
 E07E [04] 121A       188  Init_KBD:       BSET    1,KBSCR                     
                                                                              ;
 E080 [04] 121D       189                  BSET    1,ISCR                      
                                                               ;Mask interrupts
 E082 [04] 141A       190                  BSET    2,KBSCR                     
                                                                              ;
 E084 [04] 141D       191                  BSET    2,ISCR                      
                                          ;Clear any pending interrupt requests
 E086 [04] 81         192                  RTS
                      193  
                      194  ****************************************************
                                                             ******************
                      195  * Init_ICG                                          
                                                                              *
                      196  * Initializes the internal clock generator module 
                                                           for the            *
                      197  * external oscillator.                              
                                                                              *
                      198  * For now, 4.9152MHz crystal yielding 1.2288MHz bus 
                                                             frequency.       *
                      199  ****************************************************
                                                             ******************
 E087 [02] A613       200  Init_ICG:       LDA     #%00010011                  
                                                       ;Mask for external clock
 E089 [03] B736       201  LOOP_ICG        STA     ICGCR                       
                                         ;Try to set CS, ECGON and clear ICGON.
 E08B [03] B136       202                  CMP     ICGCR                       
                                                   ;Check to see if ICGCR okay.
 E08D [03] 26FA       203                  BNE     LOOP_ICG                    
                                               ;Keep looping until ICG settles.
 E08F [04] 81         204                  RTS
                      205  
                      206  ****************************************************
                                                             ******************
                      207  * Init_Ports                                        
                                                                              *
                      208  * Initializes PTA and PTB.                          
                                                                              *
                      209  * PTA[4] = MISO (Input during config mode, unused 
                                                           output in RCV mode)*
                      210  * PTA[3] = SCK (Output during config mode, input in 
                                                             RCV mode)        *
                      211  * PTA[2] = MOSI (Output during config mode, input 
                                                           in RCV mode)       *
                      212  * PTA[1] = /RST (Output)                            
                                                                              *
                      213  * PTA[0] = "RCV" LED                                
                                                                              *
                      214  * PTB[3:0] = RF, RR, LR, LF LEDs                    
                                                                              *
                      215  ****************************************************
                                                             ******************
 E090 [04] 6E0200     216  Init_Ports:     MOV     #%00000010,PTA              
                                                                ;Keep /RST high
 E093 [04] 6E1304     217                  MOV     #%00010011,DDRA             


Main.asm               Assembled with CASM08Z  3/12/2003  10:12:03 AM  PAGE 6



                                                             ;Soft SPI, one LED
 E096 [03] 3F01       218                  CLR     PTB                         
                                                                      ;LEDs off
 E098 [04] 6E0F05     219                  MOV     #%00001111,DDRB             
                                                                          ;LEDs
 E09B [04] 81         220                  RTS
                      221  
                      222  ****************************************************
                                                             ******************
                      223  * Init_SCI                                          
                                                                              *
                      224  * Initializes the serial communications interface.  
                                                                              *
                      225  ****************************************************
                                                             ******************
 E09C [04] 6E4013     226  Init_SCI:       MOV     #%01000000,SCC1             
                                                                    ;Enable SCI
 E09F [04] 6E0C14     227                  MOV     #%00001100,SCC2             
                                                                ;Enable Tx & Rx
 E0A2 [04] 6E0319     228                  MOV     #%00000011,SCBR             
                                            ;With a 4.9152MHz XTAL, 9600 bauds.
 E0A5 [04] 81         229                  RTS
                      230  
                      231  ****************************************************
                                                             ******************
                      232  * Init_TBM                                          
                                                                              *
                      233  * Initializes the timebase module.  This generates 
                                                            periodic          *
                      234  * interrupts to control the LED flashing when no 
                                                          data is received    *
                      235  * from a tire.  Vector points to 'TBM_Interrupt.'   
                                                                              *
                      236  * With 4.9152MHz crystal, interrupts occur every 
                                                          6.67ms while TBM    *
                      237  * is enabled.                                       
                                                                              *
                      238  ****************************************************
                                                             ******************
 E0A6 [04] 131C       239  Init_TBM:       BCLR    1,TBCR                      
                                                                   ;Disable TBM
 E0A8 [04] 6E0E1C     240                  MOV     #%00001110,TBCR             
                                             ;Select TBM divider and enable TBM
 E0AB [02] 9A         241                  CLI                                 
                                                             ;Enable interrupts
 E0AC [04] 81         242                  RTS
                      243  
                      244  ****************************************************
                                                             ******************
                      245  * Init_Timer                                        
                                                                              *
                      246  * Initialize the timer module.  This is used during 
                                                             the SPI receive  *
                      247  * routine, to assure that we're receiving an entire 
                                                             data frame.  If  *
                      248  * the timer overflows, an interrupt is triggered 
                                                          which resets the    *
                      249  * bit and byte counters and goes back to the 


Main.asm               Assembled with CASM08Z  3/12/2003  10:12:03 AM  PAGE 7



                                                      beginning.              *
                      250  ****************************************************
                                                             ******************
 E0AD [03] B620       251  Init_Timer:     LDA     TSC
 E0AF [04] 6E7020     252                  MOV     #%01110000,TSC              
                                        ;Get the timer ready, stop the counter.
 E0B2 [04] 6E1323     253                  MOV     #$13,TMODH                  
                                          ;Set the modulo registers so that the
 E0B5 [04] 6E3324     254                  MOV     #$33,TMODL                  
                                                   ;timer will overflow in 1ms.
 E0B8 [02] 9A         255                  CLI                                 
                                                            ;Enable interrupts.
 E0B9 [04] 81         256                  RTS
                      257  
                      258  ****************************************************
                                                             ******************
                      259  * Init                                              
                                                                              *
                      260  * Initializes the MCU                               
                                                                              *
                      261  ****************************************************
                                                             ******************
 E0BA [04] 6E281E     262  Init:           MOV     #%00101000,CONFIG2          
                                  ;Enable external oscillator, SCI uses CGMXCLK
 E0BD [04] 6E1B1F     263                  MOV     #%00011011,CONFIG1          

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -