Go to advanced search

by gordon@drogon.net
Fri Jun 21, 2019 5:34 pm
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 1052

Re: WiringPi / Raw SPI speed issue

Hello I see to have found an issue with the SPI bus and how to get any kind of speed from it. I have tried three libraries BCM2835 no issues with speed WiringPi seems to max out at 500kHz Raw SPI seems to max out at 500kHz This all came about when trying to get my OLED to run faster I assumed the d...
by gordon@drogon.net
Fri Jun 21, 2019 11:38 am
Forum: C/C++
Topic: WiringPi / Raw SPI speed issue
Replies: 8
Views: 1052

Re: WiringPi / Raw SPI speed issue

Hello I see to have found an issue with the SPI bus and how to get any kind of speed from it. I have tried three libraries BCM2835 no issues with speed WiringPi seems to max out at 500kHz Raw SPI seems to max out at 500kHz This all came about when trying to get my OLED to run faster I assumed the d...
by gordon@drogon.net
Mon May 27, 2019 1:17 pm
Forum: C/C++
Topic: OLED interface problems
Replies: 12
Views: 2888

Re: OLED is slow and CPU intensive

After some searching online I can see that a full screen redraw isn't fast as each pixel requires 4 bits each. My current thinking is the library supplied to use the display is not well written and is causing the CPU load to be much higher than it needs to be. I'm attempting to write a new C librar...
by gordon@drogon.net
Mon May 27, 2019 1:08 pm
Forum: C/C++
Topic: pigpio C sub µs single pulse generation
Replies: 48
Views: 5064

Re: pigpio C sub µs single pulse generation

I did need a single pulse of duration from few microseconds to sub microsecond. After I realized that using wiringPi these commands produce a >50µs length pulse, wiringPi was no option. ... digitalWrite (13, LOW) ; digitalWrite (13, HIGH) ; digitalWrite (13, LOW) ; ... With wiringPiSetup() or wirin...
by gordon@drogon.net
Wed Mar 13, 2019 11:25 am
Forum: C/C++
Topic: WiringPI
Replies: 4
Views: 729

Re: WiringPI

Hi guys, I have a problem with the installation of the WiringPI library I followed the steps that came in a web page everything well recognizes me the library but the problem is that it recognizes the library but not the functions of this library. Please, if someone knows that I am failing, I would...
by gordon@drogon.net
Wed Mar 13, 2019 10:54 am
Forum: C/C++
Topic: CodeBlocks and pigpio
Replies: 11
Views: 1006

Re: CodeBlocks and pigpio

With WiringPi you can set an environment variable to allow it to run without sudo. You have clearly caught a dose of sudoitis. That's a nasty disease where Raspberry users assume the answer to all problems is sudo. export WIRINGPI_GPIOMEM=1 in bash. Or do it in C programs with setenv ("WIRINGPI_GPI...
by gordon@drogon.net
Sat Jan 26, 2019 8:11 pm
Forum: C/C++
Topic: hardware pwm without wiringpi or other libraries
Replies: 7
Views: 1281

Re: hardware pwm without wiringpi or other libraries

I was going to ask a simular question. perhraps this will be a good place to ask. i'm wanting to use pwm to control 2 motors. but it seems the wiringpi library only allows for 1 pin? thus controlling only one motor. I need to control 2. correct me if im wrong you're wrong. It supports both PWM chan...
by gordon@drogon.net
Wed Dec 26, 2018 7:53 pm
Forum: C/C++
Topic: Wirring pi and SPI communication
Replies: 16
Views: 2404

Re: Wirring pi and SPI communication

The wiringPi SPI code is just dumbed-down wrappers round the standard Linux kernel SPI code. They really are just one or 2 liners for those who don't know how to read the documentation. Read the source code to see what's happening, but in essence it's: snprintf (spiDev, 31, "/dev/spidev0.%d", channe...
by gordon@drogon.net
Mon Dec 10, 2018 10:38 am
Forum: C/C++
Topic: WiringPi Segmentation fault
Replies: 3
Views: 1184

