Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

UART-Driven CAN Controller

Status
Not open for further replies.

dknguyen

Well-Known Member
Most Helpful Member
Hi. Is there an IC out there that will allow me to feed a uC's UART into it and it will do all the error handling and all transparently so that I can use my UART as if it was a CAN port?

If that's not possible, can I have a UART use a CAN line driver (rather than an RS485 line driver) to get the dominant/recessive bits for collision handling?
 
I'd use a dsPIC30F4011 that has built-in CAN, but the dsPIC30F2020 has a lot more stuff I need- the only thing it is missing is CAN (it has current limiting, built-in comparators, lots of fault lines, fastesr ADC, internal clock dithering, and a ton of different PWM schemes), all of which I need more than CAN. I'm just trying to find a way to get everything with as little effort as possible.

THe only two serial communications pins I have available are the UART lines, and it'd be nice if I could get some multi-master, differential, error-checking type protocal in without having to do it in software since the uC will be doing some time sensitive things (and I might exceed program memory if I try that in software...or I'm just lazy.).
 
Last edited:
It is a great deal easier to use a CAN Controller as a "syncronous" USART to transfer single characters, than it would be to imbue a standard serial port with the functionality of a CAN controller. The closest you might get is a CAN controller with an SPI interface, but I don't recall the microchip part number, maybe MCP2510(??)
 
Could I just use a CAN transceiver on the UART and use a simple address scheme for multi-master using the dominant-recessive as collision detection? I don't need error checking...(if I do I'll just do the send and send back error check). This doesn't need to interface with other CAN circuits...just between my own built circuits.
 
I suppose it depends on how you plan to do the bit error detection. Even if you can detect an error you can't shutoff the UART transmitter the way a CAN Controller does when it looses arbitration. You can basically do anything you want. Making it work in a useful way is the problem.
 
Maybe I should just make it single-master then and the slaves only send data when requested rather than initiate it on their own. Ahh the concessions. I hate concessions.

Is there a link to where I can read about how RS485 arbitration is done?
 
Oh, this is for a motor driver right now for a robot. Serial controlled by a "navigational" computer. I'm sort of stuck with UART one way or anotehr though since those are the only free pins left on the uC. (Unless I make the I2C pins hop back and forth between SPI functionality.
 
Yeah, the only information that the motor controller would ever send back on it's own is odometry readings so they could be coupled with intertial readings. But even then, you could just always request them frequently.

It just means that the IMU and the navigational computer would have to be one and the same (bus master) or that the nav computer (being bus master) would have to act as a middle man retrieve the odometry reading and then pass it onto the IMU (if it was separated from the navcom).

It's probably not wise to have an IMU, navcom, and motor driver all trying to pass time sensitive data over the same bus anyways. The driver would always be sending odometry readings to be processed by the IMU and the navcom woudl always be requesting the processed data from the IMU over the same bus.

Single master it is, and I guess the IMU is now the navcom as well.
 
Last edited:
Hmmm it seems RS485 line drivers need a separate enable receive/transmit input and I can't spare the pins for that (I guess that the reason CAN can do without them is becuase you can just hold the transmit line in recessive while you're listening so you will not fight the transmitting line driver?). THey also don't seem to have as common mode voltage fault tolerance as a CAN transceiver. Maybe I just don't know where to find them?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top