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.
Generate a PWM signal with GPIO.
-
- Posts: 25
- Joined: Fri Mar 13, 2015 12:12 pm
- Location: Palermo, Italy
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Generate a PWM signal with GPIO.
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
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
-
- Posts: 25
- Joined: Fri Mar 13, 2015 12:12 pm
- Location: Palermo, Italy
Re: Generate a PWM signal with GPIO.
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.
Thank you very much.
Best regards
Gianluca.
-
- Posts: 25
- Joined: Fri Mar 13, 2015 12:12 pm
- Location: Palermo, Italy
Re: Generate a PWM signal with GPIO.
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.
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.
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Generate a PWM signal with GPIO.
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
Giovanni
-
- Posts: 25
- Joined: Fri Mar 13, 2015 12:12 pm
- Location: Palermo, Italy
Re: Generate a PWM signal with GPIO.
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
Input and output.
Thanks.
Best regards
Gianluca
-
- Posts: 25
- Joined: Fri Mar 13, 2015 12:12 pm
- Location: Palermo, Italy
Re: Generate a PWM signal with GPIO.
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.
Sorry but I'm beginner.
Thanks.
Best regards
Gianluca.
- Giovanni
- Site Admin
- Posts: 14563
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1111 times
- Been thanked: 937 times
- Contact:
Re: Generate a PWM signal with GPIO.
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
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
Who is online
Users browsing this forum: No registered users and 2 guests