8 posts / 0 new
Last post
huangliangyu
Offline
Last seen:4 years 7 months ago
加入:2014-12-26 09:24
P06 output

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:
p06
VesaN
Offline
Last seen:5 years 4 months ago
Guru Master
加入:2014-06-26 08:49
Hello huangliangyu,

Hello huangliangyu,

I think you shouldn't touch themain_funcinarch_main.c. Try instead modifying your project fileapp_project_name_proj.c.

For buttons you should use interrupts. To detect a button press, use functionGPIO_RegisterCallbackand 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?

huangliangyu
Offline
Last seen:4 years 7 months ago
加入:2014-12-26 09:24
thank you VesaN.

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.

YuanhangWu
Offline
Last seen:4 years 8 months ago
Expert
加入:2015-03-25 08:19
Hi Dialog,

Hi Dialog,
Can you give you help to me?

Thanks.

VesaN
Offline
Last seen:5 years 4 months ago
Guru Master
加入:2014-06-26 08:49
Sounds strange to me, P06

Sounds strange to me, P06 should be initially low..

YuanhangWu
Offline
Last seen:4 years 8 months ago
Expert
加入:2015-03-25 08:19
Ah,yes,

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 ?

VesaN
Offline
Last seen:5 years 4 months ago
Guru Master
加入:2014-06-26 08:49
Hello YuanhangWu,

Hello YuanhangWu,

is the problem that P06 is set to high after 3 seconds, not after 10 seconds?

huangliangyu
Offline
Last seen:4 years 7 months ago
加入:2014-12-26 09:24
I have solve It. In set_pad

I have solve It. In set_pad_functions(),this IO pin should be set.

VesaN and YuanhangWu
thanks for you help.