On Thu, 18 Mar 2004 13:07:45 -0800, Thomas wrote: > Hello, > > I am having some trouble interfacing with the Maxim DS17287 RTC. The=20 > RTC IC uses 8-bit multiplex bus interface, but the PIC18F452 doesn't no= t=20 > support this interface so it has to be done in software (and I don't=20 > know how). > > Have you done any coding to interface to this RTC or a similar devices=20 > (i.e DS12877, DS1687, etc)? Please help sharing the code. Thank you i= n=20 > advance! > > Best regards, > > Thomas > Pick a port with all 8 port bits available and 4 other pins (if you don't= =20 plan on using the interrupt output). 3 of these pins can be used for othe= r=20 things (they are inputs to the device so are high impedance but need to b= e=20 drivable by the PIC). (ALE -RD -WR) First set your direction on the 8 bit data port for output Set ALE to LOW SET -RD and -WR HIGH Set -CS Low now Write your address location to the data port Set ALE to HIGH Set ALE to LOW Now if you wish to write to this address write the data to the data port Set -WR LOW Set -WR HIGH if you wish to read from this address Set the direction of the Data Port to inputs Set -RD LOW Read the Data port state to wherever Set -RD HIGH Now you are done set -CS high set the Data port as inputs (let the bus go) You can now use all those pins except the -CS pin for other things (withi= n=20 reason of course) That about sums it up.. you can read and write any register with that=20 algorythm.. here is a BIG HINT .. go to page 29 of the Data sheet and READ it. So yo= u=20 understand how the bus works. Another BIG HINT, read the WHOLE DATA SHEET, or you WILL be asking=20 questions again in a matter of minutes to hours. Most chips like these do not require you to use -CS to latch in the=20 address even. (Again LOOK at the data sheet page 29 carefully). This device you selected also support burst mode (the address is=20 automagically incremented in the address latch by consecutive read or=20 write operations). Most importantly HAVE FUN! --=20 Stephen R. Phillips was here -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics