MultiWii 2.1 on ATMEGA2560 (HK board.. wrong pins?)

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
skoubri
Posts: 18
Joined: Sun Mar 03, 2013 1:24 pm

MultiWii 2.1 on ATMEGA2560 (HK board.. wrong pins?)

Post by skoubri »

Hi to all... first, a BIG THANKS to all developers out there who provide us their work!...

Trying my first multiwii system i bought the HK board (red one) and have spent many hours by reading and reading!


I want to enable BUZZER option and later some other extra features... BUT after many tries i figured out that the code should have problem with pin assignment on ATmega2560...

I really don't have ANY programming knowledge for this chip and i ask for HELP from anyone that can program this thing!!... I found in def.h section that the BUZZER pin assignment goes to pin 32 (if i understood well) which pin on ATmega2560 is GND!... Tried to change to pin 17 and port H but i am not sure...

Any help on how to map right the pins on this chip? Is there any tweaked version for 2560 that matches "perfectly" ?


Thanks in advance!!!

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: MultiWii 2.1 on ATMEGA2560 (HK board.. wrong pins?)

Post by thebgrian »

I have my buzzer working on pin 32, labeled "Cam Roll", you may have to build a buzzer driver as described here:
viewtopic.php?f=15&t=1491#p20252

Also below is the mapping between the pin names and the actual pin on the chip:

http://arduino.cc/en/Hacking/PinMapping2560

Acoording to it, Digital pin 32 matches chip pin 58.

skoubri
Posts: 18
Joined: Sun Mar 03, 2013 1:24 pm

Re: MultiWii 2.1 on ATMEGA2560 (HK board.. wrong pins?)

Post by skoubri »

Hi thanks for your answer.. real pin 32 on 2560 is GND actually!... Do you have the same board? (HK)

After many searching i managed to make it beep!!!! D8 output on HK Red board goes to 17 actual pin of 2560 so in def.h file the original part is this:

Code: Select all

  #define BUZZERPIN_PINMODE          pinMode (32, OUTPUT);
  #define BUZZERPIN_ON               PORTC |= 1<<5;
  #define BUZZERPIN_OFF              PORTC &= ~(1<<5);


Which i changed to this:

Code: Select all

  #define BUZZERPIN_PINMODE      DDRH |= (1<<5)    ;
  #define BUZZERPIN_ON               PORTH |= (1<<5);
  #define BUZZERPIN_OFF              PORTH &= ~(1<<5);


Pin 17 is in PORTH section and H5 specific port.. by using pinMode and using 17 didn't produce sound... had to use DDRx command... really don't know why as i have no programming skills on this!

Anyone could help if this code is ok except that it is working?!! I think that many functions missing from 2560 HK board due to pin assignments...

thebgrian
Posts: 47
Joined: Sun Mar 27, 2011 4:46 am

Re: MultiWii 2.1 on ATMEGA2560 (HK board.. wrong pins?)

Post by thebgrian »

I checked your board and it has different pins for camera pitch roll and trigger than mine. I have the blue board that HK doesn't sell any more, copy of Crius AIO v1, the pins are different and my previous post doesn't really help in your case :)
I'm glad that you have it working, unfortunately I'm not familiar with the programming to help with the code. Hopefully someone with experiences will advise...

Post Reply