📄 main_hyperterm.lst
字号:
;Disable COP
266
E0C6 [05] CDE040 267 JSR Init_Vars
;Initialize RAM variables
E0C9 [04] ADCD 268 BSR Init_Ports
;Initialize I/O
E0CB [04] ADC2 269 BSR Init_ICG
;Initialize external crystal
E0CD [04] ADB7 270 BSR Init_KBD
;Initialize keyboard interrupts
E0CF [04] ADE3 271 BSR Init_Timer
;Initialize the timer
E0D1 [04] ADD1 272 BSR Init_SCI
;Initialize the SCI
E0D3 [04] ADD9 273 BSR Init_TBM
;Initialize the TBM
274
E0D5 [01] 4F 275 CLRA
E0D6 [01] 8C 276 CLRH
E0D7 [01] 5F 277 CLRX
E0D8 [02] 9A 278 CLI
E0D9 [04] 81 279 RTS
E0DA 280 $Include 'LEDCont.asm'
281 * LEDCont.asm
282
283 ****************************************************
******************
284 * Contains the controls for all the LEDs.
*
285 * PTA[0] = RX
*
286 * PTB[0] = LF
*
Main_Hyperterm.asm Assembled with CASM08Z 1/28/2003 9:41:14 PM PAGE 8
287 * PTB[1] = LR
*
288 * PTB[2] = RR
*
289 * PTB[3] = RF
*
290 ****************************************************
******************
291
E0DA [03] B601 292 BlinkLEDs: LDA PTB
;Flash the LEDs to indicate to the user
E0DC [02] AA0F 293 ORA #%00001111
;that the module is on, and the Romeo2 is
E0DE [03] B701 294 STA PTB
;configured properly.
E0E0 [04] 1000 295 BSET 0,PTA
E0E2 [02] AEFF 296 LDX #$FF
E0E4 [05] CDE2BB 297 JSR Delay
298
E0E7 [03] B601 299 LDA PTB
E0E9 [02] A4F0 300 AND #%11110000
E0EB [03] B701 301 STA PTB
E0ED [04] 1100 302 BCLR 0,PTA
E0EF [04] 81 303 RTS
304
E0F0 [03] B601 305 TurnOnLEDs: LDA PTB
;Turn on all LEDs to indicate to the user
E0F2 [02] AA0F 306 ORA #%00001111
;that there's a problem with the module.
E0F4 [03] B701 307 STA PTB
;Code is still running to try to recover,
E0F6 [04] 1000 308 BSET 0,PTA
;but if the LEDs stay on persistently then
E0F8 [04] 81 309 RTS
;there's probably a bad connection to Romeo.
310
E0F9 [02] AE10 311 LED_Flicker: LDX #$10
E0FB [01] 4F 312 L0: CLRA
;The Rx LED will flicker to indicate that
313
;something was received, but the checksum
E0FC [04] 1000 314 BSET 0,PTA
;did not match so the data is not processed.
E0FE [03] 4BFE 315 DBNZA *
E100 [04] 1100 316 BCLR 0,PTA
E102 [03] 4BFE 317 DBNZA *
E104 [03] 5BF5 318 DBNZX L0
E106 [03] B65B 319 LDA FAST_MODE
E108 [03] 2702 320 BEQ Flick_Done
E10A [04] 1000 321 BSET 0,PTA
E10C [04] 81 322 Flick_Done: RTS
323
E10D [03] B65B 324 Blink_Rx: LDA FAST_MODE
E10F [03] 2704 325 BEQ Blink
E111 [04] 1000 326 BSET 0,PTA
E113 [03] 2009 327 BRA DoneBlink
328
E115 [02] AE20 329 Blink: LDX #$20
Main_Hyperterm.asm Assembled with CASM08Z 1/28/2003 9:41:14 PM PAGE 9
;The Rx LED will blink once to indicate that
E117 [04] 1000 330 BSET 0,PTA
;good data was received.
E119 [05] CDE2BB 331 JSR Delay
E11C [04] 1100 332 BCLR 0,PTA
E11E [04] 81 333 DoneBlink: RTS
334
335 ****************************************************
******************
336 * ProcessData
*
337 * Process the (already confirmed valid) data frame,
and send tire *
338 * status, position and data to the user.
*
339 * DATA + 7: ID1
*
340 * DATA + 6: ID2
*
341 * DATA + 5: ID3
*
342 * DATA + 4: ID4
*
343 * DATA + 3: PRESSURE
*
344 * DATA + 2: TEMPERATURE
*
345 * DATA + 1: STATUS (bit 7=LVIOUT, bit 6=LOWV, bit
4=FastTx) *
346 * DATA + 0: CHECKSUM
*
347 * PTB[0] = LF
*
348 * PTB[1] = LR
*
349 * PTB[2] = RR
*
350 * PTB[3] = RF
*
351 *
*
352 * Position is stored in the STATUS byte (DATA + 1)
for the device *
353 * receiving the serial data.
*
354 * STATUS[3] high -> LF
*
355 * STATUS[2] high -> RF
*
356 * STATUS[1] high -> LR
*
357 * STATUS[0] high -> RR
*
358 ****************************************************
******************
E11F [03] B64A 359 ProcessData: LDA DATA+1
E121 [03] 2702 360 BEQ FindPos
E123 [04] 1E5B 361 BSET 7,FAST_MODE
Main_Hyperterm.asm Assembled with CASM08Z 1/28/2003 9:41:14 PM PAGE 10
;Flag that this tire is in fast mode.
362
E125 [03] B650 363 FindPos: LDA DATA+7
;Check all tire ID bytes.
E127 [03] B163 364 CMP LFID
E129 [03] 2634 365 BNE L1
E12B [03] B64F 366 LDA DATA+6
E12D [03] B164 367 CMP LFID+1
E12F [03] 262E 368 BNE L1
E131 [03] B64E 369 LDA DATA+5
E133 [03] B165 370 CMP LFID+2
E135 [03] 2628 371 BNE L1
E137 [03] B64D 372 LDA DATA+4
E139 [03] B166 373 CMP LFID+3
E13B [03] 2622 374 BNE L1
375
E13D [03] 3F52 376 LF_Match: CLR LFCNTL
E13F [03] 3F51 377 CLR LFCNTH
E141 [04] 164A 378 BSET 3,DATA+1
;Indicate which tire in STATUS
E143 [05] CDE10D 379 JSR Blink_Rx
;Blink the Rx LED.
E146 [05] 0F5B04 380 BRCLR 7,FAST_MODE,LF
E149 [04] 105B 381 BSET 0,FAST_MODE
;Flag that the LF tire is in fast mode.
E14B [03] 2002 382 BRA LF1
383
E14D [04] 115B 384 LF: BCLR 0,FAST_MODE
E14F [03] B64C 385 LF1: LDA DATA+3
;Check the pressure
E151 [03] B162 386 CMP THRESHOLD
E153 [03] 2205 387 BHI LF_OK
E155 [04] 1001 388 BSET 0,PTB
;Pressure low: light LED.
E157 [03] CCE205 389 JMP EXIT
E15A [04] 1101 390 LF_OK: BCLR 0,PTB
;Pressure okay: clear LED.
E15C [03] CCE205 391 JMP EXIT
392
E15F [03] B650 393 L1: LDA DATA+7
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -