Docsity

Laboratory Eleven Control Area Network (CAN) Interface | ECE 4510, Assignments of Microcomputers

Toggle sidebar
bg1
Laboratory Eleven
Control Area Network (CAN) Interface
Objectives:๎˜ƒ
1. To understand the basics of a CAN interface
2. To use a CAN Module of the 9S12DP512 microcontroller to implement a CAN
communications port
3. To develop a C program that will send and receive messages over a CAN
communications port
Task๎˜ƒOne:๎˜ƒ
Receive (only) CAN messages from the CAN Test Bench or sen and receive CAN messages
using the CANUSB test devices.
Task๎˜ƒTwo:๎˜ƒ
You should establish a message transfer system to/from other Evaluation Boards over a CAN
communications port. One of the CAN ports fitted with CAN transceivers on your Evaluation
Board will be assigned to this task.
Use a cable furnished by your lab TA to connect your system to the CAN Port of the other
system. Don't forget the common signal ground reference! Develop a C program that will keep
transmitting and receiving messages of 32 characters to/from the other boards. The actual CAN
Module, the Baud rate value, the ID's and Filters, and some other specs will be given in the
Prelab Assignment, or will be determined by your lab TA. Data to be transmitted (and received)
should be taken from (stored at) memory locations given in the Prelab Assignment.
Use the $00 (EOS) code as a string terminator for the message to be transmitted. The receive
buffer area should be initialized to all zeroes. Your program should use interrupts to synchronize
the data transfers between the CPU and the selected CAN Module. The programs running on the
interconnected Evaluation Boards should be able to exchange their messages.
Verify the success of the data transfer by checking and printing out the contents of the send and
receive data buffer arrays, respectively. In addition, use a logic analyzer with probes hooked up to
the TTL-level TxCANx and RxCANx signals that are available on Header H2 to record the
transmitted and received messages and the time gaps between them. You should also verify the
actual Baud rate.
Task๎˜ƒThree:๎˜ƒ
Repeat Task two but this time run your code from the Flash memory. Use a logic analyzer only
for verification purposes.
Comment on your results. You are to turn in hard copies of the recorded timing diagrams for the
transferred messages, and the memory dumps of the transmit and receive buffer areas. In
addition, turn in your cable hookup diagram complete with Header connector pin numbers. The
MC9S12DP512 programs should be documented by hard copies of your C source code and
compiled list (*.lst) files.

Partial preview of the text

Download Laboratory Eleven Control Area Network (CAN) Interface | ECE 4510 and more Assignments Microcomputers in PDF only on Docsity!

Laboratory Eleven

Control Area Network (CAN) Interface

Objectives:

  1. To understand the basics of a CAN interface
  2. To use a CAN Module of the 9S12DP512 microcontroller to implement a CAN communications port
  3. To develop a C program that will send and receive messages over a CAN communications port

Task One:

Receive (only) CAN messages from the CAN Test Bench or sen and receive CAN messages using the CANUSB test devices.

Task Two:

You should establish a message transfer system to/from other Evaluation Boards over a CAN communications port. One of the CAN ports fitted with CAN transceivers on your Evaluation Board will be assigned to this task.

Use a cable furnished by your lab TA to connect your system to the CAN Port of the other system. Don't forget the common signal ground reference! Develop a C program that will keep transmitting and receiving messages of 32 characters to/from the other boards. The actual CAN Module, the Baud rate value, the ID's and Filters, and some other specs will be given in the Prelab Assignment, or will be determined by your lab TA. Data to be transmitted (and received) should be taken from (stored at) memory locations given in the Prelab Assignment.

Use the $00 (EOS) code as a string terminator for the message to be transmitted. The receive buffer area should be initialized to all zeroes. Your program should use interrupts to synchronize the data transfers between the CPU and the selected CAN Module. The programs running on the interconnected Evaluation Boards should be able to exchange their messages.

Verify the success of the data transfer by checking and printing out the contents of the send and receive data buffer arrays, respectively. In addition, use a logic analyzer with probes hooked up to the TTL-level TxCANx and RxCANx signals that are available on Header H2 to record the transmitted and received messages and the time gaps between them. You should also verify the actual Baud rate.

Task Three:

Repeat Task two but this time run your code from the Flash memory. Use a logic analyzer only for verification purposes.

Comment on your results. You are to turn in hard copies of the recorded timing diagrams for the transferred messages, and the memory dumps of the transmit and receive buffer areas. In addition, turn in your cable hookup diagram complete with Header connector pin numbers. The MC9S12DP512 programs should be documented by hard copies of your C source code and compiled list (*.lst) files.