Show Posts
Pages: [1]
1  Development / Other Hardware Development / Re: NMEA 2000 Shield on: July 30, 2012, 07:10:21 am
Hello David,

Did you already use that library ( http://www.mikrocontroller.net/attachment/53861/NMEA2000ToNMEA183.rar )?
If yes, what hardware are you using? I have an Arduino UNO + Sparkfun Can-Bus ( http://www.sparkfun.com/products/10039 ).
I want to send some data over NMEA2000 bus to all node (broadcast).
I'd like to have a code example to send data using that library (if possible) or a brief guide to using the library.

Thanks a lot

 smiley
2  Development / Other Hardware Development / Re: NMEA 2000 Shield on: July 29, 2012, 12:01:05 pm
Hi Daniel,

I found this forum http://www.mikrocontroller.net/topic/143234 and on this forum I found this library http://www.mikrocontroller.net/attachment/53861/NMEA2000ToNMEA183.rar .

I think it is what I need...

Can you help me with it?


Thanks a lot.

smiley
3  Development / Other Hardware Development / Re: NMEA 2000 Shield on: July 25, 2012, 07:09:01 am
Thanks a lot Daniel.

Is the message format for NMEA2000 this http://www.can-cia.org/index.php?id=496 ???
But it is bit different from CAN (2.0B) message format http://it.wikipedia.org/wiki/Controller_Area_Network#Formato_dell.27Extended_frame .

I'm wrong???

 smiley-grin
4  Development / Other Hardware Development / Re: NMEA 2000 Shield on: July 23, 2012, 01:50:31 pm
Thanks a lot Daniel.

I just want to develop a Sender application on Arduino.

I have another question:
is the structure of CanBus messages (2.0b) the same of Nmea2000 messages???

 smiley-grin
5  Development / Other Hardware Development / Re: NMEA 2000 Shield on: July 23, 2012, 07:03:33 am
Hi all,

I want to send data over NMEA 2000 bus using Arduino UNO + Sparkfun Can-Bus (http://www.sparkfun.com/products/10039).

I have some questions on NMEA 2000:

1) Is correct to use that Can-Bus board to send data??? The structure of can bus message is the same of NMEA2000 message???
2) Is there any library that I can use???

Any suggestion on NMEA 2000 would be appreciated.

Thanks a lot!

smiley-grin
6  International / Generale / Re: Arduino UNO + Sparkfun CANBUS on: July 19, 2012, 05:15:44 pm
Grazie mille delle risposte daddeTr!

Qualcuno conosce il bus NMEA2000?
Secondo voi è possibile inviare dati sul bus NMEA2000 mediante una libreria CANBUS?

Grazie a tutti....
7  Using Arduino / Networking, Protocols, and Devices / Re: CANbus Shield + Uno on: July 19, 2012, 05:13:42 pm
Hi all,

anyone know NMEA2000 bus( http://en.wikipedia.org/wiki/NMEA_2000 ) ???
Shall I use some CAN library to send data in a NMEA2000 bus?

Thanks a lot!
8  International / Generale / Re: Arduino UNO + Sparkfun CANBUS on: July 16, 2012, 03:17:49 pm
Ciao niki77,

cerco di spiegare meglio il mio problema: io ho un arduino uno e tramite la sparkfun canbus vorrei connettermi ad un bus NMEA2000.
Ho un cavo che mi permette di connettere il can bus all'nmea2000.
Ora sul bus nmea non ho nessun apparato connesso ma ho solo un apparato che mi permette di vedere tutto cio' che passa sul bus su pc.
Quindi io ho provato a spedire un pacchetto sul bus ma non ci riesco infatti la coda di msg su arduino si riempie e sul pc connesso all'nmea non vedo nulla.
Dato che non sono esperto di canbus puoi aiutarmi?
Come faccio a sapere l'id di un apparato canbus?
Esiste il modo di spedire un msg canbus in broadcast?
Che differenza c'e' da canbus 2.0a a 2.0b?

Ciao e grazie!
9  Using Arduino / Networking, Protocols, and Devices / Re: CANbus Shield + Uno on: July 12, 2012, 03:27:08 pm
Anyone use this library: http://code.google.com/p/skpang/downloads/detail?name=Canbus_v4.zip&can=2&q=   ??? Is my code correct?

Witch other library I could use? Any code example?

Thanks a lot!
10  International / Generale / Re: Arduino UNO + Sparkfun CANBUS on: July 12, 2012, 03:19:16 pm
Qualcuno ha mai usato la libreria http://code.google.com/p/skpang/downloads/detail?name=Canbus_v4.zip&can=2&q=   ????
Altrimenti qualcuno può consigliarmi un'altra libreria da usare? Magari con qualche esempio di codice?..

Grazie a tutti...
11  International / Generale / Re: Arduino UNO + Sparkfun CANBUS on: July 10, 2012, 03:33:04 pm
Ciao a tutti,

scusate se non ho dato molte informazioni.
Io uso l'IDE Arduino 1.0.
Come libreria utilizzo questa http://code.google.com/p/skpang/downloads/detail?name=Canbus_v4.zip&can=2&q=
Uso la libreria solo per gestire il Can bus.
Al momento mi piacerebbe semplicemente invire un qualsiasi messaggio mediante Can Bus (preferibilimente Can Bus 2.0B).
Comunque per debug utilizzo la seriale su monitor (non lcd seriale).

Questo è il codice:

Code:
#include <Canbus.h>
#include "mcp2515.h"

#define CANSPEED_125 7 // CAN speed at 125 kbps
#define CANSPEED_250  3 // CAN speed at 250 kbps
#define CANSPEED_500 1 // CAN speed at 500 kbps

int CANCS = 53;

int D10 = 10;

int LED2 = 8;
int LED3 = 7;

void setup() {
  Serial.begin(9600);
  Serial.println("CAN BUS test start");

  if(mcp2515_init(CANSPEED_250))
  {
    Serial.println("CAN init OK");
  }
  else
  {
    Serial.println("CAN init KO");
  }

  pinMode(LED3, OUTPUT);
  pinMode(CANCS,OUTPUT);

  delay(4000);
}

void loop()
{
  digitalWrite(CANCS,LOW);

  if (mcp2515_check_free_buffer())
    Serial.println("Free buffer");     
  else
    Serial.println("Full buffer");

  tCAN message;
  message.id = 254;
  message.header.rtr = 0;
  message.header.extended = 1;
  message.header.length = 8;
  message.data[0] = 0x02;
  message.data[1] = 0x01;
  message.data[2] = 0x05;
  message.data[3] = 0x00;
  message.data[4] = 0x00;
  message.data[5] = 0x00;
  message.data[6] = 0x00;
  message.data[7] = 0x00;

  mcp2515_bit_modify(CANCTRL, (1<<REQOP2)|(1<<REQOP1)|(1<<REQOP0), 0);

  if (mcp2515_send_message(&message))
    Serial.println("Send ok");     
  else
    Serial.println("Send ko");

  delay(10); 

  if (mcp2515_check_message())
  {
    Serial.println("Message waiting");     
    if (mcp2515_get_message(&message))
      Serial.println("Read OK");
    else
      Serial.println("Read KO");
  }     
  else
    Serial.println("No message waiting");

  digitalWrite(LED3, HIGH);
  delay(500);
  digitalWrite(LED3, LOW);
  delay(500);

  delay(4000);

  Serial.println("");


  digitalWrite(CANCS,HIGH);
}
12  Using Arduino / Networking, Protocols, and Devices / Re: CANbus Shield + Uno on: July 10, 2012, 03:24:42 pm
Hi johnnyonthespot,

the library that I use is http://code.google.com/p/skpang/downloads/detail?name=Canbus_v4.zip&can=2&q=
I want to use the library only to send a message by Can-bus protocol; below the code that I use:

Code:
#include <Canbus.h>
#include "mcp2515.h"

#define CANSPEED_125 7 // CAN speed at 125 kbps
#define CANSPEED_250  3 // CAN speed at 250 kbps
#define CANSPEED_500         1 // CAN speed at 500 kbps

int CANCS = 53;  /* SPI Enable for CAN */

int D10 = 10;

int LED2 = 8;
int LED3 = 7;

void setup() {
  Serial.begin(9600);
  Serial.println("CAN BUS test start");

  if(mcp2515_init(CANSPEED_250))
  {
    Serial.println("CAN init OK");
  }
  else
  {
    Serial.println("CAN init KO");
  }

  pinMode(LED3, OUTPUT);
  pinMode(CANCS,OUTPUT);

  delay(4000);
}

void loop()
{
  digitalWrite(CANCS,LOW);

  if (mcp2515_check_free_buffer())
    Serial.println("Free buffer");     
  else
    Serial.println("Full buffer");

  tCAN message;
  message.id = 254;//0x7DF;
  message.header.rtr = 0;
  message.header.extended = 1;
  message.header.length = 8;
  message.data[0] = 0x02;
  message.data[1] = 0x01;
  message.data[2] = 0x05;
  message.data[3] = 0x00;
  message.data[4] = 0x00;
  message.data[5] = 0x00;
  message.data[6] = 0x00;
  message.data[7] = 0x00;

  mcp2515_bit_modify(CANCTRL, (1<<REQOP2)|(1<<REQOP1)|(1<<REQOP0), 0);

  if (mcp2515_send_message(&message))
    Serial.println("Send ok");     
  else
    Serial.println("Send ko");

  delay(10); 

  if (mcp2515_check_message())
  {
    Serial.println("Message waiting");     
    if (mcp2515_get_message(&message))
      Serial.println("Read OK");
    else
      Serial.println("Read KO");
  }     
  else
    Serial.println("No message waiting");

  digitalWrite(LED3, HIGH);
  delay(500);
  digitalWrite(LED3, LOW);
  delay(500);

  delay(4000);

  Serial.println("");


  digitalWrite(CANCS,HIGH);
}
13  International / Generale / Arduino UNO + Sparkfun CANBUS on: July 09, 2012, 03:41:16 pm
Ciao a tutti,

ho un Arduino UNO e una scheda Sparkfun can-bus (http://www.sparkfun.com/products/10039).
Ho provato a scaricare alcune librerie ma praticamente con tutte ho lo stesso problema.
Provo ad inviare dei messaggi e mi vengono messi in coda finché non è piena (questo lo vedo mettendo delle stampe che vedo nel monitor dell'IDE di Arduino).
Qualcuno ha esperienza con can bus + arduino???

Qualsiasi suggerimento o aiuto è ben accetto!

Grazie a tutti smiley
14  Using Arduino / Networking, Protocols, and Devices / Re: CANbus Shield + Uno on: July 09, 2012, 03:33:03 pm

Hi all,
I have a Sparkfun CAN-BUS (http://www.sparkfun.com/products/10039) and an Arduino UNO.
I have a problem with all libraries that I dowloaded.
The messages that I try to send remains in the queue and so the arduino buffer became full (I use the monitor to see that). I guess that is not a problem related to the libraries.

Anyone can help me?
Anyone use Sparkfun canbus and an Arduino UNO???

Any help would be appreciated.

Thanks a lot!  smiley
Pages: [1]