owWrite (OneWire.v)

This module implements 1-wire bus-master write cycles. The 1-wire bus is a single-wire bi-directional bus standard originally authored by Dallas Semiconductor. It has a master/slave architecure, capable of handling multiple slave devices. This module clocks a bit vector onto the bus, with the write-slot timing intervals in clocks settable via parameters. The defaults apply to a 1-MHz clock.

Ports | Parameters | Notes | Example | Timing diagram

Ports

clkinputThe clock input.
resetinput    The reset input.
goinputCommand to initiate a cycle.
datainputThe word to be written to the bus.
dqin/outThe 1-wire bus. When undriven, it goes high.
busyoutputIndicates that the instance is busy outputting a word.
doneoutputAsserted for a clock when the instance has completed its operation.

Parameters

wWidth of the bit counter (default 3).
bThe bit count of the word to be written to the bus (default 8). Must be at most 2w.
w1Bit width of the timer for the write-slot pulse duration.
t1aWrite-1 pulse duration in clocks (default 4).
t1bWrite-0 pulse duration in clocks (default 60).
w2Bit width of the timer for the write-slot duration (default 6).
t2Duration of the write slot in clocks (default 64). Must be at most 2w2.

Notes

Example instantiation in Verilog:

// write ROM command to device
wire				clk, romgo, rombusy, romdone;
wire			[7:0]	romcmd = 8'h33;
tri1				onewire;
owWrite #(.w(3), .b(8)) SendROMCommand (
    .clk(clk),			.reset(reset),
    .go(romgo),			.data(romcmd),
    .dq(onewire),
    .busy(rombusy),		.done(romdone)
);

2/4/2015