Go to advanced search

by joan
Fri Dec 03, 2021 10:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Do I need to connect ground if using serial over gpio pins?
Replies: 2
Views: 137

Re: Do I need to connect ground if using serial over gpio pins?

Both ends of the serial link need to share a common ground (so they know high from low).
by joan
Fri Dec 03, 2021 8:30 am
Forum: Beginners
Topic: Function "bcm2835_gpio_write" is not working.
Replies: 3
Views: 221

Re: Function "bcm2835_gpio_write" is not working.

By pin 7 I assume GPIO 4. GPIO 4 is used by the 1-wire bus. Perhaps you have enabled that bus.
by joan
Thu Dec 02, 2021 12:46 pm
Forum: Beginners
Topic: Function "bcm2835_gpio_write" is not working.
Replies: 3
Views: 221

Re: Function "bcm2835_gpio_write" is not working.

Are you sure RPI_BPLUS_GPIO_J8_07 is GPIO 7?. It is likely to be pin 7 which is connected to GPIO 4.
by joan
Wed Dec 01, 2021 10:26 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: IR Transmitter
Replies: 2
Views: 129

Re: IR Transmitter

It doesn't look suitable for the 3V3 Pi GPIO.

It expects to be used with a 5V Arduino GPIO.

I don't know why it has a 3 pin connector. One pin is presumably unconnected. Perhaps it shares a mechanical design with another Vellerman product.
by joan
Wed Dec 01, 2021 9:51 am
Forum: Automation, sensing and robotics
Topic: pwm frequency for N20 micro gear motor?
Replies: 3
Views: 133

Re: pwm frequency for N20 micro gear motor?

Arduino defaults to about 500 Hz. pigpio on the Pi defaults to 800 Hz. Both of these use hardware timing so there are no concerns about CPU time being lost in tight timing loops. I suppose the higher the frequency the faster the system will respond to changes. However inertial effects will quickly s...
by joan
Wed Dec 01, 2021 8:36 am
Forum: C/C++
Topic: wiringPi: featuring a Timer Interrupt?
Replies: 3
Views: 264

Re: wiringPi: featuring a Timer Interrupt?

You will have to write your own.

I doubt you will get anywhere close to regular 10 µs timing with Linux timers.

I'll be interested in how close you get and what CPU time the resulting solution uses.
by joan
Mon Nov 29, 2021 10:21 am
Forum: Automation, sensing and robotics
Topic: pwm frequency for N20 micro gear motor?
Replies: 3
Views: 133

Re: pwm frequency for N20 micro gear motor?

It matters very little for us hobbyists.

A frequency about 800 Hz is quite common.

I expect you won't be able to see any difference for any frequency you use above 100 Hz.
by joan
Mon Nov 29, 2021 8:31 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: I2C problem
Replies: 3
Views: 124

Re: I2C problem

Another look in the crystal ball suggests that SDA (or SCL) is shorted to ground.
by joan
Sun Nov 28, 2021 10:13 pm
Forum: General
Topic: Are there any examples of using the Pico for frequency measurement?
Replies: 8
Views: 281

Re: Are there any examples of using the Pico for frequency measurement?

I would just extract the code/ideas you need and put it into your own program. What you are trying to do sounds quite specialised.
by joan
Sat Nov 27, 2021 10:21 pm
Forum: C/C++
Topic: tone() lib for the Pi?
Replies: 16
Views: 695

Re: tone() lib for the Pi?

I doubt there is such a library. It would need to be bound to a particular GPIO library and is so trivial why would anyone bother to separate it from the GPIO library?
by joan
Fri Nov 26, 2021 9:26 am
Forum: Beginners
Topic: error while loading shared libraries: libgpiod.so.2:cannot open shared object file
Replies: 1
Views: 97

Re: error while loading shared libraries: libgpiod.so.2:cannot open shared object file

I doubt this error comes up at random. What command do you give to produce this error? Please cut&paste the command and the system's response.
by joan
Thu Nov 25, 2021 8:41 pm
Forum: General
Topic: Are there any examples of using the Pico for frequency measurement?
Replies: 8
Views: 281

Re: Are there any examples of using the Pico for frequency measurement?

For testing you don't need to build the C environment.

