v-trigger?
Posted: Feb 28th, '15, 07:46
I need a v-trigger (positive voltage = active), since I use synthesizers from Yusynth and Music from Outer Space.
One option would be to use an inverting schmitt trigger on the Outputs, maybe with a small selection switch.
Another way woul look like this:
10k pulldown resistor needed on pin 1,2 and 20 of the atmega and a modification in the Trig_out() and setup() section:
setup(), modified:
But since I'm not good at bitmath I have no idea how to change the following code to trigger high instead of low.
I gues using the bitSet()/bitClear() command would be too slow, right?
Trig_out(), original:
I'm wondering, that so many people seem to use s-trigger.
One option would be to use an inverting schmitt trigger on the Outputs, maybe with a small selection switch.
Another way woul look like this:
10k pulldown resistor needed on pin 1,2 and 20 of the atmega and a modification in the Trig_out() and setup() section:
setup(), modified:
Code: Select all
...
DDRB |= B100;
DDRD |= 0;
...
I gues using the bitSet()/bitClear() command would be too slow, right?
Trig_out(), original:
Code: Select all
void Reset_Trig_Out()
{
PORTB &= ~((1<<1)|(1<<0));
PORTD &= ~(1<<6);
}
void Send_Trig_Out()
{
PORTB |= ((bitRead((inst_step_buffer[step_count][pattern_buffer])&(~inst_mute),14)<<0) | (bitRead((inst_step_buffer[step_count][pattern_buffer])&(~inst_mute),13)<<1));
PORTD |= (bitRead((inst_step_buffer[step_count][pattern_buffer])&(~inst_mute),12)<<6);
}
void Test_Trig_Out()
{
PORTB |= ((1<<1)|(1<<0));
PORTD |= (1<<6);
}
void Send_Trig_Out_Midi()
{
PORTB |= ((bitRead(inst_midi_buffer,14)<<0) | (bitRead(inst_midi_buffer,13)<<1));
PORTD |= (bitRead(inst_midi_buffer,12)<<6);
}