400-878-1895
QQ2310018808 WangwangOnline
  sales@tnkey.cn

 

 

 

 

 

 

NMEA2000 Stack Code
简介:NMEA 2000协议堆栈was designed by Simma Software, a nationally recognized CAN expert, to meet the demanding needs of the high speed Controller Area Network (CAN). The NMEA 2000 source code uses a high performance modular design and has a simple API. Benchmarks have shown the stack to be 800% more efficient than other commercially available NMEA 2000 software solutions. The software protocol sta...
Brand
Made In
Modle PXF2463
Disctount
PassionTech Ord OrderNum Product Name Price RMB Brand  
该文章系原厂商文章翻译,不通之处请参考原文

NMEA 2000协议堆栈was designed by Simma Software, a nationally recognized CAN expert, to meet the demanding needs of the high speed Controller Area Network (CAN). The NMEA 2000 source code uses a high performance modular design and has a simple API. Benchmarks have shown the stack to be 800% more efficient than other commercially available NMEA 2000 software solutions. The software protocol stack is well documented and has been used in more than a quarter of a milliion embedded systems.

 

NMEA 2000 Yacht

 

Our NMEA 2000 software package handles reception and transmission of standard single frame and multi-frame (i.e. Transport Protocol) NMEA 2000 messages. Also, the ssNMEA2000 software package handles address claim arbitration specified by the network management layer. If you have questions about our NMEA 2000 software, please see our NMEA 2000 Protocol Stack FAQ for possible answers.

 

NMEA 2000 Protocol Stack Details:

 

  • Fast Packet support
  • PGN List Group functions
  • Complex Data Request
  • Product Informatin support
  • MISRA C compliant
  • ANSI C source code
  • Use with or without an RTOS
  • Use with 8, 16, 32, or 64-bit CPU
  • ssNMEA2000 reference manual

NMEA 2000

 

This article is intended to give engineers a brief overview of the NMEA 2000 protocol. For details on the specification itself, please visit the International Marine Electronics Association (NMEA).

 

NMEA 2000 is a replacement for the NMEA 0183 network which has been used in the marine industry on pleasure craft, tankers, submarines, yachts, and cargo ships for the past 20 years. Today NMEA 2000 is used as the standard communications bus for marine equipement.

 

NMEA 2000 Overview

 

NMEA 2000 is a high level communications protocol, which operates on a Controller Area Network (CAN) bus. NMEA 2000 specifies exactly how information (e.g. engine RPM) is exchanged between electronic control units (ECUs) on a network.

 

It defines the data's priority, size, scaling, and offset. For example, NMEA 2000 specifies engine RPM to have a default priority of 3, to have a size of 16-bits, a resolution of 0.125 rpm/bit, and an offset of 0.

 

The standard goes on to define many other aspects, including message timeouts, how large messages are fragmented and reassembled, the network speed, the physical layer, and how applications acquire network addresses.

 

NMEA 2000 Datalink

 

NMEA 2000 uses a simple datalink layer to communicate information. Altogether there are six subfields which are encoded into the 29-bit CAN identifier, they are shown below and are: Priority, Extended Data Page, Data Page, Protocol Format, Protocol Specific, and Source Address.

 

P EDP DP PF PS SA
3 bits 1 bit 1 bit 8 bits 8 bits 8 bits

 

P is the priority of the message, EDP and DP make up 4 different pages with one page being reserved for ISO 15765-3. PF and PS define the parameter group number and destination address, and SA is the source address of the controller application. For details about this encoding, refer to NMEA 2000-21.

 

NMEA 2000 Messages

 

At the heart of NMEA 2000 is the Parameter Group Number (PGN), which is a unique number assigned to every NMEA 2000 message. The PGN serves to identify the message and its data. Although sometimes a message will contain a single parameter (e.g. VIN), typically the PGN will contain a group of parameters. In the standard there is a total of 8,672 PGNs.

 

For an example message, take PGN 61,444. It identifies the "Electronic Engine Controller 1" message. Per the specification, "EEC1" has seven different parameters embedded in the data field of the message. Engine RPM is one of those seven parameters.

 

NMEA 2000 Message Sizes

 

NMEA 2000 has three different allowed message sizes, they are: 3 bytes, 8 bytes, and variable length. There is only one message which is three bytes in length, and that is the request message (PGN 59,904).

 

The majority of messages in NMEA 2000 are 8 bytes in length. This allows for a more efficient use of the network bandwidth by maximizing the amount of data on the network by reducing the number of messages.

 

Variable length messages are messages with a length from 9 to 1,785 bytes. These messages are too large to fit in a single CAN data frame and must be fragmented by the transmitter and reassembled by the receiver. This process is defined by NMEA 2000's transport protocol which is specified by IS 11783-3 and J1939-21.

 

The transport protocol layer defines two different types of message fragmentation: BAM and CM. There are several differences between those two types, the main difference being the destination address. A BAM uses a global destination address and is therefore sent to all CAs, while a CM is destination specific. Due to the addressing scheme, only a single BAM can be transmitted simultaneously, while multiple CMs using different destination addresses may be simultaneously transmitted.

 

Another difference between BAMs and CMs is the time is takes to send a messages. With a BAM, data packets must be spaced at least 50 ms apart and no more than 200 ms. With a CM, data frames may be sent as quickly as possible.

 

NMEA 2000 Physical Layers

 

Currently there is a single 250 Kbps physical layers defined by the NMEA 2000 main document. NMEA 2000 specifies a shielded twisted pair of wires with a maximum backbone length of 100 meters and maximum stub length of 6 meter. The physical layer uses a four pin connector, with power and ground, and allows for up to 50 CAN nodes.

 

NMEA 2000 CAN Parameters

NMEA 2000 specifies a network data rate of 250 Kbps with a minimum period of 3.98 us and a maximum period of 4.02 us. The CAN bus sample point setting has a minimum value of 85% and maximum value of 90%. CAN peripherals also allow for synchronous jump width (SJW) settings as 'large as possible'. The SJW value dictates how much time can be added or subtracted to the node's CAN clock for syncronization purposes.

NMEA 2000 NAME Field

 

Every ECU, or CA (controller application) on a NMEA 2000 network has a unique NAME. The NAME is 64 bits wide and is made up of the following fields: Arbitrary Address Capable, Industry Group, Vehicle System Instance, Vehicle System, Reserved Bit, Function, Function instance, ECU Instance, Manufacturer Code, and Identity Number. The NAME field gives each CA a unique identity. Nodes on the network use the NAME field to distinguish between each other. The NAME field is also essential to Network Management as it establishes node priority. The NAME translates to a number; the lowest numeric values have the highest priority when claiming addresses.

 

An ECU may contain multiple CAs and NAME fields.

 

NMEA 2000 Address Claiming

 

In NMEA 2000 CAs, or electronic control units, on the vehicle network bus must claim a unique source address to enable communication. Addresses 0 to 128 are pre-assigned and CAs which use these addresses are allowed to communicate immediately after power up. In anticipation of future devices and functions, however, NMEA 2000 includes a method for dynamically assigning addresses. New devices must announce an address for themselves by transmitting an address claim message.

 

Sending an Address Claim message the new (non-addressed) device sends out an Address Claim PGN indicating the address it is assuming. All devices on the network compare this newly claimed address with their internal address tables. If the address is already in use by a device with a higher priority (determined by the NAME), the higher priority device indicates the conflict by sending out a Address Claim message. The lower priority device immediately stops using the address and must claim a new one.

 

About NMEA

 

NMEA is the International Marine Electronics Association, that represents NMEA's evolution from a national to an international marine electronics standards and education association. The mission of the National Marine Electronics Association is to be a worldwide, self-sustaining organization committed to enhancing the technology and safety of electronics used in marine applications.

 

NMEA 2000 Specifications

 

  • NMEA 2000-Main: Parent Document
  • NMEA 2000-Main: Physical Layer
  • ISO 11783-3: Data Link Layer
  • ISO 11783-5: Network Management
  • NMEA 2000-Appendix A: Application Layer
  • NMEA 2000-Appendix C: Certification Criteria
  • ISO 11898: Controller Area Network

NMEA 2000 Ports

 

Our real-time NMEA 2000 protocol stack is completely platform independent and written in the ANSI C programming language. It is the CAN device driver, ssCAN, that is target specific and incorporates the details for a given microcontroller.

 

Together ssNMEA2000 and ssCAN form a complete ported system allowing customers to be up and running almost immediately. Our ssCAN device driver has been ported to over 40 different microcontrollers. Below is the list of available ports. Please contact us if you are interested in a port or device driver for a hardware platform that is not listed.

 

  • Linux
  • Windows XP/7/Embedded
  • Texas Instruments RM4x (DCAN)
  • Texas Instruments LM3Sx
  • Texas Instruments TMS470x
  • Texas Instruments TMS470Mx
  • Texas Instruments TMS570x
  • Texas Instruments Tiva TM4C
  • Texas Instruments F28M35xx
  • Texas Instruments TMS320F280x
  • Texas Instruments TMS320F281x
  • Texas Instruments TMS320F282x
  • Texas Instruments TMS320F283x
  • Texas Instruments AM3x - Sitara
  • Texas Instruments DM8x - DaVinci
  • Atmel SAM7
  • Atmel AT90
  • Freescale HCS08
  • Freescale HCS12
  • Freescale HCS12X
  • Freescale MC68xxx
  • Freescale MCF5xxx
  • Freescale MPC5xxx
  • Freescale Kinetis Kxx
  • Infineon C16x
  • Infineon TriCore
  • Intel 82527
  • Microchip PIC18
  • Microchip PIC24
  • Microchip PIC32
  • Microchip dsPIC30
  • Microchip dsPIC33
  • Microchip MCP2515
  • NXP LPC11xx
  • NXP LPC17xx
  • NXP LPC21xx
  • NXP LPC23xx
  • NXP SJA1000
  • Silicon Labs C8051
  • STMicro ST7
  • STMicro ST10
  • STMicro STR7
  • STMicro STM8
  • STMicro STM32F1x
  • STMicro STM32F2x
  • STMicro STM32F3x
  • STMicro STM32F4x
  • Xilinx LogiCORE AXI (axi_can)

 

Related Products
Question About the Products  If you have Anyquestion about the products,Please write here!
Title:
Input Question:
Contact: