Jump to content

Wireless winch controller


Tris Cocks

Recommended Posts

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 2 weeks later...

Right... Im back again :ph34r:

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Right... Im back again :ph34r:

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 :)

Link to comment
Share on other sites

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... :ph34r:

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We use cookies to ensure you get the best experience. By using our website you agree to our Cookie Policy