Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: T4.1 Interrupts(?), analogRead, usbMIDI problems

Threaded View

  1. #1
    Senior Member
    Join Date
    Apr 2019
    Posts
    110

    T4.1 Interrupts(?), analogRead, usbMIDI problems

    Hello, sorry if any of this is vague. I can't immediately post all the code to demonstrate this as there is a lot that would need cutting down - I'm just looking for ideas of what the problem(s) may be.

    I'm moving my synth code from 3.6 (working fine) to 4.1 and plowing through the problems. The increase in processor speed meant thant the multiplexer code needed 50us delays before each analogRead(..). I'm getting problems with the USB MIDI (MIDI from the client USB on the Teensy), Serial and USB Host MIDI are fine. MUX reading is fine without usbMIDI. My loop() looks like this:

    Code:
    void loop() {
      myusb.Task();			//USB HOST MIDI Class Compliant
      midi1.read(midiChannel);  	//USB HOST MIDI Class Compliant
    //  usbMIDI.read(midiChannel); //USB Client MIDI
      MIDI.read(midiChannel);    	//Serial1 MIDI 5 Pin DIN
      checkMux(); 			//routine to check two 4067 MUXs with analogRead()
      checkSwitches();		//routine to check several switches with digitalReadFast()
      checkEncoder();		//Uses Teensy Encoder lib 
    }
    I'm using Serial + Audio + MIDI. When usbMIDI is included, I get random digital noise on USB Audio and the sound cuts every 8s for about a second, then continues. Everything is slow to respond. Commenting out the checkMux() stops this problem, but the digital noise persists.

    What do you think? Could this be problems with interrupts? Many thanks for your time.

    My connections to the Teensy 4.1 are like this (AB_... are connections to the Audio Board):
    Click image for larger version. 

Name:	SCH.jpg 
Views:	15 
Size:	281.9 KB 
ID:	21142
    Last edited by UHF; 07-27-2020 at 03:23 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •