Page 1 of 1

GPIO Speed

Posted: Tue Jun 03, 2014 8:58 am
by valver
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.

Re: GPIO Speed

Posted: Tue Jun 03, 2014 10:22 am
by croston
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/

Re: GPIO Speed

Posted: Tue Jun 03, 2014 6:46 pm
by valver
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

Re: GPIO Speed

Posted: Tue Jun 03, 2014 6:49 pm
by DougieLawson
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.