Comments (13)
Just a note that pi-blaster plays with the same CPU registers and the state modification is not bound by process lifetime. Sometimes resetting the state requires really cutting the power.
That said the implementation is still known to be buggy but should have worked. Will double check in the next days.
from periph.
That's some gorgeous success :)
from periph.
Nice ;-)
I did more tests and find out we need to clear unnecessary ctl bits otherwise GPIO12 did not work after reboot.
I removed debug outputs and made a pull request.
from periph.
Did it print an error message? To work, you have to run it as root. Also I never tested having both loaded, as pi-blaster will also try to setup the PWM clock source.
There's also known bugs that the clock is not canceled correctly yet; https://periph.io/x/periph/host/bcm283x#pkg-note-bug
from periph.
Hi !
- No error messages (
err == nil
) - I noticed that
pi-blaster
and my own code can conflict, I tried both separately after clean reboots. Whenever I startedpi-blaster
, I started it as not deamon (-D
) so that I could stop it.
I am using the latest Stretch
(end of november) with a clean install.
from periph.
I also found current hardware PWM does not work. I found a few problems.
- PWM address map is broken. For example, pwmMemory.rng1 is offset by 4 bytes, we need a padding before it.
- Current configuration of dat1 looks strange.
I will send a pull request for 1.
I am using Pi B+.
Thanks,
from periph.
Still not working with a clean power-cycle and #169 merged
from periph.
Thanks for the report. Next window I have available to investigate at the earliest is tomorrow evening. Will report once I double checked what I messed up.
from periph.
Please try my pwm2 branch
https://github.com/simokawa/periph/tree/pwm2
or the patch
simokawa@9d5eacd
It also modifies rng/dat settings + verbose debugging and worked for me.
from periph.
Thanks! Will try to look at it tonight.
from periph.
@maruel @simokawa I can confirm it is working on the pwm2
branch:
package main
import (
"os"
"os/signal"
"time"
"periph.io/x/periph"
"periph.io/x/periph/conn/gpio"
"periph.io/x/periph/host/rpi"
)
func main() {
periph.Init()
p := rpi.P1_12 // GPIO18
pwm := p.(gpio.PinPWM)
c := make(chan os.Signal, 1)
signal.Notify(c, os.Interrupt)
t := time.NewTicker(100 * time.Millisecond)
defer t.Stop()
i := gpio.Duty(0)
step := gpio.Duty(2000)
for {
select {
case <-c:
return
case <-t.C:
pwm.PWM(i, 100*time.Microsecond)
i += step
if i > gpio.DutyMax || i < 0 {
step = -step
i += step
}
}
}
}
from periph.
Ok finally had time to confirm on the oscilloscope it works great, can you clean up the branch in preparation for merging?
from periph.
thanks guys!
from periph.
Related Issues (20)
- [Question] How do I set a pin to alt0? HOT 6
- All pins are exported during bcm283x Init HOT 3
- Support for firmata HOT 2
- gpio-read: bcm283x-gpio (GPIO7): pull cannot be used when subsystem gpiomem not initialized. HOT 21
- Go get fetches v3.4.0 if using go modules HOT 3
- Support for BME680 HOT 3
- Halt() does not unblock WaitForEdge() HOT 3
- Feature SSD1322 HOT 5
- mfrc522 constantly returns "IRQ error" after first read HOT 11
- spi to slow HOT 5
- onewire didnot work HOT 9
- Omega2: declare headers HOT 3
- Experimental serial package doesn't export essential func HOT 7
- Unable to set GPIO pin pull on Raspberry Pi 4 HOT 19
- MFRC522 hang on WaitForEdge HOT 2
- HX711: unstable readings and reading before data is ready HOT 2
- spi: rename MISO/MOSI to COPI/CIPO HOT 2
- I2C documentation not clear on read/write operation HOT 2
- MFRC522 - Problem reading Tag HOT 3
- pmem example code incorrect HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from periph.