This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Launchpad midi synth



Hello. I'm trying to get midi in via USART on a g2553 Launchpad. I seem to be getting 0x80, note off, but not note on. I've tried various baud/oversample settings to see if I'm just getting garbage, but I keep getting note off vs. nothing. I have a buffer for RXD input, so I hope data isn't still getting overwritten.

I'm a noob, sorry if there's just something simple I don't get.

void uart_init(void)
{
    uart_set_rx_isr_ptr(0L);

    P1SEL  = RXD + TXD;                       
      P1SEL2 = RXD + TXD;                       
      UCA0CTL1 |= UCSSEL_2 + ~UC7BIT;                     // SMCLK==4mhz
      UCA0BR0 = 32;                            //  DIVIDES SMCLK BY 32*16 = 31250  = MIDI SPEC w/UCOS16 oversample
      UCA0BR1 = 0;                              //
      UCA0MCTL =  ~UCBRS0 + UCOS16;// + ~UC7BIT ;                        // Modulation UCBRSx = 1
      UCA0CTL1 &= ~UCSWRST + ~UCMSB;                     // Initialize USCI state machine
      IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
}

thanks

  • Let's do a little "math".

    Do you know what is : 0x00 | (0x80 + ~0x10) ?

    ~0x10 is 0x7F

    (0x80 + 0x7F) is 0xFF

    0x00 | (0xFF) is 0xFF

    Do you want to chage UCA0CTL1 to 0xFF?

    You have: UCA0CTL1 |= UCSSEL_2 + ~UC7BIT; 



  • Ok, I see that error. I fixed that, but I still don't see the remaining prob. Been trying to tweak things and getting a little lost...

    void uart_init(void)
    {
        uart_set_rx_isr_ptr(0L);

        P1SEL  = RXD + TXD;                       
          P1SEL2 = RXD + TXD;                       
          UCA0CTL1 |= UCSSEL_2;                     // SMCLK==4mhz
          UCA0BR0 = 8;                            //  DIVIDES SMCLK  = 31250  = MIDI SPEC w/UCOS16 oversample
          UCA0BR1 = 0;                              //
          UCA0MCTL =   UCBRS0 + UCOS16;// + ~UC7BIT ;                        // Modulation UCBRSx = 1
          UCA0CTL1 &= ~UCSWRST;// + ~UCMSB;                     // Initialize USCI state machine
          IE2 |= UCA0RXIE;                          // Enable USCI_A0 RX interrupt
    }

  • I had the clock divider wrong also, fixed above. midi CC and note on going thru now....thx!

**Attention** This is a public forum