Skip to content

SPI One Pager#65

Open
Doppl-r wants to merge 1 commit intomainfrom
Add_Spi_Brief
Open

SPI One Pager#65
Doppl-r wants to merge 1 commit intomainfrom
Add_Spi_Brief

Conversation

@Doppl-r
Copy link

@Doppl-r Doppl-r commented Feb 28, 2026

Description

Created SPI One pager

Copy link
Collaborator

@Meowcaroni Meowcaroni left a comment

Choose a reason for hiding this comment

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

Overall pretty good, just need more descriptiveness and formatting fixes

| SPDR (Data register) | 000 | R/W 0x00 | Holds the byte to be transmitted or the byte just recieved |
| SPCR (Control Register) | 001 | R/W 0x00 | Enables SPI< selects master/slave mode, and sets clock polarity |
| SPSR (Status Register) | 010 | R/W 0x02 | Indicates transfer completion, write collisions, and mode faults. |
| SPBR (Baud Rate Register) | 011 | R/W 0x02 | Sets the clock frequency divider for the SCK signal. |
Copy link
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
| SPBR (Baud Rate Register) | 011 | R/W 0x02 | Sets the clock frequency divider for the SCK signal. |
| SPCD (Clock Divider Register) | 011 | R/W 0x02 | Sets the clock frequency divider for the SCK signal. |

| SPCR (Control Register) | 001 | R/W 0x00 | Enables SPI< selects master/slave mode, and sets clock polarity |
| SPSR (Status Register) | 010 | R/W 0x02 | Indicates transfer completion, write collisions, and mode faults. |
| SPBR (Baud Rate Register) | 011 | R/W 0x02 | Sets the clock frequency divider for the SCK signal. |
| CSCR (Chip Select Register) | 100 | R/w 0xFF | **Manages multiple Slave Select lines for peripheral addressing.** |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure why the description here is highlighted, might just be a formatting error

Purpose & Role:
The Serial Peripheral Interface (SPI) is a high speed, 4-wire, full-duplex communication protocol used for short distance data exchange between microcontrollers and peripherals. It uses a shared clock signal to synchronize data transfer.

Parameters (Registers) & Signals:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please split parameters and input/output signals into separate tables to prevent confusion

| Irq_o | Out | 1b | Interrupt request sent to CPU upon transfer completion or error. |

Configurations:
Clock Modes: Supports all four SPI modes defined by CPOL and CPHA to ensure compatibility with various peripheral timing requirements.Master/Slave: Primarily configured as a Master in SoC environments, but can be toggled to Slave mode via the SPCR.Baud Rate: The sclk_o frequency is derived by dividing the system clock by the value in SPBR.AXI-Lite valid/ready signals are required for internal register stability before data is shifted out to the physical SPI lines.
Copy link
Collaborator

Choose a reason for hiding this comment

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

If possible, define CPOL and CPHA for members to understand how they affect SPI's behavior.

Timing is strictly governed by clk_o. Data is shifted out and shifted in simultaneously during every clock cycle. To reduce CPU overhead, 16-byte Rx/Tx FIFOs are utilized. Interrupts are triggered when Rx reaches a threshold or the Tx is empty.

Errors & Dependencies:
Erros are managed by irq_o. Several errors can occur; write collision, mode fault, dependencies, or GPIO.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please give one-line descriptions of what each of these errors is and how it happens (Also typo on "erros" in description)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Looking good so far, just need a little more descriptiveness and formatting fixes. Please add heading syntax (##) to each section for visuals and feel free to use bullet points (-) or (*) to organize info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants