Jump to content
43oh

Communication Protocols, CAN, SPI etc..


Recommended Posts

Hello everyone!

 

Just wanted to say thank you for all the support and guidance everyone in this forum has towards beginners, you guys have been of so much help!!

 

Now, here is a question:

 

I am trying to interface 2 microcontrollers, a MSP430F5529 with a C2000 F28335 I was told the MSP doesnt support CAN, I would have to convert SPI to CAN and go from there.

What do you guys suggest? I have never successfully used communication protocols.

 

Any good examples of send and receive out there?

 

Thanks in advance!

Link to post
Share on other sites

Thanks everyone for your help.

What I need to do is send commands to a C2000 micro. I am trying to emulate a thermostat for a fan, I will be sending H, L, or M speed, ON or OFF and scheduling data.

What would be my limitations if i use I2C?

 

Again, thanks for all your help.

Link to post
Share on other sites

How far apart are the two devices?  I2C was originally designed for communication between chips on the same board or between boards in the same system.  Some have pushed it to greater distances by lowering the data rate and being mindful of the capacitance of the cable between nodes.  If you are trying to communciate over longer distances and/or electrically noisy environments, another possibilty that might be easier to implement than CAN would be RS-485.   The best choice will depend on the distance, environment and the data rate you need

Link to post
Share on other sites

Before diving into CAN, consider just trying it out with I2C, and if that doesn't work, try these: http://www.nxp.com/products/interface_and_connectivity/i2c/i2c_bus_repeaters_hubs_extenders/series/P82B715.html

 

I have used these in a project involving an in-car I2C network spanning from dashboard to trunk and they work perfectly.  They basically allow you to utilize a low-value pullup resistor (something like 250 ohms in my case) for the large I2C network, providing the buffering capability to allow simple CMOS MCUs with <10mA drive capability to properly drive the bus.

 

CAN is pretty cool but from the looks of your project and I'm assuming your experience, it's not the right way to go IMO.  I2C is much simpler.  If you use Energia, the "Wire" library implements it all for you.

 

edit: Those P82B715's come in DIP form factor too, the P82B715N, so you can prototype with them on a breadboard.  The downside is they're like $3-4 a chip but it was worth it for me.  I believe I could put together a CAN transceiver solution per-node for a tad less than that, but not a whole lot less and the coding would be more complex (having to manipulate an SPI CAN controller with a library vs. using the built-in I2C hardware available on pretty much all MCUs out there).

Link to post
Share on other sites

@@spirilis The I2C buffer chip looks pretty cool, didn't know such a chip was out there.  From a quick glance at the data sheet it looks like it is spec'd at 5-12V with derated operation at 3V. Given the OP will likely be at 3V supply/logic levels, in your experience do you think it will be reliable enough at the lower voltage level?

Link to post
Share on other sites

@@spirilis The I2C buffer chip looks pretty cool, didn't know such a chip was out there.  From a quick glance at the data sheet it looks like it is spec'd at 5-12V with derated operation at 3V. Given the OP will likely be at 3V supply/logic levels, in your experience do you think it will be reliable enough at the lower voltage level?

Ah thanks for checking that ... I am not sure.  I was using it with AVR/Arduino hardware.  Might see if NXP has another newer part that's better suited.

Link to post
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.

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