Go to advanced search

by jayben
Wed Dec 01, 2021 10:08 am
Forum: Automation, sensing and robotics
Topic: Detecting raspberrypi with raspberrypi via RF
Replies: 1
Views: 111

Re: Detecting raspberrypi with raspberrypi via RF

You don't say what accuracy you need, but UWB modules are readily available, and are probably your best bet.

It does work through walls, see my post https://iosoft.blog/real-time-location-ultra-wideband/
by jayben
Fri Nov 26, 2021 10:03 am
Forum: General
Topic: ADC register file reads back all zeros
Replies: 2
Views: 133

Re: ADC register file reads back all zeros

I've posted some Pico ADC code here: https://iosoft.blog/pico-adc-dma/

It is in MicroPython, but the register settings should be adaptable to the language of your choice.
by jayben
Sat Nov 20, 2021 10:50 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Possibility to fix CS duration for SPI
Replies: 3
Views: 205

Re: Possibility to fix CS duration for SPI

Hi Jayden, it's nice to read your blog and GitHub repo! Your code is such a good example. I am trying to extend this one channel ADC data streaming to 32 channels for my project. But I still have some questions. You used PWM to trigger the SPI clock. How do you match the PWM frequency and the SPI c...
by jayben
Fri Nov 19, 2021 1:32 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI communication between two RPi 4
Replies: 3
Views: 165

Re: SPI communication between two RPi 4

I thought SPI-to-SPI was going to be tricky, but SPI-to-i2c adds a whole extra layer of complication! I think it is unlikely you'll find an off-the-shelf part to do either. You need to bear in mind that SPI isn't a transparent communications medium like serial or Ethernet; most SPI communications in...
by jayben
Thu Nov 18, 2021 7:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI communication between two RPi 4
Replies: 3
Views: 165

Re: SPI communication between two RPi 4

I guess you could program a Pico to do the job, but a much easier option would be to use asynchronous serial between the Pi systems; all you'd need is 2 wires plus ground.
by jayben
Tue Nov 16, 2021 6:47 pm
Forum: General
Topic: External SRAM
Replies: 2
Views: 187

Re: External SRAM

Take a look at the Microchip 23LC1024, which is a 1 Mbit RAM with an SPI interface, clocked at 20 MHz max. It is even available in an old-fashioned DIP package.

If that is too small or too slow you can get similar devices up to 4 Mbit and/or 40 MHz SPI, all with the same 8-pin footprint
by jayben
Mon Nov 15, 2021 11:38 pm
Forum: General
Topic: DMA newbie needs hint
Replies: 3
Views: 185

Re: DMA newbie needs hint

In case it helps, I've posted a Micropython ADC DMA example here: https://iosoft.blog/pico-adc-dma/
by jayben
Mon Nov 15, 2021 9:19 am
Forum: Troubleshooting
Topic: read RS485 data
Replies: 11
Views: 376

Re: read RS485 data

You only need A and B as it is a balanced signal, the ground connection is optional and sometimes should not be used. Sorry, I completely disagree; RS485 transceivers have a limit as to how much 'common-mode voltage' (i.e. voltage difference between the transmitter and receiver zero-volt rails) the...
by jayben
Sun Nov 14, 2021 3:35 pm
Forum: Troubleshooting
Topic: read RS485 data
Replies: 11
Views: 376

Re: read RS485 data

I thought so also but when I connect the PI RS485 output to a usb-rs485 (my computer) - the data is OK and I only use 2 wires "A" and "B" is there was a noise - in the computer I should also see wrong data the PI and the computer are ot connected to same power sorce - only RS485...
by jayben
Sun Nov 14, 2021 9:43 am
Forum: Troubleshooting
Topic: read RS485 data
Replies: 11
Views: 376

Re: read RS485 data

There is a problem that is specific to RS485; generally when idle the 2 data lines float to the same mid-point voltage and it only takes a few tens of millivolts of interference to be registered as data. Ordinary RS232 is far better in this regard, since that would needs a few volts of interference,...
by jayben
Fri Nov 12, 2021 7:54 pm
Forum: Automation, sensing and robotics
Topic: Create an Amplitude modulated signal
Replies: 5
Views: 278

Re: Create an Amplitude modulated signal

50 or 60 Hz is an unusual choice; it means that the data rate will be really slow (maybe 50 or 60 bits per second max) and also you could get interference from the mains, if it is at the same frequency - maybe think about 1 kHz, or even 10 kHz? The simplest way to carry data is on-off keying, but yo...
by jayben
Thu Nov 11, 2021 9:40 am
Forum: General
Topic: Right usage for ADC (Raspberry Pi Pico)
Replies: 1
Views: 143

Re: Right usage for ADC (Raspberry Pi Pico)

