First try at daisy chaining SPI chips using a Seeeduino Xiao.
The 5v/GND is coming from a USB cable connected to the PCB (not via the XIAO). This will most likely be connected to a laptop (for power only).
What else should I include in this circuit? Should there be any pull-up (CS/Reset?), pull-down, noise filters, etc?
Do I need to add any power protection in case it gets plugged into a USB wall brick? Since the Xiao has a regulator on the 5v side, I could run the SPI chips off of the 3V3 pin? Or, I believe the Xiao can run on 3.3v, too, so I could move it all to 3.3v and use a rectifier on the USB 5v line in?
The goal is to free up a Mega w/ prototyped shield and make this a stand-alone project box with the Xiao mounted on the PCB with the MAX395 chips. Breadboard tinkering with the Xiao and the MAX395 had some occasional erratic switching, but I assume that was do to flaky breadboard connection(s).
Read the XIAO specifications.
It says the MCU runs on 3.3V. The onboard regulator converts the 5V input to 3.3V.
The GPIO cannot tolerate anything higher than 3.3V so your schematic as shown would damage the XIAO.
For general I/O pins: Working voltage of MCU is 3.3V . Voltage input connected to general I/O pins may cause chip damage if it' higher than 3.3V .
For power supply pins: The built-in DC-DC converter circuit able to change 5V voltage into 3.3V allows to power the device with a 5V supply via VIN-PIN and 5V-PIN.
Please pay attention to use, do not lift the shield cover.
Did you read any of the XIAO specification information ?
Did you read the MAX395 datasheet ?
Where did you get the schematic you posted ?
The only 5v into the XIAO is into the regulator. The XIAO is powered by the circuit, not the USB port.
The rest of the XIAO connections are outputs (Reset/ChipSelect/MOSI/Cock) are therefore at 3v3, and are enough to trigger the MAX395 (min 2.4v). Also, although I don't use it, the return MISO from the MAX395 would be at 2.8v, so it could feed back to the XIAO without exceeding the 3v3 limit.
That is assuming I read the datasheets correctly?
However... when I was working on how to include all the other stuff needed, I realized that I would not be able to easily use the common pull-up or decoupling methods, so I changed the schematic accordingly. Now, the +5v is supplied by the circuit to the XIAO regulator, and then this part of the circuit will run on 3v3 provided by the XIAO regulator.
I added pull-up resistors for the CS and Reset lines (to 3v3), and decoupling capacitors at the power into the XIAO (5v), as well as each of the MAX395 ICs (3v3). The values indicated were pulled from other peoples posts/guides. Any input on those values would be greatly appreciated.
I made the schematic in KiCad. Had to make the symbols, too, since they weren't part of the default library. I cleaned them a bit in the new schematic.
[edit: fixed the circuit diagram - CS/Reset junction]
In daisy-chained mode the MAX395 is not really doing SPI protocol, but acting as a simple shift-register.
Your latest circuit diagram shows CS shorted to the reset line above the second MAX395 - a mistake perhaps?
Yes. And yes. [fixed]
I had considered running CS to individual chips, but that would take up more pins on the XIAO. And, there aren't a lot of those to go around. There will be some other stuff needed on the final project ('status' LED, tact switches for 'next' and 'reset', etc).
Sadly, the circuits i am 'switching' are not on a common ground, and varying voltages, so this was the easiest way I found to do it. Trying to move to a smaller footprint, from a bunch of optocouplers in parallel (taking up lots of pins on a Mega shield).
Also, this is not going to be used for high speed switching and it will usually only be a single switch on at a time. The effect of the switches have to visually confirmed, and some of the circuits take a short while to get started.
This will be my first custom PCB order, so I am trying to make sure I have it all figured out. Because, even though it may 'work' on the breadboard, that doesn't mean it is right.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.