Sym32f303-discovery

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
alca
Posts: 5
Joined: Sat Jun 07, 2014 1:58 pm

Sym32f303-discovery

Post by alca »

hello to all

I have a question concerning the stm32f303-discovery
I would like to set up a motion sensor (PIR) with it
I would like to know how I can do and how do I enable pin input

thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Sym32f303-discovery

Post by Giovanni »

Hi,

In the file board.h there are the default settings of the I/O pins, by default all the unused pins are programmed as input with pull-up.

You may change the programming of a pin using palPadSetMode(), see the documentation of the PAL driver.

Giovanni
alca
Posts: 5
Joined: Sat Jun 07, 2014 1:58 pm

Re: Sym32f303-discovery

Post by alca »

sorry but I do not understand
board.h file to activate the input pin must remove the pullu-up?

and the documentation about pal drivers where can i take?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Sym32f303-discovery

Post by Giovanni »

alca wrote:board.h file to activate the input pin must remove the pullu-up?


Do you need the pull-up?

alca wrote:and the documentation about pal drivers where can i take?


In the documentation section, I will do the clicking for you, here: http://chibios.sourceforge.net/html/group___p_a_l.html

To generic questions I can only give generic answers, please be more specific.

Giovanni
alca
Posts: 5
Joined: Sat Jun 07, 2014 1:58 pm

Re: Sym32f303-discovery

Post by alca »

I apologize for the lack of clarity are not very practical about this tab

I would like to enable the pin an input to a motion sensor

I would like some sample code to configure this sensor and pin input

thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Sym32f303-discovery

Post by Giovanni »

Hi,

I don't know the sensor, what kind of connection does it have? if it is just an input pin, then any unused pin is already an enabled input.

Giovanni
alca
Posts: 5
Joined: Sat Jun 07, 2014 1:58 pm

Re: Sym32f303-discovery

Post by alca »

The sensor is :

Level Output detected: High (3.3V)
Level Output undetected Low (0 V)

thanks
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Sym32f303-discovery

Post by Giovanni »

Giovanni wrote:any unused pin is already an enabled input.


:) done, just connect your sensor and read the pin.

Giovanni
alca
Posts: 5
Joined: Sat Jun 07, 2014 1:58 pm

Re: Sym32f303-discovery

Post by alca »

I must use the funcion pwm o adc to configure the sensor?

thanks
Post Reply