Hi,
I want to use a teensy 3.1 as midi serial receiver and send it to another serial port + modify messages, etc.
Anyway, I've setup this code to start and test the workings of this all:
the pins 0 and 1 have the proper hardware on them, optocoupler on IN port etc. The hardware works on the arduino uno on which I've set this up earlier.
The problem is that proper data is displayed on the pc but it takes about a second before it's output again. Taking out the Serial.write to disable local echo does not help. Setting 'local' Serial speed to faster 38400 also does not change this behavior. The Teensy 3.1 is set to 24MHz, 'Serial' mode.
What am I doing wrong? is the Teensy to fast or something?
UPDATE: Even the 'EchoBoth' example on the Teensy library has this extreme delay, Is there a configuration think I should know of?
I want to use a teensy 3.1 as midi serial receiver and send it to another serial port + modify messages, etc.
Anyway, I've setup this code to start and test the workings of this all:
Code:
void setup() {
pinMode(LED, OUTPUT);
digitalWrite(LED,HIGH);
// connected midi devices to pins labeled 0 and 1 on the bottom of the T3.1
Serial1.begin(31250);
// output for PC
Serial.begin(9600);
// stabilize
delay(100);
}
void loop() {
// anything in MIDI?
if (Serial1.available() > 0) {
incomingByte = Serial1.read();
// echo to PC
Serial.print(incomingByte,HEX);
// echo to midi hardware
Serial1.write(incomingByte);
}
}
The problem is that proper data is displayed on the pc but it takes about a second before it's output again. Taking out the Serial.write to disable local echo does not help. Setting 'local' Serial speed to faster 38400 also does not change this behavior. The Teensy 3.1 is set to 24MHz, 'Serial' mode.
What am I doing wrong? is the Teensy to fast or something?
UPDATE: Even the 'EchoBoth' example on the Teensy library has this extreme delay, Is there a configuration think I should know of?
Last edited: