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

📄 main_quick_tx.lst

📁 基于MOTOLOLAR单片机的TPMS发送控制器代码设计
💻 LST
📖 第 1 页 / 共 5 页
字号:
                      453  ;/* Functions:                                      
                                                                             */
                      454  ;/*   Make_frame
                      455  ;/*   Read_ID
                      456  ;/*   Make_daytona_data
                      457  ;/*   Calculate_checksum
                      458  ;/*   Make_frame
                      459  ;/**************************************************
                                                   ***************************/
                      460  
                      461  ;/**************************************************
                                                   ***************************/
                      462  ;/* Make_preamble                                   
                                                                             */
                      463  ;/* Description : it reads the preamble & stores it 
                                                   in Tx_byte                */
                      464  ;/* In : Preamble in flash                          
                                                                             */
                      465  ;/* Out : Tx_byte, Tx_byte+1                        
                                                                             */
                      466  ;/* local variables :                               
                                                                             */
                      467  ;/**************************************************
                                                   ***************************/
                      468  
                      469  Make_preamble:
                      470  
 7945 [03] 45FB86     471          ldhx    #Preamble       ; Constant
 7948 [04] 3597       472          sthx    Tx_byte
 794A [04] 81         473          rts
                      474  
                      475  ;/**************************************************
                                                   ***************************/
                      476  ;/* Make_device_ID                                  
                                                                             */
                      477  ;/* Description : it reads the device ID & stores 
                                                 it in Tx_byte               */
                      478  ;/* In : Device_ID in flash                         
                                                                             */
                      479  ;/* Out : Tx_byte+2,3,4,5                           


main_quick_tx.asm      Assembled with CASM08Z  3/18/2003  3:17:57 PM  PAGE 12



                                                                             */
                      480  ;/* local variables :                               
                                                                             */
                      481  ;/**************************************************
                                                   ***************************/
                      482  
                      483  Make_device_ID:
                      484  
 794B [04] C67800     485          lda     Device_ID
 794E [03] B799       486          sta     Tx_byte+2
 7950 [04] C67801     487          lda     Device_ID+1
 7953 [03] B79A       488          sta     Tx_byte+3
 7955 [04] C67802     489          lda     Device_ID+2
 7958 [03] B79B       490          sta     Tx_byte+4
 795A [04] C67803     491          lda     Device_ID+3
 795D [03] B79C       492          sta     Tx_byte+5
 795F [04] 81         493          rts
                      494  
                      495  ;/**************************************************
                                                   ***************************/
                      496  ;/* Make_daytona_data                               
                                                                             */
                      497  ;/* Description : it stores Daytona data in Tx_byte 
                                                                             */
                      498  ;/* In : daytona_output                             
                                                                             */
                      499  ;/* Out : Tx_byte+6,7                               
                                                                             */
                      500  ;/* local variables :                               
                                                                             */
                      501  ;/**************************************************
                                                   ***************************/
                      502  
                      503  Make_daytona_data:
                      504  
 7960 [03] B6B1       505          lda     PRESSURE
 7962 [03] B79D       506          sta     Tx_byte+6
 7964 [03] B6B0       507          lda     TEMPERATURE
 7966 [03] B79E       508          sta     Tx_byte+7
 7968 [04] 81         509          rts
                      510  
                      511  ;/**************************************************
                                                   ***************************/
                      512  ;/* Make_status_byte                                
                                                                             */
                      513  ;/* Description : Places the status byte in the 
                                               right place in the frame.     */
                      514  ;/* In : parity                                     
                                                                             */
                      515  ;/* Out : Tx_byte+8                                 
                                                                             */
                      516  ;/* local variables :                               
                                                                             */
                      517  ;/**************************************************
                                                   ***************************/
                      518  
                      519  Make_status_byte:
                      520  


main_quick_tx.asm      Assembled with CASM08Z  3/18/2003  3:17:57 PM  PAGE 13



 7969 [03] B6B3       521          lda     STATUS
 796B [03] B79F       522          sta     Tx_byte+8
 796D [04] 81         523          rts
                      524  
                      525  ;/**************************************************
                                                   ***************************/
                      526  ;/* calculate_checksum                              
                                                                             */
                      527  ;/* Description : stores checksum data in Tx_byte.  
                                                   Checksum is calculated    */
                      528  ;/*    by two's complementing the sum of the 
                                            following data:                  */
                      529  ;/*    ID1, ID2, ID3, PRESSURE, TEMPERATURE         
                                                                             */
                      530  ;/*    such that the sum of these and the checksum 
                                                  is zero.                   */
                      531  ;/* In : frame in Tx_byte                           
                                                                             */
                      532  ;/* Out : Tx_byte+9                                 
                                                                             */
                      533  ;/* local variables :                               
                                                                             */
                      534  ;/**************************************************
                                                   ***************************/
                      535  
                      536  Calculate_Checksum:
 796E [03] 450099     537          ldhx    #Tx_byte+2      ; Preamble ($FFF6) 
                                                                is not included
 7971 [02] A607       538          lda     #nb_tx_byte-4   ; Nor are the 
                                                         checksum or junk bytes
 7973 [03] B7A7       539          sta     Chk_count
 7975 [01] 4F         540          clra
                      541  Calculate_chk_next:
 7976 [02] FB         542          add     ,x
 7977 [01] 5C         543          incx
 7978 [05] 3BA7FB     544          dbnz    Chk_count,Calculate_chk_next
                      545                                  ; repeat for each 
                                                              byte of the frame
 797B [01] 40         546          nega
 797C [03] B7A0       547          sta     Tx_byte+!9      ; store calculated 
                                                                       checksum
                      548  
                      549  
 797E [04] 81         550          rts
                      551  
                      552  ;/**************************************************
                                                   ***************************/
                      553  ;/* Make_frame                                      
                                                                             */
                      554  ;/* Description : it makes the frame to be transmitt
                                                   ed                        */
                      555  ;/*             Preamble (2 bytes)                  
                                                                             */
                      556  ;/*             Device ID (4 bytes)                 
                                                                             */
                      557  ;/*             Daytona data (2 bytes)              
                                                                             */
                      558  ;/*             Checksum (1 byte)                   


main_quick_tx.asm      Assembled with CASM08Z  3/18/2003  3:17:57 PM  PAGE 14



                                                                             */
                      559  ;/*             Junk (1 byte)                       
                                                                             */
                      560  ;/* In : Daytona output, Status info, Preamble + ID 
                                                   in flash                  */
                      561  ;/* Out : Tx_byte data frame                        
                                                                             */
                      562  ;/* local variables :                               
                                                                             */
                      563  ;/**************************************************
                                                   ***************************/
                      564  
                      565  Make_frame:
 797F [05] CD7945     566          jsr     Make_preamble
 7982 [05] CD794B     567          jsr     Make_device_ID
 7985 [05] CD7960     568          jsr     Make_daytona_data
 7988 [05] CD7969     569          jsr     Make_status_byte
 798B [05] CD796E     570          jsr     Calculate_Checksum
                      571  
                      572                                  ; This is a useless 
                                           byte, which is there only because it
 798E [03] B7A1       573          sta     Tx_byte+!10     ; will be corrupted 
                                         by the 33592 romeo receiver instead of
                      574                                  ; the real data.
 7990 [04] 81         575          rts
 7991                 576  $Include        'check_battery.asm'
                      577  ;/* LVI status check routine                      */
                      578  ;/* V0.1   17 July, 2002 Jeff Burgess             */
                      579  ;/* Called with:  jsr    SEND_BYTE                */
                      580  ;/* Returns:      STATUS[7,6] containing the data */
                      581  ;/*               from LVISR[7,5] respectively.   */
                      582  ;/* (c) 2002 Motorola                             */
                      583  
                      584  Check_battery:
 7991 [02] 87         585          psha
 7992 [04] C6FE0F     586          lda     LVISR
 7995 [03] B7A9       587          sta     T3
 7997 [05] 0BA902     588          brclr   LOWV,T3,Chk_dead
 799A [04] 1CB3       589          bset    6,STATUS
                      590  
                      591  Chk_dead:
 799C [05] 0FA902     592          brclr   LVIOUT,T3,Not_dead
 799F [04] 1EB3       593          bset    LVIOUT,STATUS
                      594  
                      595  Not_dead:
 79A1 [02] 86         596          pula
 79A2 [04] 81         597          rts

⌨️ 快捷键说明

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