Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best Micrcontroller to use #228

Open
bigalnz opened this issue Aug 2, 2021 · 53 comments
Open

Best Micrcontroller to use #228

bigalnz opened this issue Aug 2, 2021 · 53 comments

Comments

@bigalnz
Copy link

bigalnz commented Aug 2, 2021

The little documentation I can find seems to be several years old.

In the absence of a detailed guide is the best supported hardware to buy the Arduino Uno R3 or?

Combined with one of these : https://www.ebay.com/itm/263690841938?hash=item3d6532ef52:g:2R8AAOSw94Ba-6me

Will this setup with appropriate cable let me do everything a Actisense NGT-1 would do? (N2k reader/writer)

Thanks

@ttlappalainen
Copy link
Owner

I prefer Teensy 3.2 ... 4.1 or ESP32, if you need WiFi. I have not used much Arduinos for long time and do not know does they have any good boards for NMEA 2000.

Forget everything smaller than Arduino DUE. Mega is just on the limit, but both are physically big and eats lot power compared to above.

@bigalnz
Copy link
Author

bigalnz commented Aug 2, 2021 via email

@ttlappalainen
Copy link
Owner

I have tested on on Teensy 4.0, but it has same CAN controllor, so should not be any problem. You need then NMEA2000 and NMEA2000_TeensyX libraries

@bigalnz
Copy link
Author

bigalnz commented Aug 2, 2021

Do you think it will do the same as : https://actisense.com/products/ngt-1-nmea-2000-to-pc-interface/

@ttlappalainen
Copy link
Owner

Hw is better. Depends of sw. There is example ActisenseListenerSender, which sends and receive data. Then you can use NMEA Simulator http://www.kave.fi/Apps/ with it.

@bigalnz
Copy link
Author

bigalnz commented Aug 2, 2021

You mean NGT-1 hardware is better than Teensy4.1?

@ttlappalainen
Copy link
Owner

Teensy has better hw

@bigalnz
Copy link
Author

bigalnz commented Aug 3, 2021 via email

@ttlappalainen
Copy link
Owner

Yes. It just does not have flash card. All Teensy 3.2 and up will run ActisenseListenerSender and much more.

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@ttlappalainen
Copy link
Owner

You need NMEA2000 and NMEA2000_TeensyX for Teensy 4.0 and 4.1. You can test it with example ActisenseListenerSender and NMEA Simulator (www.kave.fi/Apps), if you have parts to connect your Teensy to the NMEA2000 bus.

Your question is bit funny "but then what do I do". How I would know that? I have no idea of what you have and what you can do and what is your goal, but definetely I'll not guid you how to start from scratch. In the library document there are some very basic samples to start with library and Arduino environment. Please read those. Either I do not know do yo even have any basic knowledge of electronics or how to connect to NMEA2000 bus.

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@ttlappalainen
Copy link
Owner

I do not see the picture, but I hope you have tranceiver chip like MCP2562 between Teensy Rx/Tx and CAN-H/CAN-L.

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@ttlappalainen
Copy link
Owner

OK. Good luck! If you read through other issues and forum https://forum.arduino.cc/t/nmea-2000-shield/51012/1102 you will find that you are not first one having problems with that chip. At least yo hould find out the meaning of R1 and R2. Note that in CAN BUS there should be exactly 2 120 ohm termination resistors.

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@bigalnz
Copy link
Author

bigalnz commented Sep 2, 2021 via email

@ttlappalainen
Copy link
Owner

Missed again. I have to write some hw instructions to library documents...

That board has CAN tranceiver, but Teensies already have better one. You need simple MCP2562 do inisolated or ISO1050 for isolated connection. For MCP2562 there is document https://github.com/ttlappalainen/NMEA2000/blob/master/Documents/ArduinoDUE_CAN_with_MCP2562.pdf for DUE connection. MCP2562 connection to Teensies or ESP32 is similar.

@bigalnz
Copy link
Author

bigalnz commented Sep 3, 2021 via email

@ttlappalainen
Copy link
Owner

No. With Teensies or ESP32 you need unisolated MCP2562 or isolated ISO1050 tranceiver. Those boards has build in CAN controller.

Controller means that it takes care of bus arbitration. Tranceiver is just "level shifter" and converts 3.3 V Tx/Rx to CAN bus differential levels.

@ttlappalainen
Copy link
Owner

Hi all,

Could you make me favour and read and comment document https://github.com/ttlappalainen/NMEA2000/blob/master/Documents/Connecting_hardware_to_NMEA2000.pdf

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@ttlappalainen
Copy link
Owner

You can add notes to .pdf.

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@ttlappalainen
Copy link
Owner

I would like to know does document help beginner as you are:)

Canbus Controller/Transceiver
Document should explain what you need. It is problematic to put any links to eBay or any shop, since they arechanging all the time. Point is that I give information what you need and then you find it.

Buying Canbus Transceiver
There is no MCP2515 tranceiver. MCP2515 is CAN controller. MCP2551 is tranceiver, but it is only 5V. Thats why I'll prefer MCP2562, since that works with any IO level.

Pictures
I expect people should be able to read schematics. Have to think about that.

Also I see that written background is important to understand. With quick start guide I should go directly to the isolated solution to be safe. I tried to keep background as short as possible. This is a bit different than just making solution to blink led.

If there would be enough market, I would make some own shield.

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@ttlappalainen
Copy link
Owner

