Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

CAN adapter to UART

License

NotificationsYou must be signed in to change notification settings

araobp/can-bus

Repository files navigation

pcb_ed

Printed circuit design for CAN node

(I have not tested the printed circuit board yet, because I have been too busy in other priority works)

Motivation

I want to develop very cheap and low power sensor/actuator network with electronic parts sold inAkizuki-Denshi, Tokyo.

Most of parts I use are DIP.

Architecture

Basic concept

I pursue seamless communications between CAN-bus and MQTT-bus:

concept

Specification

The CAN node consists of one base board and one expansion board.

See this page for expansion boards:EXPANSION BOARDS.

CAN node base board

ParameterValueNote
PIC16F1 MCU clock32MHz(Internal OSC 8MHz * 4 PLL)
UART baud rate9600bps (fixed)Full-duplex wire-rate is not supported
SPI clock2MHz (fixed)
CAN speedMax. 250kHz (default 125kHz)
Oscillator for CAN controller8MHz (ceramic)Murata Ceralock
Expansion board8 pins connected to PIC MCU

Circuit

Circuit

PCB

pcb

BOM

Part                    Akizuki-denshi URLPrice in YenQuantity
Microchip PIC16F1825-I/Phttp://akizukidenshi.com/catalog/g/gI-10656/1501
Microchip PIC16F18326-I/Phttp://akizukidenshi.com/catalog/g/gI-11886/1301
Microchip MCP2515http://akizukidenshi.com/catalog/g/gI-12030/1601
Microchip MCP2561http://akizukidenshi.com/catalog/g/gI-12483/901
Murata Ceralock 8MHz    http://akizukidenshi.com/catalog/g/gP-00153/351
Regiter 51k ohmhttp://akizukidenshi.com/catalog/g/gR-25513/11
Register 10k ohmhttp://akizukidenshi.com/catalog/g/gR-25103/11
Register 120 ohm        http://akizukidenshi.com/catalog/g/gR-25121/11
Murata capacitor 0.1 micro Fhttp://akizukidenshi.com/catalog/g/gP-00090/103
Diode 1A                http://akizukidenshi.com/catalog/g/gI-08332/101
Toshiba TA48M05F (w/ capacitors)http://akizukidenshi.com/catalog/g/gI-00451/1001
Polyswitch 250mA        http://akizukidenshi.com/catalog/g/gP-01354302
LED 3mm redhttp://akizukidenshi.com/catalog/g/gI-04780/201
Tactile switch            http://akizukidenshi.com/catalog/g/gP-08216/201
IC sockets 14pins        http://akizukidenshi.com/catalog/g/gP-00006/101
IC sockets 18pinshttp://akizukidenshi.com/catalog/g/gP-00008/101
IC sockets 8pinshttp://akizukidenshi.com/catalog/g/gP-00017/101
Pin socket 6pinshttp://akizukidenshi.com/catalog/g/gC-03784/201
Pin socket 4pins        http://akizukidenshi.com/catalog/g/gC-10099/202
Pin header L shape      http://akizukidenshi.com/catalog/g/gC-01627/501
Phenix Contact terminal block 2Phttp://akizukidenshi.com/catalog/g/gP-08369/201

CAN Standard Identifier format

This implementation supports CAN Standard Frame only (does not support Extended Frame). For home networking, 11bit Standard Identifier suffices.

=>FORMAT

"CAN adapter to UART" command list

This implementation supports CAN adapter functionality for PC and Android.

/// UART2CAN HELP (version 0.11  March 19, 2018) ///[Set standard identifier] @i<standard identifier>[Set output mode] {debug: @vd, verbose: @vv, normal: @vn}[Enable operation mode] {loopback: @ol, normal: @on}     with SID: @ols or @ons[Set mask] @m<n><mask(SID10 ~ SID0)>[Set filter] @f<n><filter(SID10 ~ SID0)>[Set baud rate] @b<bpr>[Abort all pending transmissions] @a[Dump masks and filters] @F[Dump registers] @D[Send message] <message>[Send message beginning with '@' character] @<@message>[Receive message] <message> will be output[Show this help]: @h

For example, to receive messages with SID 5, 10 and 15, set masks and filters to the CAN adapter as follows:

@m02047  --> RXM0 0b11111111111@f05     --> RXF0 0b00000000101 (SID 5 message to RXB0)@f110    --> RXF1 0b00000001010 (SID 10 message to RXB0)@m12047  --> RXM1 0b11111111111@f215    --> RXF2 0b00000001111 (SID 15 message to RXB1)

Development environment


Development plan and progress

M1 (completed on March 17, 2018)

board

  • Purchased CAN adaptors from Amazon.
  • Evaluate CAN ==>EVALUATION.
  • Developed my original ASCII-based protocol over serial for MCP2515. The protocol is mainly for evaluating MCP2515.

At first, I usethis universal board to make a prototype of the CAN adaptor:

universal board

I have finished the first prototype (Marth 25-27, 2018). I have made three boards, and it took eight hours.

front

back

daisy_chain

M2 (completed on April 1, 2018)

3d_printed

3D printed enclosure for CAN node

  • Purchase three pairs of MCP2515 and MCP2561 in Akihabara.
  • Develop my original CAN adaptor board.
  • DevelopCAN-MQTT gateway on RasPiand OpenWrt.
  • Developa 3D-printed DIN rail enclosure for the board by usingFreeCAD.
  • Mount all of them on DIN rail (incl. RasPi).
  • AddSLCAN that is ASCII-based protocol for SocketCAN.

M3

  • EvaluatePIC16F18326 that is cheaper than PIC16F1825 and supports two MSSPs.
  • Use KiCAD to redesign the circuit for PIC16F18326.
  • Adopt moduler architecture: base board and sensor/actuator building blocks.
  • Support sensors and actuators: doppler sensor, CdS, servo motor etc.

requirements


Reference

Datasheet (Microchip/NXP/Murata)

Microchip

NXP

Murata

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp