Re: PWM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


> Hi all,
>
> I'm trying to driver some modell servos on my AT91RM9200 devboard. For
> this, I need PWM. Can anyone give me some hint (or example code) on this?
>
> Thanks,
>
>         Tamas

How many servos are you looking to run at once?

You might be in luck, I wrote a piezo output device driver just this week
which gives you sysfs access to TIOA1 on the at91rm9200. My driver allows
you to alter the frequency (and play notes like 'A4' and 'C6'!) but it
keeps the PWM duty cycle at 50%. It's for 2.6.26.3. I'll happily share
this driver with you. It isn't finished, but it works.

I use the atmel_tclib to interface to the Timer Counter registers on the
at91rm9200.

See drivers/misc/atmel_tclib.c and drivers/clocksource/tcb_clksrc.c for
timer block usage, and include/linux/atmel_tc.h for API.

See drivers/misc/*-laptop.c for examples of a simple driver with a sysfs
interface.

It would be trivial to make my driver work for multiple outputs and
variable duty cycle.

In 2.6.27.7-at91 you might also look at the "PWM LEDs" interface.

drivers/leds/leds-atmel-pwm.c

or the backlight driver (as was suggested by Nick):

./drivers/video/backlight/atmel-pwm-bl.c

If you don't need to release "stable" kernel code ... there is also a
generic PWM lib which is currently being worked on by Bill Gatliff but I'm
not sure if it's working with the at91rm9200. Anyone?

Aras



______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php

[Linux ARM]     [Linux ARM MSM]     [Linux ARM Kernel]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

Add to Google Follow linuxarm on Twitter