I used the DS1302 LCD1602 microcontroller to make an electronic clock, which can be displayed, but t

Updated on technology 2024-04-07
8 answers
  1. Anonymous users2024-02-07

    DS1302 data shows that there is a problem with decimal conversion, which should be paid special attention to.

    In addition, don't copy other people's programs casually.,Be sure to read it before using it.,Even if you copy it, you have to copy the kind of program with formal comments.,So it's easier to find the problem.。。

    Here are just a few of them.

    *ds1302 **/

    Set the initial time for 1302.

    void init_1302(void)

    Fill in the monthly data to the LCM.

    void lcm_w_mo(void)

    Fill in the daily data into the LCM.

    void lcm_w_dd(void)

    weeks to process and send to the designated area of the LCM.

    void lcm_w_xq(void) //if(sel==6) //

    if(sel==5) //

    if(sel==4) //

    if(sel==3) //

    if(sel==2) //

    if(sel==1) Monday.

    Fill in the Hour data to the LCM.

    void lcm_w_hh(void)

    Fill in the minutes data into the LCM.

    void lcm_w_mm(void)

    Fill in the seconds data into the LCM.

    void lcm_w_ss(void)

    Typing is not easy, such as satisfaction, hope.

  2. Anonymous users2024-02-06

    Apparently dead. Procedural issues.

  3. Anonymous users2024-02-05

    1. Because your second is 00, and you can walk every hour. Then the problem is in your second of reading or displaying. Check the **, whether the address is correct when reading seconds, and whether there is a program error when displaying seconds.

    2. If the clock is moving and the value of seconds can change when you are on, it proves that your reading and display are normal, and you can see whether your power-on initialization will clear the seconds to zero or similar operations that will lead to zeroing. Again, as long as the DS1302 has a constant backup power supply, then there is no need to initialize it again.

    3. Teach you a way to judge whether ds1302 is initialized, first you have to know that your ds1302 is from no power to power-on, and then directly read out the value, in general, it will be (may change) seconds ==0, minutes ==0, hours ==0, day ==1, month ==1, week ==1, year ==0, because 2000 has passed useless, you judge whether the year is 0 after reading and playing, if yes, you initialize ds1302, and then put a non-zero number to the year register, As 0x12, in the end, in order to make the clock move, write 0x00 to the second (address 0x80 like). When you power on the second time, read the time first, and if the year is not zero, then don't initialize it again.

    Pure hand-typed words, I hope to be satisfied.

  4. Anonymous users2024-02-04

    Could it be that you didn't write it down in seconds.

  5. Anonymous users2024-02-03

    Brand model: Huawei MateBook D15

    System: Windows 11

    The DS1302 clock chip operates by setting the reset pin (RST) high and loading 8-bit address and command information into the shift register in order to initialize any data transfer. The data is entered serially on the rising edge of the clock (sclk), the first 8 bits are specified for the access address, and the command word is loaded into the shift register, and the clock cycle after the excitation is taken to the clock period, and the data is output during read operation and data output during write operation. The number of clock pulses is 8+8 (8-bit address + 8-bit data sensitive wheel) in single-byte square and 8 plus up to 248 data in multi-byte mode.

    DS1302 clock chip is a high-performance, low-power, real-time clock circuit with RAM launched by DALLAS company in the United States, which can time the year, month, day, week, hour, minute, and second, and can be automatically adjusted when the month is less than 31 days, and has a variety of functions such as leap year compensation.

  6. Anonymous users2024-02-02

    The DS1302 clock chip works by using a microcontroller to read the time from the DS1302, set the reset pin (RST) high, and load the 8-bit address and command information into the shift register.

    DS1302 is a high-performance, low-power, real-time clock with RAM launched by DALLAS in the United States, which has the function of timekeeping, and the electronic watch of daily contact, the Manadeng Annals is almost the same, and can time the year, month, day, hour, minute, second, and week.

    You can use a single-chip microcomputer to write time into the DS1302 for time setting, or you can use a single-chip microcomputer to read the time from the DS1302, and the read time can also be displayed on the LCD. In this way, the function of an electronic watch can be realized.

    The DS1302 operates by setting the reset pin (RST) high and loading the 8-bit address and command information into the shift register in order to initialize any data transfer. The data is entered serially on the rising edge of the clock (sclk), the first 8 bits are specified for the access address, and the command word is loaded into the shift register, and the data is output during the subsequent clock cycle, when the read operation is operated, and the data is output during the write operation.

    The number of clock pulses is 8+8 (8-bit address + 8-bit data) in single-byte mode and 8 plus up to 248 data in multi-byte mode.

    DS1302 chip introduction

    DS1302 is a high-performance, low-power real-time clock chip launched by DALLAS in the United States, with additional 31 bytes of static RAM, using SPI three-wire interface to communicate synchronously with the CPU, and can use burst mode to transmit multiple bytes of clock signals and RAM data at one time.

    The real-time clock provides seconds, minutes, hours, days, days, months, and years, and can be automatically adjusted when the month is small and 31 days, and has a leap year block compensation function.

    The operating voltage is wide. Powered by dual power supplies, it is possible to set up a backup power supply charging method, providing the ability to charge the back power supply with a trickle current. DS1302 is used for data flushing recording, especially for the recording of some data points of special significance, which can realize the simultaneous recording of data and the time when the data appears, so it is widely used in measurement systems.

  7. Anonymous users2024-02-01

    DS1302 is a trickle-charging clock chip launched by DALLAS, which contains a real-time clock calendar and 31 bytes of static RAM, which communicates with a microcontroller through a simple serial interface, and the real-time clock calendar circuit provides information on seconds, minutes, hours, days, dates, months, and years, and the number of days in a month and leap years can be automatically adjusted, and the clock operation can be determined in a 24-hour or 12-hour format by AM PM indication.

    DS1302 can easily use synchronous serial communication with the microcontroller to communicate with only three port lines: RES reset, IO data line, SCLK serial clock read and write data RAM, in a byte or up to 31 bytes of character group communication. The DS1302 operates with very low power consumption and less than 1mW while maintaining data and clock information.

  8. Anonymous users2024-01-31

    Through the DS1302 clock module, the current time, the value of this time, can be transmitted to the digital tube module, to achieve a simple clock.

Related questions
8 answers2024-04-07

3DS old model is called 3DS,** called 3DS XL, the latter is larger than the former's screen, the game is the same, universal, it is recommended that the landlord buy 3DS XL, the screen is large, suitable for players with large hands to play for a long time, but 3DS XL is much more expensive than 3DS, if you have enough funds to buy 3DS XL. 3ds and 3ds xl have been cracked, and it's a bit of a hassle to copy the game, but what's it for the sake of a fun game?! >>>More

12 answers2024-04-07

No, with data transmission, the lights should be flashing!

7 answers2024-04-07

Fox hunting, it's really hard for others to see you from a distance, but the shooting feeling is different from those male characters of the Fat Tigers, but it's good to get used to it. >>>More

28 answers2024-04-07

Vista is more memory-hungry. And the 3G wireless card itself has a slow network speed. So it is recommended that you try to connect the notebook to the network cable of the desktop Internet access. In the same network situation, compare the network speed. Look at whether it's a desktop fast or a book.。。 >>>More

10 answers2024-04-07

No, the configuration is OK.