I haven't used the Arduino IDE with the Pico (and it presumably isn't supported by the Pi Foundation) but this doesn't look like an Arduino program - where are the 'setup' and 'loop' functions? It also doesn't look like a normal microcontroller C program; it just executes main() once, then falls off...
by jayben
Wed Nov 10, 2021 2:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI minimum clock speeds
Replies: 6
Views: 291

Re: SPI minimum clock speeds

If you are running at MHz speeds with long-ish cables, then you might start to get into transmission line issues, e.g. reflections from the end of the cable, also the capacitance in your screened cable might make the waveforms quite triangular, so it doesn't work properly, If you need MHz speeds, an...
by jayben
Tue Nov 09, 2021 11:48 am
Forum: Graphics, sound and multimedia
Topic: Reading sound from a MAX4466 to a Pico
Replies: 3
Views: 182

Re: Reading sound from a MAX4466 to a Pico

The loop will run really slowly and unpredictably, as the 'print' function takes quite a lot of CPU time (and USB comms time). One improvement would be to store a block of values in an array, then print it out afterwards, but that might still be a bit too slow for this application. The best approach...
by jayben
Tue Nov 09, 2021 11:38 am
Forum: Beginners
Topic: Using CAN modul and ADC with raspberry pi
Replies: 1
Views: 56

Re: Using CAN modul and ADC with raspberry pi

You can have several SPI devices on the same bus, so long as they use separate chip selects.
See https://en.wikipedia.org/wiki/Chip_select
by jayben
Tue Nov 09, 2021 11:23 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI Clock not doing enough pulses
Replies: 7
Views: 316

Re: SPI Clock not doing enough pulses

Yes, it looks like the data output is just floating. My best guess is a faulty connection; I suggest you use the scope to check the signal on all the device pins. If they are on a fine pitch, just clip a pin or needle into your scope probe; you can then use the fine point to probe almost any package...
by jayben
Tue Nov 09, 2021 9:14 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: SPI Clock not doing enough pulses
Replies: 7
Views: 316

Re: SPI Clock not doing enough pulses

This short break is what is likely causing me to be unable to read the data (as if the clock is not continuous then the chip will not output the data). A brief gap between bytes is quite usual, and shouldn't cause any problems; there is no indication in the datasheet that this might be an issue (th...
by jayben
Mon Nov 08, 2021 8:21 am
Forum: Beginners
Topic: Turning on relay remotely using raspberry Pi GPIO
Replies: 7
Views: 232

Re: Turning on relay remotely using raspberry Pi GPIO

There are many online tutorials on the subject, e.g. https://www.electronicshub.org/control- ... pberry-pi/
by jayben
Sun Nov 07, 2021 5:27 pm
Forum: Troubleshooting
Topic: XY-MOS Power Mosfet Module
Replies: 7
Views: 238

Re: XY-MOS Power Mosfet Module

A good starting point is to look at the data sheet for the devices; a quick skim of similar modules suggests they might be D4184, data sheet at http://www.aosmd.com/pdfs/datasheet/AOD4184A.pdf I wondered if the module might only work with a 5V signal, not the 3.3V output from the Pi, but the data sh...
by jayben
Thu Nov 04, 2021 8:11 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: UART via DMA in driver
Replies: 9
Views: 396

Re: UART via DMA in driver

I sort-of understand, but to be sure, I need to get some userland code working, then publish it on my blog.

Thanks very much for the information.
by jayben
Thu Nov 04, 2021 3:39 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: UART via DMA in driver
Replies: 9
Views: 396

Re: UART via DMA in driver

Interesting, but whilst our development methods are very different, the hardware is the same, and I don't understand the mechanism by which a single UART byte becomes a 32-bit DMA word. Are you saying that for a string of 'n' characters, you end up with a buffer of n*4 bytes, each character occupyin...
by jayben
Thu Nov 04, 2021 1:48 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Possibility to fix CS duration for SPI
Replies: 3
Views: 205

Re: Possibility to fix CS duration for SPI

To quote the bcm2835 documentation at https://www.airspayce.com/mikem/bcm2835/ "The bcm2835 is a library for user programs (i.e. they run in 'userland'). Such programs are not part of the kernel and are usually subject to paging and swapping by the kernel while it does other things besides runn...
by jayben
Thu Nov 04, 2021 9:25 am
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: UART via DMA in driver
Replies: 9
Views: 396

Re: UART via DMA in driver

It is important to be clear about the difference between bus address, physical address and virtual address when doing DMA. Then there is caching; my golden rule is "if your code is behaving strangely, it is probably due to caching". Even when working with uncached memory, it is really easy...
by jayben
Wed Nov 03, 2021 4:27 pm
Forum: General discussion
Topic: Getting started, Python or C
Replies: 45
Views: 1286

Re: Getting started, Python or C

I spent decades programming in C before a colleague persuaded me to try Python. It was a real culture-shock, for example I hated the idea of creating a variable that doesn't have a known type, and can change its type depending on what is stored in it. However what made me a convert was the sheer num...

Go to advanced search