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

NMEA2K to NMEA0183: some issues/questions #64

Open
sebastian1967 opened this issue Nov 17, 2024 · 1 comment
Open

NMEA2K to NMEA0183: some issues/questions #64

sebastian1967 opened this issue Nov 17, 2024 · 1 comment

Comments

@sebastian1967
Copy link

Hello Timo,
I am trying to set up a small NMEA 2000 network (in the picture) to read the sentences of a Garmin MNEA 2000 Intelliducer and convert them to NMEA 0183 sentences in order to be able to read the depth data with an ESP32. At the moment I have many doubts as I’m not able to see any output on the serial of my MCU:
HARDWARE setup questions (Joi-it module manual: https://joy-it.net/files/files/Produkte/SBC-CAN01/SBC-CAN01-Manual-20201021.pdf):

  1. Should I connect the interrupt PIN of the Joy-it module to a pin of the ESP32?
  2. Should the ground of the MCU be connected to the ground of the NMEA network, or should they be isolated from each other?
  3. On the Joy-it module there is a 120 Ohm resistor: should I activate it or not?
    SOFTWARE questions:
    I’m trying to use the NMEA2000ToNMEA0183 of the NMEA0183 library but I’m not sure how the main.cpp should begin, at the moment the beginning is:

`#include <N2kMsg.h>
#include <NMEA2000.h>
#include <SPI.h>
#include <mcp_can.h> // https://github.com/ttlappalainen/CAN_BUS_Shield
#include <NMEA2000_mcp.h>
#define N2k_CAN_INT_PIN 17 // Pin, where interrupt line has been connected
#define N2k_SPI_CS_PIN 5 // Pin for SPI Can Select
//
tNMEA2000_mcp NMEA2000(N2k_SPI_CS_PIN,MCP_16MHz,N2k_CAN_INT_PIN);

//#define N2k_CAN_INT_PIN 21 // Interrupt pin definition for Ardino Mega or other "CAN bus shield" boards.
//#include <NMEA2000_CAN.h> // This will automatically choose right CAN library and create suitable NMEA2000 object
#include "N2kDataToNMEA0183.h"
#include "BoardSerialNumber.h"

#ifdef ARDUINO
…`

Thanks a lot in advance!
NMEA2000_Network

@ttlappalainen
Copy link
Owner

Did you study how NMEA2000 network should be setup? You could also check NMEA2000 library manual and e.g., https://ttlappalainen.github.io/NMEA2000/page_h_w_set_up.html .

  1. Yes, you need to have interrupt connected. Otherwise it is too slow to handle messages properly.
  2. You should not use that module in your solution. Your solution should use isolated transceiver. Read my document I pointed above. You can test it - ground must be connected to NMEA2000 network ground to avoid high common voltage, but you will generate ground loop. If you feed your device power and ground very near (<0.5 m) of the point you power NMEA2000 network, ground loop problem will not rise up.
  3. No. NMEA2000 bus must have exactly 2 termination resistors. Please study NMEA2000 network topology.

And... Why you do not use ESP32 internal CAN controller with ISO1050 isolated transceiver? In document mentioned above there are sample schematics for isolated connection - simple and with better protection.

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

2 participants