Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[General] connecting multiple devices to SPI

archinaragu

Newbie
Newbie level 3
Joined
Oct 13, 2024
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Russia
Activity points
29
Is it possible to connect multiple devices to SPI if each device must have its own control?
I'll explain.

I have an arduino board and I want to run a self-made NES emulator on it. I'm new to electronics, and I really want to learn it in order to design and write firmware. The arduino has 2k RAM, and it's not enough for the emulator. For the emulator, you need 4k for PPU, 0x800 for RAM, 2k for CHR, and for PRG-ROM. To do this, I want to buy SRAM with a size of 256k. SRAM communicates using SPI. The LCD communicates using SPI and the card reader communicates using SPI. Is it possible to use arduino for these purposes? What do experts recommend? Let me remind you once again, I am a beginner and would like to understand this area.
 
SPI data transfers are all started when the chip select is asserted so yes, you can parallel the SPI wires across several devices but each must have its own select (enable) pin. If you are short of I/O pins, don't forget you can use a binary decoder (74LS138 for example) to expand a few signals to 'one of many' signals to select individual SPI devices.

Brian.
 
SPI data transfers are all started when the chip select is asserted so yes, you can parallel the SPI wires across several devices but each must have its own select (enable) pin. If you are short of I/O pins, don't forget you can use a binary decoder (74LS138 for example) to expand a few signals to 'one of many' signals to select individual SPI devices.

Brian.

Can you show this with a simple example?
 
Hi,

basically that´s the idea of a bus.

As Brian write a ´138 device is very useful. It can generate up to 8 chip select signals. It helps to reduce microcontroller pin count and avoids short circuit on MISO line.
I usually us an 74HC138.

Important: the MISO of each device needs to be HIGH-Z when it´s SS in incative.

Klaus
 
Screenshot From 2025-02-08 06-51-39.png


Do I need to include this in the circuit for each input and output?

This is binary decoder (74LS138).
 
Do I need to include this in the circuit for each input and output?
What do you mean? especially with "this".

You use an 74xx138 to generate the individual SS_x signals

In doubt do a search for something like "SPI 74HC138 schematic" or "SPI binary decoder schematic"

Klaus
 
According to initial post, you want to use SPI interface besides other purpose for RAM expansion of your application. Consider that this method results in very slow memory access and also requires special compiler features for seamless usage in regular C code.
 
Well, experts, thank you. If there is anything else you can add, please write, I will be very glad of any help on my first journey.
 
Hi,,

we are no mind readers.
It´s on you to communicate your concerns and ask clear questions.

Klaus
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top