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 ...
Error Handler Read ERRIF Register RxB1 Overflow? No Error Warning Flag Set? No Rx Error Passive Flag Set? No Tx Error Passive Flag Set? No Bus-Off Flag Set? No Send Error Message 0x3FF, Error Code = 0x13 Done Yes Yes Yes Yes Yes Yes Send Error Message 0x3FF, Error Code = 0x11 Rx Warning Flag Set? Yes Send Error Message 0x3FF, Error Code = 0x01 Send Error Message 0x3FF, Error Code = 0x03 Send Error Message 0x3FF, Error Code = 0x04 1 st Bus-Off Occurrence? Yes Set Bus-Off Flag and Re-Initialize MCP2515 Send Error Message 0x3FF, Error Code = 0x12 Message Transmitted Successfully Send Error Message 0x3FF, Error Code = 0x02 Figure 5.38 Error Handler Routine Flowchart [47]. 179 No No No Enter Idle State; MCU must Reset System Node
When a valid message is received, the FILHIT bits of the RXB1CTRL register are read to determine which message has been received. Depending on the filter match number, they are described as follows: Filter 1The PIC® MCU initiates an A/D conversion on AN1, waits for the conversion to complete, loads the ADRES register value into the MCP2515 Transmit Buffer 0 and Data Byte 0, and sends the RTS command. Filter 2The PIC® MCU reads the TXRTSCTRL register for the value of the three input pins, loads this value into the MCP2515 transmit buffer and sends the RTS command. Filter 3 or 4The PIC® MCU reads the first byte of the received message and writes it to the appropriate output pin via the MCP2515 BFPCTRL register. Filter 5The PIC® MCU reads the first byte of the received message and stores the new units address into the EEDATA register and write the new unit address into the EEPROM. Filter 6The PIC® MCU turns off Digital Outputs 1 and 2. The system also provides for error detection for a number of different types of errors that may occur, including CAN bus errors detected by the MCP2515, as well as invalid system state errors (See Figure 5.38). When any of these errors are detected, the system transmits a message with the ID of 0x3FF. This message contains one data byte which is a code used to represent the type of error that occurred. The one exception to this is the Bus-Off condition that the MCP2515 may enter if a large number of transmit errors are detected. If the Bus-Off 180
- Page 153 and 154: master reset occurs. Table 5.2 show
- Page 155 and 156: EN_FOW: Enable Force One Wire. Sett
- Page 157 and 158: READ_ROM - Used to read the 64-bit
- Page 159 and 160: 5.2.8.1 Single Search ROM (single_s
- Page 161 and 162: 5.2.8.3 Scratchpad Memory (scratchp
- Page 163 and 164: 5.2.8.4 Command Recognition (cmd_re
- Page 165 and 166: TBF - The Transmit Buffer provides
- Page 167 and 168: compensate for the propagation dela
- Page 169 and 170: Figure 5.15 CAN Module memory map [
- Page 171 and 172: ‘0’, fast speed mode will be us
- Page 173 and 174: COMP-SEL: Comparator Select. When t
- Page 175 and 176: Figure 5.18 CAN Status Register. B
- Page 177 and 178: that buffer is given to the CPU and
- Page 179 and 180: Acceptance Mask Registers (accepted
- Page 181 and 182: SJW1, SJW0: Synchronization Jump Wi
- Page 183 and 184: TSEG22 - TSEG10: Time Segment Bits.
- Page 185 and 186: The transmit clock (ttxclk) is used
- Page 187 and 188: 5.3.13 CAN Module Transmit Buffer I
- Page 189 and 190: Figure 5.28 CAN Transmit Data Segme
- Page 191 and 192: 5.3.20 CAN Node Overview As stated
- Page 193 and 194: Read Digital InputsRead the value o
- Page 195 and 196: the clock high time is either 5 µs
- Page 197 and 198: Yes Perform A/D Conversion on AN0 W
- Page 199 and 200: and GP2 and GP5 as outputs. With th
- Page 201 and 202: external INT pin, and then branches
- Page 203: Read MCP2515 Rx Buffer for Digital
- Page 207 and 208: Table 5.19 Resource Utilization. Re
- Page 209 and 210: For this test, only one CAN node wa
- Page 211 and 212: an Error Frame to be generated. Aft
- Page 213 and 214: messages, acknowledge messages, or
- Page 215 and 216: 5.3.21.4 Send Basic Frame Test (sen
- Page 217 and 218: going from one node to 30 nodes (se
- Page 219 and 220: Table 6.1 Resource Utilization. Rev
- Page 221 and 222: 6.2.1 Test Verification and Overvie
- Page 223 and 224: has read access to this register. T
- Page 225 and 226: system configuration used for this
- Page 227 and 228: or not depends on the number of rec
- Page 229 and 230: 6.4. There are two receiving CAN no
- Page 231 and 232: CHAPTER 7 CONCLUSIONS AND FUTURE WO
- Page 233 and 234: a communication bus reset will occu
- Page 235 and 236: For the synthesizable CAN Controlle
- Page 237 and 238: additional CAN nodes were added to
- Page 239 and 240: Fall-Through Stack A LOW level on t
- Page 241 and 242: In conclusion, the prototype system
- Page 243 and 244: REFERENCES [1] IBM ASIC Products Ap
- Page 245 and 246: [22] “CAN - a brief tutorial for
- Page 247 and 248: [44] Microchip MCP2515 - Stand-Alon
- Page 249 and 250: [67] K. Tindell and A. Burns, “Gu
- Page 251 and 252: [88] “Verilog - A Language Refere
Error Handler<br />
Read ERRIF Register<br />
RxB1 Overflow?<br />
No<br />
Error Warning<br />
Flag Set?<br />
No<br />
Rx Error<br />
Passive Flag<br />
Set?<br />
No<br />
Tx Error<br />
Passive Flag<br />
Set?<br />
No<br />
Bus-Off Flag<br />
Set?<br />
No<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x13<br />
Done<br />
Yes<br />
Yes<br />
Yes<br />
Yes<br />
Yes<br />
Yes<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x11<br />
Rx Warning<br />
Flag Set?<br />
Yes<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x01<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x03<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x04<br />
1 st Bus-Off<br />
Occurrence?<br />
Yes<br />
Set Bus-Off Flag and<br />
Re-Initialize<br />
MCP2515<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x12<br />
Message<br />
Transmitted<br />
Successfully<br />
Send Error Message<br />
0x3FF, Error Code =<br />
0x02<br />
Figure 5.38 Error Handler Routine Flowchart [47].<br />
179<br />
No<br />
No<br />
No<br />
Enter Idle State;<br />
MCU must Reset<br />
System Node