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

Thread: 8 MIDI outs, hardware

  1. #1
    Junior Member garcho's Avatar
    Join Date
    May 2020
    Location
    Richmond, VA
    Posts
    9

    8 MIDI outs, hardware

    I have a MIDI master clock ready to be built but for the final few pieces of the puzzle.

    If I have 8 UART outputs going to 8 MIDI jacks, should I buffer each with a pair of inverters? Or will a 47Ω resistor in series with each TX pin be sufficient protection for the Teensy? This is a one-off for my own use, so "good enough" is actually good enough. If the answer is "yes, you should buffer them", then I will follow up with a few more questions in a separate reply.

    Along with the UARTs, there is the 3V3 47Ω pull-up resistor for each MIDI out. If I have 8 MIDI outputs, that's 7mA each, for a total of 56mA, right? That leaves roughly 200mA left for the convertor to comfortably provide, yes? Is there anyway to guesstimate how much current my sketch will use? Am I safe assuming a MIDI clock sketch with a few LED/button functions is less than 200mA? Is there a better way to proved the power for the 5mA current loop than from the Teensy itself? I plan on using a 5V wall wart.

    There will be 8 LED-lit buttons triggered by Teensy GPIO pins but I have each going through a 4k7 resistor to the base of a 2N3904, so hopefully that's 0.7mA per pin and not something to be concerned with?

    There is also a 3V 16x2 RGB-on-black LCD display, with an I2C "backpack" (AVR ATMega328p). I'm not sure how to go about measuring total current draw but I could blindly guess and hope it's something like 30-50mA total, including backlight. I'm basically only using the blue LEDs, so it won't be like powering a flashlight or something. It's this particular model: https://www.sparkfun.com/products/14073. Like I said, I plan on powering it (and the Teensy) from an external 5V wall wart so I don't think it matters anyway. As far as the Teensy is concerned, it's only 2 more GPIO pins, right?

    Any thoughts, suggestions, answers, haikus?
    Thanks for your time!

  2. #2
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    I'd use 74HCT244 as an octal buffer - then you get the MIDI driven from 5V, and protect the Teensy in the process.
    Driving MIDI from 3.3V is pretty shaky as the Vf for optocouplers varies. MIDI draws current on average a lot less than 50%
    of the time, peaking around 50%, its not so bad.
    Use the standard MIDI circuit once at 5V, not the 47 ohms, don't forget...

  3. #3
    Junior Member garcho's Avatar
    Join Date
    May 2020
    Location
    Richmond, VA
    Posts
    9
    "I'd use 74HCT244 as an octal buffer"
    I'm not familiar with those. Would it be something like this:



    I am assuming I should not connect the Teensy pins directly to the buffer. What value of resistor should I use between the Teensy and the 74HCT244? After that it's just a matter of 220Ω to the DIN jack?

    Thanks for your time!

  4. #4
    Senior Member PaulS's Avatar
    Join Date
    Apr 2015
    Location
    Netherlands
    Posts
    277
    You don't need to use resistors between the Teensy outputs and the 74HCT244 inputs.
    The 220Ω seems OK according to the MIDI Org spec:

    Click image for larger version. 

Name:	Midi out.jpg 
Views:	13 
Size:	68.3 KB 
ID:	21244

    But you need to connect pins 1 & 19 of the 74HCT244 to GND as well to enable the outputs:

    Click image for larger version. 

Name:	74hct244.PNG 
Views:	6 
Size:	16.8 KB 
ID:	21245

    Paul

  5. #5
    Senior Member
    Join Date
    Mar 2016
    Posts
    202
    If you are laying out a board or doing point to point wiring, you might want to look at the 74HCT541 (or 74AHCT541). Basically the same logic but the '541 has all the inputs on one side of the package and all the outputs on the other side. Makes laying it out a snap. '244 on the left, '541 on the right. Only difference is the enables but you are likely to tie both to ground in either case.
    Click image for larger version. 

Name:	74ahct244.png 
Views:	3 
Size:	34.7 KB 
ID:	21252Click image for larger version. 

Name:	74ahct541.png 
Views:	3 
Size:	36.7 KB 
ID:	21253

  6. #6
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    I would have suggested the 74HCT245 if it was still available, due to its bussed pinout... I'd forgotten they'd done a
    bussed version of the 244.

    The 16 bit chips like the 74LVC16244 both bus the signal pinout and spread multiple supply and ground across them for
    low inductance, if you ever need more than 8 signals buffered they are worth checking out, I've used the 74LVC16374
    16-fold DQ latch before on a 2-layer board that was interfacing SDRAM...

  7. #7
    Senior Member
    Join Date
    Mar 2016
    Posts
    202
    The 74HCT245 (and 74AHCT245, too) is readily available from TI, Toshiba, ON and Nexperia.

  8. #8
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    Quote Originally Posted by PhilB View Post
    The 74HCT245 (and 74AHCT245, too) is readily available from TI, Toshiba, ON and Nexperia.
    Oh yes - there they are - perhaps the database was being updated over the weekend, I've seen this before with Farnell, or
    I made a typo in the search...

  9. #9
    Junior Member garcho's Avatar
    Join Date
    May 2020
    Location
    Richmond, VA
    Posts
    9
    Thanks for the suggestions y'all, I ordered some '541s. So, as long as OE1 and OE2 are held to ground, all inputs will be non-inverting buffers?

  10. #10
    Senior Member
    Join Date
    Jul 2020
    Posts
    348
    Quote Originally Posted by garcho View Post
    Thanks for the suggestions y'all, I ordered some '541s. So, as long as OE1 and OE2 are held to ground, all inputs will be non-inverting buffers?
    Yup. Or rather the outputs will be driven as buffered versions of the inputs...

  11. #11
    Senior Member
    Join Date
    Mar 2016
    Posts
    202
    As mark said,yup. Also make sure you get the T version (74AHCT541 or 74HCT541) as the HC and AHC versions won't work with 3.3V logic.

  12. #12
    Junior Member garcho's Avatar
    Join Date
    May 2020
    Location
    Richmond, VA
    Posts
    9
    I did indeed get the correct ICs. Thanks much for the advice, and thank you Mark for untying my tongue!

  13. #13
    Junior Member garcho's Avatar
    Join Date
    May 2020
    Location
    Richmond, VA
    Posts
    9
    works like a charm and made wiring a breeze, thanks again y'all

Tags for this Thread

Posting Permissions

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