FridgeFreezer Posted November 18, 2011 Share Posted November 18, 2011 There should be a data sheet for each bit explaining what all the pins are, how they communicate etc., and also how SPI works. Manufacturers like to give things different names and different ways of working - MOSI/MISO can also be DIN/DOUT, Chip Select lines can be active low or active high, and in the micro we use you can set 4 different ways to clock & sample the data. I would recommend getting yourself a BusPirate and USB logic analyser board from Dangerous Prototypes as these will allow you get things working / locate problems an awful lot easier. The BP allows you to plug one bit into it and talk SPI commands so you can suss out if it's really working, what order to send commands, etc. before making the next bit talk. Otherwise you can find yourself tearing your software apart when it's not working only to find the other end isn't talking the same language. Quote Link to comment Share on other sites More sharing options...
CwazyWabbit Posted November 18, 2011 Share Posted November 18, 2011 Different manufacturers use different names/conventions and sometimes datasheets leave a little to be desired, that transciever data sheet only labeled the clock and data in as SPI and left data out just described as Serial Data Out (SDO) .... a little more reading of the datasheet makes me think the SPI interface is used for configuration and status monitoring and the actual data you want to send to, and recieve from the other station will need to be sent using bi-directional pin 3 and clocked via pin 4 Quote Link to comment Share on other sites More sharing options...
CwazyWabbit Posted November 18, 2011 Share Posted November 18, 2011 Might make your life easier to add the encoder/decoder IC http://www.rfsolutions.co.uk/acatalog/DS803ALPHA-1.pdf I haven't read the whole datasheet but it's worth a look. Suggest using it to greate a remote control Quote Link to comment Share on other sites More sharing options...
Pinn76 Posted November 20, 2011 Share Posted November 20, 2011 I'm a member of Challenge Southwest who run winch challenge events in the west country. One of our top competitors co-driver has a remote for the winches, all 3 if I remember correctly. If you sign up to the forum I'm sure he would be willing to give you some advise as to what he is using. He goes by the name of 'Odd Limbs' HTH best of luck. Quote Link to comment Share on other sites More sharing options...
Tris Cocks Posted December 2, 2011 Author Share Posted December 2, 2011 Right... Im back again I have been trying to send data over SPI for the RF Transceivers however im banging my head against a brick wall and getting nowhere fast! After a meeting with my project supervisor today (who is good with programming but has no prior knowledge of SPI interfaces) he has suggested that one option would be to use a different RF Transceiver that uses preferable Serial or I2C interfaces as he has lots of knowledge about these types of interfaces. Can anybody point me in the direction of a RF Transceiver module that would be suited to my project... although i have been tempted to rip apart a remote control car and see what information i can get from that! Thanks for the help Tris Quote Link to comment Share on other sites More sharing options...
Ed Poore Posted December 3, 2011 Share Posted December 3, 2011 Are you sure that you've got the clock polarities and so on correct? I spent ages debugging an SPI acellerometer for one of my projects and eventually realised I had misread the data sheet. The other option is to slow the clock speed right down first to see if that works. Since SPI is non-differential then it can be quite susceptible to noise. Quote Link to comment Share on other sites More sharing options...
Ed Poore Posted December 3, 2011 Share Posted December 3, 2011 Also unless you already know you have I2C or UART working then you're likely to be wasting more time. Quote Link to comment Share on other sites More sharing options...
CwazyWabbit Posted December 3, 2011 Share Posted December 3, 2011 Right... Im back again I have been trying to send data over SPI for the RF Transceivers however im banging my head against a brick wall and getting nowhere fast! After a meeting with my project supervisor today (who is good with programming but has no prior knowledge of SPI interfaces) he has suggested that one option would be to use a different RF Transceiver that uses preferable Serial or I2C interfaces as he has lots of knowledge about these types of interfaces. Can anybody point me in the direction of a RF Transceiver module that would be suited to my project... although i have been tempted to rip apart a remote control car and see what information i can get from that! Thanks for the help Tris Why not buy the encoder/decoder IC's the company makes? I posted the data sheet link http://forums.lr4x4.com/index.php?showtopic=70225&view=findpost&p=619647 earlier in this thread. That IC will make life MUCH easier for you.... and if you really need to make it more complex you could buy the IC's anyway and then monitor their comms to sort out yours Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted December 5, 2011 Share Posted December 5, 2011 SPI IS Serial, and I2C is just SPI with an extra bit of cunning signalling. Things that can be wrong with SPI: - Clock polarity - Data changes relative to clock changes (does the device sample the data when the clock goes high or goes low?) - Chip select lines (CS or /CS), are they working, are they the correct polarity, are you giving enough time for them to settle before squirting data about? - Clock speed - Master/slave devices, you may need to send dummy data to the slave device to generate the clock pulses so it can send real data back to you (for every byte you want back, you have to send a dummy byte), you may need to configure the micro as master, and you may need to setup clocks/prescalers/divisors. There's only so much that can go wrong with SPI, you should at least be able to see what's going on with an oscilloscope (is it generating clock pulses, are the data & CS lines changing?). With a digital storage scope (your uni must have at least one somewhere) you can read the data bit-by-bit, or you could use the BusPirate or Open Logic Analyser someone told you to beg borrow or steal quite a few posts ago... But hang on a sec... you're using an Arduino so there must already be at least one known working SPI library for it out there, surely??? reversing up a bit: - Do you know the micro is working? - Have you managed to make an LED flash? - Do you know the pins you're using are working? Quote Link to comment Share on other sites More sharing options...
FridgeFreezer Posted December 7, 2011 Share Posted December 7, 2011 Here's a fairly straightforward guide to bit-banging SPI: http://www.maxim-ic.com/app-notes/index.mvp/id/4184 Quote Link to comment Share on other sites More sharing options...
MrKev Posted December 7, 2011 Share Posted December 7, 2011 I have been trying to send data over SPI for the RF Transceivers however im banging my head against a brick wall and getting nowhere fast! After a meeting with my project supervisor today (who is good with programming but has no prior knowledge of SPI interfaces) he has suggested that one option would be to use a different RF Transceiver that uses preferable Serial or I2C interfaces as he has lots of knowledge about these types of interfaces. A little disturbing. I would question the use of a supervisor who cannot work this out with you, and would consider asking around some otehr students who may be able to give you a few pointers. SPI is a tried and tested interface, and well documented. A 'scope, and the datasheet should be all you need to find out why this interface is not working as you wish. If you want to post / send any waveforms for me / anyone to take a look at, by all means do. Kev Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.