15.08.2013 Views

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 ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

or not depends on the number of receiving CAN nodes. The command sent depends on the<br />

data written to the FILHIT bits of the RXB1CTRL register of the MCP2515. The<br />

meaning of these filter bits is described in Section 5.3.20.4 and a program execution flowchart is<br />

shown in Figure 5.37. Figure 6.5 shows the contents of this MCP2515 register.<br />

Figure 6.5 RXB1CTRL – Receive Buffer 1 Control Register Bit Definitions [44].<br />

The $random() function is used to determine which command is going to be sent to the<br />

CAN nodes. Details of the $random() function are covered in Section 5.2.8.3. To generate a<br />

random value to represent the command to send to the CAN node(s), the following block of<br />

code was executed:<br />

integer seed_value, random_value;<br />

random_value = $random(seed_value) % 7;<br />

random_value = abs(random_value);<br />

This block of code returns a value between 0 and 6 which corresponds to the list of commands<br />

summarized in Table 6.3. This random value is then sent out to one or both CAN nodes as a<br />

command setting the appropriate bits in the FILHITx registers on the node(s). The receiving<br />

CAN node(s) then perform the required command and send the resulting data back to the 1 –<br />

Wire® Master which then stores the data contiguously in the DS1996 1 – Wire® slave devices.<br />

The results of this test are presented in Table 6.4.<br />

202

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

Saved successfully!

Ooh no, something went wrong!