Here's another puzzle to me. I have a device with bus. To write to a register on the device you have to do the following:
lower D/C# to tell it you want to write to the command registers.
lower CS# to tell it you are selecting the chip so it will respond to commands.
lower WE# to tell it you are writing.
put an register address on the 8 bit data bus.
Raise WE# to tell it you are done writing the command register then
raise D/C# to tell it you want to write data to the device
lower WE# to tell it you are writing the data to be stored in the register
put the data on the (same) 8 bit data bus.
raise the WE# to tell it you are done writing the data
raise the CS# to release the chip
(we can ignore the timing, assume one clk for each step is sufficient)
I've been trying to wade through verilog examples but can't find anything to help answer some basic questions like: Assuming we wrote a module like: "WriteToRegister(clk,dc,cs,we,addr,data,bus)", what would the code look like, how would it be instatiated and how would it be "called" (forgive my programming viewpoint on the world) to write different values to different registers. Ex. I need to write the (binary) value 01011001 to register (hex) A5 on the device then write 01000000 to B7, etc.?