PDA

View Full Version : DS1302 displays 00/00/00 00:00:811



dbj
11-13-2006, 12:09 AM
Dont undestand why my·DS1302_Demo.bs2 wont work cant set time,or date. I can write· to the ram so It seems to be conecting to the chip. Thanks David

Post Edited (dbj) : 11/12/2006 4:44:47 PM GMT

Paul Sr.
11-13-2006, 12:37 AM
dbj said...
Dont undestand wyh DS1302_Demo.bs2 wont work cant set time,or date. I can write to the ram so It seems to be conecting to the chip. Thanks David


I have used it with no problems. Check your Crystal connections - the leads are quite small for proto boards - I usually put the leads in the same holes that pins 2 & 3 of the 1302 plug in to, then plug the 1302 in, to assure a good connection.

Guido
11-13-2006, 03:09 AM
I think if you are writing to the Ram then you should have an indication on startup of what you have entered into the Ram.....After that if the Crystal is not properly installed it just won't run........

Chris Savage
11-13-2006, 04:30 AM
Guido has a point…Write something to RAM…If that doesn’t work I would recheck your connections and I/O assignments.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

dbj
11-13-2006, 08:01 AM
Can write and read just fine just wont display time or count at all , have tried two ds1302s and two differant 32.768 crystals, the code is from BS2 but I am running it on a BS2p24 is that what is wrong. Now·I changed the battery and now it says 00/00/00 00:00:80 could this be that the clock has never been told to start threw writing to bit7 not to clear on this but in the data sheat it talks about this:
CLOCK HALT FLAG
Bit 7 of the seconds register is defined as the clock halt (CH) flag. When this bit is set to logic 1, the clock oscillatoris stopped and the DS1302 is placed into a low-power standby mode with a current drain of less than 100nA. When this bit is written to logic 0, the clock will start. The initial power-on state is not defined.
·Thanks David

Post Edited (dbj) : 11/13/2006 1:11:53 AM GMT

sam_sam_sam
11-14-2006, 02:30 AM
dbj

I had this problem when I frist started playing with this chip if you are getting 00:00:80

this is One of Two thing http://forums.parallax.com/images/smilies/idea.gif

#1 check and see that you have the pins to the Right Pins Statement



DS1302 Chip Basic Stamp


If you hook up your pins this way This is the way that
I have it hook up on mine



*******These pin # may not Right on the DS1302 Chip*************
How ever they are the pins that hoop up to the
*******Basic Stamp to the DS1302 Chip......................*************


-1 .......................P0
-2 .......................P1
-3........................P2
-4 Not Used



If you use the demo code that is for the DS1302 on the forum
this would be 1.0.2 in that order not 0.1.2



This is how the DS1302 Demo code is setup

-1........................P1
-2........................P0
-3........................P2
-4 Not Used



#2 You must have the pins on the DS1302 solder to the 32.768 crystals pins or this will also give you this problem this took me awhile to figur this one out

I hope this help you out

Have fun playing with this chip http://forums.parallax.com/images/smilies/idea.gif


Sam

Post Edited (sam_sam_sam) : 11/13/2006 6:35:56 PM GMT

Paul Sr.
11-14-2006, 02:46 AM
Sam,

RE: #2 You must have the pins on the DS1302 solder to the 32.768 crystals pins or this will also give you this problem this took me awhile to figur this one out

You really don't need to solder the crystal to the 1302 - you DO need to be sure they are making good contact. This can be tricky on some proto boards (well used ones, especially).

This is why I recommended putting the crystal leads in the holes that the 1302 pins 2 & 3 go in to THEN gently push the 1302 in place. This will assure the crystal leads make good contact with the 1302 pins AND allows the circuit to be disassembled as needed.

Post Edited (Paul Sr.) : 11/13/2006 6:50:53 PM GMT

Chris Savage
11-14-2006, 04:35 AM
sam_sam_sam said...(trimmed)
#2 You must have the pins on the DS1302 solder to the 32.768 crystals pins or this will also give you this problem this took me awhile to figur this one out
Sam,

·· I would recommend against soldering the crystal to the DS1302.· I have used the DS1302 in dozens of prototypes all on different bread boards and never had any issues.· I'm not sure if the RAM circuitry needs the crystal to work or not, but you can rule out the SPI interface if the RAM access is working properly.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

