Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add role to UARTResouce and fix UART flow control pin inconsistencies #65

Merged
merged 7 commits into from Jun 11, 2020

Conversation

igrr
Copy link
Contributor

@igrr igrr commented Jun 8, 2020

This PR adds 'role' parameter to UARTResource and corrects errors and inconsistencies in UART flow control pin definitions.

  • icestick: signal names matched the pin numbers, but directions were reversed. Fix by setting role=dce.
  • ice40_hx8h_b_evn: RTS/CTS and DTR/DSR pairs were swapped, compared to the schematic, but the direction of DCD was incorrect. Fix by un-swapping, and setting role=dce.
  • blackice: no RTS/CTS signals in the schematic (likely was a copy-paste from blackice_ii?), remove corresponding definitions.
  • blackice_ii: pin numbers match CH340G signals, but directions were reversed. Fix by setting role=dce.
  • de0: RTS/CTS signals match the schematic, but directions were reversed. Fix by setting role=dce.
  • nexys4ddr: RTS/CTS signals were swapped compared to the schematic. Fix by un-swapping and setting role=dce.

Schematic references are mentioned in commit messages.
Closes #63.

igrr added 7 commits Jun 9, 2020
UARTResource gets a new argument, "role", which determines flow
control signal directions:
- DCE means that the design acts as a modem
- DTE means that the design acts as a PC
Pin numbers match the P0/P1 signals in the schematic, but the
direction is reversed. Fix by setting role="dce".

Ref. https://github.com/mystorm-org/BlackIce-II/blob/master/hardware/BlackIce.pdf
According to the schematic, RTS is E5 and CTS is D3. Previously these
were reversed to work around signal direction set in UARTResource.
Un-reverse the signals, and set correct direction by passing role=dce.

Ref. https://reference.digilentinc.com/_media/nexys4-ddr:nexys_4_ddr_sch.pdf
RTS and CTS match the schematic, but the direction is incorrect:
CTS is output, RTS is input. Fix by setting role=dce.

Ref. https://www.intel.com/content/dam/altera-www/global/en_US/portal/dsn/42/doc-us-dsnbk-42-5804152209-de0-user-manual.pdf
RTS/CTS and DTR/DSR pairs have been swapped to work around the signal
direction in UARTResource. Un-reverse the signals, making the names
match the schematic. Fix the direction by setting role=dce.

Ref. http://www.latticesemi.com/view_document?document_id=50373
UART flow control pins match the signal names in the schematic, but
directions are reversed. Fix by setting role=dce.
@igrr igrr force-pushed the bugfix/uart_flow_ctrl_pins branch from 618a1c7 to cd0b740 Compare Jun 9, 2020
@igrr igrr changed the title boards: fix UART flow control pin inconsistencies Add role to UARTResouce and fix UART flow control pin inconsistencies Jun 9, 2020
@whitequark
Copy link
Member

whitequark commented Jun 9, 2020

Looks good at first glance, will review in detail a bit later.

@whitequark whitequark merged commit 8acd092 into amaranth-lang:master Jun 11, 2020
@whitequark
Copy link
Member

whitequark commented Jun 11, 2020

Thank you for this excellent work.

@igrr igrr deleted the bugfix/uart_flow_ctrl_pins branch Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

UARTResource flow control signals direction mismatch for ICEStickPlatform
2 participants