Hi all:
In a project.it need Power on ,P06 LOW delay 10 secnod to High ,
I write code :
in
set_pad_functions
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_6, OUTPUT, PID_GPIO, false );
at while(1) In main_func ,
I add this
if(button_count<4){
button_count++;
if(4==button_count)
GPIO_SetActive( GPIO_PORT_0, GPIO_PIN_6 );
}
4 is Advertising times;
sleep mode is
/*Sleep modes*/
define CFG_EXT_SLEEP
#undef CFG_DEEP_SLEEP
P06 pin is not connect anything,but ,the P06 high is not output,Why?
I am a fresh,Can you help me?
Keywords:
Hello huangliangyu,
I think you shouldn't touch the
main_func
inarch_main.c. Try instead modifying your project fileapp_project_name_proj.c.For buttons you should use interrupts. To detect a button press, use function
GPIO_RegisterCallback
and thenGPIO_EnableIRQ
Is this the same issue as you described here:http://support.dialog-semiconductor.com/use-p06-input-gpiothen-used-p06-...
Can you describe your problem more?
thank you VesaN.
I can brief describe my meaning.
ah,I intended to detected time from power on,after power on 10 second,then output P06 high.
so
in void GPIO_reservations(void);I set
RESERVE_GPIO( LED, GPIO_PORT_0, GPIO_PIN_6, PID_GPIO); //for reserve p06
in void set_pad_functions(void) ;I set
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_6, OUTPUT, PID_GPIO, false ); // for set p06 GPIO and set low ,
in void app_adv_func(struct gapm_start_advertise_cmd *cmd);i set
app_timer_set(APP_MY_TIME_MSG, TASK_APP, 1000); //app_time_set task for 10 second
in APP_MY_TIME_MSG's app_my_timer_handler;i set
GPIO_SetActive(GPIO_PORT_0, GPIO_PIN_6); //SET P06 high
return (KE_MSG_CONSUMED);
它可以运行在董事会,但P06高是拉斯维加斯t 3 second,then it is become low.
why this happen.
THS.
Hi Dialog,
Can you give you help to me?
Thanks.
Sounds strange to me, P06 should be initially low..
Ah,yes,
in
set_pad_functions
I,write:
GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_6, OUTPUT, PID_GPIO, false );
I do not know,why? Can you tell me ?
Hello YuanhangWu,
is the problem that P06 is set to high after 3 seconds, not after 10 seconds?
I have solve It. In set_pad_functions(),this IO pin should be set.
VesaN and YuanhangWu
thanks for you help.