Using the UART ports for MIDI - Baud Rate 31250

Discussion in 'UDOO X86' started by ingo, Jul 9, 2019.

  1. ingo

    ingo UDOOer

    Joined:
    Aug 21, 2018
    Messages:
    10
    Likes Received:
    3
    Hi,

    I'm trying to use the UART2 as a MIDI out on my X86 (CN15 Pin14 - TX). MIDI requires a baud rate of 31250 which does not exist as an option.

    I tried "init_uart_clock=2441406" and then "init_uart_baud=38400" on my Debian system.
    This should bring down the 38,400 baud rate to 31,250 (assuming that the standard uart clock is 3,000,000).
    I'm also using a level shifter to shift the 1.8V of the Brasswell to 5V for the MIDI standard and the usual 220R resistors. The same hardware setup (without level shifter) works with a arduino Micro or Leonardo where I can set the serial baud rate in the software to 31,250. Not so on the X86 UART.

    However, I had no success so far.
    Does anyone know if the "init_uart_clock=2441406" command is working either from the Linux console or a startup script or any config file (if yes, where in Debian 9.5?) with the X86?
    If not, does anyone know another method?

    I have already PCBs made with a connection to the UART2-TX and do not really want to change to the 101 or Leonardo for this reason. I know tis would be easy to do but requires replacing quite a few PCBs. Setting the UART baud rate to 31250 would be much easier for me.

    Thanks!
    Ingo
     
  2. evaloverde

    evaloverde Administrator Staff Member

    Joined:
    Apr 29, 2019
    Messages:
    236
    Likes Received:
    60
    Ciao Ingo,
    the post was invisible because every activity in this forum is closely monitored and new users need moderator approval to post and reply to topics.

    We used to have a huge spam problem, and if not for this filter, the problem would keep happening. Please be patient.
     
  3. ccs_hello

    ccs_hello UDOOer

    Joined:
    Apr 15, 2017
    Messages:
    536
    Likes Received:
    194
    These settings won't be applicable in the case that UART came from Intel Celeron N processor (from its PCH section.)
    See page 123: https://www.intel.com/content/dam/w.../pentium-celeron-n-series-datasheet-vol-1.pdf

    The DDS Divisor things seems to be a NDA type of config setting.
    The baud rate divisor (DLH and DLL), should be accessible from device driver level. Use value either 88 or 89 will get you close to 31250 baud.
     
    evaloverde likes this.
  4. ingo

    ingo UDOOer

    Joined:
    Aug 21, 2018
    Messages:
    10
    Likes Received:
    3
    Thank you, css_hello!

    How would I change the device driver? Isn't this a proprietary Intel driver?
     
  5. ccs_hello

    ccs_hello UDOOer

    Joined:
    Apr 15, 2017
    Messages:
    536
    Likes Received:
    194
    Extreme-hack the serial driver (find-n-replace the value in baud rate table, from the binary, of course.)

    Alternative is to write an Assembly program to alter DLH and DLL values.
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  7. ingo

    ingo UDOOer

    Joined:
    Aug 21, 2018
    Messages:
    10
    Likes Received:
    3
    Thanks, guys!

    The "Etreme-hack" of the serial driver is probably nothing for me ...

    I'll take a closer look at the link, waltervl.
    Seems to work for Linux.

    I already have an Arduino for the MIDI input that is set up as a MIDI Thru atm.
    However, it is also used for the I2C LCD display (coming from USB) and I'm afraid of MIDI timing issues.
    I might be able to get MIDI to interrupt the display data and have priority over the display data.
    This way timing might not suffer but it could get a bit complicated and requires headers for for all types of messages.
    I'll check all alternatives to see which works best.
     
  8. Emmnauel Oluga

    Emmnauel Oluga UDOOer

    Joined:
    Sep 25, 2019
    Messages:
    3
    Likes Received:
    0
    Thank you fpr this thread, I recently gor onto analog synthesizersand MIDI and I've been tryong to check for documentation on how to start and go about the whole process. I chose the UDOO as my board because of the x86 architecture. Are there any resources you could recommend. Thank you
     

Share This Page