Summary of Contents for SK Pang Electronics PiCAN FD
Page 1
PiCAN FD SENT Rev B 1.0 PiCAN FD and SAE J2716 SENT USER GUIDE V1.0 Product name PICAN FD and SENT Board for Raspberry Pi Model number RSP-PICANFDSENT Manufacturer SK Pang Electronics Ltd SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
PiCAN FD SENT Rev B 1.0 1. Introduction This PiCAN FD board with SAE J2716 SENT. Classic CAN and CAN FD is provided by the Microchip MCP2518FD IC. SAE J2716 SENT is provided by a dsPIC33 micro-controller. Communication to the Pi is over UART on ttyS0 using ASCII text commands. Example SENT GUI app is available written in Python3 and tkinter. The firmware is updatable using the Microchip UnifiedHost java app. This requires the Raspberry Pi running in GUI mode. Easy to install SocketCAN driver. Programming can be done in Python. Optional 3A SMPS module which can power the PiCAN FD SENT board and Raspberry Pi from 7 to 24v external supply. 1.1. 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 screw terminal • 120Ω terminator ready • LED indicator (GPIO04) • Four fixing holes, comply with Pi Hat standard •...
PiCAN FD SENT Rev B 1.0 1.3. Screw Terminal Plugs The CAN connections is made via the 4way screw terminal plug on J3 and SENT on J5. J5 SENT Function J3 CAN-Bus Function GND CAN_L RX1 CAN_H TX1 GND RX2 +12v TX2 +5v 1.4. CAN-BUS 120 W Terminator There is a 120W fitted to the board. To use the terminator solder a 2way header pin to JP2 then insert a jumper. 1.5. LEDs There is a red LED (LED1) fitted to the board. This is connected to GPIO04. LED2 and LED3 are the SENT status light which is controlled by the dsPIC33. 1.6. Optional SMPS. Switch mode power supply module option, this is a 5v module that can power the board and the Raspberry Pi. It has an input voltage range of 7v to 24v.
PiCAN FD SENT Rev B 1.0 3. 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 dtoverlay=mcp251xfd,spi0-0,interrupt=25 Reboot Pi: sudo reboot 1.7. Installing CAN Utils Install the CAN utils by: sudo apt-get install can-utils 1.8. Bring Up the Interface You can now bring the CAN interface up with CAN 2.0B at 500kbps:...
PiCAN FD SENT Rev B 1.0 You should see something like this: 4. 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 can0 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.
PiCAN FD SENT Rev B 1.0 To received messages and display on screen type in: notifier = can.Notifier(bus, [can.Printer()]) 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 1.9. SENT Usage The SENT controller is communicated to the Pi over the UART on ttyS0 port at 115200 8-N-1 setting. Using Coolterm for Raspberry Pi or a text base terminal. Set the port to /dev/ttyS0 / 115200 8-N-1 and connect. On the terminal type in ‘v’ and press enter. Type in ‘V’ and press enter. You should see a reply like this screen: SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
PiCAN FD SENT Rev B 1.0 1.10. ASCII Command Set To control the SENT port a simple ASCII command is sent from the Pi to the PICAN FD LIN board. Commands from Pi to the PiCAN FD SENT board The command requires a carriage return character (0x0D). All values are in hex. Get hardware version Get firmware version Open SENT port. x:1 port 1. x:2 port. x:3 both ports Close SENT port. x:1 port 1. x:2 port. x:3 both ports dxsiiiiii Transmit a SENT frame with 6 nibble dxsiiiiii x:1 port1. x:port2 x:3 both ports s:Status nibble 0 to 0xf iiiiii:6 nibble of data. 0 to 0xf each txii Set Tick Time 03 to 90 (decimal) txii x:1 port1. x:port2 x:3 both ports ii:00 to 90 fxiii Set Frame Time 284 to 920 (decimal) fxiii x:1 port1. x:2 port2 iii:284 to 920 Set Pause Pulse Present x:1 port1. x:2 port2 x:3 both ports mxi Set operation mode mxi x:1 port1. x:port2 x:3 both ports i:r receive. i:t transmit...
Page 9
PiCAN FD SENT Rev B 1.0 Data from PiCAN FD SENT board to Pi After each command is received, an acknowledge character is sent back to the Pi. Command is ok. Error. Command is not ok or command format error. dxsiiiiiic x:1 port1. x:2 port2 s: Status nibble i: Six nibbles of data c: Checksum nibble Example 1. Port 1 to receive at 3us tick rate. Device such as Microchip LXE3302AR001 - LX3302A Inductive Position sensor. To setup port 1 to receive at 3us tick rate. Command string: t103 You should now see a series of data returned like shown below: d10E66E66F d10E66E66F d10E66E66F SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
PiCAN FD SENT Rev B 1.0 d10E66E66F d10E66E66F Example 2. To read the output of a vehicle accelerator pedal. This SENT device has two outputs. To setup port 1 and 2 to receive at 3us tick rate. Command string: t103 t203 You should now see a series of data returned like shown below: d140EFFCFE d200776CF6 d140EE15F8 d2007685F6 1.11. SENT GUI Demo A simple GUI interface is available to download from github: https://github.com/skpang/PiCAN_SENT_GUI_demo To run the program start a terminal and type in: python3 pican-sent.py You should see a screen shown below: SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
Page 11
PiCAN FD SENT Rev B 1.0 1. Click the Connect button to connect to the PiCAN FD SENT board. 2. Check the Status box is updated. Example 1. Connect an accelerator pedal to the board. SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
Page 12
PiCAN FD SENT Rev B 1.0 Now click. 3. Set Frame Time value for Channel 1 4. Set Tick Time value for Channel 1 5. Set Frame Time value for Channel 2 6. Set Tick Time value for Channel 1 To open the channels click. 7. Click Open Channel 1 8. Click Open Channel 2 SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
Page 13
PiCAN FD SENT Rev B 1.0 You should now see data from both channels. 9. Status nibble 10. Six data nibble in hex 11. First 3 data nibble converted to decimal 12. CRC nibble Example 2. Transmitting SENT frames SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
Page 14
PiCAN FD SENT Rev B 1.0 To transmit SENT frames, click. 13. Close Channel button 14. Tx radio button 15. Enter status and data values 16. Set Data value button 17. Open Channel 1 button The example data values are Status nibble : A Data nibble : 123456 From a scope you should see a waveform like shown below: This should a status nibble of 0xA. Six data nibble and a CRC of 0x2. SK Pang Electronics Ltd Ó 2022 www.skpang.co.uk...
Need help?
Do you have a question about the PiCAN FD and is the answer not in the manual?
Questions and answers