tgergo
Junior Member
Posts: 59
|
Post by tgergo on Feb 19, 2022 19:28:55 GMT
I started working on a gate generator firmware. The idea is to have multiple trigger inputs that affect 2 gate outputs. The first iteration has the following design goals: * input cv-b toggles gate on output m * input cv-c toggles gate on output s * input cv-d toggles both outputs
I have the following code so far.
#include "wonkystuffCommon.h"
volatile uint8_t clockHappenedB = 0; volatile uint8_t clockHappenedC = 0; volatile uint8_t clockHappenedD = 0;
// wsKnob1 (A0) PB5 PCINT5 // wsKnob2 (A1) PB2 PCINT2 // wsKnob3 (A3) PB3 PCINT3 // wsKnob4 (A2) PB4 PCINT4 // wsOut1 (PB1) m-out // wsOut2 (PB0) s-out
void setup(void) { GIMSK |= (1 << PCIE); PCMSK |= (1 << PCINT5); PCMSK |= (1 << PCINT2); PCMSK |= (1 << PCINT3); wsInit(); wsInitAudioLoop(); wsPinClear(wsOut1); wsPinClear(wsOut2); }
void loop(void) {}
void wsAudioLoop(void) { if (clockHappenedB) { wsToggleOutput(wsOut1); clockHappenedB = 0; } if (clockHappenedC) { wsToggleOutput(wsOut2); clockHappenedC = 0; } if (clockHappenedD) { wsToggleOutput(wsOut1); wsToggleOutput(wsOut2); clockHappenedD = 0; } }
ISR(PCINT0_vect) { if (PINB & _BV(PB5)) { clockHappenedB = 1; }
if (PINB & _BV(PB2)) { clockHappenedC = 1; }
if (PINB & _BV(PB3)) { clockHappenedD = 1; } }
Unfortunately all my attempts to upload it to the module failed so far. Feel free to try it for yourself. I would also appreciate feedback.
|
|
namke
wonkystuff
electronics and sound, what's not to like?!
Posts: 686
|
Post by namke on Feb 21, 2022 17:19:37 GMT
I started working on a gate generator firmware. The idea is to have multiple trigger inputs that affect 2 gate outputs. The first iteration has the following design goals: * input cv-b toggles gate on output m * input cv-c toggles gate on output s * input cv-d toggles both outputs Unfortunately all my attempts to upload it to the module failed so far. Feel free to try it for yourself. I would also appreciate feedback. Are you able to upload any new firmware to your board? As with most audio-data-storage mechanisms, there is always a bit of juggling of signal levels required when doing this… Once you have something working then stick with it! (I use the headphone output of my laptop with the volume at maximum)
|
|