Go Down

Topic: NMEA 2000 Shield (Read 404567 times) previous topic - next topic

cmtas

what tx and rx pins should be used on Teensy 4.1?

timolappalainen

You could Google "Teensy 4 Pins" and get https://www.pjrc.com/store/teensy40_pins.html There you can see that default CAN1  CRX1=pin 23 and CTX1=pin 22

cmtas

Thank you. I am a nube and could not find in source code what (default) pins were defined. I could find it for the Teensy 3.2 but not 4.1.
Again thank you for your help.

cmtas

My goal is to add contour following on my boat for shore fishing. A feature not included with my electronics (Lowrence 7Ti head unit and Motorguide Xi5 trolling motor). I hope to read the water depth PCN 128267 compare it to a wanted depth and output a PCN to the Xi5 to turn left or right to maintain depth. I don't know if any thing like this has been done before, but from what I read hear and Github it seams doable.

Your development on NMEA 2000 system is amassing to me. I am just building the hardware together now and hope to sniff my boats network and verify PCNs I intend to use. 

timolappalainen

They are PGN.

It is doable if you find a way how to command Xi5. There are bow thruster commands on NMEA2000 (https://www.nmea.org/Assets/20190613%20thruster%20amendment%20128006,%20128007,%20128008.pdf), but I do not know does Xi5 use them or does it use some proprietary PGNs or only internal control by remote.

Hope you try some better hw than traditional Arduino boards - e.g. Teensy or ESP32.

cmtas

I have been to that site looking at the slandered PGNs. I am hoping the PGNs as you say are not proprietary. The head unit seams to only feed commands to the Xi5. I have turned off my head unit after setting a course and the Xi5 kept on running on course independent of the head unit. The head unit can also send heading adjustments by increments or actual heading word.

I believe with NMEA Reader it will show all network traffic and give me a full idea of what PGNs are being used when changing course. Or am I off course?

seamaster

My goal is to add contour following on my boat for shore fishing. A feature not included with my electronics (Lowrence 7Ti head unit and Motorguide Xi5 trolling motor). I hope to read the water depth PCN 128267 compare it to a wanted depth and output a PCN to the Xi5 to turn left or right to maintain depth. I don't know if any thing like this has been done before, but from what I read hear and Github it seams doable.
Just for your information, Simrad EVO3 series with Simrad autopilot has a feature that allows the AP to follow a depth contour.  

cmtas

Unfortunately now that I am retired my budget does not allow me to invest in new equipment. I am aware now I may have not made the best choice in equipment just a few years back but I am stuck with it now.

FXVT

Bonjour Timo,
Could you please help me.
I am working on a simple tachometer sketch and have troubles with the interrupt.
I get the pulse from the "W" connector of the generator. It is pluged to the D2 pin of the Arduino Uno thru a small PCB.

I use the interrupt to catch the pulse:
...
int pin = 2;  

...
attachInterrupt(digitalPinToInterrupt(pin), rpm_fun, FALLING);
...
It works and count accurately only if I comment these lines:
  ...
  NMEA2000.Open();  

  ...
 SendN2kEngine();
 NMEA2000.ParseMessages();
  ...
But iIf I uncomment them, it does'nt count any longer.


Anyway this sketch can properly send dummy data to the N2K network.


I have tried to use the D3 pin (INT1), supposing that there is an incompatibility between the INT0 (D2 pin) and the NMEA2000 library, but I can't get any count when using the D3 pin.
Concernng the UNO memory, this small sketch uses only 84%.

Can you tell me what is wrong ?
Merci.
FX

timolappalainen

Uno does not have enough memory. Library makes dynamic memory reservation so compiler will not show all it need. If you like to bang your head against wall, you can try to squeeze library memory requirement. There were something on the library readme and some discussion under some topic. 

I prefer to move to Teensy 3.2-4.0 or ESP32

FXVT

Bonjour Timo,

Thank you for your prompt reply.
I will try next weekend with an Arduino Mega.
I have done this sketch based on an Uno because I already wrote an other sketch with his small board and it still works well.
Merci.
FX

sglard

Hi Timo,
Just wanted to update that I tried the new seeed pi can fd hat with your library and it works great. It was very easy to setup and no extra steps were needed beyond your doc,
https://www.seeedstudio.com/CAN-BUS-FD-HAT-for-Raspberry-Pi-p-4742.html
Thanks

timolappalainen

How you have connected MCP2551 to Teensy 4.1? According document MCP2551 is 5V only and Teensy 4.1 is only 3.3V. So in any voltage you will have problems somewhere. You should use MCP2562 or ISO1050, if your device will require isolation. MCP2562 you can power with 5V and with Vio pin define that IO is 3.3V.  ISO1050 you power from bus side 5V with own regulator and from MCU side with 3.3V from Teensy.

sarman1964

Hi Timo & every body
My project is to convert msg from NMEA183 ( GPSMAP 76 ) to NMEA2000 ( B&G Triton2 ) with ESP32.
I adapt "NMEA0183ToN2k" example from NMEA-master library and GNSS data work well but i cannot display navigation data (BRW, BTW) on a page. 
I tried with N2K sender with raw data and i have the same issue:
I can see Navigation data with NMEA reader and on triton2 when  i go Settings>System>Network>device list>"MyDevice">data but in source>Navigation, my device not appear so navigation data cannot be display.
It seems that Triton2 do not reconize my device as navigation data available.
Further more when i declare my device at Navigation class (60) and Navigation management function (190),  NMEA reader is: Navigation class (60) and Radiotelephone ( vhf) function (190) ???

Is someone have 129284 PGN working on a B&G (or simrad & furino) display ? A example would be greated appreciated .
 

timolappalainen

Add 129284 to your device transmit PGN list. 

Go Up