Discussion:
[libopencm3-devel] force pull-down on stm32 f1 GPIO
j m
2013-04-23 09:31:27 UTC
Permalink
Hello, I use libopencm3 with f1 stm32 for paparazzi autopilot (luftboot).
I would like to force a pull-down resistor on PIN PA9.

I wanted to know how. If possible directly in libopencm3 file (gpio.h) for
example, or in the luftboot.c file where I call libopencm3 ?

thank you
Tomaž Šolc
2013-04-23 10:07:26 UTC
Permalink
Post by j m
Hello, I use libopencm3 with f1 stm32 for paparazzi autopilot
(luftboot). I would like to force a pull-down resistor on PIN PA9.
I wanted to know how. If possible directly in libopencm3 file
(gpio.h) for example, or in the luftboot.c file where I call
libopencm3 ?
You should add the following to the part of your code that initializes
GPIOs:

gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO9);
gpio_clear(GPIOA, GPIO9);

Best regards
Tomaž

- --
Tomaž Šolc, research assistant
SensorLab, Jožef Stefan Institute
http://sensorlab.ijs.si
mail: ***@ijs.si
blog: http://www.tablix.org/~avian/blog
j m
2013-04-23 11:43:19 UTC
Permalink
thank you for your answer, but this it is if I have an external pull-down
resistor, I want the software to activate a pull-down on the entrance, I
don't have external resistor.


thanks
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Post by j m
Hello, I use libopencm3 with f1 stm32 for paparazzi autopilot
(luftboot). I would like to force a pull-down resistor on PIN PA9.
I wanted to know how. If possible directly in libopencm3 file
(gpio.h) for example, or in the luftboot.c file where I call
libopencm3 ?
You should add the following to the part of your code that initializes
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO9);
gpio_clear(GPIOA, GPIO9);
Best regards
TomaÅŸ
- --
TomaÅŸ Å olc, research assistant
SensorLab, JoÅŸef Stefan Institute
http://sensorlab.ijs.si
blog: http://www.tablix.org/~avian/blog
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iQEcBAEBAgAGBQJRdl1eAAoJED848b3tOBsIJacIAL6eV3YASYHowhoiPJKukFx+
EQEU76OyJAE8W9md/89oFZomhfqI9iSGVtX5iIlxBsgkNaIGYGt0Y/v82u71CMsu
W6TfHPzS44W09nnVdb5sY4SnlifU4TEzd/Ir/z0bpGbf1KysbQw/VR+cMFFh4tAU
XssGe6QbYRxpgVxCWJae72b3HesRtKCiWZgtV6E9KUfftOdrpmyT/ueeP4TXWhHM
doJcn1WPNM8V67aRSxLLFJhRN0DtSzTsUy9OZv0cfsdr+G6yW5L0txHONFBrkWnZ
TUtXZD3PMiDGMzrOMHE2FP+k2iBDTVPgL//j0FiTrzmHhOwBitAsQCOtdbuCOlw=
=uRsD
-----END PGP SIGNATURE-----
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
libopencm3-devel mailing list
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
Tomaž Šolc
2013-04-23 11:51:52 UTC
Permalink
Post by j m
thank you for your answer, but this it is if I have an external
pull-down resistor, I want the software to activate a pull-down on
the entrance, I don't have external resistor.
No. These settings activate an internal, weak pull-down that is inside
the stm32f1 IC.

Best regards
Tomaž
Post by j m
Post by j m
Hello, I use libopencm3 with f1 stm32 for paparazzi autopilot
(luftboot). I would like to force a pull-down resistor on PIN
PA9.
I wanted to know how. If possible directly in libopencm3 file
(gpio.h) for example, or in the luftboot.c file where I call
libopencm3 ?
You should add the following to the part of your code that
gpio_set_mode(GPIOA, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN,
GPIO9); gpio_clear(GPIOA, GPIO9);
Best regards Tomaž
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
Post by j m
New Relic is the only SaaS-based application performance
monitoring service that delivers powerful full stack analytics.
Optimize and monitor your browser, app, & servers with just a few
lines of code. Try New Relic and get this awesome Nerd Life shirt!
http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________ libopencm3-devel
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
Post by j m
New Relic is the only SaaS-based application performance monitoring
service that delivers powerful full stack analytics. Optimize and
monitor your browser, app, & servers with just a few lines of code.
Try New Relic and get this awesome Nerd Life shirt!
http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________ libopencm3-devel
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel
- --
Tomaž Šolc, research assistant
SensorLab, Jožef Stefan Institute
http://sensorlab.ijs.si
mail: ***@ijs.si
blog: http://www.tablix.org/~avian/blog

Loading...