UART16550 support

This topic contains 0 replies, has 1 voice, and was last updated by Profile photo of Stanislav Stanislav 1 week, 2 days ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #55254
    Profile photo of Stanislav
    Stanislav
    Member

    Hello! I have added UART16550 core support to https://github.com/MIPSfpga/mipsfpga-plus project.

    Supported boards
    • Terasic DE10-Lite;
    • support of other boards can be added easily.

    Main features:
    • all uart specific code was imported from https://github.com/olofk/uart16550 and https://github.com/freecores/uart16550 projects;
    • all imported uart core code was placed in folder uart16550;
    • Module mfp_ahb_lite_uart16550 is always turned on. The behavior of its inputs and outputs depends on MFP_USE_DUPLEX_UART option that was placed in mfp_ahb_lite_matrix_config.vh;
    • UART_RX is always connected to uart program loader (mfp_uart_receiver);
    • UART_TX is connected to mfp_ahb_lite_uart16550 TX output when MFP_USE_DUPLEX_UART is undefined and disconnected in other case;
    • UART_SRX и UART_STX signals of mfp_system are connected mfp_ahb_lite_uart16550 only when MFP_USE_DUPLEX_UART is defined;
    • modem signals of mfp_ahb_lite_uart16550 (UART_RTS, UART_CTS, UART_DTR, UART_DSR, UART_RI, UART_DCD) are available in module interface (inside the mfp_ahb_lite_matrix) but was not mapped on mfp_system level;
    • uart module interrupt signal (UART_INT) is available but was not connected to SI_Int;
    • UART_STX is connected to UART_SRX in simulation mode;
    • all code is simulated with modelsim and tested on Terasic DE10-Lite board;
    • 05_uart program added – it sends ‘Hello!’ to uart after reset, outputs all received chars to LED and 7-segment indicator and sends all chars back to PC. Its working mode is: 8n1, 115200
    • there is a separate sandbox, where I have developed this uart module: https://github.com/zhelnio/ahb_lite_uart16550. It can be used for standalone simulation debug;
    • uart core doc was placed in https://github.com/zhelnio/ahb_lite_uart16550/tree/master/doc

    05_uart program run order
    • turn on (uncomment) MFP_USE_DUPLEX_UART option in mfp_ahb_lite_matrix_config.vh;
    • Select running mode in main.c
    SIMULATION
    HARDWARE

    For SIMULATION mode
    • compile the program and run it in simulator:
    02_compile_and_link.bat
    05_generate_verilog_readmemh_file.bat
    06_simulate_with_modelsim.bat
    • the program will send ‘Hello’ string to uart. These chars will be send and received by module because UART_STX and UART_SRX are connected in simulation mode. All received char codes will be shown on LED and 7-segmen indicator;

    For HARDWARE mode
    • check the connection of uart signals UART_SRX and UART_STX to the GPIO port of the top module (boards/de10_lite/de10_lite.v for example)
    • connect the usb-uart converter to PC and the GPIO port of the board (UART_STX и UART_SRX);
    • build the rtl code and program the board;
    • run the terminal program on PC and connect it to the COM port (mode: 8n1, 115200) that is relevant to UART_SRX и UART_STX signals.
    • build the software and upload it to the board:
    02_compile_and_link.bat
    08_generate_motorola_s_record_file.bat
    12_upload_to_the_board_using_uart.bat
    • press reset button on the board;
    • the ‘Hello’ string will be shown in the terminal window;
    • the code of each received symbol will be shown on LED and 7-segmen indicator;
    • each received symbol will be transmitted back to PC.

    • This topic was modified 1 week, 2 days ago by Profile photo of Stanislav Stanislav.
    5 users thanked author for this post.
Viewing 1 post (of 1 total)
You must be logged in to reply to this topic.