Help with DS1302

Discussion in 'Homework Help' started by user01, Jul 29, 2009.

  1. user01

    Thread Starter New Member

    Jun 22, 2009
    I've to make an assembler project, which display time and temperature on LCD. The information is taken from RTC (DS1302) and digital thermometer (DS1620). The CPU is MC68HC11 and the board is EVBplus2 from Wytec. Also there is 4x4 membrane keypad, from which I have to adjust the clock.

    1. The first thing I have to do is to write in the DS1302 the date and the hour. I have to put RST into high state, but how to configure SCLK and I/O?

    2. After that I have to configure Address/Command Byte for writing. It has the following format but how to configure A0 – A4 for input, and when is needed for output, and what they are exactly used for? Also in 6th position which one to select: Clock/Calendar Data (0) or RAM Data (1), and which one what is for?
    0 – 0
    1 – A0
    2 – A1
    3 – A2
    4 – A3
    5 – A4
    6 – 0/1
    7 – 1

    3. When entering info about date and hour where I have to save it? I have read that I have to save seconds, minutes, hours, days, months and years in separate registers. Is it so and how to change registers during entering the info.

    4. When I’m reading the info about day and hour, I have to display it on LCD. When it’s from different registers how to display all of them on one LCD and how to separate them with dots. Can you give me any sample code? Should I have to convert the data from the registers in special format or it’s displayed directly?

    5. When I read from DS1302 how to configure SCLK and I/O, and Address/Command Byte for reading?