SPI Slave Sketch Example #901
Replies: 1 comment 2 replies
-
Spi slave on arduino is hard to pull off within the arduino api. It must be
implemented dmanually (look around, nobody else has an spi slave library
either. You've got to do it manually (for example, attached interrupts are
dead before the arrived, because if you are calling a function that it
can't inline, from the isr, the interrupt overhead is such that the timing
constraints at typical spi clock speed simply cannot be met. Even with
tight hand written isrs, it's tough. The core of the problem is thst you
can't clock stretch like i2c and to compound thst issue, spi clock speeds
are often higher. Even with buffered mode and manual interrup, if the sck
clock isn't on the low side, it's just not going to work because the
arduino can't get data into the buffer before the master tries to clock in
or out the next byte. I recommend wire slave, usart, or basically any other
means of communication unless you are a real wizard, and/or are flagrantly
abusing the spi module (as in, you're slave, but you're just using it as a
shift register and being your own master, combing with evsys and ccl to to
output those weirdo custom.protocols.
…____________
Spence Konde
Azzy’S Electronics
New products! Check them out at tindie.com/stores/DrAzzy
GitHub: github.com/SpenceKonde
ATTinyCore: Arduino support for almost every ATTiny microcontroller
Contact: ***@***.***
On Tue, Jan 24, 2023, 00:56 Nathaniel.Belles ***@***.***> wrote:
Hello,
I have not used the SPI interface much at all and definitely not as a
slave and am looking for a simple example writing data from the master to
the slave. I have found some examples for generic Arduino's around the
internet but I'm not sure that they work with this core. Any help would be
greatly appreciated.
Thanks!
—
Reply to this email directly, view it on GitHub
<#901>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABTXEW2SPYGB5ZKKIPMHYXDWT5VIRANCNFSM6AAAAAAUEVUHCM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
Nbelles
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I have not used the SPI interface much at all and definitely not as a slave and am looking for a simple example writing data from the master to the slave. I have found some examples for generic Arduino's around the internet but I'm not sure that they work with this core. Any help would be greatly appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions