PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working!?

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working!?

Post by xoxota »

I'm using the HK_MultiWii_328P with a Spektrum Satellite receiver. When I enable the PILOTLAMP option and plug my pilot Lamp into D8 / VCC / GND , it just lays there, no lights, no sound. So my question is:

1) Am I doing it right?
2) Can I specify some other pin (such as any of the regular receiver pins, since I'm not using them).
3) How can I test to ensure my PilotLamp is working properly? I set RCOPTIONSBEEP to see if I could get some signal when I flip AUX1 or AUX2, but no joy.

xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by xoxota »

The BUZ pin on this board is connected to D9, and not D8 for some reason (design error?). I can't find where D8 comes out. Is there some way to configure which pin to use for BUZ within the multiwii code?

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by doughboy »

to use pin 9 instead of pin 8, look for these lines under PROMINI section in def.h

Code: Select all

        #define    PL_PIN_ON            PORTB |= 1;
        #define    PL_PIN_OFF           PORTB &= ~1;


and change to

Code: Select all

        #define    PL_PIN_ON            PORTB |= (1<<1);
        #define    PL_PIN_OFF           PORTB &= ~(1>>1);

xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by xoxota »

There's actually a section in config.h:

Code: Select all

  //#define BUZZERPIN_PINMODE          pinMode (A2, OUTPUT); // use A2 instead of d8
  //#define BUZZERPIN_ON               PORTC |= 1<<2 //PORTB |= 1;
  //#define BUZZERPIN_OFF              PORTC &= ~(1<<2); //PORTB &= ~1;


In general, it looks like PL_PIN_ON and PL_PIN_OFF are usually set to the same as BUZZER_PIN_[ON|OFF]. So I could use A2, I guess. Unfortunately, when I did this, my pilotlamp continued to lay there inert (no sound, no lights). I suspect I fried it somehow when I connected it to D8/D9 :-(

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by doughboy »

you will have to edit PL_PIN_ON and PL_PIN_OFF defines for it to work. using A2 will work as well. Make sure you modify the right PL_PIN define (under PROMINI).
I think it my previous instructions, I forgot to add the step to configure the pin for output. So you may just need to add pinMode(9,OUTPUT);

Unless you see your pilotlamp smoke or you stepped on it and completely crushed it, I don't see how it can be damaged. Make sure the wires to the servo connector are not disconnected. you can easily test it if you have an extra arduino by simply sending a pulse (digitalWrite(pin,HIGH);delayMicroseconds(100);digitalWrite(pin,LOW);) on the signal line that is 100us, 200us, etc. up to 800us long and see if the pilotlamp responds.
make sure it is getting sufficient power. I don't think it really requires a lot of power, but I connected mine to the ESC BEC.

xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by xoxota »

doughboy wrote:Unless you see your pilotlamp smoke or you stepped on it and completely crushed it, I don't see how it can be damaged. Make sure the wires to the servo connector are not disconnected. you can easily test it if you have an extra arduino by simply sending a pulse (digitalWrite(pin,HIGH);delayMicroseconds(100);digitalWrite(pin,LOW);) on the signal line that is 100us, 200us, etc. up to 800us long and see if the pilotlamp responds.
make sure it is getting sufficient power. I don't think it really requires a lot of power, but I connected mine to the ESC BEC.


Hey, thanks! I'll try that!

I also just got a digital multimeter, so I'm going to run some continuity checks on the rest of this HK board, and see if any other pins are wrongly connected...

xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by xoxota »

Thanks for your suggestion, Doughboy! Wrote a quick and dirty sketch to test each pilotlamp option (Red/Green/Blue/Beep), and everything worked fine. Discovered the reason it wasn't working (missing a couple of semicolons in my BUZZERPIN_ON and PL_PIN_ON defines).


...But dang, that PilotLamp buzzer is LOUD. Wonder if there's some way to put it into "silent" mode, so I can use the LED indicators, but not the buzzer....

doughboy
Posts: 252
Joined: Tue Sep 04, 2012 7:20 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by doughboy »

if you want to permanently not use the buzzer, then change in def.h

from this

Code: Select all

  #define    PL_BZR_ON    175    // 700us  
  #define    PL_BZR_OFF   200    // 800us


to this

Code: Select all

  #define    PL_BZR_ON    200    // force off  
  #define    PL_BZR_OFF   200    // 800us


I'd say the buzzer is quite useful, particularly for letting you know when the battery is low. You may not always see the lights, but you can always hear the buzzer.

xoxota
Posts: 37
Joined: Mon Aug 27, 2012 12:21 am

Re: PilotLamp + Spektrum Sat. + HK_MultiWii_328P not working

Post by xoxota »

Thanks! Do you by any chance have a reference for how to hack the PilotLamp signal? alarms.ino is not super readable for this, and I mostly stumbled across a couple of things through trial and error (setting varying pulse freqs at 50% duty cycle). So far, I've got something like (in microseconds):

Code: Select all

#define PL_GREEN   100;
#define PL_RED     200;
#define PL_BLUE    300;
#define PL_NIL_0   400; //nothing
#define PL_REDBLUE 500;  //Red + Blue?
#define PL_NIL_1   600; //nothing
#define PL_BUZZER  700;
#define PL_NIL_2   800; //nothing


I want to know how to, for example, turn on the red light and buzzer at the same time. I'm sure there's an API reference somewhere, but I've no idea where to find it. The XAircraft Wiki entry is not very helpful.

Post Reply