Custom Wakeup Buttons

Started by lavanyasubbu, August 19, 2013, 01:47:48 PM

Previous topic - Next topic

lavanyasubbu

Team,
Newbie question.I have worked with other boards where I have had the luxury of adding my own android buttons to the board. I like doing it because it helps me place the buttons where ever I want and can also make it "sturdy" for rough use

I see A20 Olinuxnio already has android buttons attached to LRADC. CAn i also connect my own some other way? Is there a LRADC2

sanzoghenzo

Hi lavanyasubbu,
you can use the GPIO-4 (in my rev. C board is labeled GPIO-1) connector. As you can see here the pins you need are:
6: vol+
8: vol-
10: menu
12: search
14: home
16: esc
18: enter
and of course the ground pins, 2 and 4.

Have fun!

lavanyasubbu

thanks a bunch for you reply.
Final question (hopefully) :)
Can you tell me how I can get a wakeup button in case this is going to be used in a "tablet-like" environment so (obviously) use it to wake up from power-save/sleep



Tom

Is there also a power button on the gpio connectors, i cant find it. Does it matter which ground pin i use ?

Tom

granite_crusher

I do not have A20, but it looks card have same AXP209 power unit as in A13 cards. As I checked schematics it looks the pins on GPIO-2: NMI_N and RESET_N are for power_on/off and reset. I use these on A13 (shorting one ore other with ground). However I am not sure if resistor should be inserted in this power button circuits? I didn't found answer.
If all ground pins are uninterruptedly connected together, it should be no difference which ground pin to use.

jess

Quote from: granite_crusher on August 22, 2013, 01:53:27 PM
... it looks the pins on GPIO-2: NMI_N and RESET_N are for power_on/off and reset. I use these on A13 (shorting one ore other with ground).

Where did you find the info on NMI_N and RESET_N acting as Power ON/OFF and Reset?


granite_crusher

well these are probably hardware reset and on/off, and they are described in AXP209 manual. RESET_N is self explanatory. NMI_N is interrupt pin, for example RTC (real time clock) is attached to same pin, and can wake up system from sleep or power on, however NMI_N and RESET_N is not connected to same pins on AXP209 as power and reset buttons. I don't know how it is on android, but on debian if xfce/e17 is running it recognises power button and brings up logout/poweroff window/ asks for permission, however it doesn't react to NMI_N shorted for few seconds (both NMI_N and power button holding down for 10 sec will make board hardware off with no shutdown) how ever using both after shuting down - both do it same. RESET_N and reset button resets my debian system with hard reset without asking permission.

jess

#7
So you completely bypass AXP209 and force the cpu instead to start running by using its NMI_N instead of Power UP button, correct?

I'll try it on my A13 Android board and see how it works :)
I guess the AXP209 needs 6 seconds (OFFLEVEL time default) for the complete shutdown without asking.

granite_crusher

No, I do not bypass AXP209, because all: power, reset buttons, as pins NMI_N and RESET_N is connected to AXP209 just on different chip pins, and have slightly different behaviour. The curious thing is that software recognises/are informed by AXP209 when power button is pressed, and software do not react to NMI_N shorted (maybe AXP209 sends signal, but it is not implemented in software as power button press event. This needs some investigation. By the way AXP209 behaviour and manual (originally Chinese, with google translated English text only version) are very complicated (not counting these NMI_N and RESET_N there is additional 4 GPIO's: from which 2 (by olimex used just one) is for LCD control, and other two can work as interrupt, but they have to be programmed. Specification of AXP209 looks superb, but it needs stable serious software part to use all of its potential.

jess

I'm slowly (very slowly) plowing through that AXP209 info and use AXP202 pdf (english version) instead to get a better understanding of its functionality and such. Based on my observations so far I agree that it requires a better handling in software (not to mention a slightly better pdf translation :)


Tom

#10
I only need a power button, not the advanced functions. The same funcionality as the onboard power button. Is there any way ? Nmi_n does not do the same as the power button, which gpio does ? Or is there no way and i will have to desolder the power button and solder my own cables there ?
There is also nothing in the buttons section of the rev.d schematics. I only see there the esc, enter, vol +, vol -, menu, search, enter and recover buttons... I found the power button on the axp209 pin 47, but question is, do i need to solder there or is this pin also on one of the gpios ? Help please.

Tom

How did the other developers handle the power down/wakeup in linux ? The only possibility i see is to use a random gpio, connect a button there and read this one out and go to standby by software  if button pressed. Any other ideas ?

XFer

Sorry Tom, yours is a good question but I didn't need to look into this problem.
Once my system is finalized, I'll mount everything in ReadOnly and just switch on/off the power source.
As an alternative, I'd use a polled GPIO-connected button like you suggest. Better if IRQ-handled, but alas looks like we don't have GPIO IRQs yet (but they should be coming).

Fernando

Tom

Quote from: XFer on August 29, 2013, 12:18:52 PM
Sorry Tom, yours is a good question but I didn't need to look into this problem.
Once my system is finalized, I'll mount everything in ReadOnly and just switch on/off the power source.
As an alternative, I'd use a polled GPIO-connected button like you suggest. Better if IRQ-handled, but alas looks like we don't have GPIO IRQs yet (but they should be coming).

Fernando

Still thanks for respond. I had a hope, that perhaps there are ppl out there, who also need a standby/sleep button. If i use a full power up, linux with my program needs too long to boot up.
I also had a little hope, that perhaps someone from olimex could tell us more about this.
I wonder if i should switch over to android, perhaps the a20 is useable there, because in linux its useless at its current state.