pican-m user guide v1 - copperhill techpican-m rev b 1.0 sk pang electronics ltd Ó 20 6 sudo nano...

11
PiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk 1 Product name PiCAN-M with NMEA 0183 and NMEA 2000 Connection Model number RSP-PICAN-M Manufacturer SK Pang Electronics Ltd PiCAN-M USER GUIDE V1.0 July 2020

Upload: others

Post on 24-Jan-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

1

Product name PiCAN-M with NMEA 0183 and NMEA 2000 Connection

Model number RSP-PICAN-M

Manufacturer SK Pang Electronics Ltd

PiCAN-M

USER GUIDE V1.0 July 2020

Page 2: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

2

Contents

Table of Contents

1. Introduction ........................................................................................................... 31.1. Features.............................................................................................................................................................32. Hardware Installation ............................................................................................. 41.2. NMEA2000CAN-BUSConnection.........................................................................................................41.3. NMEA0183(RS422)Connection...........................................................................................................51.4. 120WTerminator..........................................................................................................................................51.5. LED.......................................................................................................................................................................51.6. SwitchModePowerSupply(optional)................................................................................................53. Software Installation .............................................................................................. 51.7. InstallingCANUtils.......................................................................................................................................61.8. BringUptheInterface.................................................................................................................................64. NMEA 0183 (RS422) Installation ............................................................................. 7

5. Qwiic (I2C) Connector J4 ......................................................................................... 9

6. Third Party Applications ......................................................................................... 91.9. ConnectingaBME280Sensor................................................................................................................10

Page 3: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

3

1. Introduction ThisisaPiCAN-MwithNMEA0183andNMEA2000Connection.TheNMEA0183(RS422)isviaa5wayscrewterminal.TheNMEA2000isviaMicro-Cconnector.

ExtrasensorscanbeconnectedviatheQwiic(I2C)connector.

Optional3ASMPS.The12vfromtheNMEA2000networkcanbeusetopowerthePiCAN-MandtheRaspberryPi.

EasytoinstallSocketCANdriver.ProgrammingcanbedoneinCorPython.

1.1. Features • CANconnectionviaMicro-Cconnector• 120Ωterminatorready• SocketCANdriver

o appearsascan0toapplication• NMEA0183(RS422)via5-wayscrewterminal

o appearsasttyS0toapplication• LEDindicator(GPIO22)• Qwiic(I2C)connectorforextrasensors• Optional3ASMPS.• CompatiblewithOpenCPNandSignalK

Page 4: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

4

2. Hardware Installation BeforeinstallingtheboardmakesuretheRaspberryisswitchedoff.Carefullyalignthe40wayconnectorontopofthePi.Usespacerandscrew(optionalitems)tosecuretheboard.

1.2. NMEA 2000 CAN-BUS Connection TheCAN-busconnectionsaremadeviaJ1a5pinMicro-Cconnector.

J1 Function1 Shield2 +12v3 GND4 CAN_H5 CAN_L

Page 5: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

5

1.3. NMEA 0183 (RS422) Connection TheNNEA0183(RS422)connectionaremadeviaJ3a5wayscrewterminal.

1.4. 120W Terminator Thereisa120Wresistorfittedtotheboard.Tousetheterminatorsoldera2wayheaderpintoJP1theninsertajumper.

1.5. LED ThereisaredLEDfittedtotheboard.ThisisconnectedtoGPIO22.

1.6. Switch Mode Power Supply (optional) Thisisanoptional5v3AmodulethatcanpowerthePi.Ithasaninputvoltagerangeof7vto24v.

3. Software Installation ItisbesttostartwithabrandnewRaspbianimage.Downloadthelatestfrom:

https://www.raspberrypi.org/downloads/raspbian/

Afterfirsttimebootup,doanupdateandupgradefirst.

sudo apt-get update

sudo apt-get upgrade

sudo reboot

Addtheoverlaysby:

J3 Function1 GND2 IN+3 IN-4 OUT-5 OUT+

Page 6: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

6

sudo nano /boot/config.txt

Addtheselinestotheendoffile:

dtparam=i2c_arm=on

dtparam=spi=on

dtoverlay=mcp2515-can0,oscillator=16000000,interrupt=25

dtoverlay=spi-bcm2835-overlay

RebootPi:

sudo reboot

1.7. Installing CAN Utils InstalltheCANutilsby:

sudo apt-get install can-utils

1.8. Bring Up the Interface YoucannowbringtheCANinterfaceupwithCAN2.0Bat250kbps:

sudo /sbin/ip link set can0 up type can bitrate 250000

ConnectaNMEA2000devicetothenetworkandstartcandump.

candump can0

Youshouldseesomethinglikethis:

Page 7: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

7

ThiscaptureisfromaYachtDevicesDigitalThermometerNMEA2000YDTC-13N

4. NMEA 0183 (RS422) Installation TheNMEA01832(RS422)isconnecttothePionUARTport.Thisneedtobeenablefirst.

OntheRaspberryPitypein:

sudo raspi-config

Select5InterfacingOptions,P6Serial

“Wouldyoulikealoginshelltobeaccessibleoverserial?”SelectNo.

“Wouldyouliketheserialporthardwaretobeenabled?”SelectYes.

Page 8: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

8

SelectfinishandrebootthePi.

ConnectaNMEA0183GPSdevicetothe5wayconnectlikeshownbelow:

OnthePiterminaltypein:

stty -F /dev/ttyS0 raw 4800 cs8 clocal

cat /dev/ttyS0

YoushouldnowseetheGPSsentences:

Page 9: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

9

5. Qwiic (I2C) Connector J4 J4isaQwiic(I2C)connector.TheI2Cbuscanbeuseforextrasensors.

6. Third Party Applications TherearemanythirdpartyapplicationsthatcanbeusewiththePiCAN-Mboard:

• OpenCPN• SignalK

ANMEA0183GPSdevicecanbeusewithOpenCPN.OncethereisaGPSlockyoucanviewyourlocationonthemap.

Page 10: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

10

TemperaturereadingfromaYachtDevicesDigitalThermometerNMEA2000YDTC-13NonSignalKinstrumentpanel.

1.9. Connecting a BME280 Sensor TheSparkfunBME280sensorcanprovidebarometricpressure,humidity,andtemperaturetotheRaspberryPi.

Thedefaultaddressontheboardis0x77butthisgivesaproblemtoSignalKapplication.Thiscanbesolvedbychangingitto0x76.Todothiscutthetrackonthe

Page 11: PiCAN-M USER GUIDE V1 - Copperhill TechPiCAN-M Rev B 1.0 SK Pang Electronics Ltd Ó 20 6 sudo nano /boot/config.txt Add these lines to the end of file: dtparam=i2c_arm=on dtparam=spi=on

PiCAN-M Rev B 1.0

SK Pang Electronics Ltd Ó 2020 www.skpang.co.uk

11

0x77addresssolderbridgethensolderthebridgeforaddress0x76.Thiswillchangetheboardaddressto0x76.

InOpenPlottersoftware,I2C.AddtheBME280sensor.

InSignalKsoftwareyoucanviewtheBME280readings.

Formoreinformationinthesetupwatchthisvideo:

https://www.youtube.com/watch?v=r8CGixMl18k&t=604s