Skip to content

Instantly share code, notes, and snippets.

@robertoalcantara
Last active August 23, 2017 00:11
Show Gist options
  • Save robertoalcantara/50625f906d6fe7d7c2c57ca95e9d85fb to your computer and use it in GitHub Desktop.
Save robertoalcantara/50625f906d6fe7d7c2c57ca95e9d85fb to your computer and use it in GitHub Desktop.
elements:
CPU1:
clocked: true
modes: #values in mW
- fast: -6.795 # 2.265mA * 3V
- slow: -2.5 # 0.855 * 3V
- sleep: -0.075
- off: 0
speed: #values in instructions/s
- fast: 40000000 #16MHz ~4 cycles/inst
- slow: 1000000 #4MHz ~4 cycles/inst
- sleep: 0
- off: 0
default: "off"
TEMPERATURE:
modes: #values in mW
- off: 0
- standby: -0.001
- active: -4.5
default: "off"
RADIO:
modes: #values in mW
receive: -78.9
transmit: -112.5
off: -0.015
default: "off"
LED:
modes: #mW
on: -7
off: 0
default: "off"
CHARGER:
modes:
- on: 50 #value in miliwatts
- off: 0
default: "off"
SUPERCAP:
storage: true
maximum: 120 #mWh (3 * 40mAh)
default: 60 #mWh default startup
tasks:
AUDIO_ANALISYS:
timescale: 1000 #timescale em ms (microsecond unit)
signals:
1:
or:
- TMR(100ms)
- ON_AUDIO_AN
code:
0:
- ON_AUDIO_AN: 1
- CPU1: "fast"
CPU1.2400:
99.9%:
- CPU1: "off"
- ON_AUDIO_AN: 0
0.1%:
- CPU1: "slow"
CPU1.8100:
- LED_ENABLE: 1
- SIG_TX_DATA: true
- CPU1: "off"
- ON_AUDIO_AN: 0
10:
- SEG_10: 1 #10s depois
LED:
timescale: 1000000 #(us unit)
signals: LED_ENABLE
code:
0:
- LED: "on"
5:
- LED: "off"
- LED_ENABLE: 0
TX_DATA:
timescale: 1000 #1ms
signals: SIG_TX_DATA
code:
0:
- RADIO: "transmit"
- CPU1: "fast"
CPU1.28:
- CPU1: "off"
- SIG_TX_DATA: 0
RX_DATA:
timescale: 1000
signals: INTERRUPT(RX)
code:
0:
- CPU1: "slow"
CPU1.30,99.99%:
- CPU1: "off"
- INTERRUPT(RX): 0
CPU1.330:
- CPU1: "off"
- INTERRUPT(RX): 0
CHARGER_EN:
timescale: 1000000 #1s
signals:
1:
or:
- TMR(12h)
- CHAR_RUN
code:
0:
- CHARGER: "on"
- CHAR_RUN: 1
3600: #recarregou durante 1h, 60 unidades de energia. (1 minuto = 1 uniddes). Vai recarregar novamente 12h depois.
- CHARGER: "off"
- CHAR_RUN: 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment