CAN Transceiver chip usage (without CAN Protocol) - Page 1
Forum section: electronics / projects

author: Docara
author_rank: Regular Contributor
timestamp: June 09, 2018, 09:33:50 pm
content: Hello Everyone,I'm looking to implement a serial connection between two micro-controllers. The data will only be very basic and infrequent eg occasionally updating from a remote RTCC clock,remote LED display state etc, however the length and route is problematic for noise. I need a wake command so RS485 is out, (unless I've missed a something) these also have basic cable diagnostics included which is always helpful.I was wondering could I use a CAN transceiver chip (eg TLE6251-2G or NCV7341) without the full headache of the full CAN protocol on top of it and just knock up my own?Installing a new 'proper' TP cable realistically is a non starter but I do have spare 1 pair of wires already in place which aresortof twisted together and I was hoping to use those.Has anyone used these types of IC's in anger and could off an opinion?ThanksMatt

author: langwadt
author_rank: Super Contributor
timestamp: June 09, 2018, 10:56:09 pm
content: Quote from: Docara on June 09, 2018, 09:33:50 pmin the beginning CAN was done with rs485 drivers, so ..

author: sleemanj
author_rank: Super Contributor
timestamp: June 09, 2018, 11:01:07 pm
content: I've done it just for an experiment short distance, using a pair of TJA1050 modules.Works fine, what goes in one end on TX, comes out the other on RX, super simple.

author: fsedano
author_rank: Contributor
timestamp: June 09, 2018, 11:40:46 pm
content: Hello,Curious on what uC you have on each of the sides. Isn't choosing one with integrated CAN (or using one of the external CAN interfaces like MCP2561) an option?Usually 'reinventing the wheel' is not a good idea, and the integrated CAN saves you A LOT of time..Quote from: Docara on June 09, 2018, 09:33:50 pm

author: nano
author_rank: Contributor
timestamp: June 10, 2018, 07:25:25 am
content: Some CAN transceivers have a "dominant bit timeout" protection which can disable the transmitter. Make sure to not exceed this timeout with you own protocol.

author: Siwastaja
author_rank: Super Contributor
timestamp: June 10, 2018, 10:36:44 am
content: CAN transceiver ICs are specifically designed for the "full CAN protocol", so if you just want the differential electrical signaling without ugly surprises, why not consider an RS422/RS485 transceiver, having similar robust signaling? You can simply drive your microcontroller USART with that.

author: max_torque
author_rank: Super Contributor
timestamp: June 10, 2018, 03:51:12 pm
content: A half duplex RS-485 transceiver would seem a much better idea to me!And yes, most CAN transceivers have a TX time out to prevent a failed node disrupting the entire bus, usually set at around 1ms

author: Haatveit
author_rank: Regular Contributor
timestamp: June 10, 2018, 07:32:47 pm
content: Currently working on a similar project. I went with off the shelf RS422 drivers and receivers, since all they really do is translate a single-ended signal to a differential one, and vice versa, they don't really care or understand any particular protocol. I went with Texas InstrumentsALS192 DriverandALS193 Receiver.Using this and some RJ45 breakout boards (I posted about one I made on Redditthe other day, with pictures), you can get some pretty long reaching basic serial comms, like I2C etc. That doesn't seem to be within the scope of what you're doing, but, either way, I think something like a RS422 driver/receiver pair would be better than CANBUS...!

author: Docara
author_rank: Regular Contributor
timestamp: June 11, 2018, 09:42:36 am
content: Hi Thank you all for the replies,Yes I did consider RS485 but as mention in my original post, I want/need a wakeup function. As I only have 2 (loosely twisted) wires available and one of the transceivers I found (not posted) specifically stated a tolerance to poor wiring topology that have been designed for noisy automotive environments with tolerance for transients etc this is why I thought about using them. What I didn't know is whether or not the could be used this way - hence my question here.To clarify what I'm researching is the feasibility of having have a remote wakeup signal to a (sleeping) power supply. After a suitable startup delay start communicating and commanding a second uC. Then power down again. The two units are 4m apart but 12m route length and fully in a steel hull with steel bulkheads in-between. I and have tried using Bluetooth and WiFi on other devices in the past without success. The wires I have installed are contained within flexible conduit and impractical and impossible to install 'proper' cabling for communication. The wired I have available formed part of a screened 7 core signal cable (240Vac rated) which I stripped down and kept the bundle and included it a cable pull to allow for some spares if needed in the future. They are 'loosely' twisted together as part of the original manufacturing process.With reference to the reply asking about CAN on a uC I have considered it and would love to use one but my level of programming skills do not extend to using these when I looked at the Datasheets if was ...scary!! Also as the amount of data passing between the two is minute, 5 bytes maximum ish at a time and very infrequent I can afford to have a slow link there is only ever going to be 2 devices.So can I take away from the replies that I could use 2 of these types of IC and (basically) just connect them up to a uC UART and jobs done?ThanksMatt

author: Haatveit
author_rank: Regular Contributor
timestamp: June 11, 2018, 05:59:23 pm
content: At low speeds / low data rates, I don't even think you necessarily need to worry about twisted pair or differential signaling. 12 meters is not that long a distance. I think, if you slowed down the signaling rate you could easily go with single-ended signaling. What you could (and probablyshould) do is try to measure the noise on the line with some test signals. Feed in a square wave on one end - and look at the result on the other end with an oscilloscope if possible. Turn down the frequency until it looks workable. If the line is noisy, you could add some Schmitt trigger action on the receiving end - this will clean up the signal, as long as the noise amplitude isn't insanely high (more than the Schmitt trigger thresholds). You can find dedicated Schmitt trigger IC's, or you can look for something like a 74 series inverters or logic gates, some of them have Schmitt inputs (but some don't, so make sure).If you wanted to get really adventurous it's also possible to do some error detection and / or correction on the signaling.Wikipedia. Some error correcting schemes are relatively simple to implement and grasp, and could be worth the time.

author: abyrvalg
author_rank: Frequent Contributor
timestamp: June 11, 2018, 11:41:28 pm
content: If you really want to use a CAN transceiver for it’s wakeup capabilities:The NCV7341 datasheet specifies a worst case (smallest) dominant TxD timeout value as 300uSec. So if you connect it to UART port, 8N1 settings, the worst dominant (zero) case will last 9x bit time (1 zero start bit plus 8 zero data bits. The stop bit/idle state are recessive 1). So to avoid dominant tx timeouts you need to have a single bit time to be shorter than 300/9=33.3uSec, meaning a >30kbps UART baudrate, which looks ok.

author: Docara
author_rank: Regular Contributor
timestamp: June 12, 2018, 01:43:04 pm
content: Hi,Have no way to measure anything because the system is not live and what I have already have installed wasn't present before, so I just want to make a provision for communication and assume the worst case scenario.The 12m length IS important because the cores I have available run parallel too and is situated near things which I knowwillbe noisy (inverter control panel alternator power switching relays and an electric engine water pump PWM controlled).I think Abyrvalg has brought the last bit of info to the party - thank youMany thanks to all who have contributed, I consider my question to be answeredMatt