Line 1... |
Line 1... |
/////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
|
//
|
//
|
// Filename: rxuart.v
|
// Filename: rxuart.v
|
//
|
//
|
// Project: FPGA library development (Spartan 3E development board)
|
// Project: XuLA2 board
|
//
|
//
|
// Purpose: Receive and decode inputs from a single UART line.
|
// Purpose: Receive and decode inputs from a single UART line.
|
//
|
//
|
//
|
|
// To interface with this module, connect it to your system clock,
|
// To interface with this module, connect it to your system clock,
|
// pass it the 32 bit setup register (defined below) and the UART
|
// pass it the 32 bit setup register (defined below) and the UART
|
// input. When data becomes available, the o_wr line will be asserted
|
// input. When data becomes available, the o_wr line will be asserted
|
// for one clock cycle. On parity or frame errors, the o_parity_err
|
// for one clock cycle. On parity or frame errors, the o_parity_err
|
// or o_frame_err lines will be asserted. Likewise, on a break
|
// or o_frame_err lines will be asserted. Likewise, on a break
|
Line 53... |
Line 51... |
// would want to set the setup value to:
|
// would want to set the setup value to:
|
//
|
//
|
// 32'h0006c8 // For 115,200 baud, 8 bit, no parity
|
// 32'h0006c8 // For 115,200 baud, 8 bit, no parity
|
// 32'h005161 // For 9600 baud, 8 bit, no parity
|
// 32'h005161 // For 9600 baud, 8 bit, no parity
|
//
|
//
|
// Creator: Dan Gisselquist
|
//
|
|
//
|
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
// Copyright: 2015
|
////////////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// Copyright (C) 2015, Gisselquist Technology, LLC
|
|
//
|
|
// This program is free software (firmware): you can redistribute it and/or
|
|
// modify it under the terms of the GNU General Public License as published
|
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
|
// your option) any later version.
|
|
//
|
|
// This program is distributed in the hope that it will be useful, but WITHOUT
|
|
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
// for more details.
|
//
|
//
|
|
// License: GPL, v3, as defined and found on www.gnu.org,
|
|
// http://www.gnu.org/licenses/gpl.html
|
//
|
//
|
/////////////////////////////////////////////////////////////////////////
|
|
//
|
//
|
// This software is the ownership of Gisselquist Technology, LLC, and as
|
////////////////////////////////////////////////////////////////////////////////
|
// such it is proprietary. It is provided without any warrantees, either
|
|
// express or implied, so that it may be tested. Upon completion, I ask
|
|
// that working code be returned and not further distributed beyond those
|
|
// that it is originally offered to.
|
|
//
|
//
|
// Thank you.
|
|
//
|
//
|
|
|
// States: (@ baud counter == 0)
|
// States: (@ baud counter == 0)
|
// 0 First bit arrives
|
// 0 First bit arrives
|
// ..7 Bits arrive
|
// ..7 Bits arrive
|