Control Area Network Interface - Prelab 11 | ECE 4510, Lab Reports of Microcomputers

Material Type: Lab; Professor: Bazuin; Class: Microcontroller Applications; Subject: Electrical & Computer Engineer; University: Western Michigan University; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 09/17/2009

koofers-user-3d1
koofers-user-3d1 ๐Ÿ‡บ๐Ÿ‡ธ

10 documents

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1 of 2
Prelab Eleven
Control Area Network (CAN) Interface
Port M (PM.0 โ€“ PM.1) is designated as CAN0 pins.
Port M (PM.2 โ€“ PM.2) is designated as CAN1 pins.
Task๎˜ƒOne๎˜ƒ
The designated CAN Module is CAN0.
The Baud rate should be set to 1 Mbs. Select the Oscillator Clock for the MSCAN clock source.
Study Section 4.3.2 of the MSCAN Data Sheets carefully to make your decision on the
parameter values for the Bit-Time and the Prescaler. Set up four 16-bit acceptance filters. The
11-bit receive addresses you are looking for (right justified) are 0x0500, 0x0501, 0x0502,
0x0503 and 0x0504. Your transmit address (right justified) should be 0x0300.
The memory locations for 64-character transmit and receive buffer arrays should be 0x1100 and
0x1140, respectively. The receive buffer area should be initialized to all zeroes. The message to
be transmitted should be made up of ASCII text characters. It is to be terminated by a 0x00
(EOS) character (not included in the count) that will be transmitted. The program should keep on
receiving and transmitting messages on the CAN Bus.
You should use polling of the MSCAN0 Transmit and Receive flags to determine when a frame
is to be read or is ready to be sent.
If using the CANUSB, configure the PC to monitor and send CAN frames. Initialize your
module and send periodic CAN frames once every 250 msec. Observe the received data using
the CANUSB.
In the CANUSB, set up the transmission of one frame with known ASCII characters (e.g.
01234567). Send the frame once and check the received data memory buffer of your module to
see if they were successfully received.
Task๎˜ƒTwo๎˜ƒ
The designated CAN Module is CAN1.
The Baud rate should be set to 500 kbs. Select the Oscillator Clock for the MSCAN clock
source. Study Section 4.3.2 of the MSCAN Data Sheets carefully to make your decision on the
parameter values for the Bit-Time and the Prescaler. Set up four 16-bit acceptance filters,
however, the Lab TA will define the ID and filter values. Work with a single CAN transmit
buffer.
The memory locations for 64-character transmit and receive buffer arrays should be 0x1100 and
0x1140, respectively. The receive buffer area should be initialized to all zeroes. The message to
be transmitted should be made up of ASCII text characters. It is to be terminated by a 0x00
pf2

Partial preview of the text

Download Control Area Network Interface - Prelab 11 | ECE 4510 and more Lab Reports Microcomputers in PDF only on Docsity!

1 of 2

Prelab Eleven

Control Area Network (CAN) Interface

Port M (PM.0 โ€“ PM.1) is designated as CAN0 pins. Port M (PM.2 โ€“ PM.2) is designated as CAN1 pins.

Task One

The designated CAN Module is CAN0.

The Baud rate should be set to 1 Mbs. Select the Oscillator Clock for the MSCAN clock source. Study Section 4.3.2 of the MSCAN Data Sheets carefully to make your decision on the parameter values for the Bit-Time and the Prescaler. Set up four 16-bit acceptance filters. The 11-bit receive addresses you are looking for (right justified) are 0x0500, 0x0501, 0x0502, 0x0503 and 0x0504. Your transmit address (right justified) should be 0x0300.

The memory locations for 64-character transmit and receive buffer arrays should be 0x1100 and 0x1140, respectively. The receive buffer area should be initialized to all zeroes. The message to be transmitted should be made up of ASCII text characters. It is to be terminated by a 0x (EOS) character (not included in the count) that will be transmitted. The program should keep on receiving and transmitting messages on the CAN Bus.

You should use polling of the MSCAN0 Transmit and Receive flags to determine when a frame is to be read or is ready to be sent.

If using the CANUSB, configure the PC to monitor and send CAN frames. Initialize your module and send periodic CAN frames once every 250 msec. Observe the received data using the CANUSB.

In the CANUSB, set up the transmission of one frame with known ASCII characters (e.g. 01234567). Send the frame once and check the received data memory buffer of your module to see if they were successfully received.

Task Two

The designated CAN Module is CAN1.

The Baud rate should be set to 500 kbs. Select the Oscillator Clock for the MSCAN clock source. Study Section 4.3.2 of the MSCAN Data Sheets carefully to make your decision on the parameter values for the Bit-Time and the Prescaler. Set up four 16-bit acceptance filters, however, the Lab TA will define the ID and filter values. Work with a single CAN transmit buffer.

The memory locations for 64-character transmit and receive buffer arrays should be 0x1100 and 0x1140, respectively. The receive buffer area should be initialized to all zeroes. The message to be transmitted should be made up of ASCII text characters. It is to be terminated by a 0x

2 of 2

(EOS) character (included in the count) that will be transmitted. The program should keep on receiving and transmitting messages on the CAN Bus. You should use both the MSCAN Transmit and Receive Interrupts, respectively, to synchronize the CPU and the CAN0 Module.

Task Three

Use the same conditions as Task 2.