So I have a task to write some pseudo code to program a frequency synthesizer. There are three main ports to this that I will utilize, 'Enable', 'Data', and 'Clock'.
The device is initially off, and when enable (active low) is triggered, the clock will cycle (after some minimum setup time). Aside from the delays, I will have a function SendCommand(uint32_t addr, uint16_t data).
The issue that I am having, is that in the specifications given to me, the data is "READ" on a falling clock edge. This means that the data is read into the register at the address defined in the parameter, one bit at a time, and is kept on reading until the entire 16-bit word has been written to the register. The clock cycles at about 10MHz. My questions are:
-How can I simulate the clock to cycle at 10MHz (100 ns/cycle)?
-How can I perform the "data reading" on the falling edge of said clock.
For now ignore the writing aspect of the program, it is still just pseudo-code.