Go to advanced search

by joan
Thu Aug 06, 2020 3:43 pm
Forum: Troubleshooting
Topic: GPIO15 high from beginning
Replies: 11
Views: 249

Re: GPIO15 high from beginning

You say no config lines affected the GPIO. That is contradicted by saying you have enabled the SPI interface.

Rather than guess at what you have done could you post the contents of /boot/config.txt?
by joan
Wed Aug 05, 2020 9:09 am
Forum: Troubleshooting
Topic: Button Madness!
Replies: 10
Views: 317

Re: Button Madness!

Perhaps you have the serial link enabled (it uses GPIO 14 for transmit and GPIO 15 for receive).
by joan
Tue Aug 04, 2020 9:54 pm
Forum: Beginners
Topic: How to use another i2c pins in Raspberry pi zero W
Replies: 4
Views: 171

Re: How to use another i2c pins in Raspberry pi zero W

The slave device should not have pull-ups.

However as long as they are to 3V3 it should still work when connected to a the standard I2C bus pins on the Pi.
by joan
Tue Aug 04, 2020 8:39 pm
Forum: Beginners
Topic: Testing gpio and MCP8003
Replies: 11
Views: 286

Re: Testing gpio and MCP8003

The photo is not clear enough to show the connections made. To help we need to check which Pi pins are connected to which breadboard pins and chip pins.
by joan
Mon Aug 03, 2020 3:22 pm
Forum: Automation, sensing and robotics
Topic: Arduino GPIO Output to Raspberry Pi Input
Replies: 12
Views: 350

Re: Arduino GPIO Output to Raspberry Pi Input

If you connect directly you also need to add a ground connection between Pi and wemos.
by joan
Mon Aug 03, 2020 5:17 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Changing pins for ADS1115
Replies: 4
Views: 302

Re: Changing pins for ADS1115

Hardware I2C is available on GPIO 2/3 only on the Pi. If busio insists on using hardware I2C you will need to find an alternative solution.
by joan
Sun Aug 02, 2020 7:49 pm
Forum: Python
Topic: RPi as IR pulse counter
Replies: 6
Views: 396

Re: RPi as IR pulse counter

Try it with piscope.

That will tell you if the Pi can capture the signals reliably. If the Pi can reliably capture the signals you can write a program to decode the signals. If it can't capture the signals you need to be looking at a different product.
by joan
Sun Aug 02, 2020 4:46 pm
Forum: Automation, sensing and robotics
Topic: Trouble controlling brushless motor with ESC
Replies: 19
Views: 726

Re: Trouble controlling brushless motor with ESC

I'd be surprised if you can't do the equivalent of the Arduino on the Pi. I suggest you experiment from the command line to find the correct control. I'd check on just what the Arduino myESC.arm() is doing as that is crucial for correct operation. From the command line you can send servo pulses with...
by joan
Sat Aug 01, 2020 3:16 pm
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

I stopped looking once I could see nothing wrong. ./rpi-279139.py --repeat 255 |grep " 2," #!/usr/bin/env python3 import time import pigpio class rx(): """ A class to read a Dali frame. """ TE = 834/2 # half bit time = 417 usec MIN_TE = 350 MAX_TE = 490 MIN_2TE = 760 MAX_2TE = 900 STP_2TE = 1800 def...
by joan
Sat Aug 01, 2020 5:37 am
Forum: Python
Topic: RPi as IR pulse counter
Replies: 6
Views: 396

Re: RPi as IR pulse counter

If only there was a way to see what was going on.
by joan
Tue Jul 28, 2020 7:11 pm
Forum: Python
Topic: RPi as IR pulse counter
Replies: 6
Views: 396

Re: RPi as IR pulse counter

That should be okay as long as you can feed a 3V3 signal into the Pi GPIO.

See http://abyz.me.uk/rpi/pigpio/piscope.html
by joan
Tue Jul 28, 2020 4:43 pm
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

I have added the code as an example.

http://abyz.me.uk/rpi/pigpio/examples.html#C_pps_c
by joan
Tue Jul 28, 2020 1:07 pm
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

Try the following partially tested code. Use -s x option to specify the pulse interval in seconds (1<=x<=60). Note that if x does not divide exactly into 60 the pulse won't be in sync with displayed wall seconds. #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include...
by joan
Tue Jul 28, 2020 10:41 am
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

Can you confirm the 20-100 millisecond delay that guym noted. I apologize for misrepresenting how pigpio handles watchdog (and other alerts). The alert thread is scheduled to run every msec, so on average a 0.5msec latency should be expected. This latency, however, is subject to OS preemption. Inst...
by joan
Mon Jul 27, 2020 7:07 pm
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

I can't think of a trivial change. It would require some thought. Could you explain a bit more about what you want? For instance if every x seconds would it be sufficient just to not output the intervening pulses?
by joan
Mon Jul 27, 2020 5:54 pm
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

Are you saying that the Pi time is 150µs or so behind GPS time? I'm not sure if that is good or bad.
by joan
Mon Jul 27, 2020 3:34 pm
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

I think the change came about when I allowed for the creation of multiple waves. Try the following code. #include <stdio.h> #include <stdlib.h> #include <stdarg.h> #include <unistd.h> #include <string.h> #include <sys/timex.h> #include <pigpio.h> /* pps.c 2020-07-27 Public Domain gcc -o pps pps.c -l...
by joan
Mon Jul 27, 2020 11:58 am
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

The watchdog will be triggered x milliseconds after the last level change on the GPIO. I usually set a watchdog when the message starts and cancel when the message ends (or times out). You can leave it set but will receive a stream of watchdog alerts during the inter-message period. The Pi model sho...
by joan
Mon Jul 27, 2020 11:07 am
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

I have run the test with a repeat of 255. I added the watchdog event to the recorded timestamps. I made a change to the way the watchdog is started and stopped. if level < 2: # Received an edge interrupt edge_len = pigpio.tickDiff(self._last_edge_tick, tick) self._last_edge_tick = tick if self._edge...
by joan
Mon Jul 27, 2020 10:25 am
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

sjalloq wrote:
Mon Jul 27, 2020 10:03 am
Well that testcase I provided earlier shows a 10ms gap between frames and I've tried a 1ms watchdog that doesn't fire.
I didn't notice you added the test case.

I can run it but don't know how to tell the difference between a good or bad result.
by joan
Mon Jul 27, 2020 9:29 am
Forum: Python
Topic: Strange behaviour with pigpio and threading.Timer
Replies: 30
Views: 984

Re: Strange behaviour with pigpio and threading.Timer

20-200 ms seems excessive.

The last times I did tests interrupts (ISR) had a latency of 50 µs or so. Alerts had an average latency of 500 µs or so (samples are reported every millisecond). I'd expect the watchdog event to happen within one or two milliseconds of expected time.
by joan
Mon Jul 27, 2020 8:27 am
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

The correction is applied by updating the slack time in the DMA control block. The address is calculated using g_slackA = &(rawWaveCBAdr(2)->length); /* get address of slack length */ and updated with *g_slackA = (slack * 4); Perhaps that method of calculating the DMA control block address no longer...
by joan
Mon Jul 27, 2020 8:09 am
Forum: Beginners
Topic: Pulse GPIO relative to system time
Replies: 34
Views: 2494

Re: Pulse GPIO relative to system time

The basics still seem to work, e.g. a tick every second of 200µs duration. Will have to look a bit deeper to see why it isn't synchronised to wall time.

Go to advanced search