sam_sam_sam
11-14-2006, 12:43 PM
Chris (http://forums.parallax.com/member.php?u=40514), Paul Sr. (http://forums.parallax.com/member.php?u=45125)

How do·you hook up·a DS1302 Chip to crystals pins· Is this what you are talking about

This is why I recommended putting the crystal leads in the holes that the 1302 pins 2 & 3 go in to THEN gently push the 1302 in place. This will assure the crystal leads make good contact with the 1302 pins AND allows the circuit to be disassembled as needed.
·················································· ······································· http://forums.parallax.com/images/smilies/idea.gif
Now i have not tried doing it this way
·But i will try it the next time i use a DS1302 Chip

·Thanks for recommending a better way of do this i will give this a try and let you know what happen



I learn something new ever so often·I know it hard to teach an old dog new tricks················· ·http://forums.parallax.com/images/smilies/jumpin.gif


Sam

Paul Sr.
11-14-2006, 09:11 PM
sam_sam_sam said...
Chris (http://forums.parallax.com/member.php?u=40514), Paul Sr. (http://forums.parallax.com/member.php?u=45125)

How do you hook up a DS1302 Chip to crystals pins Is this what you are talking about

This is why I recommended putting the crystal leads in the holes that the 1302 pins 2 & 3 go in to THEN gently push the 1302 in place. This will assure the crystal leads make good contact with the 1302 pins AND allows the circuit to be disassembled as needed

Now i have not tried doing it this way

But i will try it the next time i use a DS1302 Chip

Thanks for recommending a better way of do this i will give this a try and let you know what happen

I learn something new ever so often I know it hard to teach an old dog new tricks http://forums.parallax.com/images/smilies/jumpin.gif

Sam


Yes, you got it. Putting the Xtal leads in the same holes as the 1302 pins makes for a very good connection. You just need to be careful not to break the leads off the Xtal.

http://forums.parallax.com/images/smilies/wink.gif

Post Edited (Paul Sr.) : 11/14/2006 1:18:38 PM GMT

Chris Savage
11-15-2006, 12:18 AM
Paul,
·
·· On many breadboards that may not work properly.· The pins on the IC are much thicker than the crystal leads.· When you put the crystal into the same set of holes as the IC pins are in, they will not close onto those smaller leads, but rather they will be held apart by the thicker pins on the IC.· It is for this reason we recommend using the next set of holes out from the IC.· If the breadboard is in good condition, the crystal leads will make good contact that way.· Whenever you try to put two leads into the same hole the thicker lead will get a good connection, while the thinner lead will not.· This is due to the way most breadboards work, which is they have two parallel strips of metal which run along a given row.· There are usually notches between them so that they don’t affect other holes on the same row.· But on a given hole the two pieces of metal will expand to the thickness of the larger pin/lead.· Since the strips run perpendicular to the IC, there really is no easy way to make this work.· The only way I could see it possibly working is if you have a really expensive breadboard which has the 4 strips/hole, which are rare.· I hope this helps.· Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Paul Sr.
11-15-2006, 12:31 AM
Chris,

Thanks for the insight - I hadn't thought about how the BB was interconnected. I was having strange issues while experimenting and decided it was because the Crystal leads weren't making full contact. I then moved it to the same pins as the DIP and haven't had problems since. The leads SEEMED to be in there very tight - I guess I have been lucky!

Paul

Chris Savage
11-15-2006, 12:42 AM
Paul,
·
· ·Yes, I have tried·this way·before and found that if the IC leads are pushing outward (which they usually are) then they may push against the plastic holes with enough force to make contact.· This is a pressure connection of metal against plastic, which will often work, but many of the well-handled ICs we have laying around here do not have the cleanest leads so that type of connection doesn’t work well.· But when individual leads are inserted into the holes, they make a metal to metal connection with friction which tends to clean the edge of the lead.· And since it is the wide part, it makes a bigger difference.· Obviously the crystal leads are typically round and won’t necessarily be as big a difference, but I wanted to save anyone hair pulling I have gone through.· Years ago I couldn’t afford a large breadboard and did sometimes force multiple leads into a hole to make things fit.· It always caused problems at some point.· Anyway, the advice and experience of others is always appreciated, and your points were well-taken.· Take care.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

Chris Savage
11-15-2006, 12:44 AM
Almost forgot…Got off topic…I wanted to ask the OP if he has another DS1302 to try.· It seems I remember someone plugging one in backward or something once and not being able to get the time to work.· I don’t recall if they tried the RAM, but the fact that it could happen means trying a second unit might be a good idea.· Also, did you get the crystal from us or another source?· As I recall the DS1302 is a little touchy about the crystal.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support