Go to advanced search

by joan
Sun May 27, 2018 7:41 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI For MCP3008, Without GPL License
Replies: 2
Views: 61

Re: SPI For MCP3008, Without GPL License

What language? If C then why not just read/write directly to /dev/spidev0.0 etc? That could be done without needing to use GPL.
by joan
Sat May 26, 2018 3:08 pm
Forum: C/C++
Topic: ALT0 and SPI
Replies: 2
Views: 76

Re: ALT0 and SPI

Each GPIO may be independently in one of 8 modes: INPUT, OUTPUT, ALT0, ALT1, ALT2, ALT3, ALT4, ALT5, or ALT6. A GPIO can only be in one mode at any one time.

If a GPIO needs to be in ALT0 to act as SPI then the hardware will handle whether it is read or write.
by joan
Fri May 25, 2018 2:44 pm
Forum: Automation, sensing and robotics
Topic: Sensing 50Hz frequency deviation fast
Replies: 12
Views: 257

Re: Sensing 50Hz frequency deviation fast

It only takes a few seconds to see if pigpio can accurately time the pulses. Download http://abyz.me.uk/rpi/pigpio/examples.html#Python_monitor_py which is a Python script which just prints GPIO callbacks. (monitor.py). If you don't have a 50Hz source use the hardware PWM peripheral to generate a 50...
by joan
Fri May 25, 2018 7:06 am
Forum: C/C++
Topic: PWM and Servo Kernel Module
Replies: 4
Views: 139

Re: PWM and Servo Kernel Module

Can't help with that. Haven't used the kernel module and you can read the wiringPi documentation as well as I can.

If the servo stopped that rather suggests it is either wired incorrectly or it isn't a servo or you think you have a continuous rotation servo when you actually have a normal servo.
by joan
Thu May 24, 2018 4:49 pm
Forum: C/C++
Topic: PWM and Servo Kernel Module
Replies: 4
Views: 139

Re: PWM and Servo Kernel Module

What is the problem? It doesn't get much simpler than http://abyz.me.uk/rpi/pigpio/examples.html#C_servo_demo
by joan
Thu May 24, 2018 11:19 am
Forum: Automation, sensing and robotics
Topic: Sensing 50Hz frequency deviation fast
Replies: 12
Views: 257

Re: Sensing 50Hz frequency deviation fast

If you can get the signal to pulse a Pi GPIO then pigpio will be able to measure the pulse gap to within 10µs or so.

http://abyz.me.uk/rpi/pigpio/index.html
by joan
Thu May 24, 2018 7:54 am
Forum: Beginners
Topic: More question about GPIO on servo
Replies: 4
Views: 117

Re: More question about GPIO on servo

You need at least hardware timed PWM for proper control of servos. pigpio, servoblaster, and RPIO.GPIO provide hardware timed PWM. Note, RPIO.GPIO is not the same as RPi.GPIO which only provides software timed PWM. pigpio also supports the hardware PWM GPIO (GPIO 12/13/18/19 on a Pi with the 40-pin ...
by joan
Wed May 23, 2018 7:37 pm
Forum: Beginners
Topic: More question about GPIO on servo
Replies: 4
Views: 117

Re: More question about GPIO on servo

RPi.GPIO has no support for hardware PWM. It allows software PWM on all GPIO.
by joan
Wed May 23, 2018 7:29 am
Forum: Advanced users
Topic: PWM + AUDIO
Replies: 2
Views: 128

Re: PWM + AUDIO

RPIO is probably using the hardware PWM peripheral to time its PWM pulses. This will conflict with using the hardware PWM peripheral to generate audio.
by joan
Tue May 22, 2018 2:26 pm
Forum: Beginners
Topic: Why do I need wiringpi?
Replies: 4
Views: 143

Re: Why do it need wiringpi?

RPi.GPIO only supports software timed PWM. The timing jitter will make the servo twitch (unless you have a very poor quality servo) and probably make it hot as it constantly adjusts position and will shorten its lifetime. Servoblaster and pigpio etc. use hardware timed PWM which have much less jitter.
by joan
Tue May 22, 2018 1:08 pm
Forum: Beginners
Topic: Why do I need wiringpi?
Replies: 4
Views: 143

Re: Why do it need wiringpi?

The linked article is out of date. What it says may have been correct at the time the article was written but it is irrelevant today.

There are better choices to drive servos on the Pi now, e.g. servoblaster or my pigpio. They can provide the needed pulses on all GPIO, rather than just GPIO #18.
by joan
Tue May 22, 2018 7:11 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How many samples per second,can get with ADC
Replies: 2
Views: 153

Re: How many samples per second,can get with ADC

Find the number of bytes per message.

The maximum samples will be 400000 / ( (bytes+1) * 9 )

Expect half that rate in practice.
by joan
Mon May 21, 2018 9:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI: How many bytes were sent?
Replies: 7
Views: 220

Re: SPI: How many bytes were sent?

Something like an Arduino Pro Mini should be fine. I think they can be run at 3V3 which simplifies interfacing with the Pi.
by joan
Mon May 21, 2018 9:12 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI: How many bytes were sent?
Replies: 7
Views: 220

Re: SPI: How many bytes were sent?

The Pi SPI hardware peripherals (main and auxiliary) only support being the master, i.e. you can not use it for Pi to Pi communications. The Pi does have a hardware peripheral which is meant to allow a SPI slave (called BSC) but I'm not aware of anyone getting it to work (I tried and failed). See ht...
by joan
Sat May 19, 2018 8:06 am
Forum: C/C++
Topic: Increase GPIO toggle frequency
Replies: 24
Views: 656

Re: Increase GPIO toggle frequency

There must be dozens of examples of interfacing with those registers.

Here is a small example of mine.

http://abyz.me.uk/rpi/pigpio/examples.h ... nimal_gpio
by joan
Thu May 17, 2018 10:53 am
Forum: C/C++
Topic: New linux GPIO (C++/C) poll Interrupt problem
Replies: 3
Views: 166

Re: New linux GPIO (C++/C) poll Interrupt problem

It's a well known problem with mechanical switches. Look up debounce, e.g.

http://www.labbookpages.co.uk/electronics/debounce.html
by joan
Thu May 17, 2018 9:16 am
Forum: Troubleshooting
Topic: All pins fried, don't know why
Replies: 24
Views: 604

Re: All pins fried, don't know why

The damage could have been done weeks ago in a moment of inattention. My understanding is that it spreads like a virus from the point of infection, no idea why.
by joan
Wed May 16, 2018 2:59 pm
Forum: Troubleshooting
Topic: All pins fried, don't know why
Replies: 24
Views: 604

Re: All pins fried, don't know why

As @B.Goode says a likely possibility is that RX (pin 10, GPIO 15) received more than 3V3 for a sustained period. What is connected to the serial link?
by joan
Wed May 16, 2018 7:27 am
Forum: Automation, sensing and robotics
Topic: monitoring rotary encoder on fast motor with pigpio - improving performance?
Replies: 14
Views: 382

Re: monitoring rotary encoder on fast motor with pigpio - improving performance?

My take is finding ways of doing things on the Pi without having to resort to additional hardware is a win win situation. The person doing the development learns a lot and it lowers the entry cost for everyone else wanting to experiment in the area - they may not need to spend money and time buying ...
by joan
Tue May 15, 2018 2:15 pm
Forum: Beginners
Topic: Changing PIGPIO SPI timing
Replies: 2
Views: 73

Re: Changing PIGPIO SPI timing

pigpio uses the SPI hardware for all timings. The only control you have is in setting the bit rate (bits per second transferred between the Pi and the SPI device). I think it would be exceptional if any of the timings on that diagram were configurable. I guess that diagram is intended for hardware e...
by joan
Tue May 15, 2018 12:30 pm
Forum: Automation, sensing and robotics
Topic: monitoring rotary encoder on fast motor with pigpio - improving performance?
Replies: 14
Views: 382

Re: monitoring rotary encoder on fast motor with pigpio - improving performance?

The bottleneck will be the Python callback processing code. It's not big, perhaps 20 or 30 lines of code but it's all Python and takes time. Doing the same with the C pigpiod_if2 interface might be hundreds of times faster for that code. I suspected the first bit, but even ten times faster would be...
by joan
Tue May 15, 2018 9:41 am
Forum: Automation, sensing and robotics
Topic: monitoring rotary encoder on fast motor with pigpio - improving performance?
Replies: 14
Views: 382

Re: monitoring rotary encoder on fast motor with pigpio - improving performance?

The bottleneck will be the Python callback processing code. It's not big, perhaps 20 or 30 lines of code but it's all Python and takes time.

Doing the same with the C pigpiod_if2 interface might be hundreds of times faster for that code.
by joan
Sun May 13, 2018 7:11 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Need true SPI device with datasheet
Replies: 1
Views: 105

Re: Need true SPI device with datasheet

Have a look at a SPI based ADC such as the MCP3202 or MCP3008. They will give a useful introduction to SPI, have good datasheets, and plenty of available software if the datasheet proves incomprehensible.
by joan
Sun May 13, 2018 7:06 am
Forum: Advanced users
Topic: Load Sensor HX711
Replies: 3
Views: 129

Re: Load Sensor HX711

It's not a particularly easy sensor to read reliably (because of some strict timing requirements which are hard for the Pi to meet from Linux). Try this example to see if it gives repeatable results (you will have to interpret any results yourself). http://abyz.me.uk/rpi/pigpio/examples.html#Python_...

Go to advanced search