Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Microcontrollers, Assembly Language and the like

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Microcontrollers, Assembly Language and the like

    Is there anyone here on the forum that has any experience with microcontrollers and assembly language and how it pertains to MIDI? If so, what would be the best forum to post up questions related to this subject?

    Reason being is I'm just starting to delve into the world of MIDI decoding circuits for switching and control purposes and don't really know where to start. I'm very new when it comes to any sort of programming (although I used to know a little bit of BASIC years ago).
    Jon Wilder
    Wilder Amplification

    Originally posted by m-fine
    I don't know about you, but I find it a LOT easier to change a capacitor than to actually learn how to play well
    Originally posted by JoeM
    I doubt if any of my favorite players even own a soldering iron.

  • #2
    I whimped out and use a software suite to code in BASIC and let it do the compiling for me. It might make larger/less efficient code, but I accepted long ago that I'm not a software engineer and that learning assembly was about 10x too much for me.

    This is what I use: MikroElektronika - Development tools, Compilers, Books
    I'm not sure if someone has worked out how to do MIDI with it.

    That said, I have seen MIDI solutions posted on the DIY Stompboxes forums. Like full source code and schematic.
    -Mike

    Comment


    • #3
      Well, I work with microcontrollers all the time, but I've never actually written a MIDI decoder. However, I know how you do it.

      MIDI is just serial data at 31250 baud. Most micros have a "UART"- an onboard piece of hardware for sending and receiving serial data. You just set it up appropriately and it can send and receive MIDI.

      The Arduino is one of the more accessible microcontroller setups for newbies, here is a short tutorial on how to do MIDI with it. Arduino - Midi

      As you can see there's no assembly language in sight. The Arduino environment has C++ wrappers for everything. Assembly is less and less common nowadays. As chips get more powerful, people waste machine time to save human time by doing everything in C.

      In my last job, I designed about a dozen products based on PICs and DSPs running assembler, but I realised I had to get out before I went crazy. Switching to C/C++ didn't help: it's 5 times easier, but my new boss just asks me to do 5 times as much, and my brain feels as fried as ever.
      "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

      Comment


      • #4
        Well I've gotten pretty familiar with PIC assembly. Currently working on a MIDI decoder for guitar amp channel switching/solo select/FX loop select that is able to "learn/recall". I've currently gotten it to learn the assigned MIDI channel and am working on writing the source code to make it learn preset change combinations as well as learn CC on/off messages and mapping them to the front panel switches.

        Will keep you all posted. This stuff is actually more fun than I realized.
        Jon Wilder
        Wilder Amplification

        Originally posted by m-fine
        I don't know about you, but I find it a LOT easier to change a capacitor than to actually learn how to play well
        Originally posted by JoeM
        I doubt if any of my favorite players even own a soldering iron.

        Comment


        • #5
          Well done Jon! I guess analog electronics was too easy for you
          "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

          Comment


          • #6
            Originally posted by Steve Conner View Post
            Well done Jon! I guess analog electronics was too easy for you
            HA! Nah I've been a big fan of MIDI since 2005 and have always wanted to make analogue devices MIDI compatible.

            As I'm going through coding I'm finding ways to optimise it and get it "tight"...which is the time consuming part.
            Jon Wilder
            Wilder Amplification

            Originally posted by m-fine
            I don't know about you, but I find it a LOT easier to change a capacitor than to actually learn how to play well
            Originally posted by JoeM
            I doubt if any of my favorite players even own a soldering iron.

            Comment


            • #7
              Originally posted by Wilder Amplification View Post
              As I'm going through coding I'm finding ways to optimise it and get it "tight"...which is the time consuming part.
              How optimal and tight does it need to be? Does it matter if your amp changes patches in 100 microseconds rather than 10? I've always been a fan of "just make it work" and only spend time optimizing if any performance problems actually turn up in use.

              The biggest reason for "tightness" might be the limited RAM on PICs. The last one I used had only 256 bytes.

              When you're working in assembler, you'll be amazed how much you can get done in the time between energizing a relay coil and the contacts actually closing. (You can execute something like 10,000 instructions on yer average PIC. )
              "Enzo, I see that you replied parasitic oscillations. Is that a hypothesis? Or is that your amazing metal band I should check out?"

              Comment


              • #8
                Originally posted by Steve Conner View Post
                How optimal and tight does it need to be? Does it matter if your amp changes patches in 100 microseconds rather than 10? I've always been a fan of "just make it work" and only spend time optimizing if any performance problems actually turn up in use.

                The biggest reason for "tightness" might be the limited RAM on PICs. The last one I used had only 256 bytes.

                When you're working in assembler, you'll be amazed how much you can get done in the time between energizing a relay coil and the contacts actually closing. (You can execute something like 10,000 instructions on yer average PIC. )
                For me it's more of a thing to "learn" how to tighten up the code. Wouldn't wanna be labeled as a "sloppy programmer" ya know.

                On the PIC I'm using the program ROM is 2048 x 14 while the data EEPROM is 128 x 8 and the RAM is 224 x 8. The data EEPROM will be used to store the presets as well as the acceptable status byte variables (the channel nibble is variable on that one) and CC assignments. On start up the ROM is loaded into RAM and worked with from RAM, while the only time during the program that EEPROM is read/written is when you're storing presets. Preset recall is all done from RAM.

                Minimizing switching latency is also key.
                Jon Wilder
                Wilder Amplification

                Originally posted by m-fine
                I don't know about you, but I find it a LOT easier to change a capacitor than to actually learn how to play well
                Originally posted by JoeM
                I doubt if any of my favorite players even own a soldering iron.

                Comment

                Working...
                X