Cypress CY8CKIT-026 Manual

Can communication between fm4-s6e2gx series and psoc 4 m-series using can and lin shield kit

Advertisement

Quick Links

Objective
This code example demonstrates CAN communication between FM4-S6E2Gx Series & PSoC® 4 M-Series using the
CY8CKIT-026 CAN and LIN Shield Kit.
Overview
This code example demonstrates the configuration of FM4 S6E2GM Pioneer Kit and CY8CKIT-044 for CAN communication
using CY8CKIT-026 as the CAN transceiver. FM4 S6E2GM acts as the CAN transmitter (Tx) and PSoC
receiver (Rx). The CAN transmitter sends data for ON/OFF status, color, and brightness of an RGB LED. This data is
transmitted over the CAN; at the CAN receiver, the RGB LED is configured to reflect the received data.
Requirements
Tool: PSoC Creator™ 3.3 SP1 (PSoC 4 M-Series) or later, Keil µVision
Programming Language: C (Armcc V5.05, ARM GCC 4.9.3 and MDK compilers)
Associated Parts: 4200-M and 4100-M, FM4
CY8CKIT-044 – PSoC 4 M-Series Pioneer Kit, FM4-176L-S6E2GM,
Related Hardware:
Design
This code example consists of two projects; one for the CAN transmitter, and one for the CAN receiver.
Network Topologyshows the hardware connections between the kits.
FM4-S6E2GM
PIONEER KIT
The transmitter project continuously transmits LED ON/OFF status, color, and brightness values. The receiver project controls
its LEDs accordingly.
www.cypress.com
Figure 1. CAN Network Topology
Jumper
Wires
CAN-Tx
CN7_9
C_Tx
CAN-Rx
CN10_3
C_Rx
CY8CKIT-026
3V3
V3.3
GND
GND
Document No. 002-11027 Rev.*A
CE211027 - CAN Communication Between
FM4-S6E2Gx Series and PSoC
Using CY8CKIT-026 CAN and LIN Shield Kit
®
5 (FM4 S6E2Gx series).
DB9
connector
C_Tx
CAN_H
CAN-Rx
C_Rx
CY8CKIT-026
CAN_L
V3.3
GND
®
4 M-Series
®
4 M as the CAN
two
CY8CKIT-026
kits
Jumper
Wires
CY8CKIT-044
(CAN_Rx)
CAN-Tx
P0.1
P0.0
V3.3
RGB LED
GND
UART_Tx
UART_Rx
Computer
(HyperTerminal)
Figure 1.
CAN
1

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CY8CKIT-026 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Cypress CY8CKIT-026

  • Page 1 This code example demonstrates the configuration of FM4 S6E2GM Pioneer Kit and CY8CKIT-044 for CAN communication ® using CY8CKIT-026 as the CAN transceiver. FM4 S6E2GM acts as the CAN transmitter (Tx) and PSoC 4 M as the CAN receiver (Rx). The CAN transmitter sends data for ON/OFF status, color, and brightness of an RGB LED. This data is transmitted over the CAN;...
  • Page 2 ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit CAN_Tx_FM4 Project This project is configured to work as a CAN transmitter. The project continuously sends three bytes of data when it is powered, as shown in Figure 2.
  • Page 3: Design Considerations

    ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit CAN_Rx_PSoC4M Project This project receives the CAN data sent from the CAN_Tx_FM4 project. The received data is a packet of three bytes consisting of the ON/OFF status, color, and brightness, as Figure 4 shows.
  • Page 4: Hardware Setup

    4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Hardware Setup CAN Tx Hardware Connections To use CY8CKIT-026 with an FM4 Kit (FM4 S6E2GM Pioneer Kit), make the following connections:  To connect CY8CKIT-026 with the FM4 kit, connect extra headers to CY8CKIT-026 as shown in Figure 5.
  • Page 5 CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit  Connect CY8CKIT-026 on top of the FM4 kit as shown in Figure 6. CY8CKIT-026 Connected to FM4 Kit  Make connections for CAN Tx and Rx on CY8CKIT-026 per Table 1.Connections...
  • Page 6 CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit  Power the Shield kit with a 12-V/1-A input and connect the DB9 connector to CY8CKIT-026 as shown in Figure 7. Figure 7. CY8KIT-026 and FM4 Kit www.cypress.com...
  • Page 7 ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit CAN Rx Hardware Connections To use CY8CKIT-026 with CY8CKIT-044, make the following connections:  Make sure that the jumper J9 on the baseboard (CY8CKIT-044) is in the 3.3V position.
  • Page 8 ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit  Connect a DB9 connector to CY8CKIT-026 as in Figure Figure 10.DB9 Connector Components Peripherals Used – CAN_Tx_FM4lists the peripherals used in the CAN_Tx_FM4 project, as well as the hardware Table 2.
  • Page 9: Parameter Settings

    ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Parameter Settings CAN_Tx_FM4 project The CAN peripheral block is configured using the associated peripheral registers. See the 32-BIT MICROCONTROLLER FM4 for more information on the CAN peripherals. This project uses CAN Family Communication Macro Part PERIPHERAL MANUAL peripheral and I/O pins.
  • Page 10 ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Figure 11. CAN Component Clock Accuracy Warning In the clock configuration wizard of the CAN_Rx_PSoC4M.cydwr file, the IMO can be trimmed to an accuracy of 0.5 percent using the watch crystal oscillator (WCO) in PSoC 4 M.
  • Page 11 ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Figure 13. CAN_Rx Configuration – Timing Tab In the Interrupt tab, enable Advanced interrupt configuration and select Full custom internal ISR, as shown in Figure 14 Figure 14.
  • Page 12 CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit In the Receive Buffers tab, add a Full Rx mailbox with the mailbox ID as 0x01. Rename the mailbox to “Button,” as shown in Figure 15.
  • Page 13: Operation

    ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Operation CAN_Tx_FM4 Program the CAN_Tx_FM4 project into the FM4 pioneer kit that is used as CAN Tx. Press reset, using SW1, on the kit.
  • Page 14: Related Documents

    ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Related Documents Table 3 lists the relevant application notes, code examples, knowledge base articles, device datasheets, and Component datasheets. Table 3. Related Documents Application Notes Introduces you to PSoC 4, an ARM®...
  • Page 15: Document History

    ® CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit Document History ® Document Title: CE211027 – CAN Communication Between FM4-S6E2Gx Series and PSoC 4 M-Series Using CY8CKIT-026 CAN and LIN Shield Kit...
  • Page 16: Worldwide Sales And Design Support

    Cypress is not liable, in whole or in part, and you shall and hereby do release Cypress from any claim, damage, or other liability arising from or related to all Unintended Uses of Cypress products.

Table of Contents