EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies / HiI think I have found out

HiI think I have found out

|

Microcontroller › AVR › I2C (TWI) address transmission to slave (problem) › HiI think I have found out

March 20, 2018 at 7:17 am #14805
GANEEV SINGH
Participant

Hi

I think I have found out the mistake. When you are sending data i.e. TWI_Write_Data(0xA0); //i want to write 10 in seconds memory location of DS1307(RTC), you are actually enabling the CH(Clock Halt) bit which is why RTC is not responding afterwards.

The thing is while writing seconds onto it's register, the 8th bit or BIT7 is dedicated for CH. So when you are writing 0xA0 you are also activating CH bit which is halting the clock of RTC. It you want to write 10 seconds then try sending 0X10 or 0X0A because RTC's register is divided into two parts BIT0-3 which accept values for 1 x seconds while BIT4-6 accept values for 10 x seconds i.e if you write 2 in former part then it will be 2 seconds but if you do the same in latter part then it will be traeted as 20 seconds. 

Refer to its datasheet once agin and confirm.

RSS Recent Posts

  • reviving old swordfish program but? May 18, 2026
  • Assistance locating a 'trail' camera gadget, please ? May 18, 2026
  • Projector focus circuit May 18, 2026
  • Relay question May 18, 2026
  • Phone Charger 5v to 12v May 17, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise