At 08:54 AM 6/06/2002 +1000, you wrote: >John Brown wrote: >>I am trying to hook a Dallas 1302 Timekeeping chip up to a 16f877. I am >>using PortD 4-6 for the 3-wire interface, and the read/write routines >>available from Dontronic's rtc1302.asm file (appropriately modified to >>work on the pins I have selected). Is there any problems with using these >>routines on a 877? Are there better ones? >> >>My main problem is that I can't seem to get it going, which is always >>annoying! I was wondering if anyone has any ideas? I have confirmed that >>the chip is correctly wired to the correct pins :-) and as far as I can >>tell it is all wired up correctly. > >If what way does it not work? Can you read & write the time? I attempt to write the time, wait 10 seconds and then read it back. But the results of my attempt to read are all zeros. I have no idea if the attempt to write to it is working, or if the time is ticking over. At this stage I am assuming that I am not writing successfully to the chip and therefore it isn't ticking. My understanding is that all I have to do to start it tick is clear bit 7 of the second register (which I then write to the chip), but I assume this message isn't getting through at the moment. > bcf second,7 ;clear `clock halt' CH bit Actually, I just remember that one thing I am not doing correctly is that the numbers I write to the chip should be binary coded decimal, when in fact at the moment my code is writing just plain decimal. This shouldn't stop the communications though, I should just be setting to the wrong time and date! Setting the wrong time and date would be better than nothing! Thanks, John >Does the time tick over by itself? I used the DS1307 a while >ago & you have to set the oscillator bit in one of the registers >to get it running. I don't know if the DS1302 is the same but it >may be worth looking at. >Regards... > >___________________________________________ >David Duffy Audio Visual Devices P/L >U8, 9-11 Trade St, Cleveland 4163 Australia >Ph: +61 7 38210362 Fax: +61 7 38210281 >New Web: www.audiovisualdevices.com.au >___________________________________________ _______________________________________________________________________ John Brown PhD (Clinical Psychology) candidate Email: john.brown@anu.edu.au School of Psychology Phone: (02) 6125-3827 Room 124, Building 39, Psychology Fax: (02) 6125-0499 The Australian National University Mobile: 0429 455 504 ACTON ACT 0200 Web: http://www.anu.edu.au/psychology/staff/BrownJ.htm -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu