Bizzare DS1307 behaviour

Fowkc

Senior Member
I've got a Dallas DS1307 slaved to my 28X, no problems on the I2C side of things, but on pin 7 (the one that's meant to flash at a set frequency) is doing something odd.

If I set a 1Hz frequency, for 0.5s the pin will just be at 0v. Then the other 0.5s, there's 50Hz mains noise appearing at about 10mV amplitude, which I suspect the oscilloscope leads are picking up as I'm powering the circuit from an SLA battery (regulated of course). An LED won't light on the pin, whether going to Vcc or ground.

Can anyone shed some light? I don't need the light flashing, it's just weird is all...
 

andrewpro

New Member
Do you have a pullup on pin 7? If not, it wont work right. That could be your problem. Admittedly, it is odd...I've never encountered that specifically before.

--Andy P
 

hippy

Ex-Staff (retired)
There's also the SQWE bit which needs setting in the Control register (07h). If the bit isn't set right you won't see anything on that pin.
 

Fowkc

Senior Member
Yeah... bog-standard (working) red LED with a 220ohm resistor at 5V. I've tried another DS1307 now, it's only one particular chip. Perhaps a manufacturing error, or perhaps I did something to it earlier and didn't realise. Meh. Not important anyway.
 

BeanieBots

Moderator
If you only have the LED and 220R, then there will be a very high impedance when the LED is off. Your scope probe will be picking up mains noise. Add the 4k7 pull-up resistor as well in parallel with the LED/220R if the noise bothers you or if you wish to use the signal in further cicuitry.
 
Top