Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jun 2015 19:59:15 +0300
From:      Daniel Braniss <danny@cs.huji.ac.il>
To:        Luiz Otavio O Souza <lists.br@gmail.com>
Cc:        freebsd-arm <freeBSD-arm@freebsd.org>
Subject:   Re: pwm for raspberry pi?
Message-ID:  <DC13576F-D968-492C-B6F5-0578339A021D@cs.huji.ac.il>
In-Reply-To: <CAB=2f8zuMhPkwuuh-yNeMK1_iv3%2Bg3%2BXtXLZ-FyOmudBifsh0w@mail.gmail.com>
References:  <1FD1336E-D99F-4114-AD33-FBA1DF844E93@cs.huji.ac.il> <CAB=2f8wigyRaP9fXr6V=-%2BM9YZTE=2nzdj-AngD6m15zZFu1gQ@mail.gmail.com> <DB799EA8-3401-46F6-A4F5-79E5BE9743E2@cs.huji.ac.il> <CAB=2f8zuMhPkwuuh-yNeMK1_iv3%2Bg3%2BXtXLZ-FyOmudBifsh0w@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail


> On May 26, 2015, at 9:51 PM, Luiz Otavio O Souza <lists.br@gmail.com> wrote:
> 
> On 26 May 2015 at 03:13, Daniel Braniss wrote:
>> 
>>> On May 26, 2015, at 1:14 AM, Luiz Otavio O Souza wrote:
>>> 
>>> On 25 May 2015 at 07:52, Daniel Braniss wrote:
>>>> Hi,
>>>> Now that I’m rapping up my spi/rfid driver (available on demand :-),
>>>> I would like to use the pwm interface to power on/off a lock, but
>>>> have no idea how to go around it, so any clues would be mostly welcomed.
>>>> 
>>>> cheers,
>>>>       danny
>>> 
>>> The PWM module is quite simple and has only two outputs, they can be
>>> used only with recent 40 GPIO pins header (RPi-B+ or RPi2), in the
>>> older models only one output was wired.
>>> 
>> I do have a B+
>> 
>>> The bcm2835 peripherals datasheet describes the PWM module registers
>> 
>> I’ve read it, hence I know it’s possible, what I’ missing is how to access it via
>> FreeBSD. There is a some mention for the BeagleBoneBlack, but it seems
>> broken, the FDT mentions the pins. Too many leads but not enough info
>> on how to tie them up :-)
>> 
>> cheers,
>>        danny
> 
> There is no defined API to access PWM settings ATM, on beaglebone this
> is done with sysctls:
> 
> dev.am335x_pwm.2.dutyB: 0
> dev.am335x_pwm.2.dutyA: 0
> dev.am335x_pwm.2.period: 1000
> dev.am335x_pwm.2.freq: 100000
> dev.am335x_pwm.2.clkdiv: 1
> dev.am335x_pwm.2.%parent: simplebus0
> dev.am335x_pwm.2.%pnpinfo: name=pwm@48304000 compat=ti,am335x-pwm
> dev.am335x_pwm.2.%location:
> dev.am335x_pwm.2.%driver: am335x_pwm
> dev.am335x_pwm.2.%desc: AM335x PWM
> 
> There are 3 PWM modules, each one with two outputs controlled by dutyA
> and dutyB.
> 
> Here is the PWM code for beaglebone:
> https://svnweb.freebsd.org/base/head/sys/arm/ti/am335x/am335x_ehrpwm.c?view=markup <https://svnweb.freebsd.org/base/head/sys/arm/ti/am335x/am335x_ehrpwm.c?view=markup>;
> 

i see these under 10.1 but nothing under 11, what am I missing?
i tried with today’s current, and I see the modules being compile, the .dts seems ok
but no signes of am35x_pwm


> At some point I think I will expose PWM settings via gpioctl (and
> possibly add a gpiopwm for a software based pwm).
> 
> Regards,
> Luiz



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DC13576F-D968-492C-B6F5-0578339A021D>