

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Lab; Professor: Bazuin; Class: Microcontroller Applications; Subject: Electrical & Computer Engineer; University: Western Michigan University; Term: Unknown 1989;
Typology: Lab Reports
1 / 2
This page cannot be seen from the preview
Don't miss anything!


1 of 2
Port M (PM.0 โ PM.1) is designated as CAN0 pins. Port M (PM.2 โ PM.2) is designated as CAN1 pins.
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.
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.
Use the same conditions as Task 2.