Documentation for “Zerocat Chipflasher” as of Wed, 24 Jun 2026 07:28:37 +0200
Repository: git://zerocat.org/zerocat/projects/chipflasher.git
Version: v3.0.0-0-b445ef922
Branch: master

status.spin.connect.html

Propeller Spin/PASM Compiler 'OpenSpin' (c)2012-2016 Parallax Inc. DBA Parallax Semiconductor.
Version 1.00.78
Compiling...
status.spin
|-time.spin
Done.
Program size is 276 bytes

______________________________________________________________________________
********************************************************* File starts here ***
Zerocat Chipflasher --- Flash free firmware, kick the Management Engine.

File status.spin --- provide status and error codes.

Copyright (C) 2020, 2021, 2022, 2026  Kai Mertens 

This file is part of Zerocat Chipflasher.

See end of file for terms of use.

******************************************************************************


# Object Summary

Object "status" Interface:

PUB  drive_LEDs(code)

Program:  65 Longs
Variable: 0 Longs


# Loaded Objects

* time object


# Included Files


# Constants

* LED pins

* ENUM CODE_type

    - CODE_RQ_SUSPEND        -- internal flag
    - CODE_HELLO_38400       -> all LEDs blink once or twice (according to board version), very very slow
    - CODE_HELLO_57600       -> all LEDs blink once or twice (according to board version), very slow
    - CODE_HELLO             -> all LEDs blink once or twice (according to board version), slow
    - CODE_HELLO_230400      -> all LEDs blink once or twice (according to board version)
    - CODE_RST               -> LED D2 on
    - CODE_CANCEL            -> LED D2 off
    - CODE_SUCCESS           -> LED D2 blinks once
    - CODE_HANDSHAKE         -> LED D2 blinks twice
    - CODE_JOB               -> LED D2 blinks three times
    - CODE_TIMEOUT           -> LED D2 blinks 4 times
    - CODE_TX                -> LED D2 blinks 5 times
    - CODE_INTERNAL          -> LED D2 blinks 6 times
    - CODE_INTERFACE         -> LED D2 blinks 7 times
    - CODE_LOWVOLTAGE        -> LED D2 blinks 8 times
    - CODE_CABLE             -> LED D2 blinks 9 times


# Functions

_____________________
PUB  drive_LEDs(code)

 Display status codes with D1..D3:

  Status codes are displayed ...

  a) at program start
  b) when program is done

  During start, all LEDs D1..D3 blink in unisono as a `hello world' greeting message.
  If they light up once, a PCB of type board-v1 has been detected.
  If they light up twice, a PCB of type board-v2 has been detected.

  The light up duration tells you about the baudrate in use by the firmware.
  An intuitively `normal' duration is used for 115200 bps.
  A greater duration is used for 57600 bps.
  An even greater duration is used for 38700 bps.
  However, a very short light up pulse is used for 230400 bps.

  Right after this `hello world' greeter, LED D2 might get
  switched on for up to 25 seconds in order to tell us that the RST
  reset line is inhibited to allow a follow-up handhake with
  `connect'.

  At the end of the program, LED D2 provides trains of pulses to report the status code:

  CODE_SUCCESS      -- one pulse    : no failure, success!
  CODE_HANDSHAKE    -- two pulses   : handshake failure
  CODE_JOB          -- three pulses : job error
  CODE_TIMEOUT      -- 4            : timeout error
  CODE_TX           -- 5            : transmission error
  CODE_INTERNAL     -- 6            : internal code error
  CODE_INTERFACE    -- 7            : no interface
  CODE_LOWVOLTAGE   -- 8            : voltage too low
  CODE_CABLE        -- 9 pulses     : SPI cable absent or twisted

  While in this status report mode, the firmware is open to receive a reset or a new firmware upload.


******************************************************************************
Terms of Use:

Zerocat Chipflasher is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

Zerocat Chipflasher is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License along
with Zerocat Chipflasher.  If not, see <http://www.gnu.org/licenses/>.

************************************************************** End of File ***