< 0 000 1011 (VT) AAARGH Followed by debug chars (only)
< 0 000 1101 (CR) WTIMEOUT Watchdog timeout happened
< 0 000 0111 (BEL) FAULT Fault exists
- < 0 000 0110 (ACK) FIXED Fault now fixed
+ < 0 000 0110 (ACK) RETRIABLE Fault may be tested once more
< 0 000 0100 (ENQ) WAGGLED Pin changed according to WAGGLE
< 0 0100 PPP (20+) POINTED Point change done using capacitor P
< 0 0101 PPP (28+) CHARGED Point capacitor P is now charged
Track and CDU Track and CDU
disabled -------ON-------> enabled
- .
- /|\ |
- | |Short circuit detected
- \ |
- \FIXED FAULT
- \ |
- \__________________ V
- operator `
- fixes the short Short circuit
- (User Fault indicator lit)
-
-
-If OFF is issued in the first 500ms following a short circuit, it will
-be ignored; if the short circuit persists, OFF during the following
-period will go to the `Track and CDU disabled' state without sending
-FIXED.
+ . __ __
+ /|\ |`-._ ON ,-'| |
+ | `-._ ,-' |Short circuit detected
+ | OFF `-._ ,-' |
+ OFF| ,-' _ FAULT
+ | ,-' `-._ |
+ | ,-' `-._ V
+ ' `
+ Track disabled Wait for post-fault
+ CDU enabled <-----500ms------ minimum off time
+ User Fault lit RETRIABLE
+
+
+If ON or OFF are issued in the first 500ms following a short circuit,
+they are ignored.
POINTS and CDU
;
; Off shutdown off none off On
; On power-up on none off Stopping,FAULT Off
-; Stopping shutdown on 500ms 50% 1/100ms Retry
-; Retry power-up off 50ms off Persists Off,FIXED Off
-; Persists shutdown off 90ms on Retry Off
-;
+; Stopping shutdown on 500ms 50% 1/100ms Retriable
+; Retriable shutdown on none on On Off
; (no notation: event ignored)
;
-; shutdown LAT stop_wait retry_wait
+; shutdown LAT stop_wait retry_wait cdu pointstate
;
-; Off H (shutdown) 0 0
-; On L (power-up) 0 0
-; Stopping H (shutdown) before Retry for LED flash
-; Retry L (power-up) 0 before Off
-; Persists H (shutdown) 0 before retry
+; Off H (shutdown) 0 0 off Charging
+; On L (power-up) 0 0 on any
+; Stopping H (shutdown) before Retry for LED flash on any
+; Retriable H (shutdown) 0 0 on any
;
; (uses tickdiv) (uses tick)
command_power_section code 0x2080
;--------------------
command_power_on @
-; Off -> On; noop in other states
- pinlat_ifl p0_booster_shutdown
- return ; On or Retry
- ; might be Off, Stopping or Persists:
-
- tst_f_ifnz retry_wait
- return ; that deals with Stopping or Persists
- ; must be Off:
+; Off, Retriable -> On; noop in other states
+ tst_f_ifnz stop_wait
+ return ; that deals with Stopping
+ ; might be Off, On or Retriable, so safe to just turn On
+ pin_vh p0_booster_userfault
+ pin_vh p0_booster_pwm
pin_vl p0_booster_shutdown
- Dl 0x81
goto cdu_on
;----------
command_power_off @
-; On, Retry, Persists -> Off; noop in Off or Stopping
+; On, Retriable -> Off; noop in Off or Stopping
tst_f_ifnz stop_wait
return ; that deals with Stopping
- ; must be On, Off, Retry or Persists:
- ; (it's harmless to do this if we were already Off)
-power_off_now
- clr_f retry_wait
+ ; must be Off, On or Retriable, so safe to just turn Off
+
pin_vh p0_booster_userfault
pin_vh p0_booster_shutdown
goto cdu_off
;-----
fault_isactual
- pinlat_ifh p0_booster_shutdown
- bra faultintrl_noop
- ; Off, Stopping or Persists - must have lost the race
- ; or flapped while we faffed. Well, never mind, it's
- ; off now and we're taking care of it. (If the host
- ; caused Off by OFF they can at worst send an OFF and
- ; immediate ON in about 2ms, so worst-case duty cycle
- ; for a short (if the host is perversely timed) is
- ; (our interrupt latency) / 2ms
- ; and if they ever don't manage to get the OFF through
- ; in time then we go into Stopping.)
- ; must be On or Retry:
-
+ pin_vl p0_booster_pwm
pin_vh p0_booster_shutdown
- tst_f_ifnz retry_wait
- bra fault_persists ; that deals with Retry
- ; must be On:
+
+ tst_f_ifnz stop_wait
+ bra fault_isactual_ifalreadystopping
mov_lw b'00000111'
call serial_addbyte
+fault_isactual_ifalreadystopping
mov_lw stop_timeout / tickdiv_us
mov_wf stop_wait
rcall power_stop_doflash
intrl_handled_nostack
-;-----
-fault_persists ; Retry -> Persists (booster was shut down just a moment ago)
- mov_lw persist_timeout / tick_us
- mov_wf retry_wait
- pin_vl p0_booster_userfault
-faultintrl_noop
- intrl_handled_nostack
-
;--------------------
power_fault_tick @
tst_f_ifnz retry_wait
dec_f_ifnz retry_wait
return
; retry_wait was running but has just reached zero;
- ; we were in Stopping, Retry or Persists:
+ ; we were in Stopping.
- tst_f_ifnz stop_wait
- bra power_stop_doflash ; that deals with Stopping (just flash)
- ; must be Retry or Persists:
-
- pinlat_ifh p0_booster_shutdown
- bra power_retry ; we were in Persists, now we can try again
- ; we were in Retry and it worked.
-; go to Off:
- pin_vh p0_booster_shutdown
- pin_vh p0_booster_userfault
- mov_lw b'00000110'
- goto serial_addbyte
-
-;----------
+;-----
power_stop_doflash
pin_vhl p0_booster_userfault
mov_lw stopflash_timeout / tick_us
dec_f_ifnz stop_wait
return
; stop_wait was running but has just reached zero;
- ; we were in Stopping, now we can Retry:
- call cdu_off
-power_retry
- mov_lw retry_timeout / tickdiv_us
- mov_wf retry_wait
- pin_vl p0_booster_shutdown
- pin_vh p0_booster_userfault
- return
+ ; we were in Stopping, go to Retriable:
+ clr_f retry_wait
+ pin_vl p0_booster_userfault
+ mov_lw b'00000110'
+ goto serial_addbyte
;----------
fault_spurious_tickdiv