Page 1 of 1

Generate a PWM signal with GPIO.

Posted: Fri Mar 13, 2015 12:34 pm
by GianlucaLaManna
Hello,
I'm a trainee to STMicroelectronics. We use the board SPC560P - DISP. How I can use the signal PWM with GPIO for (for example) to blink a led or to manage some servomotors? There is a full documentation? On site of ST there is a little information. There are the API?
I do not understand what port(GPIO) write and what should I use C functions.
I'm sorry, but I'm at the beginning.

Best regards
Gianluca.

Re: Generate a PWM signal with GPIO.

Posted: Fri Mar 13, 2015 12:49 pm
by Giovanni
Hi,

Have you tried the PWM demo included in SPC5Studio? there is a an example there, the API documentation is accessible by right clicking on the "Portable HAL" component, then look under the "Doc" submenu.

Giovanni

Re: Generate a PWM signal with GPIO.

Posted: Fri Mar 13, 2015 1:01 pm
by GianlucaLaManna
Yes I included this demo, but If I understand it that code writes PWM signals on the board for led D11. Ok I have found the doc. If I understand its operation I will close this thread.
Thank you very much.

Best regards
Gianluca.

Re: Generate a PWM signal with GPIO.

Posted: Fri Mar 13, 2015 3:52 pm
by GianlucaLaManna
Ok I understand where it exits the signal PWM. I used the test program ICU PWM. Do you know how take external inputs? I've read that you must use eTimer.
For example, if I wanted to turn on and off a LED external to the board via a software interface like and what can I send as input to the board?
Thanks.

Best regards
Gianluca.

Re: Generate a PWM signal with GPIO.

Posted: Fri Mar 13, 2015 5:34 pm
by Giovanni
What kind of external inputs? if you mean digital states on input pins then you have to use the PAL driver, palReadPad() reads the state of an input pin.

Giovanni

Re: Generate a PWM signal with GPIO.

Posted: Mon Mar 16, 2015 4:16 pm
by GianlucaLaManna
Ok, I have to manage some sensors (ultrasonic sensor). I must then process the signal taken from the sensors to send to another output signal.
Input and output.
Thanks.

Best regards
Gianluca

Re: Generate a PWM signal with GPIO.

Posted: Tue Mar 17, 2015 4:39 pm
by GianlucaLaManna
Sorry but I don't understand how to use the palReadPad(). Can I see a console for output? For example, I have a infrared sensor which provides output a number. Where can I see this number and which port and pad I have to use in the function palReadPad()? Which pin have to use on the board?
Sorry but I'm beginner.
Thanks.

Best regards
Gianluca.

Re: Generate a PWM signal with GPIO.

Posted: Tue Mar 17, 2015 4:43 pm
by Giovanni
palReadPad() returns the status of an input pin which can be zero or one.

I cannot answer to any other question until you provide details about the sensor, how it is connected and how you expect to use it.

Giovanni