Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docs/ip-briefs/I2C_Module_Brief_v0.2.md

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty good here too, just need a little more descriptiveness and formatting fixes. Again, please split parameter and signal tables and add heading formatting (+ bullet points if you'd like)

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
**I2C - Module Brief V 0.1**

**By Nicholas McNeill**

Purpose & Role:
the Inter-Intergrated Circuit (I2C) is a multi-master, multi-slave, 2-wire synchronous bidirectional serial communication bus used for synchronous, bidirectional serial communication bus used for short-distance communication between low-speed peripherals and processors. It uses only two signals and supports multiple devices on the same bus through unique addressing.

Parameters (Registers) & Signals:

The I2C module typically resides on the AXI-Lite interconnect bus for register access and configuration by the CPU.

| Name | Addr. | Default Val | Purpose |
| --- | --- | --- | --- |
| I2CDR (data register) | 000 | R/W 0x00 | Holds the data for transmission or recently received data bytes. |
| I2CCR (Control Register) | 001 | R/W 0x00 | Enables I2C, sets Master/Slave mode, and handles Start/Stop generation. |
| I2CSR (Status Register) | 010 | R/W 0x00 | Indicates Bus Busy, Arbitration Lost, Address Match, and RX/TX Status |
| I2CBR (Baud Rate) | 011 | R/W 0x02 | Sets the clock frequency for the SCL line based on the system clock. |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Baud Rate, although applicable here, is a specific terminology for UART since it uses asynchronous clock signals. To prevent confusion, please use a different name like suggested below:

Suggested change
| I2CBR (Baud Rate) | 011 | R/W 0x02 | Sets the clock frequency for the SCL line based on the system clock. |
| I2CCD (Clock Divider) | 011 | R/W 0x02 | Sets the clock frequency for the SCL line based on the system clock. |

| Signal | Dir | Size | Description |
| scl_io | In/Out | 1b | Serial Clock: Synchronizes data transfer; driven by the active master. |
| Sda_io | In/Out | 1b | Serial data: Bidrectional line for data and address transmission. |
| Axi_lite | M<->S | Var | Standard AXI-Lite signals for CPU-to-register communication |
| Irq_o | Out | 1b | Interrupt Request sent to CPU for events (Transfer Complete, NACK, Error). |

Configurations:
Clock Modes: Supports standard mode, 100kbps, fast-mode, 400kbps, and sometimes a high-speed mode (3.4 Mbps). For addressing it supports a standard 7-bit addressing or extended 10-bit addressing mode for identifying slaves. Multi-Master; includes built in collision detection and arbitration logic of two masters attempt to control the bus simultaneously. Pull-yps; an open-drain protocol the physical lines (SDA/SCL) require external pull-up resigstors to function.

Behavior & Timing:
Timing is governmed by the SCL signal. Data on the SDA line must be stable while SCL is high. Transitions on SDA while SCL is high are reserved for Start and Stop conditions.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly provide a brief description of what a data transfer would look like in I2C for members


Errors & Dependencies:
Errors: Managed via irq_o. Common errors are; arbitatrion lost, NACK (No acknowledge from slave) And bus overrun.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provide one-line descriptions of errors and their causes


Proper operation depends on a stable system clock for the baud rate generator and software driver to handle the I2C state machine.

Performance Targets:
Standard: 100kHz, Fast: 400kHz