Home/Support/Support Forum/Initial state of GPIO pins
New and improved user forum site going live on 12/6 (All users will need to reset their password when the new forum is active)
Welcome to Digi Forum, where you can ask questions and receive answers from other members of the community.

Initial state of GPIO pins

0 votes
Hi there.

I am coding a little remotecontrol solution based on the sample web-server. With the code I can change the state of some GPIO pins with http-form. So at this point I have three checkboxes and state of GPIO1-3 changes according to those.

Additionally I would like to have one _enable signal, so it wouldn't matter to the application if the server was rebooted or power-cycled / whatever. I have included this functionality to the code, but:

As the initial state of GPIO pins after reset is 1, this now somehow drives pins 4 and 5 down immediately before it starts to load application. So immediately when i get screen informing of IP settings and saying press any key in 5 seconds to modify these settings... pins 4 and 5 go down (and 1-3 stay high), why? Is there any place where I could change this behaviour?
asked Aug 2, 2004 in Plug N' Play by sijuma00 New to the Community (16 points)
recategorized Dec 19, 2013 by tuxembb

Please log in or register to answer this question.

3 Answers

0 votes
To add something:

I thought this behaviour could be caused because of the booleans to those three pins are presented in the web-page (and the fourth one wasn't). I did a test and added a similar checkbox and code for the GPIO4, and the "feature" stays. GPIO 1-3 are high, and 4&5 low. Already checked through reg_def.h, but there doesn't seem to be anything related to this.
answered Aug 3, 2004 by sijuma00 New to the Community (16 points)
0 votes
"Problem" seems to be there with every application I tried, so are those GPIO registers used to some threadx stuff / initialization during boot-up? I am interested is this a default behavior so can I count on it that those three pins are "1" at every bootup?)
answered Aug 9, 2004 by sijuma00 New to the Community (16 points)
0 votes
I guess i still continue this monologue :)

Problem solved. There is a line in src/bsp/platform/connectme/bsp.c which should setup the register with "current values", if I understood it correctly:

store->porta = narm_read_reg(NARM_PORTX_REG, NARM_PORTA_ADDR, data);

Anyway, even all of the GPIO pins were tied to pull-up, this didn't work :P Commented it out and replaced with my own register initialization which drives all GPIO pins to "1" and changes modes to output and now it works as expected.
answered Aug 9, 2004 by sijuma00 New to the Community (16 points)