Go to advanced search

by joan
Sat Jan 20, 2018 8:51 pm
Forum: C/C++
Topic: Hardware PWM Pin 32 and Pin 33 Question
Replies: 16
Views: 389

Re: Hardware PWM Pin 32 and Pin 33 Question

You can alter it anyway you want. I wouldn't be surprised if debounce was a bad choice of words on my part. There should be standard implementations. Perhaps try with and without the "debounce" to see which works better.
by joan
Sat Jan 20, 2018 8:28 am
Forum: Python
Topic: How to assign hysteresis/Schmitt trigger to an Input?
Replies: 7
Views: 180

Re: How to assign hysteresis/Schmitt trigger to an Input?

Yes they are in the same register (as indicated in the datasheet I linked). There is a corresponding gpioGetPad() function which could be modified to print out all the bits. I guess I probably checked the value of slew and hysteresis were both 1 when I tested but thereagain perhaps I didn't. It woul...
by joan
Sat Jan 20, 2018 8:16 am
Forum: Troubleshooting
Topic: SPI doesn't work on Rpi Zero W, Stretch
Replies: 16
Views: 289

Re: SPI doesn't work on Rpi Zero W, Stretch

Setting the GPIO high or low will set it to be in OUTPUT mode. The driver will not know and the SPI circuitry will no longer be connected to that GPIO (i.e. the SPI hardware is busy toggling the clock line but the clock line is no longer routed to the GPIO). The GPIO needs to be put back into ALT0 m...
by joan
Fri Jan 19, 2018 9:18 pm
Forum: Python
Topic: How to assign hysteresis/Schmitt trigger to an Input?
Replies: 7
Views: 180

Re: How to assign hysteresis/Schmitt trigger to an Input?

pigpio uses the following code to set the pad drive strength. The constant 0x18 sets the slew and hysteresis bits. Perhaps experiment by not setting one or both bits. int gpioSetPad(unsigned pad, unsigned padStrength) { DBG(DBG_USER, "pad=%d padStrength=%d", pad, padStrength); CHECK_INITED; if (pad ...
by joan
Fri Jan 19, 2018 5:00 pm
Forum: Other languages
Topic: Temperature and light controller in NodeJS - sensor reading slow
Replies: 9
Views: 235

Re: Temperature and light controller in NodeJS - sensor reading slow

What functions are causing the delays? You must be able to add timers to see where the delays are happening.
by joan
Fri Jan 19, 2018 4:18 pm
Forum: General discussion
Topic: Motor Control on my RaspberryPi 3
Replies: 7
Views: 136

Re: Motor Control on my RaspberryPi 3

Dheeraj Bheemesh wrote:
Fri Jan 19, 2018 3:45 pm
Hello Joan,

I checked if softPwmCreate returned success (should return 0 for success), but it returns -1. What could have gone wrong here?

Thanks and Regards,
Dheeraj Bheemesh
I don't use that function. I'm afraid you will have to read the documentation.
by joan
Fri Jan 19, 2018 2:55 pm
Forum: Python
Topic: How to assign hysteresis/Schmitt trigger to an Input?
Replies: 7
Views: 180

Re: How to assign hysteresis/Schmitt trigger to an Input?

Hysteresis is enabled by default on all GPIO. I'm not aware of any software to allow it to be switched off.

https://www.scribd.com/doc/101830961/GPIO-Pads-Control2
by joan
Fri Jan 19, 2018 1:57 pm
Forum: General discussion
Topic: Motor Control on my RaspberryPi 3
Replies: 7
Views: 136

Re: Motor Control on my RaspberryPi 3

How do you know you don't get errors? The only status you check is wiringPiSetup(). Do none of the other functions return a status?

How do you know the wiring is correct?
by joan
Fri Jan 19, 2018 1:11 pm
Forum: General discussion
Topic: Motor Control on my RaspberryPi 3
Replies: 7
Views: 136

Re: Motor Control on my RaspberryPi 3

Do none of the functions you call return an error status? You don't appear to be checking. Do you initialize the wiringPi library?
by joan
Fri Jan 19, 2018 1:01 pm
Forum: Troubleshooting
Topic: SPI doesn't work on Rpi Zero W, Stretch
Replies: 16
Views: 289

Re: SPI doesn't work on Rpi Zero W, Stretch

I reckon you might have misunderstood my answer at https://raspberrypi.stackexchange.com/q ... 0786#70786
by joan
Fri Jan 19, 2018 12:57 pm
Forum: General discussion
Topic: Motor Control on my RaspberryPi 3
Replies: 7
Views: 136

Re: Motor Control on my RaspberryPi 3

Do any of those functions return an error?

I would not call softPwmCreate inside the while loop. I'd also add a time delay within the while loop.
by joan
Fri Jan 19, 2018 12:40 pm
Forum: Troubleshooting
Topic: SPI doesn't work on Rpi Zero W, Stretch
Replies: 16
Views: 289

Re: SPI doesn't work on Rpi Zero W, Stretch

wiringPi is not deprecated. Using the gpio utility function to load the SPI and I2C drivers is not needed if device tree is being used.
by joan
Thu Jan 18, 2018 9:23 pm
Forum: Automation, sensing and robotics
Topic: coin hopper sensor: not detecting all coins dispensed (Pi GPIO too slow?)
Replies: 8
Views: 249

Re: coin hopper sensor: not detecting all coins dispensed (Pi GPIO too slow?)

Thanks all, Due to current budget/available time constraints, I ordered a Trinket M0 as a start. It's cheap, small, lets me run Arduino sketches at a low level and has a built-in RGB LED I can flash as coin pulses are detected. If that works out well, I'll send serial communications to the USB-conn...
by joan
Thu Jan 18, 2018 4:40 pm
Forum: C/C++
Topic: Hardware PWM Pin 32 and Pin 33 Question
Replies: 16
Views: 389

Re: Hardware PWM Pin 32 and Pin 33 Question

If you turn the encoder slowly you should be able to see the lines going high and low with a meter.
by joan
Thu Jan 18, 2018 2:50 pm
Forum: C/C++
Topic: Hardware PWM Pin 32 and Pin 33 Question
Replies: 16
Views: 389

Re: Hardware PWM Pin 32 and Pin 33 Question

I can't be sure.

All the encoder A/B lines I've used float to the external voltage except when pulled to ground during the rotation. So yes, normally you need to enable the GPIO pull-ups to pull the A/B lines high.
by joan
Thu Jan 18, 2018 11:23 am
Forum: C/C++
Topic: Hardware PWM Pin 32 and Pin 33 Question
Replies: 16
Views: 389

Re: Hardware PWM Pin 32 and Pin 33 Question

No, PWM is completely separate from sampling.

For usage of gpioSetAlertFunc perhaps look at the following example.

http://abyz.me.uk/rpi/pigpio/ex_rotary_encoder.html
by joan
Thu Jan 18, 2018 11:16 am
Forum: Beginners
Topic: Current through gpio pins
Replies: 3
Views: 86

Re: Current through gpio pins

Those servos are rated for 4.8 volts. Feeding them 7.4 volts would shorten their life considerably, perhaps destroying them immediately if the internal circuit board is not designed to work at that voltage. Get a UBEC or similar to drop the voltage of the battery to 5V. You could then drive the serv...
by joan
Thu Jan 18, 2018 8:57 am
Forum: Bare metal
Topic: GPIO pull up resisance
Replies: 15
Views: 18399

Re: GPIO pull up resisance

I'm pretty certain that the 50mA recommendation was based on the old 3v3 linear regulator on the original Pi. The newer ones (B+ and later) use a more efficient switching regulator and can supply much more current. I haven't seen an actual recommended maximum, but I believe it can supply over 100mA...
by joan
Thu Jan 18, 2018 3:21 am
Forum: Beginners
Topic: Creating a pwm signal by hand
Replies: 29
Views: 5623

Re: Creating a pwm signal by hand

@Tibalt

The PWM peripheral is used purely for timing. The DMA hardware uses a user chosen peripheral to time the transfer (usually the PWM or PCM peripheral).
by joan
Wed Jan 17, 2018 11:54 pm
Forum: Automation, sensing and robotics
Topic: coin hopper sensor: not detecting all coins dispensed (Pi GPIO too slow?)
Replies: 8
Views: 249

Re: coin hopper sensor: not detecting all coins dispensed (Pi GPIO too slow?)

Try my piscope.

http://abyz.me.uk/rpi/pigpio/piscope.html

The needed pigpio library may be already installed if you are using Raspbian (sudo pigpiod to check, if no error is displayed it is installed).
by joan
Wed Jan 17, 2018 4:54 pm
Forum: Beginners
Topic: Controlling Externally Powered Motors
Replies: 3
Views: 113

Re: Controlling Externally Powered Motors

Alright. So electrical stuff beside, where should I start programming-wise? Is there anything in Raspbian that can access the GPIO pins using Java or Python? Plenty of libraries. For Java the PI4J library springs to mind. For Python RPi.GPIO, RPIO.GPIO, wiringpi2, and (my) pigpio. Have a look at ht...
by joan
Tue Jan 16, 2018 11:11 pm
Forum: General programming discussion
Topic: Raspberry PI Sonic Sensor for Pallet Detection
Replies: 1
Views: 57

Re: Raspberry PI Sonic Sensor for Pallet Detection

Yes, that is achievable.

Perhaps break down the job into smaller parts and join them together at the end?

Plenty of examples of using sonar rangers.
by joan
Tue Jan 16, 2018 11:06 pm
Forum: Beginners
Topic: drive a servo with a 2-axis button PS2 Controller Joystick
Replies: 5
Views: 116

Re: drive a servo with a 2-axis button PS2 Controller Joystick

Best to put code in code quotes for legibility.

What is the problem? What specific errors do you see?
by joan
Tue Jan 16, 2018 9:34 pm
Forum: Automation, sensing and robotics
Topic: Controlling 4 gear motors with encoders
Replies: 7
Views: 227

Re: Controlling 4 gear motors with encoders

However it is less than 6 revolutions per second Sometimes the encoder is not on the gear-reduced output shaft but is on the actual high-rpm motor-shaft so that's something to watch out for I've just bought a couple of motors with attached encoders. They are on the motor shaft with 30 vanes, no loa...
by joan
Tue Jan 16, 2018 8:47 pm
Forum: Automation, sensing and robotics
Topic: 2 motors and 16bit pwm...
Replies: 16
Views: 369

Re: 2 motors and 16bit pwm...

Fine. It's probably worth mentioning that you could use the Pi's hardware PWM channels Thanks, is that using pigpio and is 8 bit? pigpio general PWM (for want of a better term) is DMA timed and defaults to 250 steps, not quite 8 bits. I meant the hardware PWM channels used to drive audio which I gu...

Go to advanced search