Skip to content

Latest commit

 

History

History
77 lines (45 loc) · 1.12 KB

README.md

File metadata and controls

77 lines (45 loc) · 1.12 KB

Recoil USB-CAN Adapter

This adapter follows the python-can serial bus API packet format to transmit CAN frames over UART.

Recoil Motor Controller Communication Format

The CAN ID is separated into two fields, device_id and func_id.

func ID device ID
5 bits 6 bits
CAN_ID[10:6] CAN_ID[5:0]
32 functions 64 devices

Hardware Settings

CAN Baudrate setting:

Prescaler: 18

Time Quantum: 125.0 ns

Time Seg1: 7

Time Seg2: 2

Time for one Bit: 1250 ns

Baud Rate: 800000 bit/s

Usage

COM_PORT = "COMx"  # COM port of the dongle

bus = can.Bus(interface="serial", channel=COM_PORT, baudrate=1000000)

TODO

todo

Setting up Pi CAN Hat

sudo apt update
sudo apt install python3-pip
pip3 install python-can
sudo nano /boot/config.txt
dtparam=spi=on
dtoverlay=mcp2515-can0,oscillator=12000000,interrupt=25,spimaxfrequency=1000000
reboot
dmesg | grep -i '\(can\|spi\)'