Devo10 device doesn't respond to key press(Fixed)

More
06 Oct 2012 01:37 - 07 Oct 2012 03:27 #2009 by suvsuv
I coded the main page for devo10, it works fine with emulator. However, after I had codes flashed to real devo10 devices, it doesn't respond to key press, e.g. the timer1 should start /stop when UP is pressed and should reset when Ext is pressed. In addition, the throttle value is not updated in the main page screen.

PB, could you please check out codes from the deviationfor6810 repo and help me figure out what is wrong with my codes?

BTW, there is a minor bug in devo10's tx_buttons.c , Line 46-47 should be as follows, PB, please let have it fixed in your main repo
gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO4 | GPIO5 | GPIO8 | GPIO9);
Last edit: 07 Oct 2012 03:27 by suvsuv.

Please Log in or Create an account to join the conversation.

More
06 Oct 2012 01:47 - 06 Oct 2012 01:50 #2010 by suvsuv
The main page is shown as below. Battery is updated properly and the tx can be power on/off, so the event-loop and GPIO is working in the real devo10 device

Attachments:
Last edit: 06 Oct 2012 01:50 by suvsuv.

Please Log in or Create an account to join the conversation.

More
06 Oct 2012 08:06 #2015 by suvsuv
After more test, I found only the buttons connected to PORTB.GPIO4(UP,DN and Ext) don't work, all other buttons work properly.

So I tried change codes related to B.4, I got no good result yet. Any idea from PB and xC?

And I have a question about why the B.5 pin should be set to 0 instead of setting to 1 as B.4/8/9

gpio_set_mode(GPIOB, GPIO_MODE_OUTPUT_50_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO4 | GPIO5 | GPIO8 | GPIO9);

/* PB.4 = 1, PB.5 = 0, PB.8 = 1, PB.9 = 1 */
gpio_set(GPIOB, GPIO4 | GPIO8 | GPIO9);
gpio_clear(GPIOB, GPIO5);

Please Log in or Create an account to join the conversation.

More
07 Oct 2012 03:18 #2019 by suvsuv
Finally got the issue solved, it is caused by conflicting with the SPI touch which uses the PB.5 pin as well. So the main() function should conditionally comment out functions related to SPI touch for devo10

void Init() {
....
CYRF_Initialize();
#ifdef PROTO_HAS_A7105
A7105_Initialize();
#endif
#if !defined(devo10) && !defined(emu_devo10)
SPITouch_Init(); // Comment out as conflicted with devo10's PB.5 connection(UP/DN/Ext key)
#endif
SOUND_Init();
...
}

void EventLoop()
{
...
if (CLOCK_getms() > next_scan) {
MIXER_CalcChannels();
BUTTON_Handler();
#if !defined(devo10) && !defined(emu_devo10)
TOUCH_Handler(); // Comment out as conflicted with devo10's PB.5 connection(UP/DN/Ext key)
#endif
PAGE_Event();
...
}

Please Log in or Create an account to join the conversation.

More
07 Oct 2012 03:23 - 07 Oct 2012 03:31 #2020 by suvsuv
Hi PB, please also modify the tx_button.c under the devo10 foloder to fix minor bug with GPIOB pins' assignment
Attachments:
Last edit: 07 Oct 2012 03:31 by suvsuv.

Please Log in or Create an account to join the conversation.

More
07 Oct 2012 10:08 #2023 by thloh85
Looks like u've made a lot of progress for Devo10. Thanks for the hard work... :)

Please Log in or Create an account to join the conversation.

Time to create page: 0.060 seconds
Powered by Kunena Forum