Clock connection to DS1802 from 16F877A


Results 1 to 8 of 8

Threaded View

  1. #5
    Join Date
    Aug 2005
    Location
    Vermont
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Shiftin and Timing

    I don't believe that using a 20mhz clock would even come close to working. If you look at the timing diagrams the clk has to transition low to high for each bit that you are reading in. The instruction clock of a pic running at 20mhz is running at 20mzh/4 = 5mhz. If you put the osc line to the clk input on the DS1802 then your clock will be transitioning much to fast. Try something like this:
    Dedicate four lines for the interface, RST, CLK, D, C.
    To read C use the shiftin, something like this (this is not tested and may have errors):

    high RST 'data appears on C when rst transitions to high
    input D 'left floating during read of the C line according to datasheet
    shiftin C,CLK,0,[CDATA\16]
    low RST

    To write to the D line something like this should work:
    high RST 'data appears on C when rst transitions to high
    input C 'just to make sure that it doesn't interfere by holding high or low
    shiftout D,CLK,0,[DDATA\16]
    low RST

    Again this is not tested but it seems to fit the specifications in the datasheet. You may have to adjust the mode values which are found on page 146 of the PBC manual.

    By the way, the datasheet lists the maximun clk rate at 10mhz.
    Last edited by Mith; - 24th December 2005 at 17:01.

Similar Threads

  1. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 09:42
  2. EM4095 Chip, get Clock and Data signals?
    By mindthomas in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th August 2008, 07:27
  3. Shiftout/in
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd August 2007, 12:48
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 21:36
  5. LCD Clock, Interrup
    By Patrick in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th July 2006, 17:00

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts