Start
-
Define Requirements:
- Specify CAN bus bit rate (e.g., 500 kbps, 1 Mbps).
- Choose a CAN transceiver IC (e.g., MCP2515, SN65HVD23x).
-
Design CAN Controller Modules:
- Bit Timing Module:
- Calculate Baud Rate Prescaler (BRP) and Synchronization Jump Width (SJW) based on requirements.
- Generate control signals for Transmit and Receive logic based on bit timing.
- Frame Handling Module:
- Parse standard/extended IDs from received frames.
- Handle data field (up to 8 bytes) for data frames.
- Implement CRC (Cyclic Redundancy Check) calculation.
- Perform bit stuffing and destuffing.
- Transmit Logic Module:
- Manage data transmission onto the CAN bus.
- Implement CSMA/CD (Carrier Sense Multiple Access with Collision Detection) for arbitration.
- Handle retransmission logic for errors.
- Interface with CAN Transceiver Interface Module.
- Receive Logic Module:
- Capture data from the CAN bus.
- Perform bit unstuffing.
- Verify CRC of received data.
- Extract information from the frame (ID, data, type).
- Bit Timing Module:
-
Design CAN Transceiver Interface Module:
- Transceiver Control Module:
- Manage control pins of the CAN transceiver IC (mode, loopback, etc.).
- Data Exchange Module:
- Read data from CAN transceiver receive pins (CANH, CANL).
- Send data to CAN transceiver transmit pins (CANH, CANL).
- Transceiver Control Module:
-
Develop Test Bench:
- Stimulate CAN controller modules with test vectors (frames).
- Verify module functionality (ID parsing, CRC, data handling).
-
Integration and Verification:
- Integrate modules with CAN Transceiver Interface Module (initially simulated).
- Connect modules with appropriate signals.
- Refine design based on test bench results.
-
FPGA Implementation:
- Synthesize Verilog code to generate FPGA configuration file.
- Program the FPGA with the configuration file.
- Integrate physical CAN transceiver IC with the FPGA board.
-
Testing and Validation:
- Test the CAN transceiver core on a real CAN bus network.
- Validate data transmission and reception functionality.
- Verify error handling mechanisms.
-
Optimization (Optional):
- Consider pipelining and state encoding for performance improvement.
- Analyze resource utilization and optimize code if necessary.
End