Hi,
is it possibly to control one of the digital out pins with (software) pwm? I need to adjust the brightness on a LED. It should have a frequency greater then 100Hz (about 1000Hz would be really nice). I control the RP with the serial interface.
Thanks,
Chris
PWM on digital out
-
- Posts: 10
- Joined: Tue Sep 08, 2015 7:00 pm
Re: PWM on digital out
I have found that with the new version of Scope+generator, the generator allows additional output signal modes, and one of them is PWM.
Another matter is if there is a new console command that brings PWM out easily....
The latest 0.94 OS documentation seems that still is being written.
Another matter is if there is a new console command that brings PWM out easily....
The latest 0.94 OS documentation seems that still is being written.
-
- Posts: 3
- Joined: Mon Aug 03, 2015 10:27 am
Re: PWM on digital out
The generator console command only allow to control the FPGA-outputs. I want to use a boring digital pin (of the extension connector E1). The use of the fpga outputs is a little bit oversized, becaus I just want to control the brightness of a led.
Thank you,
Chris
Thank you,
Chris
-
- Posts: 1441
- Joined: Sat Jun 07, 2014 12:49 pm
- Location: Königswinter
Re: PWM on digital out
The monitor command line tool does probably not execute fast enough to use it for bash-pwm. Either you dedicate one of the auxiliary analog outputs to your led and configure it via monitor or you write a program that toggles a gpio pin yourself.
-
- Posts: 3
- Joined: Mon Aug 03, 2015 10:27 am
Re: PWM on digital out
I think you are right, the monitor tool is not fast enough. The timing is terrible...
I tried a Bash-Script like this:
while true
do
monitor 0x40000010 0x02 #Turn led on
usleep $timeOn #Wait
monitor 0x40000010 0x00 #Turn another led on and first off
usleep $timeOff #Wait
done
The timing was set so that it was 990µs off and 10µs on but it makes no difference when I set it so 10µs off and 990µs on...
Or had I done a misstake? Any other ideas? A control with the analog outputs is not possible (Voltage is not high enough).
I tried a Bash-Script like this:
while true
do
monitor 0x40000010 0x02 #Turn led on
usleep $timeOn #Wait
monitor 0x40000010 0x00 #Turn another led on and first off
usleep $timeOff #Wait
done
The timing was set so that it was 990µs off and 10µs on but it makes no difference when I set it so 10µs off and 990µs on...
Or had I done a misstake? Any other ideas? A control with the analog outputs is not possible (Voltage is not high enough).
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie
Who is online
Users browsing this forum: No registered users and 83 guests