I did not either found "board" with MCP2562. When I started, I did not search board for MCP2515 with MCP2551. I ordered parts and soldered my own and did not had any problems. Thats also why I had no problems with MCP2562 - just ordered chip and soldered own board for it.

Problem is that all those CAN shields are really CAN shields and not for NMEA2000. Your SN65HVD230 may work, if you remove those resistors on it.

@ttlappalainen
Copy link
Owner

@ttlappalainen
Copy link
Owner

One can get ISO1050 chip in DIP as low as 3.60 $. Would save Teensy board, by learning soldering. Or actually you can wire DIP package to test board.

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@ttlappalainen
Copy link
Owner

You will need. As in document, bus must have exactly 2 termination, which I expect you already have on your boat. If you connect this, you will have three. Also that has been centers to gnd with two 60 ohm. This is not used on NMEA2000.

So just remove both and if you make test bench do it as in my document.

@ttlappalainen
Copy link
Owner

My first Teensy 3.2 + MCP2562 + PSU + fuse + 1-wire took less space than that CAN-Bus CAN FD Breakout Board.

@ttlappalainen
Copy link
Owner

One more hint: You do not need to quote my previous answer.

@bigalnz
Copy link
Author

bigalnz commented Sep 5, 2021 via email

@bigalnz
Copy link
Author

bigalnz commented Sep 6, 2021 via email

@ttlappalainen
Copy link
Owner

No. But as I said you need termination resistors in both end of backbone as in my document chapter 6.

@bigalnz
Copy link
Author

bigalnz commented Sep 6, 2021 via email

@ttlappalainen
Copy link
Owner

No. That would shortcut CAN-L and CAN-H

@bigalnz
Copy link
Author

bigalnz commented Sep 18, 2021

So I got the cable. It has
CAN-H
CAN-L
and Red and Black wires which appear to be

image

Can the Black go to ground on the Teensy?
Where should the Red go?

Thanks

Al

@ttlappalainen
Copy link
Owner

Read my document https://github.com/ttlappalainen/NMEA2000/blob/master/Documents/Connecting_hardware_to_NMEA2000.pdf
On chapter 5 there is connection examples. If you feed your device with USB, you leave red 12 V unconnected, but you have risk on groundloop.

@bigalnz
Copy link
Author

bigalnz commented Sep 19, 2021

The issue with the docs is it relates only to the MCP2562 - which cant be brought as just a transceiver - well I think there was one place in the UK - but by and large SN65HVD230 is most common.

When you say you can power your "device" from NMEA2000 bus - do you mean connecting the Red and Black wires to the Teensy4.1? (If so which pins?)

I also have no idea if the SN65HVD230 is isolated or un-isolated transceiver. How would I know.

@ttlappalainen
Copy link
Owner

I do not want to advertise SN65HVD230, since there has been so much problems with that. It is unisolated. In document there is clear schema that if you want to power device from bus, you need DC-DC converter. Teensy boards can be powered with 5V only by cutting USP power pad as shown in schema. 4.1 has similar pad.

@bigalnz
Copy link
Author

bigalnz commented Sep 19, 2021 via email

@ttlappalainen
Copy link
Owner

Then you connect ground to Teensy, but this is risky to create ground loop as I have explained in document. If you are just testing on table with few devices, it does not matter, but in boat it may cause problems.

@bigalnz
Copy link
Author

bigalnz commented Sep 19, 2021 via email

@mrbubble62
Copy link
Contributor

I will run laptop off it's internal battery so no other path to boat ground. Does that mitigate the loop risk?

That will work, just don't try charging the laptop.

@ttlappalainen
Copy link
Owner

Actually laptop powersupplies are isolated. But if you connect some unisolated sensors to board,...

@bigalnz
Copy link
Author

bigalnz commented Sep 20, 2021

In the meantime (until I get to test this on boat) I am looking at ordering MCP2562 and designing a board to mount it. Does this look right? (I am assuming I don't need resistors on the board since on both ends of my network on boat have terminators)

image

@ttlappalainen
Copy link
Owner

Yes, but if you make a board, why not to connect STBY to ground and add screw terminal for NMEA2000 connection as in some of my documents.

@bigalnz
Copy link
Author

bigalnz commented Sep 20, 2021

You mean connect stby to ground on the teensy (and use screw in terminals)? I don't mind screw in terminals but that is just a part I solder to the board, the board remains unchanged or am I missing something?

@ttlappalainen
Copy link
Owner

I mean that if you make own board for MCP2562, it would be best to make more improved on NMEA2000 side. Add pads for 5 pin screw terminal for NMEA2000. You could also have optional place for DC-DC converter so that you could use it also as powering from bus side. Connect STBY to ground directly or use resistor. Add also capacitor between Vss and Vdd. See my document chapter 5.2 Teensy 3.2, simple unisolated.

Screw terminal type is "21.95MV/5-E Terminal Block, Vertical, Header, 5.08 mm, 5 Ways, 20 A, 320 V, Through Hole Vertical" See e.g. on Farnell: https://fi.farnell.com/imo-precision-controls/21-95mv-5-e/terminal-block-header-5pos-th/dp/2517881?ost=2517881
This connector type is used in DeviceNet.

Then you would have board, which can be used with any board having internal CAN (Teensy, ESP32). If you do not wnat to use screw terminal, you just solder wire directly to the screw terminal pads. Or optionally you can solder DC-DC and use it as bus powered board as soon as other side is isolated (optoisolation or just simple isolated sensors).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants