Disconnects when using uart to Teensy


#1

Hi folks,
I'm really struggling with disconnects when developing my Mongiloti synth. I connect my Teensy UART to the Axo UART in order to send Midi CC's. I use the script objects from extra_midi_io and it works very well. When it works that is. I use an XPS13 with Ubuntu 16.10 to develop on.

When going "live" or either uploading to flash, I'll get Generate Code complete, then a Disconnect Request a second later. To get Connected again I need to power cycle the Axo which means dropping the power supply AND disconnecting the USB (as it feeds it with a poor voltage).

Other points.
* The Teensy is powered from the Axo 5v bus
* The PSU is 7.5v 1.5A rated so plenty of juice.
* The Teensy is running the OLED i2c and Pots only.
* All other modules in the Mongiloti (Trellis, encoders) are disabled.

It's clearly something to do with the UART. The Teensy isn't sending anything but the serial is initialised. I'm assuming Axo doesn't like this when it uploads.


#2

I think it is the receiving thread that is not able to terminate.
Could you try modifying the loop() function in the extra midi input script into:
void loop(){
while(!sdGetWouldBlock(&SD2)) {
char ch = sdGet(&SD2);
MidiInByteHandler(ch);
}
}


#3

Thanks Johannes, that work's great. I now realise I have a similar issue at the Teensy end. If I go live with a patch, the Axo basically resets and the Teensy hangs and won't send midi. The only way to "dev good" is to flash to in Edit:ternal ram then power cycle, then test. Time to dig into the arduino Midi library to see if I can do something similar.

Ninja Edit: Think I'll just wire a power switch between the axo power bus and the Teensy. Job done.


#4

Hardware switch mongrol? Pffft!. What I would do is use the encoder button to send a Teensy restart if it's held down for 2 seconds. Win! and no embarrassing case opening to expose the dodgy innards.


#5

Did you do that restart button? Just came to my mind if i could send midi from axoloti built-in button via tx to teensy rx to trigger resetting teensy?

Sorry about the unreadable sentence :confused: