Use P06 As input GPIO,Then used P06 as output GPIO. Can achieve this function?

9 posts / 0 new
Last post
huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
Use P06 As input GPIO,Then used P06 as output GPIO. Can achieve this function?

Hi all.

14580_01,
I used this function in a project,then I want to know this can achieve.

Use P06 As input GPIO,Check Poweron button push;Then if this High Level Electricity last 10 second, used P06 as output GPIO,output High Level Electricity for Transistor to complete broad Power on. Can achieve this function?

code :
/******************in void set_pad_functions(void) ***/

GPIO_ConfigurePin( GPIO_PORT_0, GPIO_PIN_6, INPUT, PID_GPIO, false );
************************end void set_pad_functions(void) ***/******/

/*********************in main()()*********/

if(button_count<4){
if(GPIO_GetPinStatus(GPIO_PORT_0, GPIO_PIN_6))
button_count++;
else
button_count=0;

if(button_count==4)
{
GPIO_ConfigurePin (GPIO_PORT_0 GPIO_PIN_6,输出, PID_GPIO, true);
GPIO_SetActive( GPIO_PORT_0, GPIO_PIN_6 );
}

/****************end in main()**/

Keywords:
huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
I am in testing Now

I am in testing Now

huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
I test it,but now cannot

I test it,but now cannot achieve this function。please help me!

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

Hello huangliangy,

try setting thebutton_count=0;inside theif(button_count==4)statement. Take the emptyelseaway

huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
Thanks VesaN,But is not solve

Thanks VesaN,But is not solve this problem。 But I Discoveried GPIO's high or low Electricity Level is change by Sleep and Advertiing change,is this right?

huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
Hi ,all:

Hi ,all:

Use P06 As input GPIO,Check Poweron button push;Then if this High Level Electricity last 10 second, used P06 as output GPIO,output High Level Electricity for Transistor to complete broad Power on.

Not achieve this function,Please help ,help please!

huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
Now I change this project.it

Now I change this project.it need Power on ,P06 LOW delay to High ,in

set_pad_functions
I set
GPIO_ConfigurePin (GPIO_PORT_0 GPIO_PIN_6,输出, 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 );
}

sleep mode is
/*Sleep modes*/
define CFG_EXT_SLEEP
#undef CFG_DEEP_SLEEP

the P06 high is not output,Why?

I am a fresh,Can you help me?

yassin.bennaceur
Offline
Last seen:5 years 6 months ago
Joined:2015-04-10 15:32
well ... I am doing nearly

well ... I am doing nearly the same thing but i am changing the input/output faster (each around 10 micro seconds) ? did you make this work ?

huangliangyu
Offline
Last seen:4 years 7 months ago
Joined:2014-12-26 09:24
I get it.the IO pin should be

I get it.the IO pin should be set high.

thank you for all help.