Go to advanced search

by piras77
Mon Aug 21, 2017 3:19 pm
Forum: Advanced users
Topic: Raspberry Pi 3 SPI Queries
Replies: 2
Views: 858

Re: Raspberry Pi 3 SPI Queries

Will there be speed difference? Which one would you prefer over the other? Well, using one master for two slaves does obviously provide only half of the maximum speed compared with two masters. However, on the Pi that's only half of truth since SPI0 and SPI1 differ. SPI1 does not provide DMA suppor...
by piras77
Mon Aug 21, 2017 12:08 pm
Forum: Beginners
Topic: Interrupt rising edge reads both rising and falling!
Replies: 3
Views: 995

Re: Interrupt rising edge reads both rising and falling!

Your callback is invoked on falling edges even if your code doesn't say so? How did you verify this? If your library supports callbacks on rising edges then it's either a problem in your code / setup (very likely) or the library is broken (less likely). So, where is your code? I think it is not a co...
by piras77
Mon Aug 21, 2017 9:21 am
Forum: Beginners
Topic: Regarding rasberry pi usb library
Replies: 14
Views: 3968

Re: Regarding rasberry pi usb library

Code: Select all

$ find /usr | grep libusb | grep \.so\$
/usr/lib/arm-linux-gnueabihf/libusb-1.0.so
There is your lib.

So all you need:

Code: Select all

$ gcc usb1.c -o usb1 -lusb-1.0
$ ./usb1
hello
by piras77
Sun Aug 20, 2017 8:30 am
Forum: HATs and other add-ons
Topic: Controlling WS2812B from RPi 3b
Replies: 10
Views: 11774

Re: Controlling WS2812B from RPi 3b

Did you give PCM or SPI a try? These peripherals have no device conflicts with Raspbian. Do you have some kind of logic analyzer? Then check the output of the Pin. There is also pigpio to analyze the signals. In all my tests, the 3.3 V were sufficient even if they do not meet the WS spec. Still, a l...
by piras77
Sat Aug 19, 2017 9:10 pm
Forum: HATs and other add-ons
Topic: Controlling WS2812B from RPi 3b
Replies: 10
Views: 11774

Re: Controlling WS2812B from RPi 3b

It is connected to outside power supply. Data wire was connected to RPi's 18 port, LED ground was connected to RPi ground. After supply is turned, there are 4 LEDs lighting with green light, after running test from this library nothing changes, like the RPi cannot control LEDs. Pin 18 is PWM. You m...
by piras77
Tue Aug 15, 2017 8:02 am
Forum: Beginners
Topic: Getting a USB optical drive working on Jessie.
Replies: 6
Views: 3262

Re: Getting a USB optical drive working on Jessie.

The drive is being plugged into a POWERED USB HUB. Not directly into the Pi. Still, in my experience, I failing cd/dvd drive is very often caused by a power problem. That is where I am falling over. The /dev directory has these sg(x) things, but I am not sure what they are. You can figure out what ...
by piras77
Fri Aug 11, 2017 5:28 am
Forum: C/C++
Topic: Sampling with C and MCP3008
Replies: 8
Views: 3498

Re: Sampling with C and MCP3008

Hi Emperon, You may want to make yourself familiar with process scheduling on Linux: this means, your process may get suspended at any time for any duration. If you do a sequence of... analogRead (BASE + chan); gettimeofday(&tv2, NULL); ...your process may get suspended in between these calls. So yo...
by piras77
Thu Aug 10, 2017 7:01 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Raspberry pi as spi slave????
Replies: 2
Views: 1908

Re: Raspberry pi as spi slave????

There is a peripheral on the Pi that claims to work as SPI slave (see the section BSC Slave in the datasheet). However, it doesn't work (viewtopic.php?f=44&t=181784). So, if you want your program act as an SPI slave, you have to do it yourself (e.g. bit-bang).
by piras77
Thu Aug 10, 2017 6:48 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ADC Sampling 4 channels @ 100kHz
Replies: 6
Views: 2866

Re: ADC Sampling 4 channels @ 100kHz

I'm not that familiar with the capabilities of the SPI of the pi. Then you may want to start reading. :-) I did that with an MCP3008 and used 4 DMA control blocks (CB) per sample: Reset peripheral, tx, take a time-stamp and rx. The CBs are daisy chained. This requires about 140 bytes per sample for...
by piras77
Wed Aug 09, 2017 3:07 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ADC Sampling 4 channels @ 100kHz
Replies: 6
Views: 2866

Re: ADC Sampling 4 channels @ 100kHz

Using DMA is possible, Only I thought that it would only be beneficial when transferring a huge block of data instead of 2bytes per sample. I wouldn't use DMA for single samples. Instead, I would set up DMA to sample "everything" over a "long" period, e.g. a few seconds, into a ring buffer. So the ...
by piras77
Tue Aug 08, 2017 8:33 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO Interrupt handling system is buggy
Replies: 4
Views: 2815

Re: GPIO Interrupt handling system is buggy

At the beginning of the test, the counts on the PI are the same counts from both arduinos but after long time of running the test (1 day), the counts differ. I didn't use SPI. This means the problem is not with the SPI and in the way GPIO driver handles the interrupts themselves. Just a few things ...
by piras77
Mon Aug 07, 2017 4:21 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: ADC Sampling 4 channels @ 100kHz
Replies: 6
Views: 2866

Re: ADC Sampling 4 channels @ 100kHz

What ADC are you using? I see a constant 'gap' every 10ms in the transmission. I'm not sure what linux is doing here... Yeah. Known problem. No clues yet. https://www.raspberrypi.org/forums/viewtopic.php?f=33&t=164819 Or maybe using timers at lower levels by writing directly through registers? I don...
by piras77
Sun Aug 06, 2017 6:28 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How to get stable 2KHz square wave with MCP4725 on RPi3?
Replies: 9
Views: 3114