Re: WiringPi Segmentation fault

I see you're using softPwm - great, but if you use the hardware PWM, then you need to run it as root.

You might also want to look at the wiringSerial helpers - it has all the serial stuff you need too.

And note that millis () will wrap after 49 days.

-Gordon
by gordon@drogon.net
Tue Dec 04, 2018 11:56 am
Forum: C/C++
Topic: The most efficient way to transfer SPI data
Replies: 9
Views: 4639

Re: The most efficient way to transfer SPI data

I managed to write a benchmark program which measures the speed of GPIO and my previous error was that I was not buffering the reads. I am still using the WiringPi library. It can be observed that the more packets are being sent at once, the better bitrate is achieved, however this seems to plateau...
by gordon@drogon.net
Sat Nov 17, 2018 10:09 am
Forum: C/C++
Topic: External SRAM with Raspberry Pi 3
Replies: 8
Views: 3589

Re: External SRAM with Raspberry Pi 3

Don't use pinMode() on any SPI pins. the Linux kernel driver does the right thing when you have the SPI driver loaded at boot time (use rpi-config to make sure). Similarly you don't need to digitalWrite() to control the CE lines. The kernel driver does that for you. Essentially, you don't need wiri...
by gordon@drogon.net
Fri Nov 16, 2018 12:05 pm
Forum: C/C++
Topic: External SRAM with Raspberry Pi 3
Replies: 8
Views: 3589

Re: External SRAM with Raspberry Pi 3

Don't use pinMode() on any SPI pins. the Linux kernel driver does the right thing when you have the SPI driver loaded at boot time (use rpi-config to make sure). Similarly you don't need to digitalWrite() to control the CE lines. The kernel driver does that for you. Essentially, you don't need wirin...
by gordon@drogon.net
Wed Nov 07, 2018 12:10 pm
Forum: C/C++
Topic: Problems with mixing WiringPi Interrupts with forking to a child process
Replies: 2
Views: 2717

Re: Problems with mixing WiringPi Interrupts with forking to a child process

I've no idea why your program behaves as it does (and not really got time to look that closely at it. sorry), however note that wiringPiISR calls fork() and pthread_create() itself. These may or may not be having some sort of side-effect on your code.

-Gordon
by gordon@drogon.net
Mon Oct 29, 2018 3:16 pm
Forum: C/C++
Topic: DHT11 : C program not working but python program OK [solved]
Replies: 9
Views: 9378

Re: DHT11 : C program not working but python program OK [solved]

wiringPi supports these sensors natively - if this works for you: gpio -xrht03:100:7 aread 100 Returns temp * 10. To get the humidity, aread 101. then you can look at the source code to work it out. (the dht11 works the same as the rht03) https://git.drogon.net/?p=wiringPi;a=blob;f=examples/rht03.c ...
by gordon@drogon.net
Fri Mar 16, 2018 12:15 pm
Forum: C/C++
Topic: how can i use one button to controll 3 LEDs, plss help
Replies: 1
Views: 697

Re: how can i use one button to controll 3 LEDs, plss help

I'm not writing your code for you, but would just like to point out that you're calling wiringPiSetup() twice. This is an error. Even worse that you call it the first time to set bcm_gpio pin mode, wiringPiSetupGpio() then the 2nd time to set wiringPi pin mode. wiringPiSetup(); This is not going to ...
by gordon@drogon.net
Wed Mar 14, 2018 10:56 am
Forum: C/C++
Topic: wiringPi and the 3+
Replies: 0
Views: 1288

wiringPi and the 3+

