Line 1... |
Line 1... |
// ============================================================================
|
// ============================================================================
|
// (C) 2007,2011,2013 Robert Finch
|
// (C) 2007,2011,2013,2015 Robert Finch
|
// All rights reserved.
|
// All rights reserved.
|
// robfinch@<remove>finitron.ca
|
// robfinch@<remove>finitron.ca
|
//
|
//
|
// rtfSimpleUart.v
|
// rtfSimpleUart.v
|
// Basic uart with baud rate generator based on a harmonic
|
// Basic uart with baud rate generator based on a harmonic
|
Line 255... |
Line 255... |
input dsr_ni, // data set ready - active low
|
input dsr_ni, // data set ready - active low
|
input dcd_ni, // data carrier detect - active low
|
input dcd_ni, // data carrier detect - active low
|
output reg dtr_no, // data terminal ready - active low
|
output reg dtr_no, // data terminal ready - active low
|
input rxd_i, // serial data in
|
input rxd_i, // serial data in
|
output txd_o, // serial data out
|
output txd_o, // serial data out
|
output data_present_o
|
output data_present_o,
|
|
//----------------
|
|
output baud16_clk
|
);
|
);
|
parameter pClkFreq = 20000000; // clock frequency in MHz
|
parameter pClkFreq = 20000000; // clock frequency in MHz
|
parameter pBaud = 19200;
|
parameter pBaud = 19200;
|
parameter pClkMul = (4096 * pBaud) / (pClkFreq / 65536);
|
parameter pClkMul = (4096 * pBaud) / (pClkFreq / 65536);
|
parameter pRts = 1; // default to active
|
parameter pRts = 1; // default to active
|
Line 295... |
Line 297... |
assign irq_o =
|
assign irq_o =
|
rxIRQ
|
rxIRQ
|
| txIRQ
|
| txIRQ
|
| msIRQ
|
| msIRQ
|
;
|
;
|
|
assign baud16_clk = baud16;
|
|
|
wire [2:0] irqenc =
|
wire [2:0] irqenc =
|
rxIRQ ? 1 :
|
rxIRQ ? 1 :
|
txIRQ ? 3 :
|
txIRQ ? 3 :
|
msIRQ ? 4 :
|
msIRQ ? 4 :
|