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);
}