I see that I could set the RST pin high and, possibly, use PULOUT to send 20MHz to the CLK pin of the DS1802. Then during the pulse, I could read the WORD output on the DS1802's COUT pin. However, I don't know if this is a "best practice".
The datasheet states:
When RST is driven high, bit 0 is present on the COUT pin. When the CLK input transitions low to high, bit 0 is loaded into the first position of
the I/O shift register and bit 1 becomes present on COUT. After 16 bits, the data has shifted completely around and back to its original position.
So, can I use pin 14 (OSC2/CLKOUT) on the CLK pin, and use two other pins to to set RST high and use SERIN on COUT?
Or, do I use three other pins to set RST high, PULOUT, and SERIN?
Also, with regard to PULOUT, the PICBASIC PRO manual states, "The pulse is generated by toggling the pin twice, thus the initial state of the pin determines the polarity of the pulse." I have no idea whether the pin should start HIGH or LOW before using PULOUT. Can someone explain?
I looked at the SHIFTIN command, but I don't understand how to implement it in my situation. I not sure it's the right answer to my problem.
Bookmarks