element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
NexGen Flight Simuator Nexgen: Adventures into CANaerospace part 1
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: phoenixcomm
  • Date Created: 14 May 2020 4:34 PM Date Created
  • Views 1542 views
  • Likes 4 likes
  • Comments 5 comments
  • flight simulator
  • nexgen
  • diy hardware
  • arduino mega 2560
  • mcp2515
  • canaerospace
  • diy software
  • canbus
Related
Recommended

Nexgen: Adventures into CANaerospace part 1

phoenixcomm
phoenixcomm
14 May 2020

imageOk, this will be a new series of blogs taking you and me from sending a CAN message between two Arduinos. First without interrupts on the receiver and then with. Then with the same hardware, I will send an adequately formatted CANaerospace message. CAN and CANaerospace are almost the same.

They are both democratic networks which means that any node can transmit to other nodes, hence there is no master-slave relationship.  While most of the demos show a master and a slave. The circuit below is a typical hookup for either CANbus or CANaerospace. But in its present configuration, it is a SLAVE-MASTER. Also since  CANaerospace uses the ISO 7 layer module, you can create a socket.CAN ie you can put CANaerospace over TCP.

BYTE CANbus CANaerospace
0 CAN ID = 0x36; Node_ID = 324
1 canMsg.can_dlc = 8; DATA TYPE
2 canMsg.Data[0] = h; SERVICE CODE
3 canMsg.Data[1] = t; MESSAGE CODE

MESS_ID starts at 1 and

increments thereafter

4 canMsg.Data[2] = 0x00; DATA 
5 canMsg.Data[3] = 0x00;
6 canMsg.Data[4] = 0x00;
7 canMsg.Data[5] = 0x00;
8 canMsg.Data[6] = 0x00; N/A
canMsg.Data[7] = 0x00;

 

 

imageimage

Since CANaerospace IDs are predefined where 324 is Static Air Temperature, I will only worry about temperature.  I will only be using standard hardware.

PartsList:

  • Arduino Mega 256 x 2
  • MCP2515 CANbus Modules x 2 which are attached to the SPI bus.

 

Articles that I have used.

  • Arduino CAN Tutorial - Interfacing MCP2515 CANbus Module with Arduino. [Pramoth Thangavel] 7/16/2019
  • Using Interrupt to Read Data from CAN Controller in Arduino [Prabakaran P.M]  4/22/2016
  • Portable Implementation of CANaerospace protocol, targeted for microcontrollers and Linux. [Pavel Kirienko]
  • Sign in to reply

Top Comments

  • DAB
    DAB over 5 years ago +1
    Hi Chris, How often do you intend to send the messages? DAB
  • Jan Cumps
    Jan Cumps over 5 years ago +1
    If you want to reduce space: the new range of Arduino MKR 1xxx are much smaller and there's a CAN shield available. I've tested one in a CAN setup.
  • phoenixcomm
    phoenixcomm over 5 years ago in reply to Jan Cumps +1
    Jan Cumps Jan, I am more worried about memory, and I/O. So putting a Mega, CAN mod, 50 pins of I/O (2xDB25), dual RJ45 connector module, DIN 5F for power, and a DPDT slide switch fro the terminating resistor…
  • relaxibus
    relaxibus 26 days ago

    Hi, would you share your Arduino code?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 5 years ago in reply to Jan Cumps

    Jan Cumps  Jan, I am more worried about memory, and I/O. So putting a Mega, CAN mod, 50 pins of I/O (2xDB25), dual RJ45 connector module, DIN 5F for power, and a DPDT slide switch fro the terminating resistor. Each LRU (box) is 3-D printed about 3" across, 7" high and 7" deep, So on the front panel, you have the Arduino (USB, Power) & dual RJ45 mod plus the switch. On the rear you have 2xDB25 and DIN-5.

    Oh btw the MKR is more money than an unassembled Megas for about 10.00 us

    . image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • phoenixcomm
    phoenixcomm over 5 years ago in reply to DAB

    DAB It will run at 800kb/sec

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Jan Cumps
    Jan Cumps over 5 years ago

    If you want to reduce space: the new range of Arduino MKR 1xxx  are much smaller and there's a CAN shield available.

    I've tested one in a CAN setup.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 5 years ago

    Hi Chris,

     

    How often do you intend to send the messages?

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube