diff options
| author | Selene ToyKeeper | 2019-03-18 03:00:56 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2019-03-18 03:00:56 -0600 |
| commit | 7599d9827a94f199c170298b97b482faaf19520e (patch) | |
| tree | b247c70ed11ef8196c4c341094db785bdac812fc | |
| parent | merged refactoring updates (diff) | |
| download | anduril-7599d9827a94f199c170298b97b482faaf19520e.tar.gz anduril-7599d9827a94f199c170298b97b482faaf19520e.tar.bz2 anduril-7599d9827a94f199c170298b97b482faaf19520e.zip | |
added Emisar D18 config (not final)
| -rw-r--r-- | hwdef-Emisar_D18.h | 51 | ||||
| -rw-r--r-- | spaghetti-monster/anduril/cfg-emisar-d18.h | 38 |
2 files changed, 89 insertions, 0 deletions
diff --git a/hwdef-Emisar_D18.h b/hwdef-Emisar_D18.h new file mode 100644 index 0000000..638dadb --- /dev/null +++ b/hwdef-Emisar_D18.h @@ -0,0 +1,51 @@ +#ifndef HWDEF_EMISAR_D18_H +#define HWDEF_EMISAR_D18_H + +/* Emisar D18 (FET+13+1) driver layout + * ---- + * Reset -|1 8|- VCC + * eswitch -|2 7|- aux LED? + * FET -|3 6|- 13x7135 + * GND -|4 5|- 1x7135 + * ---- + */ + +#define PWM_CHANNELS 3 + +#ifndef SWITCH_PIN +#define SWITCH_PIN PB3 // pin 2 +#define SWITCH_PCINT PCINT3 // pin 2 pin change interrupt +#endif + +#ifndef PWM1_PIN +#define PWM1_PIN PB0 // pin 5, 1x7135 PWM +#define PWM1_LVL OCR0A // OCR0A is the output compare register for PB0 +#endif +#ifndef PWM2_PIN +#define PWM2_PIN PB1 // pin 6, 7x7135 PWM +#define PWM2_LVL OCR0B // OCR0B is the output compare register for PB1 +#endif +#ifndef PWM3_PIN +#define PWM3_PIN PB4 // pin 3, FET PWM +#define PWM3_LVL OCR1B // OCR1B is the output compare register for PB4 +#endif + +#ifndef AUXLED_PIN +#define AUXLED_PIN PB2 // pin 7 +#endif +#define ADC_PRSCL 0x06 // clk/64 + +// average drop across diode on this hardware +#ifndef VOLTAGE_FUDGE_FACTOR +#define VOLTAGE_FUDGE_FACTOR 5 // add 0.25V +#endif + +//#define TEMP_DIDR ADC4D +#define TEMP_CHANNEL 0b00001111 + +#define FAST 0xA3 // fast PWM both channels +#define PHASE 0xA1 // phase-correct PWM both channels + +#define LAYOUT_DEFINED + +#endif diff --git a/spaghetti-monster/anduril/cfg-emisar-d18.h b/spaghetti-monster/anduril/cfg-emisar-d18.h new file mode 100644 index 0000000..5171dba --- /dev/null +++ b/spaghetti-monster/anduril/cfg-emisar-d18.h @@ -0,0 +1,38 @@ +// Emisar FET+13+1 config options for Anduril +#include "hwdef-Emisar_D18.h" + +// front-facing aux LEDs +#define USE_INDICATOR_LED +//#define USE_INDICATOR_LED_WHILE_RAMPING +// enable blinking indicator LED while off +#define TICK_DURING_STANDBY +#define STANDBY_TICK_SPEED 3 // every 0.128 s +#define USE_FANCIER_BLINKING_INDICATOR +// off mode: low (1) +// lockout: blinking (3) +#define INDICATOR_LED_DEFAULT_MODE ((3<<2) + 1) + +// Emisar wanted a shortcut to this +#define USE_TENCLICK_THERMAL_CONFIG + + +// FW3A 1x7135 ramp: +// ../../bin/level_calc.py cube 1 65 7135 1 0.8 150 +// ... mixed with this: +// ../../../bin/level_calc.py ninth 3 150 7135 1 2.5 150 7135 1 1 1600 FET 1 10 5265 +#define RAMP_LENGTH 150 +#define PWM1_LEVELS 1,1,2,2,3,3,4,4,5,6,7,8,9,10,12,13,14,15,17,19,20,22,24,26,29,31,34,36,39,42,45,48,51,55,59,62,66,70,75,79,84,89,93,99,104,110,115,121,127,134,140,147,154,161,168,176,184,192,200,209,217,226,236,245,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM2_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,5,6,8,9,11,13,14,16,18,20,22,25,27,29,32,34,37,40,43,46,49,53,56,60,63,67,71,76,80,85,89,94,100,105,110,116,122,128,135,142,148,156,163,171,179,187,196,205,214,224,234,244,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,0 +#define PWM3_LEVELS 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,10,16,21,27,33,39,46,52,59,66,74,81,89,97,105,114,123,132,142,151,162,172,183,194,205,217,229,242,255 +#define MAX_1x7135 65 +#define MAX_Nx7135 120 +#define HALFSPEED_LEVEL 14 +#define QUARTERSPEED_LEVEL 5 + +// start at ~1500 lm, not ~150 lm +#define DEFAULT_LEVEL MAX_Nx7135 + +// stop panicking at about 4.9A or ~1750 lm +#define THERM_FASTER_LEVEL MAX_Nx7135 +// optional, makes initial turbo step-down faster so first peak isn't as hot +#define THERM_HARD_TURBO_DROP |
