Here are my notes so far. Any comments or issues please let me know. I think I am on the right track.
Here are my notes so far. Any comments or issues please let me know. I think I am on the right track.
Ok!
I have learned that I should use pins 24/26 as CE0/CE1 instead of pin15(GPIO 22) because this alleviates me writing extra code. I plan on using Python SPIDEV from GitHub...
Thanks for Elektor Academy - Hardware Hacking the RPi pointing this out. Excellent if you want the details
Question: What to do with HOLD pin? I need it to stayhHigh. Also how to make the CS pin be high but go low when transmitting?
Thanks,
Clem
Hi Clem,
Use a pull-up resistor (10K should be just fine) with the HOLD pin.
The CS handling is done by the driver.
I found an example here involving MCP3008. This chip uses an active low chip select as well as the 23K256. Good luck!
Just to be clear:
V3.3 ------- R1(10K) -------- HOLD
What state is the CS when I boot up? I put power on the 23K256 and the bootup for the Pi goes crazy with strange errors. Take power off the 23K256 and no problem...
Thanks
Yes, you are correct about the HOLD pull-up resistor.
As for the CS state, I have to check it on my board as well. Can you try to disconnect the SO pin of the 23K256? Of course, this means the SPI communication with this chip won't work but it is worth checking if this is the cause of the strange errors you're seeing.
Hi Clem,
Congrats!!! It is good to hear everything works fine with the SPI memory. Good luck with the tests!
After you play with SPI maybe you can try some I2C chips as well. There are so many interesting I2C chips (pressure, temp, acceleration sensors, gyros, magnetometers, ...) you can attach to the RPi.
Hi Clem,
Congrats!!! It is good to hear everything works fine with the SPI memory. Good luck with the tests!
After you play with SPI maybe you can try some I2C chips as well. There are so many interesting I2C chips (pressure, temp, acceleration sensors, gyros, magnetometers, ...) you can attach to the RPi.
Well I am stuck again, but this time I think software. I can program using python, but nothing gets stored(?) and the chip does not respond (0XFF) ! If I unplug the chip's +3 volts, all responses are 0X00... I am too close to this to figure it out. Ask me questions to send me on the right track.
Thanks,
Clem
You've now reached the stage where I would connect the 4 channel scope or a logic analyser !
Do you have either ?
If not you can try posting your code and we'll see if we can pick our way through it.
MK
HI @bbolo1
No scope (Yet), but have voltmeter and was thinking to use over SO/MISO and ground. It is also a current meter as well. Will do some I2C next after this works.
Thanks,
Clem
Well post the code here and I'll see if I can pick my way though it.
If you are bit banging the SPI you can add logging features to the code to trace each pin state as it runs.
MK
Well guess what...
I decided to pull everything and remount changing colored wires and new positions and the thing is working! So cannot tell what is wrong!?! I have a few bit flips, but that may be timing or something. But progress is being made. Thanks for the help. Next is a code rewrite/cleanup because so much extra stuff
Clem
I'm glad it's working - how fast are you running the spi clock and how long are the wires ?
Any chance of a picture ?
MK
Sure I will sum this up experiences and all. Thanks @Michael Kellett for kind words of encouragement