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.

having real trouble with DS1307 and 16f877a

Status
Not open for further replies.

Anthony_

Junior Member level 2
Junior Member level 2
Joined
Jul 29, 2013
Messages
23
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Zulia-Venezuela
Visit site
Activity points
175
hi guys! im a newbie in the uC world, lately i've been trying to interface a 16f877a with the DS1307 clock with no result! i've been using the master I2C module of this pic, everything in the real circuit is connected correctly, with pull-ups resistor in the bus lines and SQW pin, cristals of 32khz in the DS1307 and 4 mhz in the pic side, everything according to datasheet specs, i think im doing something wrong in the code, i've been trying to turn the Ds1307 oscillator ON with 1HZ output in SQW pin but with no sucess (the uC has never received an acknowledge from DS1307), here's the code i hope you guys can help me! im a lil bit frustrated with this
 

Attachments

  • digital clock source code.txt
    3 KB · Views: 88

Could you please define what a super-loop is in this situation? maybe that's the part im missing

- - - Updated - - -

the code secuencially sets a start condition and starts writing ds1307's registers from register 0 to control register, after the stop condition the code doesnt repeat again, at this point the ds1307 should be oscillating regarless the functioning of the pic
 

i've made the code in assembly (MPASM), im real frustrated with this, cant get the DS1307 working, can you take a look at the code pls? i would really appreciate it :(
 

i made a new code piece by piece, and i found that there's an acknowledge after i sent the ds1307 address to it, but afterwards when i send the 0x00 number to set the pointer @register 0 it doesnt acknowledge anymore
 

well i parcially solved my problem, i sucessfully interfaced the 16f877a with the ds1307, i received acknowledges and set the RTC to output a 1hz pulses from SQW pin, but the ds1307's oscillator doesnt seem to work, i connected the 32khz crystal in X1 and X2 pins, but it remains stopped, afterwards i connected the ds1307 's X1 pin with the OSC2/CLKOUT pin of the 16f877a (the pic has also a 32 khz crystal, LP mode) and the RTC started working with the 1 hz pulse in the SQW pin! is the RTC oscillator damaged?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top