Hello
I'm trying to connect SPI FRAM breakout to XIAO nRF52840 using CircuitPython.
When provided examples threw OSError I tried to follow this generic SPI tutorial. I found out that i can't obtain a lock on the bus
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
code.py output:
Traceback (most recent call last):
File "code.py", line 8, in <module>
File "/lib/adafruit_fram.py", line 359, in __init__
OSError: FRAM SPI device not found.
Code done running.
Press any key to enter the REPL. Use CTRL-D to reload.
I'll try to use my multi meter in continuity mode from MC pads to elements on breakout board.
//
Continuity test from MC to components on breakout board was successful. Also tested for shorts between pins of breakout board, No shorts.
Sorry for bad pics, but that's the maximum my phone can do.
It looks you are using the 5v pin on your SEEED XIAO (black wire). Be sure and change that to 3v3 since your have a 3v3 controller all the SPI communication should be happening at 3v3.
Also you have a blob of solder on the FRAM board end pin. Probably best to briefly go over each pin for a bit more flow.
mikeysklar wrote: ↑Tue Nov 22, 2022 3:20 pm
It looks you are using the 5v pin on your SEEED XIAO (black wire). Be sure and change that to 3v3 since your have a 3v3 controller all the SPI communication should be happening at 3v3.
Does that mean that signals send from MC to FRAM was too low to be read correctly? But that didn't help.
mikeysklar wrote: ↑Tue Nov 22, 2022 3:20 pm
Also you have a blob of solder on the FRAM board end pin. Probably best to briefly go over each pin for a bit more flow.
Probably that was the problem. After reflowing all the pins, now i can read and write to FRAM. Thanks a lot for the suggestion. Any advice how to prevent that from happening again?
Last edited by Yasen6275 on Wed Nov 23, 2022 3:04 pm, edited 2 times in total.
Your MC is a 3v3 device so you want everything hooked up to the be running at 3v3. The danger in using the 5v line off the XIAO and sending that over the FRAM is that when the FRAM is communicating back with the XIAO it will be doing so at 5v feeding into the XIAO SPI pin. You could damage the XIAO.
As far as the soldering I'm glad to hear that going over each pin again with a iron resolved the issue. Just making sure you get good flow on each pin will prevent this happening in the future. Your soldering should look more like puddles than blobs.
You had not mentioned the value you were seeing 8k addresses.
There is a different address size on the FRAM devices. The 4Mb is a 4-byte address size (32-bit or double word). It uses fram.begin(3) in the Arduino section of the guide. I realize how obscure that is when you are using CircuitPython. The smaller FRAM devices use the default 2-byte, single word address sizing.
You can try using this to determine fram size and work in a usable address space. I would expect your unit to show 125k usable addresses (32-bit per address).
import board
import busio
import digitalio
import adafruit_fram
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
cs = digitalio.DigitalInOut(board.D7)
fram = adafruit_fram.FRAM_SPI(spi, cs)
# size returned by len()
len(fram)
# can be used with range
for i in range(0, len(fram))