TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137106 times)
  2. FAT32 Library (70236 times)
  3. Network Ethernet Library (56126 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42079 times)
  6. FT800 Library (41389 times)
  7. GSM click (29118 times)
  8. mikroSDK (26564 times)
  9. PID Library (26503 times)
  10. microSD click (25487 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

CAN Transmit Demo

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.0.0.3

mikroSDK Library: 2.0.0.0

Category: CAN

Downloaded: 30 times

Not followed.

License: MIT license  

The application demonstrates CAN Transmit functionality.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "CAN Transmit Demo" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "CAN Transmit Demo" changes.

Do you want to report abuse regarding "CAN Transmit Demo".

  • Information
  • Comments (0)

mikroSDK Library Blog

CAN Transmit

Code developed on UNI-DS v8 and it can be used on other MIKROE development boards as well. Code was developed with purpose of easier understanding functions for Controller Area Network Interface (CAN). CAN Transmit Demo is meant to work with CAN Receive Demo, meaning that one should be programmed on one MCU and the other on another one and boards should be connected properly. Follow the steps to make the example work as it should.



Code description

This is a simple example that utilizes mikroSDK 2.10.0 CAN driver library. In this demo we send three bytes of data, of which the first and the third one are the same every time and they're used to make sure transmit and receive are not stuck. The second one is an 8-bit value that gets incremented in each transmit.


Hardware Support

This code was developed on UNI-DS v8 board. For this hardware to work according to program, you will need the following:

  1. Two boards and two MCUs
  2. Twisted wire - around 30cm of it
  3. MCU cards with CAN connectors (or boards with on-board CAN connectors, such as EasyPIC v8)
    • easypic_v8_can_connector
    • image
  4. Alternatively, instead of soldering additional connectors to your existing MCU cards, you could use CAN-1 Boards

Note: You might need terminal resistence (aproximately 120 Ohms). This is hardware dependent.

To connect everything properly, follow these steps:

  1. Connect CAN connectors with twisted wire. CANH and CANL on one board are connected to CANH and CANL on the other one respectively.
  2. If terminal resistance is needed, put a through-hole resistor in one of the connectors (between CANH and CANL of the same connector).
  3. If using CAN-1 Boards, place them on adequate headers on boards.

Software Support

We provide code for demonstrating the usage of functions contained in CAN driver library. To run this example, follow these steps:

In order to make this example work, proper clock setup is needed. To create a setup with the adequate clock scheme, follow these steps:

  1. Install the package from Package manager.
  2. Open example.
  3. It will take you to setups, so make one for your hardware.
  4. Choose adequate setup and clock configuration and the project will open.
  5. Program it by clicking on Flash.
  6. Once CAN Receive Demo is programmed on the other board and the two boards are connected properly, data should be visible on it on the defined port. Use a logic analyzer to see the signals.

ALSO FROM THIS AUTHOR

LED Driver 13 click

0

LED Driver 13 Click is a compact add-on board that simplifies the control of multiple LEDs. This board features the A80604-1, a 4-channel LED driver designed at a switching frequency of 400kHz that provides 150mA per channel from Allegro Microsystems. It is powered by an external power supply in the range of 6V to 18V, providing an output voltage of approximately 26V, which is used to power LEDs connected to LED channels. On the logical side, this board uses both 3V3 and 5V with mikroBUS™ power rails and communicates with the MCU via GPIO pins. In addition, the user is given the option of analog or digital LED dimming selection, using a PWM pin from the mikroBUS™ socket or via an onboard potentiometer/external PWM signal.

[Learn More]

6DOF IMU 14 click

0

6DOF IMU 14 Click is a compact add-on board that contains a 6-axis MEMS motion tracking device combining a 3-axis gyroscope and a 3-axis accelerometer. This board features the ICM-42688-P, high precision 6-axis MEMS motion tracking device, from TDK InvenSense.

[Learn More]

Fan 2 click

0

Fan 2 click carries the MAX31760 precision fan-speed controller. It can measure temperature and adjust the fan speed to keep the temperature at the same level. Fan 2 click can also control two fans at the same time.

[Learn More]