SK Pang PiCAN FD and GNSS or GPS Board With NEO-M8M User Guide

June 5, 2024
SK Pang

SK Pang PiCAN FD and GNSS or GPS Board With NEO-M8M

SK Pang PiCAN FD and GNSS or GPS Board With NEO-
M8MIntroduction

This PiCAN FD GPS/GNSS board provides Classic CAN and CAN FD Raspberry Pi. It uses the Microchip MCP2518FD CAN controller. GPS/GNSS is provided by ublox NEOM8M modules. Other NEO modules are also available. The improved CAN FD extends the length of the data section to up to 64 bytes per frame and a data rate of up to 8 Mbps. Easy to install SocketCAN driver. Programming can be done in C or Python.

CAN Features

  •  Arbitration Bit Rate upto 1Mbps
  •  Data Bit Rate up to 8Mbps
  •  CAN FD Controller modes
  •  Mixed CAN2.0B and CANFD mode
  •  Conforms to ISO11898-1:2015
  •  High speed SPI Interface
  •  CAN connection via 4way plug in terminal
  •  LED indicator on GPIO04
  •  Four fixing holes, comply with Pi Hat standard
  •  SocketCAN driver, appears as can0 and can1 to application
  •  Interrupt RX on GPIO25

GPS GNSS Features

  •  U-blox NEO-M8M module
  •  72-channel u-blox M8 engine GPS/QZSS L1 C/A, GLONASS L10F, BeiDou B1 SBAS L1 C/A: WAAS, EGNOS, MSAS Galileo-ready E1B/C (NEO-M8N)
  •  Position accuracy 2.0 m CEP
  •  Acquisition
    •  Cold starts: 26 s
    •  Aided starts: 2 s
  •  Reacquisition: 1.5 s
  •  Sensitivity
    •  Tracking & Nav: –167 dBm
    •  Cold starts: –148 dBm
    •  Hot starts: –156 dBm
  •  Assistance AssistNow GNSS Online
  •  AssistNow GNSS Offline (up to 35 days)
  •  AssistNow Autonomous (up to 6 days)
  •  OMA SUPL & 3GPP compliant
  •  Oscillator TCXO
  •  RTC crystal Built-In
  •  Anti jamming Active CW detection and removal.
  •  Extra onboard SAW band pass filter
  •  Memory Flash
  •  Supported antennas Active and passive
  •  Odometer Travelled distance
  •  Data-logger For position, velocity, and time
  •  Communicate to the Pi via UART or I2C
  •  PPS output to GPIO06
  •  Can work as a standalone using on board USB-C connection

Hardware Installation

Before installing the board make sure the Raspberry is switched off. Carefully align the 40way connector on top of the Pi. Use spacer and screw (optional items) to secure the board.

  • Screw Terminals
    • The CAN connections are made via the 4way screw terminals.
J4 Function
1 CAN_L
2 CAN_H
3 GND
4 n/c
  • 120W Terminator
    • There is a 120W fitted to the board. To use the terminator solder a 2way header pin to JP1 and JP2 then insert a jumper.
  • LED
    • There is a red LED fitted to the board. This is connected to GPIO04.
  • Not Fitted Items
    • Switch mode power supply, this is a 5v module that can power the Pi. It has an input voltage range of 7v to 24v.

Software Installation

It is best to start with a brand new Raspbian image. Download the latest from: After first time boot up, do an update and upgrade first.
sudo apt-get update
sudo apt-get upgrade
sudo reboot
Add these lines to the end of file:
enable_uart=1
dtparam=spi=on
dtparam=i2c_arm=on
dtoverlay=mcp251xfd,spi0-0,interrupt=25

Reboot Pi:
sudo reboot

CAN-Bus Usage

Installing CAN Utils

Install the CAN utils by:
sudo apt-get install can-utils

Bring Up the Interface

You can now bring the CAN interface up with CAN 2.0B at 500kbps:
sudo /sbin/ip link set can0 up type can bitrate 500000
or CAN FD at 500kpbs / 2Mbps. Use copy and paste to a terminal Connect the PiCAN FD LIN board to your CAN network. To send a CAN 2.0 message use :
cansend can0 7DF#0201050000000000
This will send a CAN ID of 7DF. Data 02 01 05 – coolant temperature request. To send a CAN FD message with BRS use :
cansend can0 7df##15555555555555555
To send a CAN FD message with no BRS use :
cansend can0 7df##05555555555555555
Connect the PiCAN to a CAN-bus network and monitor traffic by using command:
candump can0
You should see something like this:SK Pang PiCAN FD and GNSS or GPS Board
With NEO-M8M 3

Python Installation and Use

Ensure the driver for PiCAN FD is installed and working correctly first. Clone the pythonCan repository by: git clone https://github.com/hardbyte/python- can cd python-can sudo python3 setup.py install
Check there is no error been displayed.
Bring up the can interface:

sudo /sbin/ip link set can0 up type can bitrate 500000 dbitrate 2000000 fd on sample-point .8 dsample-point .8
Now start python3 and try the transmit with CAN FD and BRS set.
python3 import can bus = can.interface.Bus(channel=’can0′, bustype=’socketcan’,fd = True) msg = can.Message(arbitration_id=0x7de,is_fd = True, bitrate_switch = True,data=[0,0,0,0,0,0x1e,0x21,0xfe, 0x80, 0, 0,1,0]) bus.send(msg)SK
Pang PiCAN FD and GNSS or GPS Board With NEO-M8M 4

To received messages and display on screen type in:
notifier = can.Notifier(bus, [can.Printer()])SK Pang PiCAN FD and GNSS or
GPS Board With NEO-M8M 5

Documentation for python-can can be found at :
https://python-can.readthedocs.io/en/stable/index.html
More expamles in github:
https://github.com/skpang/PiCAN-FD-Python-examples

GPS GNSS Usage

Ensure a GPS GNSS antenna is connected to board. Place the antenna outdoor with a good view to the sky. LED3 flashes to indicate a lock.

Communicate over UART

To use the UART port ensure SB6 and SB7 are made. The default baudrate is 9600 8-N-1. To do basic UART test on the Raspberry Pi, type in:
stty -F/dev/ttyS0 raw 9600 cs8 clocal cat/dev/ttyS0
You should now see the GNSS/GPS sentences like this:SK Pang PiCAN FD and
GNSS or GPS Board With NEO-M8M 6

Communicate over I2C

To use the I2C port ensure SB4 and SB5 are made First install I2C tool:
sudo apt-get install i2c-tools
Now check I2C port:
sudo i2cdetect -y 1
Check address 0x42 has shown up.SK Pang PiCAN FD and GNSS or GPS Board With
NEO-M8M 7Now download the i2c python script from Github:
https://github.com/skpang/Raspberrypi_i2c_gps
Start the script by:
python3 i2c-gps.py
You should now see the GNSS/GPS sentences over I2C like this:SK Pang PiCAN
FD and GNSS or GPS Board With NEO-M8M 8

Communicate over USB
The PiCAN FD GPS board can function as a standalone and communicate over USB. This requires an USB-C cable plug into the board. The USB-C also provides power to the board. This can be plugged into a PC.

On a Windows PC, u-center can be used:SK Pang PiCAN FD and GNSS or GPS Board
With NEO-M8M 9

References

Read User Manual Online (PDF format)

Loading......

Download This Manual (PDF format)

Download this manual  >>

Related Manuals