Re: How to get stable 2KHz square wave with MCP4725 on RPi3?

Hi rollyng, I can only repeat what I already wrote above. (1) Your approach with time.sleep() is very inaccurate because the sleep call will vary in time. Same for code execution; especially on a Pi-3 with varying core-clock. (2) Instead, get the moment in time and wait for the next moment in time. ...
by piras77
Sat Aug 05, 2017 8:23 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: GPIO Interrupt handling system is buggy
Replies: 4
Views: 2815

Re: GPIO Interrupt handling system is buggy

Instead of using Raspbian's SPI device driver, you could use a userland library. You may want to have a look at http://abyz.co.uk/rpi/pigpio.
by piras77
Sat Aug 05, 2017 8:11 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Number of SPI CS lines
Replies: 5
Views: 1463

Re: Number of SPI CS lines

karrika wrote:
Sat Aug 05, 2017 7:41 am
There is 5 CS lines and 2 SPI devices. So you should be able to control lots of devices.
SPI0 can control 2 lines with 3 values (0,1,2). SPI1 can control 3 lines with all 8 values. SPI0 supports DMA, SPI1 not. Well, it's all in the datasheet.
by piras77
Sat Aug 05, 2017 8:07 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: How to get stable 2KHz square wave with MCP4725 on RPi3?
Replies: 9
Views: 3114

Re: How to get stable 2KHz square wave with MCP4725 on RPi3?

Raspbian is no real-time operating system. That is, there is no guarantee when a command gets executed. A process may be suspended any time for short (a few us) or long periods (more than 100ms). Hence, in order to produce a stable signal, you cannot rely on any Raspbian userland process (whether wr...
by piras77
Sat Aug 05, 2017 7:40 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Number of SPI CS lines
Replies: 5
Views: 1463

Re: Number of SPI CS lines

baantonia wrote:
Sat Aug 05, 2017 7:04 am
My question is: Is there any reason why other GPIO pins cannot be used as CS lines
It is completely up to you whether to use the SPI peripheral's CS signals or not.
Since you are going to use bare metal there shouldn't be any timing issues by controlling arbitrary GPIO pins.
by piras77
Sun Jul 30, 2017 8:19 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: RPi 3 +ADC (ADS1115) - Input/Output Error
Replies: 1
Views: 980

Re: RPi 3 +ADC (ADS1115) - Input/Output Error

You could ask the developer of Adafruit_PureIO directly on GitHub https://github.com/adafruit/Adafruit_Python_PureIO. You could also use one of the other Python libs which provide better support, i.e. pigpio: http://abyz.co.uk/rpi/pigpio/python.html. In my experience the Pi works fine with the ADS11...
by piras77
Sat Jul 22, 2017 9:27 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CE pins Mixed Configuration
Replies: 2
Views: 1659

Re: SPI CE pins Mixed Configuration

1. Can I assert more than one CE signal at the same time (so that though a decoder IC I can then create effectively 8 CE signals)? Yes 2. Regardless of the above, can I configure GPIO19, GPIO20 and GPIO21 as SPI (MISO, MOSI and CLK) while at the same time configure the other SPI pins for that same ...
by piras77
Thu Jul 20, 2017 4:22 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CLK issue
Replies: 9
Views: 1899

Re: SPI CLK issue

So does that mean that you changed the value of DLEN through the pigpio library? Your question indicates that you need to familiarize yourself on how to access the SPI peripheral on a Raspberry Pi, i..e. on what ways there are and on how it works. And what do you mean by how do I plan on running th...
by piras77
Thu Jul 20, 2017 3:15 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CLK issue
Replies: 9
Views: 1899

Re: SPI CLK issue

I see.

I'm unfortunately not familiar with the kernel driver / spi device, so maybe, someone else here has a clue and can help you out.

How did you plan to run your spi dialogues anyway (in terms of scripting / programming)?
by piras77
Thu Jul 20, 2017 1:31 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CLK issue
Replies: 9
Views: 1899

Re: SPI CLK issue

SPI0 and its registers (including DLEN) are described in §10 of the peripheral datasheet: https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf Which kinda begs the question: how did you get SPI1 working in the first place? If you are just starting off and if you do C or Python...
by piras77
Wed Jul 19, 2017 10:05 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI CLK issue
Replies: 9
Views: 1899

Re: SPI CLK issue

Words that read from/written to FIFO are always 32-bit wide. The actual width to be transferred can be configured. Either statically (32-bit or less) or dynamically within the word (24-bit or less). And yes, there is always a gap of two clock-cycles between the transmission of two subsequent words (...
by piras77
Tue Jul 18, 2017 9:18 am
Forum: General programming discussion
Topic: Registers to control the PWM clock on BCM2835
Replies: 8
Views: 6450

Re: Registers to control the PWM clock on BCM2835

This posting is just intended as reference; for people who stumble across the same issue. PWM clock source and frequency is controlled in CPRMAN. I've found on the internet that the pwm clock registers are at address 0x7E1010A0 and 0x7E1010A4. I suppose it works like the GPIO clocks documented in yo...
by piras77
Thu Jun 29, 2017 4:18 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: VC Mailbox Property Interface: Power State
Replies: 1
Views: 704

VC Mailbox Property Interface: Power State

Hi there, Somebody here who has experience with the Mailbox interface? I'm particularly interested in the Get power state (tag 0x00020001) Set power state (tag 0x00028001) dialogs as described in https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface. It appears to me that the retur...

Go to advanced search