This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CAN for Senior Project using Stellaris?

Other Parts Discussed in Thread: SN65HVDA542-5-Q1, SN65HVD1050, LM3S2965

I am a student at Western Washington University and I could use some guidance....

For my senior project I wish to communicate between two or three boards using CAN protocol.  One board will receive user input and place that information on the CAN bus. While one or two boards will interpret that information and react accordingly. This is an over simplification of my project, but the foundation which I am running into issues with. 

Background:

I have been playing with the Stellaris LM4F120XL LaunchPad for the last few weeks. I have familiarization myself with CCS and some of the many features of this board. I realize that unlike the EK_M3S2965, this board is not a "Fully operational CAN Network-in-a-box". It does say that the launchPad can "Gluelessly attaches to an external CAN transceiver through the CANnTX and CANnRX signals".

My question:

If I can get free samples of the SN65HVDA542-5-Q1 (a CAN Transceiver) will I be able to achieve the same functionality as the EK_M3S2965 for a fraction of the price? I assume this has been done, is there any examples or material that I should be looking into?

I have only been programming off and on for three years, so please feel free to point out any obvious misunderstandings.

Thank you,

Jordan Mosher

  • Jordan:

    The TI guys have probably gone to bed for the night so...

    Everything you said sounds reasonable. I have a lot more experience than you -- but have done no CAN projects --- but based on your reasoning I would give it a shot.

    I am sure you will have the usual difficulties -- but what the heck -- nothing ventured -- nothing gained.

    The way you laid this out is excellent -- I commend you.

  • jordan mosher said:

    If I can get free samples of the SN65HVDA542-5-Q1 (a CAN Transceiver) will I be able to achieve the same functionality as the EK_M3S2965 for a fraction of the price? I assume this has been done, is there any examples or material that I should be looking into?

     Hi Jordan, answer is near yes, you need adapt the examples from DK, but take care about drivers you need the part with I/O at 3 Volt so from Datasheet:

    Digital Inputs and Outputs
    The SN65HVDA54x devices have an I/O supply voltage input pin (VIO) to ratiometrically level shift the digital logic
    input and output levels with respect to VIO for compatibility with protocol controllers having I/O supply voltages
    between 3 V and 5.33 V.
    The SN65HVDA54x-5 devices have a single VCC supply (5V). The digital logic input and output levels for these
    devices are with respect to VCC for compatibility with protocol controllers having I/O supply voltages between
    4.68 V and 5.33 V.

     Simply attach RX TX then VCC to 5V and Vio to 3.x Vcc pin of processor to translate logic levels.

  • Evaluate also isolated version sn65hvd1050 of CAN driver, again select correct version.

    http://www.ti.com/product/sn65hvd1050&lpos=See_Also_Container&lid=Alternative_Devices

  • Agree w/others - your plan appears sound.  Much of the code w/in original CAN Kit should directly apply in your application.  (but beware the more intense pin set-up/config required by the LX4F MCUs) 

    To ease your construction - you may search for "dip" style CAN xcvr.  Suggest that you either design/develop small pcb - or construct w/small proto board.  Remember to include the appropriate power and ground signals for each of your CAN xcvr boards.  (and I'd add 0.1uF cap across xcvr power pins)   Note that you'll require 3 such boards.  (one for main controller - two for "remote" boards)  Suggest that you invest in "single" power supply - so that all boards come up/down in sync.  Keep your communication leads short - locate boards as close together as possible - unwanted noise pick-up will add unwanted challenges to your work.  I'd add a small smt Led to each CAN board - so that you can confirm that power has reached each.  Be consistent in your color-coding of communication wiring and power.

    While "free" often is good - adding time/delay to your project is not.  The 3 CAN xcvrs you require are not likely to "break" your bank - and your school should provide some level of financial support.  (God knows - they charge enough)  If we "move" from free - perhaps the time/effort devoted to "making" add-on CAN xcvr boards can be eliminated by purchasing ready made boards!   Sparkfun may be such a source - or CAN IC vendors may so offer...

    I always look for ways to "ease/simplify" such projects.  As stated - you're tasked with "both" transmitting and receiving over CAN.  Thus - you have 2 (new for you and your hardware + software) requirements.  This adds "FUD" (fear, uncertainty, doubt) to your project.  Perhaps you can locate/acquire a relatively "simple" CAN device - so you "know" (for sure) that - at least - "one end" of your signal requirement works!    Without this "proof" you cannot be sure if your TX, RX (or both) are in error during your initial test/verify.  (i.e. too many unknowns ...)

    *** Update *** Nigtmare scenario just dawned - during development - you will need to debug/program two such launchpad boards.  (later three)  Do you know how to achieve this?  Does CCS even support this?  Can you open 2 CCS Windows - and talk to 2 different launchpads - at the same time?  (actually - one at a time - but you see my point)  Devil in such detail...

    There may well be a clue w/in your earlier referenced EK_LM3S2965 CAN Kit.  See if/how they suggest you "view" CAN data passage between "master" and "slave."  I don't use CCS - am unable to guide there. 

     

  • Thank you to all have posted,

    Roberto, I appreciate you pointing out the errors that I have overlooked in the selection of my CAN transceiver. In the haste of finding a solution to my problem, I posted the first option I came across without reviewing my specs. 

    CB1, your delay and PCB information has been taken to heart. I have experience with, and access to, PCB equipment. It is a painful process, due to the donated equipment that my college can afford. I am one of a few individuals in my major who has successfully built a PCB using our system. Which is made inconveniently complicated due to machines that are roughly twenty years old. I plan to make a PCB, but I would like to keep it as simple as possible(Keeping the processor on the dev board if possible). Previous PCB's have taken me two weeks to get functioning, and were slightly less complicated. 

    As for cost, I would prefer to put in the extra effort to reduce cost at this point. The process of getting funds for these kinds of projects seems to take longer and require more work than benefit. I do have some connections, but my goal for this project is to try and keep things reasonable. I want to showcase my determination, and I am tired of seeing people buy their projects...

    I have outlined in my project proposal, which I have not posted, this project is to broken up into stages. The first, and only stage I am committed to completing, is a one way communication from the user too the satellite board(s). But, I do understand the importance of feedback, and I hope that I will be able to incorporate two way communication into his project. I have accomplished communication of various protocols between boards in the past using other boards. I agree that it is more difficult using one computer, but with the help of digital oscilloscopes I have been successful.

    I am full of "FUD", but this motivates me to work harder on my project. I have roughly five months to turn my idea into reality and I don't want to waist two of those months with false confidence. 

    I do have one additional question, how short is short? When you say I should keep my communication leads short, I assume you are referring to the Rx and TX too the CAN Transceiver? And when I am testing without a PCB do you believe a three-inch jumper is going to impact my communication?

    Thank you,

     Jordan Mosher

  • Jordan - very nice, quick yet keenly detailed response - motivates myself/others to, "try and assist."

    jordan mosher said:
    I am tired of seeing people buy their projects...

    This is a great attitude - hope that you (and others) can sustain this. 

    I can assure you that while 5 months seems like, "forever" - you will encounter "hiccups" - and Mr. Murphy will visit @ inopportune times - count on it.   My suggestion of pcb design/build was only to include the necessary CAN xcvr chip - and 2 connectors.  (one connector to receive power & MCU-CAN signals from master CAN board - 2nd connector to carry power and Xcvr CAN signals to your "slave" CAN board.  May be easiest if these are 2 edge connectors - screened as to functionality - and placed at opposite ends of your board.)  Note: the CAN pcb I propose - which mounts adjacent to your Slave CAN MCU board - works just as the master CAN board.  Please realize that CAN transceivers "talk" only to another transceiver - each MCU talks to its unique, connected CAN transceiver.  (thus MCU_master -- CAN Xcvr1 ---- CAN Xcvr2 -- MCU_Slave.)   Is this clear?  TX of CAN xcvr connects to RX of 2nd CAN xcvr.   TX of MCU connects to TX of CAN Xcvr. 

    In no way did I mean to suggest that you build a Pcb containing MCU - of course - use launchpads - and be sure to buy at least 2,3 spares.  (just in case)

    Re: short - the trace lengths (and you must include the length of cable/wires to your CAN-Xcvr boards) of both CAN-TX and CAN-RX (low level) signals should be as near equal as possible.  (and avoid any capacitance)   Suggest that you start with your CAN-Xcvr board w/in an inch or so of the launchpad's edge connector.  (I fear that CAN-TX and CAN-RX may have routed to opposite edges of launchpad - you must check.)  Overall - suggest that the 2 launchpads be about 1 foot apart - I'd mount these to a sheet of plastic (so all secure) and use a bigger sheet so that distance may be increased up to 2 feet.  (sometimes - "interference" occurs between 2 pcbs mounted too close together.  (believe it or not - garage door "receivers" used to generate enough RFI that 2nd "receiver" was "blocked!"

    Best speeches always on the ride home...  Suspect that a simple 3V3 RS232 xcvr chip (smallest one you can find) would be most worthwhile addition to my suggested CAN Xcvr board.  This enables you to "talk" between your MCU and a PC or other terminal - always helpful/advisable.  You must add another connector pair for the RS232 - again I'd "screen" these on this "accessory" pcb...

    I don't like the idea of using USB cable/connector as "serious" power source.  Power glitches will make you crazy - suggest that you find/acquire a solid, 5V regulated source which is capable of powering 2 or 3 launchpads and all CAN xcvr boards.  (you can do that calculation)  You want to insure that all boards power up/down in concert...

    You do discount the suggestion of searching for/finding a "known good" CAN device.  This will save you much agony - I am certain.  Less than ideal policy to reject a suggestion w/out even trying - having a "safe" harbor is something we sailors always seek out - even when we don't really think that we need one...

     

  • jordan mosher said:

    I do have one additional question, how short is short? When you say I should keep my communication leads short, I assume you are referring to the Rx and TX too the CAN Transceiver? And when I am testing without a PCB do you believe a three-inch jumper is going to impact my communication?

     If you start with low speed communication test (under 500K also 20cm don't care too much) but use a good design too, insert two ground wire and twist together one with Rx and one with Tx wire then twist both to reduce crosstalk and external interference too.If you are in an RF quiet zone and have no cell phone near board then wire on interface are quiet too.

  • Roberto Romano said:
    If you are in an RF quiet zone

    And just "where" - on this planet - might that be - mon ami?  (Cherchez le "LOS" (NASA term - loss of signal)

    Our firm has a 10 by 10' "sound room" - lined with perforated steel (both inner and outer walls) which does "double duty" as sound and RF field testing.  Even with this - 50KW AM station penetrates (TX antenna 5 miles away) and other "offending" RF signals sometimes, "get thru."  Signals are substantially reduced - but this should illustrate that "escape" from RF in today's "connected" world is a challenge...

  • cb1_mobile said:

    And just "where" - on this planet - might that be - mon ami?  (Cherchez le "LOS" (NASA term - loss of signal)

     I am sorry for you, I hope you light up like a fluorescent bulb night and day... During day this can be screened by solar radiation...

     50KW AM did it means as MW .5-1.7MHz broadcasting transmitter? I am quite sure this is not a big trouble like a cell phone near wire. So screening a LONG wave is more simple than screening microwave due to energy carried by photon. Different approach need to do compliance, I got more trouble from an FM 88 MHz 200W transmitter located 200m away from a lab...

     Again I don't believe radio frequency level (EIRP) can be so high due to antenna radiation theory, the worst again can be cell phone due to high energy pulse @ microwave.

  • Indeed - 50KW AM station @ 720KHz.  Always able to penetrate our "Sound/Quiet Lab Room" - we enforce cell-phone quiet - have never been bothered (or didn't recognize the source) from them.   During a ball-game - in between pitches - scoped MCU GPIO input signal drops - as they talk/modulate - signal rises in sync - fairly convincing...

    At times - that same AM signal can be heard on our landline (telephone) system as well.  Have never been bothered by a cell.

    Your theory appears valid - but our "real world" experience is - as reported...

    As original poster has abandoned our follow-up - I'll leave his subsequent rescue to you/others - his start/stop not for me...