Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pmod:pmodcan:reference-manual [2021/05/14 23:06] – ↷ Links adapted because of a move operation Arthur Brownpmod:pmodcan:reference-manual [2022/10/04 11:38] (current) – external edit 127.0.0.1
Line 2: Line 2:
 ====== Pmod CAN Reference Manual ====== ====== Pmod CAN Reference Manual ======
  
-The Digilent Pmod CAN (Revision B) is a CAN 2.0B controller with an integrated transceiver. The embedded [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|Microchip MCP25625]] chip connects directly to the physical CAN bus and meets automotive requirements for high-speed (1 Mb/s), low quiescent current, electromagnetic compatibility, and electrostatic discharge.+The Digilent Pmod CAN (Revision B) is a CAN 2.0B controller with an integrated transceiver. The embedded [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|Microchip MCP25625]] chip connects directly to the physical CAN bus and meets automotive requirements for high-speed (1 Mb/s), low quiescent current, electromagnetic compatibility, and electrostatic discharge.
  
 {{Digilent Image Gallery  {{Digilent Image Gallery 
Line 77: Line 77:
 ====== Functional Description ====== ====== Functional Description ======
  
-The Pmod CAN utilizes the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|Microchip MCP25625]] to enable CAN communication with a variety of external devices. A complete CAN solution with a controller and transceiver can be implemented on a system board by communicating with the host board via the [[pmod:communication_protocols:SPI|SPI protocol]] in SPI mode 0 or 3. The two differential lines on the transceiver, [[pmod:pmodcan:reference-manual#pinout_table_diagram|CANH and CANL]], enable balanced differential signaling to eliminate most of the electromagnetic field (EMF) and provide high noise immunity within the system.+The Pmod CAN utilizes the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|Microchip MCP25625]] to enable CAN communication with a variety of external devices. A complete CAN solution with a controller and transceiver can be implemented on a system board by communicating with the host board via the [[pmod:communication_protocols:SPI|SPI protocol]] in SPI mode 0 or 3. The two differential lines on the transceiver, [[pmod:pmodcan:reference-manual#pinout_table_diagram|CANH and CANL]], enable balanced differential signaling to eliminate most of the electromagnetic field (EMF) and provide high noise immunity within the system.
  
  
 ===== Serial Communication ===== ===== Serial Communication =====
  
-The Pmod CAN communicates with the host board via the [[learn/fundamentals/communication-protocols/spi/start|SPI protocol]]. By driving and keeping the Chip Select line ([[pmod:pmodcan:reference-manual#pinout_table_diagram|pin 1]]) at a logic level low, users may communicate back and forth with the Pmod depending on whether or not both sets of data lines are enabled. The embedded chip on the Pmod operates in SPI Mode 0 or 3, with data captured on the rising edge of the clock and data transferred on the falling edge of the clock, and a minimum clock cycle time of 100 nanoseconds as per Table 7-6 (page 70) of the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|Microchip MCP25625 datasheet]]. +The Pmod CAN communicates with the host board via the [[learn/fundamentals/communication-protocols/spi/start|SPI protocol]]. By driving and keeping the Chip Select line ([[pmod:pmodcan:reference-manual#pinout_table_diagram|pin 1]]) at a logic level low, users may communicate back and forth with the Pmod depending on whether or not both sets of data lines are enabled. The embedded chip on the Pmod operates in SPI Mode 0 or 3, with data captured on the rising edge of the clock and data transferred on the falling edge of the clock, and a minimum clock cycle time of 100 nanoseconds as per Table 7-6 (page 70) of the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|Microchip MCP25625 datasheet]]. 
  
-Nine SPI instructions are available to read the status of the receiver, load a transmit buffer, modify bits in a register and more. Most of the instruction commands are single byte instructions followed by an address byte. More information is available in the [[pmod:pmodcan:reference-manual#quick_start|Quick Start]] section as well as Section 5 (page 55) of the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|MCP25625 datasheet]].+Nine SPI instructions are available to read the status of the receiver, load a transmit buffer, modify bits in a register and more. Most of the instruction commands are single byte instructions followed by an address byte. More information is available in the [[pmod:pmodcan:reference-manual#quick_start|Quick Start]] section as well as Section 5 (page 55) of the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|MCP25625 datasheet]].
  
  
Line 181: Line 181:
     - Send a write SPI command (0x02)     - Send a write SPI command (0x02)
     - Send the address of the register to modify followed by the value to set     - Send the address of the register to modify followed by the value to set
-    - Three registers are manipulated in this way with a variety of settings; for more details see Section 4.4 (page 47) in the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|MCP25625 datasheet]]. The following three commands set a CAN speed of 250 kBPS with a CAN clock of 20 MHz.+    - Three registers are manipulated in this way with a variety of settings; for more details see Section 4.4 (page 47) in the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|MCP25625 datasheet]]. The following three commands set a CAN speed of 250 kBPS with a CAN clock of 20 MHz.
       - CNF1 (0x2A) set to 0x41       - CNF1 (0x2A) set to 0x41
       - CNF2 (0x29) set to 0xFB       - CNF2 (0x29) set to 0xFB
Line 244: Line 244:
 Similar to [[learn/fundamentals/communication-protocols/uart/start|UART]], all nodes on a CAN network must operate at the same nominal bit rate as data is transmitted without a clock signal in an asynchronous format. The Pmod CAN is compliant with CAN 2.0B (ISO-11898-2 and ISO-11898-5). In addition to the de-facto RS-232 header, [[pmod:pmodcan:reference-manual#pinout_description_table|Header J1]], screw terminals are provided on [[pmod:pmodcan:reference-manual#pinout_description_table|Header J3]] for other CAN devices that use twisted pair wiring. Similar to [[learn/fundamentals/communication-protocols/uart/start|UART]], all nodes on a CAN network must operate at the same nominal bit rate as data is transmitted without a clock signal in an asynchronous format. The Pmod CAN is compliant with CAN 2.0B (ISO-11898-2 and ISO-11898-5). In addition to the de-facto RS-232 header, [[pmod:pmodcan:reference-manual#pinout_description_table|Header J1]], screw terminals are provided on [[pmod:pmodcan:reference-manual#pinout_description_table|Header J3]] for other CAN devices that use twisted pair wiring.
  
-Timing diagrams from page 58 of the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|MCP25625 datasheet]] for the Pmod CAN for data coming in and out through SPI are provided below. The timing values for the parameters shown in the images can be found in Table 7-6 (page 70) of the [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|MCP25625 datasheet]].+Timing diagrams from page 58 of the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|MCP25625 datasheet]] for the Pmod CAN for data coming in and out through SPI are provided below. The timing values for the parameters shown in the images can be found in Table 7-6 (page 70) of the [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|MCP25625 datasheet]].
  
 {{ :reference:pmod:pmodcan:pmodcan_spi_input.png?900 |SPI Input Timing Diagram}} {{ :reference:pmod:pmodcan:pmodcan_spi_input.png?900 |SPI Input Timing Diagram}}
Line 255: Line 255:
 ====== Additional Information ====== ====== Additional Information ======
  
-The schematics of the %%Pmod CAN%% are available {{reference:pmod:pmodCAN:pmodCAN_sch.pdf|here}}. Additional information about the CAN controller and transceiver including communication modes and specific timings of the chip can be found in the datasheet [[http://ww1.microchip.com/downloads/en/DeviceDoc/20005282A.pdf|here]].+The schematics of the %%Pmod CAN%% are available {{reference:pmod:pmodCAN:pmodCAN_sch.pdf|here}}. Additional information about the CAN controller and transceiver including communication modes and specific timings of the chip can be found in the datasheet [[https://ww1.microchip.com/downloads/en/DeviceDoc/MCP25625-CAN-Controller-Data-Sheet-20005282C.pdf|here]].
  
 Example code demonstrating how to get information from the %%Pmod CAN%% can be found on its Resource Center [[pmod:pmodcan:start#example_projects|here]].  Example code demonstrating how to get information from the %%Pmod CAN%% can be found on its Resource Center [[pmod:pmodcan:start#example_projects|here]].