DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ...

DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ... DESIGN OF A CUSTOM ASIC INCORPORATING CAN™ AND 1 ...

acumen.lib.ua.edu
from acumen.lib.ua.edu More from this publisher
15.08.2013 Views

condition is detected, the PIC® MCU performs a re-initialization of the MCP2515 and then attempts to transmit the error message (ID = 0x3FF) with an error code of 0x12. After initiating a request to send for the error message, the PIC® MCU checks to ensure that the message was transmitted successfully. If it was successfully transmitted, the PIC® MCU sets an internal flag to indicate that a Bus-Off condition occurred and then resumes normal operation. If the error message fails to transmit correctly, of if the Bus-Off condition is detected a second time, the PIC® MCU automatically enters an Idle loop and remains there until a system Reset occurs via power-on. 5.3.21 Verification of CAN Module To verify the proper operation of the synthesizable CAN Controller, five test cases were executed: Synchronization (test_synchronization), Bus Off (bus_off_test), Error Test (error_test), Send Basic Frame Test (send_frame_basic), and Send Extended Frame Test (send_frame_extended). All tests were compiled and simulated using Altera Quartus II 9.1 (32- bit) and ModelSim Altera Starter Edition 6.6c software on a PC executing Windows XP Service Pack 3. All tests were performed extensively while trying to cover all possible combinations of data and I/O values for the CAN Controller. Only a few failures (most were attributed to the addition and removal of nodes while tests were being conducted) were observed for any of the five tests described below. The source code for all modules, testbench code, and simulation results are located on the DVD included with this work. Table 5.19 shows the FPGA resource utilization for the Altera DE2 Development and Education Board. 181

Table 5.19 Resource Utilization. Revision Name CAN_Controller Family Cyclone II Device EP2C35F672C6 Timing Models Final Met timing requirements Yes Total logic elements 1560 / 33,216 ( 1 % ) Total combinational functions 1462 / 33,216 ( 1 % ) Dedicated logic registers 625 / 33,216 ( < 1 % ) Total registers 625 Total pins 19 / 475 ( 4 % ) Total virtual pins 0 Total memory bits 832 / 483,840 ( 0 % ) Embedded Multiplier 9-bit element 0 / 70 ( 0 % ) Total PLLs 0 / 4 ( 0 % ) 5.3.21.1 Synchronization Test (test_synchronization) All nodes on a CAN bus must have the same NBT. Since the CAN protocol is an asynchronous serial bus with Non-Return to Zero (NRZ) bit coding; a clock is not encoded into each message. The receivers must synchronize to the transmitted data stream to insure messages are properly decoded. There are two methods used for achieving and maintaining synchronization: hard synchronization and re-synchronization (Sections 3.6.4 – 3.6.5). When synchronizing, there are five basic rules to follow to synchronize the receivers with the transmitted data: Only recessive-to-dominant edges will be used for synchronization. Only one synchronization within one bit time is allowed. An edge will be used for synchronization only if the value at the previous sample point differs from the bus value immediately after the edge. 182

Table 5.19 Resource Utilization.<br />

Revision Name CAN_Controller<br />

Family Cyclone II<br />

Device EP2C35F672C6<br />

Timing Models Final<br />

Met timing requirements Yes<br />

Total logic elements 1560 / 33,216 ( 1 % )<br />

Total combinational functions 1462 / 33,216 ( 1 % )<br />

Dedicated logic registers 625 / 33,216 ( < 1 % )<br />

Total registers 625<br />

Total pins 19 / 475 ( 4 % )<br />

Total virtual pins 0<br />

Total memory bits 832 / 483,840 ( 0 % )<br />

Embedded Multiplier 9-bit element 0 / 70 ( 0 % )<br />

Total PLLs 0 / 4 ( 0 % )<br />

5.3.21.1 Synchronization Test (test_synchronization)<br />

All nodes on a CAN bus must have the same NBT. Since the CAN protocol is an<br />

asynchronous serial bus with Non-Return to Zero (NRZ) bit coding; a clock is not encoded into<br />

each message. The receivers must synchronize to the transmitted data stream to insure messages<br />

are properly decoded. There are two methods used for achieving and maintaining<br />

synchronization: hard synchronization and re-synchronization (Sections 3.6.4 – 3.6.5).<br />

When synchronizing, there are five basic rules to follow to synchronize the receivers with<br />

the transmitted data:<br />

Only recessive-to-dominant edges will be used for synchronization.<br />

Only one synchronization within one bit time is allowed.<br />

An edge will be used for synchronization only if the value at the previous sample<br />

point differs from the bus value immediately after the edge.<br />

182

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!