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

📄 main.lst

📁 基于MOTOLOLAR单片机的TPMS发送控制器代码设计
💻 LST
📖 第 1 页 / 共 5 页
字号:
                      162  ;/* - added work-around for bug in Romeo2 receiver, 
                                                   where its SPI corrupts    */
                      163  ;/*   the last bit of data in the frame.  Simply 
                                                transmit one more useless    */
                      164  ;/*   byte, that will be corrupted instead of the 
                                                 useful data.                */
                      165  ;/**************************************************
                                                   ***************************/
                      166  
                      167  ; Flash handler variables
                      168  
 0088                 169  CTRLBYT         ds      1       ; byte of control 
                                                         of the size of erasure
 0089                 170  CPUSPD          ds      1       ; frequency of the 
                                                                   pump of load
 008A                 171  LADDR           ds      2       ; address last byte 
                                                                   has to write
 008C                 172  BUMPS           ds      1       ; a number of 
                                                  attempts at writing maximum :
                      173                                  ; 10 per 12 ms max 
                                                               with Fcpu = 2MHz
 008D                 174  DERASE          ds      2       ; time of erasure 
                                                                     (in us/24)
 008F                 175  Data            ds      8       ; buffer of 
                                                     transfer of RAM/flash data
                      176  
                      177  ; transmit variables
                      178  ; Preamble (2 bytes) - Device ID (4 bytes) - 
                                                       daytona data (2 bytes) -
                      179  ; Status (1 byte) - CRC (1 byte) - Junk (1 byte)
                      180  
 0097                 181  nb_tx_byte      EQU     !11     
 0097                 182  Tx_Byte         ds      nb_tx_byte
                      183  


main.asm               Assembled with CASM08Z  3/18/2003  3:17:52 PM  PAGE 5



 00A2                 184  Current_Tx_Bit  ds      1
 00A3                 185  Next_Tx_Bit     ds      1
 00A4                 186  current_tx_byte ds      1
 00A5                 187  nb_1            ds      2
 00A7                 188  Last_byte       EQU     {Tx_byte+nb_tx_byte}
                      189  
                      190  ; Checksum
                      191  
 00A7                 192  Chk_count       ds      1
 00A8                 193  $Include        'daytona_ram_variables_avg.h'
                      194  ;/* hardware variables for Daytona */
                      195  ;/* v0.1 Ador Reodique 4/20/00
                      196  ;/* Modified by Jeff Burgess for 8x oversampling */
                      197  
                      198  ; variables for Daytona Serial and SAR routines
                      199  
 00A8                 200  T2              ds      1       ; temporary 
                                                                     variable 2
 00A9                 201  T3              ds      1
 00AA                 202  T4              ds      1
 00AB                 203  T5              ds      1
 00AC                 204  AVGCOUNT        ds      1       ; Averaging counter
 00AD                 205  SAR             ds      1       ; SAR result 
                                                                       Register
 00AE                 206  BITCOUNT        ds      1       ; bit count
 00AF                 207  DATABUFF        ds      1       ; DATA buffer
 00B0                 208  TEMPERATURE     ds      1       ; converted 
                                                                    temperature
 00B1                 209  PRESSURE        ds      1       ; converted pressure
                      210  
 00B2                 211  COUNTER         ds      1       ; counter to count 
                                                                   every 6 secs
 00B3                 212  STATUS          ds      1
 00B4                 213  Random_Number   ds      1       ; Pseudo-random 
                                       number (from timer counter low register)
 00B5                 214  Tx_count        ds      1       ; Measure pressure 
                                                  every 3 sec, tx every 54 sec.
 00B6                 215  Max_Pres        ds      1       ; Holds the maximum 
                                                                       pressure
 00B7                 216  Min_Pres        ds      1       ; Holds the minimum 
                                                                       pressure
                      217                                          ; Daytona 
                                                       Serial and SAR variables
 7800                 218          org     $7800
 7800      89AABBCC   219          db      $89,$AA,$BB,$CC         ; Device ID
                      220  
 7880                 221          org     RomStart
 7880                 222  $Include        'util.asm'
                      223  ;/**************************************************
                                                   ***************************/
                      224  ;/* PROJECT : RF key demonstrator (ASK or FSK)      
                                                                             */
                      225  ;/* Functions: tempo                                
                                                                             */
                      226  ;/**************************************************
                                                   ***************************/
                      227  
                      228  ;/**************************************************


main.asm               Assembled with CASM08Z  3/18/2003  3:17:52 PM  PAGE 6



                                                   ***************************/
                      229  ;/* tempo                                           
                                                                             */
                      230  ;/* Description : it waits for n cpu cycles         
                                                                             */
                      231  ;/* In : H:X                                        
                                                                             */
                      232  ;/* Out : TMOD, TSC                                 
                                                                             */
                      233  ;/* local variables :                               
                                                                             */
                      234  ;/**************************************************
                                                   ***************************/
                      235  
                      236  Tempo:
                      237  
 7880 [02] 87         238          psha
                      239  
 7881 [03] B620       240          lda     TSC             ;
 7883 [02] A47F       241          and     #%01111111      ; clear tof
 7885 [02] AA30       242          ora     #%00110000      ; stop the counter,
 7887 [03] B720       243          sta     TSC             ; while keeping 
                                                                 prescaler same
                      244  
 7889 [04] 3523       245          sthx    tmodh
 788B [04] 1B20       246          bclr    5,TSC           ; start the timer
 788D [05] 0F20FD     247          brclr   7,TSC,*         ; wait until the 
                                                               tempo is expired
                      248  
 7890 [02] 86         249          pula
                      250  
 7891 [04] 81         251          rts
 7892                 252  $Include        'emis1.asm'
                      253  ;/**************************************************
                                                   ***************************/
                      254  ;/* PROJECT : RF key demonstrator (FSK)             
                                                                             */
                      255  ;/* Functions: Wake_up_Rx                           
                                                                             */
                      256  ;/*  Transmit_1                                     
                                                                             */
                      257  ;/*  Init_timer0                                    
                                                                             */
                      258  ;/*  tempo                                          
                                                                             */
                      259  ;/*  Transmit                                       
                                                                             */
                      260  ;/*  Tx_Uhf_ISR                                     
                                                                             */
                      261  ;/**************************************************
                                                   ***************************/
                      262  
                      263  
                      264  ;/**************************************************
                                                   ***************************/
                      265  ;/* Transmit_1                                      
                                                                             */
                      266  ;/* Description : it transmits a tone at 9600 bauds 


main.asm               Assembled with CASM08Z  3/18/2003  3:17:52 PM  PAGE 7



                                                   for 64 ms                 */
                      267  ;/* In :                                            
                                                                             */
                      268  ;/* Out : nb_1                                      
                                                                             */
                      269  ;/* local variables :                               
                                                                             */
                      270  ;/**************************************************
                                                   ***************************/
                      271  
                      272  Transmit_1:
                      273  
 7892 [03] B625       274          lda     TSC0            ; initial output = H
 7894 [02] A4E3       275          and     #%11100011
                      276          ;             \\\_______;Pin under port 
                                                                       control,
                      277          ;              \________;Initial output = 
                                                                           High
 7896 [03] B725       278          sta     TSC0
 7898 [04] AD01       279          bsr     Init_Timer0
                      280  
 789A [04] 81         281          rts
                      282  
                      283  ;/**************************************************
                                                   ***************************/
                      284  ;/* Init_timer0:                                    
                                                                             */
                      285  ;/* Description : it initializes the timer for PWM 
                                                  output at 9600 bauds       */
                      286  ;/*       with uPclk as Tclk                        
                                                                             */
                      287  ;/* In :                                            
                                                                             */
                      288  ;/* Out : TSC, TSC0, TMOD, TCH0                     
                                                                             */
                      289  ;/* local variables : H:X                           
                                                                             */
                      290  ;/**************************************************
                                                   ***************************/
                      291  
                      292  Init_Timer0:
                      293  
 789B [02] 8B         294          pshh                    ; save h & x
 789C [02] 89         295          pshx
                      296  
 789D [04] 6E01A2     297          mov     #1,current_tx_bit
 78A0 [04] 6E01A3     298          mov     #1,next_tx_bit
                      299  
 78A3 [03] B620       300          lda     TSC
 78A5 [04] 6E3720     301          mov     #$37,TSC        ; counter stopped & 
                                           cleared, tof clear, TOF_ISR disabled
                      302                                  ; DATACLK = Timer 
                                                                            clk

⌨️ 快捷键说明

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