SPI, Master receiving data from the Slave, how to?
hi, might have made hard on myself on project.
perhaps it's best start @ beginning. final thesis extracting high resolution data. data (in case) generated @ 90 khz, know it's not fast arduino's. transportation "line" (fieldbus) has maximum speed of around 30 khz. means need buffer generated data, since don't want lose of it. far it's pretty straight forward.
now i've decided use spi communication. way i've setup case follows:
slave1 > master > slave2
slave1 = simulation of data generation. (arduino uno)
master = arduino due, because has possibility switch between multiple slaves
slave2 = fieldbus slave, gives interrupt master has send data slave (arduino uno).
so since i'm pretty new spi thought let's start basics. used example code http://www.gammon.com.au/forum/?id=10892 has been helpful.
i've been able send data master slaves, simple texts. without interrupt "talks" slave 1 , interrupt "talks" slave 2. far good.
now apparently quite hard do, want slave 1 send data master, instead of master sending data slave. mentioned before, i'd able send out data generating within arduino master. data kind of counters can go value of 17-bits.
all codes i've been able find ones master sends data only. while spi full duplex communication. i've found in link mentioned earlier example of code slave sends kind of information master. takes out byte send master register of spi library (if i'm correct). it's simple adding/substracting, puts new value in register (spdr), after master has given microsecond delay takes new value out of register. arduino uno master works. arduino due not accepting it'll return '0'.
for reason due can't setup slave uno. make 10 times easier since switch slave 1 master , master slave (since it's possible me use 2 due's).
i've read it's supposed possible sending exact same amount of bytes master slave slave has send master. no idea how realise (keep type of arduino's in mind).
i'd able remove simulation arduino , simulate data generation within master, means i'd leave out quite big part of "proof of concept" situation.
so question in simple form like: how can send buffer of data slave master.
i hope able me problem, if still cryptic sincere apologies.
i did quite extensive research on this, find solution within forum unfortunately not time.
kind regards , in advance!
perhaps it's best start @ beginning. final thesis extracting high resolution data. data (in case) generated @ 90 khz, know it's not fast arduino's. transportation "line" (fieldbus) has maximum speed of around 30 khz. means need buffer generated data, since don't want lose of it. far it's pretty straight forward.
now i've decided use spi communication. way i've setup case follows:
slave1 > master > slave2
slave1 = simulation of data generation. (arduino uno)
master = arduino due, because has possibility switch between multiple slaves
slave2 = fieldbus slave, gives interrupt master has send data slave (arduino uno).
so since i'm pretty new spi thought let's start basics. used example code http://www.gammon.com.au/forum/?id=10892 has been helpful.
i've been able send data master slaves, simple texts. without interrupt "talks" slave 1 , interrupt "talks" slave 2. far good.
now apparently quite hard do, want slave 1 send data master, instead of master sending data slave. mentioned before, i'd able send out data generating within arduino master. data kind of counters can go value of 17-bits.
all codes i've been able find ones master sends data only. while spi full duplex communication. i've found in link mentioned earlier example of code slave sends kind of information master. takes out byte send master register of spi library (if i'm correct). it's simple adding/substracting, puts new value in register (spdr), after master has given microsecond delay takes new value out of register. arduino uno master works. arduino due not accepting it'll return '0'.
for reason due can't setup slave uno. make 10 times easier since switch slave 1 master , master slave (since it's possible me use 2 due's).
i've read it's supposed possible sending exact same amount of bytes master slave slave has send master. no idea how realise (keep type of arduino's in mind).
i'd able remove simulation arduino , simulate data generation within master, means i'd leave out quite big part of "proof of concept" situation.
so question in simple form like: how can send buffer of data slave master.
i hope able me problem, if still cryptic sincere apologies.
i did quite extensive research on this, find solution within forum unfortunately not time.
kind regards , in advance!
quote
master = arduino due, because has possibility switch between multiple slavesevery master has possibility if client spi compatible.
quote
now apparently quite hard do, want slave 1 send data master, instead of master sending data slave. mentioned before, i'd able send out data generating within arduino master.you can send data slave master if master requesting it. master provides clock signal , selects slave pulling it's ss line low.
quote
so question in simple form like: how can send buffer of data slave master.simply copy data in spdr when master sends value. data sent master while slave receives data master.
Arduino Forum > Using Arduino > Networking, Protocols, and Devices (Moderator: fabioc84) > SPI, Master receiving data from the Slave, how to?
arduino
Comments
Post a Comment