User avatar
valver
Posts: 137
Joined: Fri Mar 22, 2013 10:01 pm

GPIO Speed

Tue Jun 03, 2014 8:58 am

Hello,

What is te maximun switching speed of the GPIO ?

In loop:

Code: Select all

GPIO.output(17, 1)
timesleep(???)
GPIO.output(17, 0)
timesleep(???)
How can I use PWM?

Thanks in advance.

User avatar
croston
Posts: 706
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: GPIO Speed

Tue Jun 03, 2014 10:22 am

The maximum switching speed will depend on a lot of factors:
[*] The operating system you are using
[*] The language your code is written in
[*] Your code
[*] If there are any other processes using the same CPU resources
[*] Your electronics - too much capacitance at high frequencies and your waveform will end up clipped.

Here is how to use software PWM with RPi.GPIO:
http://sourceforge.net/p/raspberry-gpio ... /wiki/PWM/

User avatar
valver
Posts: 137
Joined: Fri Mar 22, 2013 10:01 pm

Re: GPIO Speed

Tue Jun 03, 2014 6:46 pm

Thanks for reply.

I would like to know the maximun and how to get it.

It is faster wicht: ?

[*] Raspian or Pidora or Arch ?
[*] Phyton or C ?
[*] You recommend not to use GUI? to increase speed?

Thanks again

User avatar
DougieLawson
Posts: 38826
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: GPIO Speed

Tue Jun 03, 2014 6:49 pm

valver wrote:
[*] Raspian or Pidora or Arch ?
[*] Phyton or C ?
[*] You recommend not to use GUI? to increase speed?
The OS distribution doesn't matter, it's all Linux on a 700MHz ARM6.

Python is interpreted, C is compiled to machine code. C is faster.

The X-windows & the GUI is a) a memory hog and b) a CPU hog if you can run without it you will gain some speed and memory.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “Beginners”