Rx on Arduino Micro with MultiWii?

Post Reply
Posts: 1
Joined: Sat Apr 04, 2015 10:14 am

Rx on Arduino Micro with MultiWii?

Post by epf »

I've got an Arduino Micro (pictured below) that I'd been planning to use as a flight controller with MultiWii. I managed to get a GY-521 accelerometer + gyro working with it, and it shows up and functions perfectly in MultiWii Config. I figured this would be the hardest part, since hooking it up was a bit weird (was hard to figure out that the Micro uses pins D2 + D3 for I2C instead of the usual A4 and A5), but I can't for the life of me get my receiver channels to show up in MultiWii Config.

I've verified that my receiver is working by hooking it up directly to my ESC and spinning my motors. I've verified that I'm getting a good signal to my Arduino Micro by writing a sketch that accumulates the input on an input pin, hooking my throttle Rx up to that pin, and printing the result. This gives me a predictable range of low->high values, as it should, since I'm accumulating PWM. I even used my Arduino as an oscilloscope with Processing to verify that there wasn't some weird voltage drift going on. Everything looks perfect.

So why can't MultiWii see my throttle? Clearly the signal is getting to my Arduino just fine. To be honest, I'm not really even sure what pin I should be hooking up my Rx signal wire to. It seems like there's some overlap between the I2C pins and the Rx pins. (pin D2 should be throttle, but I need it for I2C?) Even still, from what I can tell from the MultiWii source, Yaw should be pin D4, and yet I get no response in MultiWii Config when I hook a known-good Rx channel up to that pin. Or any pin, for that matter. I've tried all of them at this point.

What's going on? Is this some weird bus thing? I was under the impression that the I/O on the Arduino went straight from the CPU to the pins. The Micro uses the ATmega32u4. It seems like this should just work, or I at least should see something happening in MultiWii Config when I hook up my Rx to random pins and fiddle with my Tx.

What gives? Any ideas?



Posts: 532
Joined: Fri Jan 04, 2013 10:06 am

Re: Rx on Arduino Micro with MultiWii?

Post by QuadBow »

epf wrote:It seems like there's some overlap between the I2C pins and the Rx pins.
Indeed, it is confusing. Pin PD0 and PD1 are used for I2C and they are called D2 and D3. But, they don't have anything to do with the receiver inputs, since those pins are attached to PORTB (e.g. PB3 for throttle). The sequence of RX pins depends on the definition A32U4ALLPINS as the code reveals:

Code: Select all

  #define THROTTLEPIN                  3
  #if defined(A32U4ALLPINS)
    #define ROLLPIN                    6
    #define PITCHPIN                   2
    #define YAWPIN                     4
    #define AUX1PIN                    5
    #define ROLLPIN                    4
    #define PITCHPIN                   5
    #define YAWPIN                     2
    #define AUX1PIN                    6
  #define AUX2PIN                      7
  #define AUX3PIN                      1 // unused
  #define AUX4PIN                      0 // unused

Just try again with the pin mapping of http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf !

Posts: 2
Joined: Sat Apr 30, 2016 12:39 pm

Re: Rx on Arduino Micro with MultiWii?

Post by manzurmurshid »

Any Update on Arduino Micro MWC. Can anyone suggest what should be the connection diagram or do i need to change anything from the code for RX to work properly

Post Reply