Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

problem with rtc ds1307 and 8051

Status
Not open for further replies.

hassan ali

Member level 2
Joined
May 18, 2010
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
egypt
Activity points
1,667
hi,,,,,,,,,,,,,sorry for my English.

i have a big problem i have build up my project (connect the 89s52 with ds1307) but am facing a big problem , and i am sure of firmware but there is a problem in hardware and i can't determine it , i see a strange thing when i connect the battery i found that (pin 7) is connected to ground if there is a problem here???,, here is my project and i guess that there is something missing or replaced in hardware connection.
am sorry because am a beginner in rtc and i need help

here is my attached photo.
https://obrazki.elektroda.pl/12_1309288290.png
 

when i connect the battery i found that (pin 7) is connected to ground if there is a problem here???
Pin 7 of the ds1307 is the output and depending on the setting it can give clock pulses but it is also an open drain output so you need a pullup resistor from pin 7 to the Vcc to work correctly.
The 1nf capacitors in the mcu crystal are also strange, I suppose you are using a correct low capacitor value there

Alex
 
For the time being, forget about pin[7] .. unless you really need a square wave synchronized with time .. and BTW, input P2.3 has internal pullup ..
The main connections between the CPU and the RTC are the 2 I2C lines, and you have them ..
As far as various components go, the crystal caps are to big and the reset cap is to small ..
The most common values for crystal caps are around 33pF(subject to crystal), and the reset cap should be not smaller than 1uF (1-10uF) ..

:wink:
IanP
 
should i connect pin 7 in ds1307 with a pull up resistor and then to vcc????????
note: i used this pin for an external interrupt.
 

Normally pin7 should be connected through a resistor to Vcc but in your case there is already an internal pull up resistor in the port 2 input (inside the mcu).
IanP is correct , there is no need for an external resistor.

Alex
 
okay , so why when i connected the battery then i found that pin 7 in ds1307 is connected to the ground is that right?????
 

No, why should pin 7 be connectred to ground????

it may be the result of the status of the port pin to which you have connected the pin 7 to controller.
 

If you read the datasheet **broken link removed**
page 9 it says

Bit 7: Output Control (OUT). This bit controls the output level of the SQW/OUT pin when the square-wave output is disabled. If SQWE = 0, the logic level on the SQW/OUT pin is 1 if OUT = 1 and is 0 if OUT = 0. On initial application of power to the device, this bit is typically set to a 0.

Bit 4: Square-Wave Enable (SQWE). This bit, when set to logic 1, enables the oscillator output. The frequency of the square-wave output depends upon the value of the RS0 and RS1 bits. With the square-wave output set to 1Hz, the clock registers update on the falling edge of the square wave. On initial application of power to the device, this bit is typically set to a 0.

so the default is for the clock output to be disabled (setting controlled by bit 4) and the default steady state (setting controlled by bit 7) is 0

I assume that by
okay , so why when i connected the battery then i found that pin 7 in ds1307 is connected to the ground is that right?????
you mean that the measured state of the pin is 0 (low)

Aex
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top