The current version of wiringPi; 2.44 will work fine on the new 3+ however the gpio readall command is somewhat fussy and will complain that it doesn't know the board, so I've released an updated version. Source in the usual place for those who take the source ( https://git.drogon.net/ ) but if you ...
by gordon@drogon.net
Wed Feb 28, 2018 12:17 pm
Forum: C/C++
Topic: wiringPi in C Language
Replies: 4
Views: 1545

Re: wiringPi in C Language

As well as the typo (compile with -Wall -Werror) you need to link in the library. Same way you'd link in the math library with -lm, link in wiringPi with -lwiringPi. wiringPi is not really intended for noobs to C programming though. Also type: gpio readall to list the pin numbers - wiringPiSetup(); ...
by gordon@drogon.net
Sun Dec 24, 2017 12:03 pm
Forum: C/C++
Topic: stretch wiringpi
Replies: 24
Views: 5038

Re: stretch wiringpi

The wiringPi package works OK under Stretch - I was able to compile and run some programs last night with it, using the installed package on a Pi 0W. My testing was using my old Ladder board under C and RTB BASIC, not that that makes any difference. You need to re-order your command-line. Put the co...
by gordon@drogon.net
Sun Dec 17, 2017 8:11 pm
Forum: C/C++
Topic: Problem with voltage measure with MCP3424 in c++
Replies: 22
Views: 4207

Re: Problem with voltage measure with MCP3424 in c++

Google can't find it because Gordon could be blocking the Googlebots on his small and overloaded website. Also you need a special level of Google Fu to find things like that (mainly because it doesn't contain "MCP3424" as a plain text string). I'm not blocking anything. Google can't find it simply ...
by gordon@drogon.net
Sun Dec 17, 2017 5:15 pm
Forum: C/C++
Topic: Problem with voltage measure with MCP3424 in c++
Replies: 22
Views: 4207

Re: Problem with voltage measure with MCP3424 in c++

1dot0 wrote:
Sun Dec 17, 2017 5:11 pm

where can I browse this with my Windows PC? How can Google find the MCP3424 in there?
I'm sorry. I don't think I can help you further.

-Gordon
by gordon@drogon.net
Sun Dec 17, 2017 4:40 pm
Forum: C/C++
Topic: Problem with voltage measure with MCP3424 in c++
Replies: 22
Views: 4207

Re: Problem with voltage measure with MCP3424 in c++

Where is the overview which lists all and everything? It's all in the source code. I just haven't had the time/energy to document everything due to other issues/illness in the past few years, sorry. -Gordon source code? where? The link I gave earlier - http://wiringpi.com/ See the download/install ...
by gordon@drogon.net
Sun Dec 17, 2017 3:43 pm
Forum: C/C++
Topic: Problem with voltage measure with MCP3424 in c++
Replies: 22
Views: 4207

Re: Problem with voltage measure with MCP3424 in c++

Where is the overview which lists all and everything?
It's all in the source code.

I just haven't had the time/energy to document everything due to other issues/illness in the past few years, sorry.

-Gordon
by gordon@drogon.net
Sun Dec 17, 2017 12:50 pm
Forum: C/C++
Topic: Problem with voltage measure with MCP3424 in c++
Replies: 22
Views: 4207

Re: Problem with voltage measure with MCP3424 in c++

Hey guys ! We want to get the voltage of our source with an MCP3424 using the i2c protocol between a raspberry pi3 ( the master ) and the MCP3424 ( the slave ). The problem is that we dont know how to setup our MCP3424 with an c++ code. There are examples online and there's always the source code -...
by gordon@drogon.net
Wed Nov 15, 2017 3:13 pm
Forum: C/C++
Topic: Help with ILI9225 display
Replies: 4
Views: 2138

Re: Help with ILI9225 display

Two things - firstly I'd try one screen with the hardware SPI, then if that works, then you can use all 4 with the hardware SPI by using alternative CE pins and manually setting those pins rather than let the hardware use the hardware CE pins. (I do this to let me run 3 SPI Thermocouple amplifiers o...
by gordon@drogon.net
Mon Nov 13, 2017 4:49 pm
Forum: C/C++
Topic: C code for MCP3008
Replies: 22
Views: 25553

Re: C code for MCP3008

I run raspi-config as sudo and enabled SPI and disabled I2C. Then I tried the command gpio load spi, but got these error: gpio: Unable to load/unload modules as this Pi has the device tree enabled. You need to run the raspi-config program (as root) and select the modules (SPI or I2C) that you wish ...

Go to advanced search