I want to improve my skills controlling the GPIO of a linux embedded board, is there a site for beginner or where can I start with basic programs like controlling a servo motor? do I need to create the driver or I can just create the program to control a servo?
I want to improve my skills controlling the GPIO of a linux embedded board, is there a site for beginner or where can I start with basic programs like controlling a servo motor?
Linux has a protected kernel, therefore you will most likely need to write a kernel driver to handle the low level interface with the GPIO pins. Also a kernel driver may already exist or the code for an existing driver could possibly be ported, however here again the exact development board and its MCU or processor will need to be know.
I'm using the Mini2440 S3C2440 ARM9 Board and also I had tried on the DM365 from TI, I was able to turn ON/OFF LEDs using this commands:
echo "1" > gpio32/value
echo "0" > gpio32/value
My next step would be controlling a RC servo, but from your information, I would need to write a driver, is there a guide line of how to write GPIO drivers? or as you said if there is a driver for it where I should look?
I'm using the Mini2440 S3C2440 ARM9 Board and also I had tried on the DM365 from TI, I was able to turn ON/OFF LEDs using this commands:
echo "1" > gpio32/value
echo "0" > gpio32/value
My next step would be controlling a RC servo, but from your information, I would need to write a driver, is there a guide line of how to write GPIO drivers? or as you said if there is a driver for it where I should look?
Maybe not. It appears you have low level access to the ports via the shell. Most servos require a PWM of 50Hz or 20ms period and a duty cycle ranging from 1ms to 2ms. You could attempt to write a C program generating a PWM at one of the GPIO pins, like you demonstrated with the LED.
Thanks BigDog, so my question is :
is there a site for beginner or where can I start with basic programs like controlling a servo motor using the GPIO?
Thanks, I already know how to control a servo with PIC, I just want to know how to do it with the GPIO in Linux I had previously wrote this basic program: