Forum: Projekte & Code NMEA2000 nach NMEA0183 Converter

Announcement: there is an English version of this forum on Posts you create there will be displayed on and
von Philipp D. (phili)

Angehängte Dateien:


Dear Community,

enclosed you will find an NMEA2000 to NMEA0183 message converter. 
Currently the converter itself only supports PGN 0x01F805, coding the 
actual GPS position. This PGN is then translated into an 0183 GPGLL 

I required the converter to interface an old VHF radio (supporting only 
NMEA0183) to the new NMEA2000 bus we installed into out boat.

In the .rar archive you will additionally find the NMEA2000 protocol
stack i wrote. It supports transmission and reception of NMEA2000 
As the NMEA2000 protocol is not as open as some people claim, the most 
difficult part at the moment is to interpert and decypher the 
representation of many CAN datafields for different messages.

You can find a lot of information in the appendix of all Maretron 
datasheets (

Additionally I am using the transmission part of the NMEA2000 stack with 
an old speedometer that I converted to NMEA2000. It works pretty very 
well. Unfortunately the sources are not sufficiently well documented to 
be published yet.

I will be improving the stack in the near future and add more comments 
on how it works.

Liebe Grüße

von NunEinGast (Gast)


Hi Philipp,

are there any news on your converter ? New developments, extensions ....



von tom lafleur (Gast)



I am very interested in this project, can you keep me informed of your 
progress with your stack.

I also have a lot of information on J1939 that NMEA2000 is based on that 
maybe of help to you. Including PNG data formats.

also, you are using part of a "Multi-Tasking Core for ATMEL 
microcontrollers", where did this come from??


tom lafleur

lafleur @  <--- please use this address

von Eric (Gast)


I realize that this posting is over a year old but have you done any 
further work on the N2K standard that you would be willing to release?

Thanks in Advance if you read this.


von Andreas H. (andy78)



Ich komme bei den Message id nicht weiter kann mir da jemand helfen.
habe den obigen Code ausprobiert.

uint8_t mcp2515_read_id(uint32_t *id)
  uint8_t first;
  uint8_t tmp;

  first = spi_putc(0xff);
  tmp   = spi_putc(0xff);

  if (tmp & (1 << IDE)) {
    *((uint16_t *) id + 1)  = (uint16_t) first << 5;
    *((uint8_t *)  id + 1)  = spi_wait();

    *((uint8_t *)  id + 2) |= (tmp >> 3) & 0x1C;
    *((uint8_t *)  id + 2) |=  tmp & 0x03;

    *((uint8_t *)  id)      = spi_wait();

    return 1;
  else {

    *((uint8_t *)  id + 3) = 0;
    *((uint8_t *)  id + 2) = 0;

    *((uint16_t *) id) = (uint16_t) first << 3;


    *((uint8_t *) id) |= tmp >> 5;


    return 0;

void mcp2515_write_id(const uint32_t *id)
  uint8_t tmp;

  spi_start(*((uint16_t *) id + 1) >> 5);

  // naechsten Werte berechnen
  tmp  = (*((uint8_t *) id + 2) << 3) & 0xe0;
  tmp |= (1 << IDE);
  tmp |= (*((uint8_t *) id + 2)) & 0x03;

  // warten bis der vorherige Werte geschrieben wurde

  // restliche Werte schreiben
  spi_putc(*((uint8_t *) id + 1));
  spi_putc(*((uint8_t *) id));

PGN=0x1F010; (Date/TIME)
Source_address=10 = ((uint32_t)(message_container->priority & 0x07) << 26) | 
(((uint32_t)message_container->PGN & 0x01FFFF) << 8) | source_address;

Ergebniss messageid=0x1003 das stimmt doch nicht???

die Daten kommen richtig im Datafeld.

Nur die ID nicht.

Wie wird die berechnet???


Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.