Go to advanced search

by joan
Fri Jul 19, 2019 9:39 am
Forum: Troubleshooting
Topic: GPIO pins having trouble
Replies: 3
Views: 47

Re: GPIO pins having trouble

wiringPi has a pintest utility. pigpio has a similar gpiotest utility.

http://abyz.me.uk/rpi/pigpio/examples.h ... l_gpiotest
by joan
Fri Jul 19, 2019 8:15 am
Forum: Python
Topic: Unwanted PWM rise
Replies: 5
Views: 102

Re: Unwanted PWM rise

You need to get a 'scope or piscope on the line.
by joan
Fri Jul 19, 2019 7:32 am
Forum: Python
Topic: Unwanted PWM rise
Replies: 5
Views: 102

Re: Unwanted PWM rise

I don't have a Pi3B to hand so tried on a Pi3B+. The following code works okay. PWM will have correctly started by the time the call to hardware_PWM has returned. I checked by looking at the piscope output as I started the program. The only thing I can think off is if you are playing PWM audio that ...
by joan
Thu Jul 18, 2019 7:42 pm
Forum: Automation, sensing and robotics
Topic: BME280 issues with Raspberry Pi
Replies: 3
Views: 76

Re: BME280 issues with Raspberry Pi

Hobbyists like me do not buy the raw BME280 chip. We buy it in a module with the needed supporting electronics and simple headers so we can connect to it easily. A BME280 module would typically allow you to use either the SPI or I2C I/F to talk to the chip. If using I2C it would also let you set the...
by joan
Thu Jul 18, 2019 5:09 pm
Forum: Automation, sensing and robotics
Topic: BME280 issues with Raspberry Pi
Replies: 3
Views: 76

Re: BME280 issues with Raspberry Pi

Remote I/O error sounds like an I2C transaction failed. They do every now and then. If you are using Python it might be worth adding a try/except clause around the I2C read. Failed to find BME280 sounds like the device was not seen on the bus. The most likely reason is the address has not been prope...
by joan
Thu Jul 18, 2019 2:55 pm
Forum: Python
Topic: Unwanted PWM rise
Replies: 5
Views: 102

Re: Unwanted PWM rise

What Pi? Where is the code you are using?
by joan
Wed Jul 17, 2019 7:48 pm
Forum: General discussion
Topic: Two servo motors with different periods
Replies: 9
Views: 214

Re: Two servo motors with different periods

This isn't really about PWM, it's about how pigpio programs the Pi's PWM peripheral to provide a PWM signal. The PWM hardware can only accept a frequency of clock source frequency / 2. That's how it works. So if the clock source is 500 MHz the maximum frequency is 250 MHz. pigpio doesn't allow a val...
by joan
Wed Jul 17, 2019 7:36 am
Forum: Compute Module
Topic: I2C problem
Replies: 4
Views: 92

Re: I2C problem

Is there an appropriate overlay for those GPIO in I2C mode?

See /boot/overlays/README
by joan
Wed Jul 17, 2019 6:26 am
Forum: Troubleshooting
Topic: Analog-Digital conversion not working over ~20 ksps
Replies: 2
Views: 78

Re: Analog-Digital conversion not working over ~20 ksps

It might be helpful to see the actual software used to read the device.
by joan
Tue Jul 16, 2019 4:47 pm
Forum: C/C++
Topic: wiring pi error
Replies: 6
Views: 148

Re: wiring pi error

https://pinout.xyz/

You need to find out which wiringPi numbering scheme you are using: it could be wiringPi number, board number, or GPIO number.
by joan
Tue Jul 16, 2019 4:36 pm
Forum: C/C++
Topic: wiring pi error
Replies: 6
Views: 148

Re: wiring pi error

by joan
Tue Jul 16, 2019 3:19 pm
Forum: Français
Topic: comprehension callback python
Replies: 24
Views: 523

Re: comprehension callback python

Peut-être que la GPIO n'est basse que pendant une courte période, disons inférieure à une milliseconde. Il faudra un peu de temps avant que Python puisse démarrer le code de rappel. Au moment où vous le lisez dans le rappel, il est peut-être redevenu trop fort. (google translate from "Perhaps the GP...
by joan
Tue Jul 16, 2019 11:31 am
Forum: C/C++
Topic: i2c - send only read bit without register address and read 2 bytes
Replies: 5
Views: 119

Re: i2c - send only read bit without register address and read 2 bytes

There doesn't seem to be any error. Are you sure that is not expected behaviour? You could try bit banging, but it does not appear to be a clock stretch problem. sudo pigpiod pigs bi2co 2 3 50000 # open 2/3 for bit bang at 50 kbps pigs bi2cz 2 4 0x34 2 7 2 0xd2 0x67 3 0 # write config pigs pi2cz 2 4...
by joan
Tue Jul 16, 2019 11:06 am
Forum: C/C++
Topic: i2c - send only read bit without register address and read 2 bytes
Replies: 5
Views: 119

Re: i2c - send only read bit without register address and read 2 bytes

Perhaps it's the clock stretch. One is shown on the diagram.

What is the address of your device on the I2C bus? What are the values of the two bytes of configuration data you are sending.
by joan
Tue Jul 16, 2019 8:31 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPI3 DMA for the SPI
Replies: 9
Views: 239

Re: RPI3 DMA for the SPI

You are not going to find an easy way of doing this if you want microsecond (or even millisecond) precision at sending the values. How far in advance do you know the values you want to send? Are they always the same repeating sequence? If so pigpio waves could probably give microsecond precision.
by joan
Mon Jul 15, 2019 8:54 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPI3 DMA for the SPI
Replies: 9
Views: 239

Re: RPI3 DMA for the SPI

The SPI driver will use DMA as long as you give it enough data to transmit. You really need to give details such as how many values per second.
by joan
Mon Jul 15, 2019 8:00 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPI3 DMA for the SPI
Replies: 9
Views: 239

Re: RPI3 DMA for the SPI

0x3fff is at least 14 bits. I'd guess the DAC expects 16 bits.
by joan
Mon Jul 15, 2019 7:46 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPI3 DMA for the SPI
Replies: 9
Views: 239

Re: RPI3 DMA for the SPI

I do not understand. You want to send data to a DAC. The data must be between 0x3000 and 0x3FFF. The data must be based on a sine wave. So the maximum will be 0x3FFF, the minimum 0x3000. Where does DMA come into this? How many values do you want to transfer per second? Is each value a single 16-bit ...
by joan
Mon Jul 15, 2019 5:11 pm
Forum: Python
Topic: only read a certain length of a output
Replies: 9
Views: 171

Re: only read a certain length of a output

Try

apt-cache policy python-pigpio

and

apt-cache policy python3-pigpio
by joan
Mon Jul 15, 2019 4:55 pm
Forum: Python
Topic: only read a certain length of a output
Replies: 9
Views: 171

Re: only read a certain length of a output

A Wiegand code is a series of bits. The meaning of the bits is controlled by the code writer. I don't know what all those 89 bits mean, perhaps some are a checksum. You need to find the documentation to see how the bits are to be interpreted. Module not found means the module has not been installed ...
by joan
Mon Jul 15, 2019 4:34 pm
Forum: Python
Topic: only read a certain length of a output
Replies: 9
Views: 171

Re: only read a certain length of a output

You could take the modulus of 100000000.

var = value % 100000000

Are you sure that's what you need? Normally you would be extracting a series of bits from the Wiegand code rather than a series of decimal digits.
by joan
Mon Jul 15, 2019 2:23 pm
Forum: Advanced users
Topic: New vcgencmd commands on RPi 4
Replies: 4
Views: 423

Re: New vcgencmd commands on RPi 4

What does measure_clock actually return? In my naiveté I assumed it was the frequency.
by joan
Mon Jul 15, 2019 10:25 am
Forum: Advanced users
Topic: GPIO access via bashscript and sysfs: Block until GPIO changes / interrupt handling
Replies: 3
Views: 112

Re: GPIO access via bashscript and sysfs: Block until GPIO changes / interrupt handling

Let me rephrase the answer. The sysfs interface (/sys/class/gpio) provides no way. You will have to write a program. E.g. /* 2014-07-06 wfi.c gcc -o wfi wfi.c ./wfi [gpio] */ #include <stdio.h> #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <sys/time.h> #include <poll.h> #define...
by joan
Mon Jul 15, 2019 8:47 am
Forum: Python
Topic: Using SPI on python
Replies: 21
Views: 2400

Re: Using SPI on python

... Hi , I met the same problem , when I used the old version raspbian , the code (spi.xfer2()) worked right and when I use the new version raspbian like lateset version or run "sudo apt-get update & sudo apt-get upgrade", wrong. So what's your mean about re-installing the RPI software???? If you h...
by joan
Sun Jul 14, 2019 9:39 pm
Forum: C/C++
Topic: wiring pi error
Replies: 6
Views: 148

Re: wiring pi error

They look like link errors. Perhaps you need to add -lwiringPi to your gcc command.

Go to advanced search