aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-09-24 06:22:09 -0600
committerSelene ToyKeeper2021-09-24 06:22:09 -0600
commit39ce1eb4f0f1d911b5a26e7b0271092555f11f37 (patch)
tree76aa6498ebb56612929c6d230f0f08ec90f78d52
parentadded dynamic PWM and FET to MD11 (diff)
downloadanduril-39ce1eb4f0f1d911b5a26e7b0271092555f11f37.tar.gz
anduril-39ce1eb4f0f1d911b5a26e7b0271092555f11f37.tar.bz2
anduril-39ce1eb4f0f1d911b5a26e7b0271092555f11f37.zip
unsure which pin MD11 uses for switch; added a potential change for later
Diffstat (limited to '')
-rw-r--r--hwdef-Noctigon_MD11.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/hwdef-Noctigon_MD11.h b/hwdef-Noctigon_MD11.h
index 334e17b..c2abcca 100644
--- a/hwdef-Noctigon_MD11.h
+++ b/hwdef-Noctigon_MD11.h
@@ -21,10 +21,10 @@
* 14 PC1 SCK
* 15 PC0 (none) PWM0A
* 16 PB3 main LED PWM (PWM1A)
- * 17 PB2 MISO
+ * 17 PB2 MISO / e-switch? (PCINT10)
* 18 PB1 MOSI / battery voltage (ADC6)
* 19 PB0 Opamp power
- * 20 PA7 e-switch (PCINT7)
+ * 20 PA7 e-switch? (PCINT7)
* ADC12 thermal sensor
*
* Main LED power uses one pin to turn the Opamp on/off,
@@ -46,6 +46,13 @@
#define PWM_TOP 255 // highest value used in top half of ramp
#define USE_DYN_PWM // dynamic frequency and speed
+//#define SWITCH_PIN PB2 // pin 17
+//#define SWITCH_PCINT PCINT10 // pin 17 pin change interrupt
+//#define SWITCH_PCIE PCIE1 // PCIE1 is for PCINT[11:8]
+//#define SWITCH_PCMSK PCMSK1 // PCMSK1 is for PCINT[11:8]
+//#define SWITCH_PORT PINB // PINA or PINB or PINC
+//#define PCINT_vect PCINT1_vect // ISR for PCINT[11:8]
+
#define SWITCH_PIN PA7 // pin 20
#define SWITCH_PCINT PCINT7 // pin 20 pin change interrupt
#define SWITCH_PCIE PCIE0 // PCIE0 is for PCINT[7:0]
@@ -143,6 +150,8 @@ inline void hwdef_setup() {
PWM1_TOP = PWM_TOP;
// set up e-switch
+ ////PORTB = (1 << SWITCH_PIN); // TODO: configure PORTA / PORTB / PORTC?
+ //PUEB = (1 << SWITCH_PIN); // pull-up for e-switch
//PORTA = (1 << SWITCH_PIN); // TODO: configure PORTA / PORTB / PORTC?
PUEA = (1 << SWITCH_PIN); // pull-up for e-switch
SWITCH_PCMSK = (1 << SWITCH_PCINT); // enable pin change interrupt
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.