http://abyz.me.uk/picod/download.html

Though in practice I expect you will need to use additional C to meet your requirements.
by joan
Thu Nov 25, 2021 4:17 pm
Forum: General
Topic: Are there any examples of using the Pico for frequency measurement?
Replies: 8
Views: 281

Re: Are there any examples of using the Pico for frequency measurement?

Have a look at how I read frequency in picod.

http://abyz.me.uk/picod/

From memory it reads at maximum speed (using an interrupt to bump the count when it wraps).

https://github.com/joan2937/picod/blob/ ... cod.c#L645

https://github.com/joan2937/picod/blob/ ... od.c#L1723
by joan
Wed Nov 24, 2021 8:48 pm
Forum: General
Topic: dht11 returns error
Replies: 10
Views: 303

Re: dht11 returns error

I can't see a pull-up to 3V3 on the data line.
by joan
Wed Nov 24, 2021 10:27 am
Forum: General
Topic: dht11 returns error
Replies: 10
Views: 303

Re: dht11 returns error

I suggest you add a photo and wiring schematic.
by joan
Mon Nov 22, 2021 1:23 pm
Forum: Beginners
Topic: massive 100us delay between SPI bytes
Replies: 5
Views: 174

Re: massive 100us delay between SPI bytes

Use C.

Send more than one byte per transaction.

Bare metal won't help very much.
by joan
Mon Nov 22, 2021 9:49 am
Forum: Beginners
Topic: massive 100us delay between SPI bytes
Replies: 5
Views: 174

Re: massive 100us delay between SPI bytes

Clue. Python is an interpreted language
by joan
Mon Nov 22, 2021 8:41 am
Forum: Advanced users
Topic: It is possible to connect two raspy pico to raspberry pi4?
Replies: 5
Views: 551

Re: It is possible to connect two raspy pico to raspberry pi4?

Probably thonny. What happens if you run an example as instructed from the command line?
by joan
Sun Nov 21, 2021 4:59 pm
Forum: C/C++
Topic: Question about pigpio wave functions
Replies: 11
Views: 424

Re: Question about pigpio wave functions

For reference you can use http://abyz.me.uk/rpi/pigpio/examples.html#Python_code/create_wave.py to create a template program for Python, C ,or pdif. You need to specify the GPIO and levels in a file. e.g. wave1.bit # GPIO bit_levels 23 11000001 24 01110000 25 00011100 26 00000111 Then for a Python, ...
by joan
Sat Nov 20, 2021 8:43 pm
Forum: Beginners
Topic: Moving Distance Sensor (and other stuff) to gpiozero
Replies: 5
Views: 173

Re: Moving Distance Sensor (and other stuff) to gpiozero

There is a caveat when using pigpio as a back end to gpiozero. pigpio is implemented as a daemon which is continually sampling the GPIO (100 thousand times a second). This sampling is carried out by DMA. DMA requires the use of a specialised hardware block to time the DMA transfers. The hardware blo...
by joan
Sat Nov 20, 2021 4:35 pm
Forum: C/C++
Topic: Question about pigpio wave functions
Replies: 11
Views: 424

Re: Question about pigpio wave functions

True.

The reasoning is that if you write to a GPIO you must want it in output mode. If you read from a GPIO it is not possible to guess what mode is desired.

Waves are a special case and I decided not to automatically set used GPIO to output mode.
by joan
Sat Nov 20, 2021 1:05 pm
Forum: C/C++
Topic: Question about pigpio wave functions
Replies: 11
Views: 424

Re: Question about pigpio wave functions

You need to set any GPIO you are using with waves to output mode.
by joan
Thu Nov 18, 2021 4:29 pm
Forum: General
Topic: dht11 returns error
Replies: 10
Views: 303

Re: dht11 returns error

The 0 pulses indicate that no DHT11 is connected to the Pico. I suggest you add a photo and wiring schematic.
by joan
Sat Nov 13, 2021 1:07 pm
Forum: HATs and other add-ons
Topic: Dirty serial output
Replies: 1
Views: 129

Re: Dirty serial output

That looks more likely to be a problem with the way minicom displays data. Try playing with the linefeed options.

Why worry though? You shouldn't be using minicom to process the data, that should be another program or script.

Go to advanced search