![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | I am using a PIC18F2620 to interface with a DS1302 real time clock. I haven't manually set the time using push button switches yet. I have a set of functions including various data transfer functions, a set of functions that involves setting the current time, a set of functions involving reading the time and displaying it on the LCD, and a function that starts or stops the clock and another function that sets or clears the write protect bit. It appears that the displaying part of the routine is correct, but the actual time displayed is nowhere close to the time that I have set it to. I have checked the timing on the chip enable as well as the SCLK pin, however, they are quite erratic. Does someone have any recommendations on what I should do next? Thanks! |
| | |
| | (permalink) | |
| New Member | Quote:
| |
| | |
| | (permalink) |
| Experienced Member | I have a 32 kHz crystal connected between pins 2 and 3 on the breadboard. Not sure if that helps with the problem. |
| | |
| | (permalink) | |
| Super Moderator | Quote:
| |
| | |
| | (permalink) |
| Experienced Member | So you're suggesting me to wire up the circuit on an actual circuit board before proceding? |
| | |
| | (permalink) | |
| Super Moderator | Quote:
You don't need to etch a PCB, use a piece of veroboard (stripboard). | |
| | |
| | (permalink) |
| Experienced Member | Hola Nigel, I am not trying to say that it should work for anyone else, out there, but in more than 15 years, all my projects, 90% with PICs (starting with the 16C57) were breadboarded. And worked OK. Yes, with a Xtal of 4 MHz maximum. Bad quality breadboards (easy to run across) are a trap due to poor contact, I admit. I insist; that is my experience and not a suggestion to use them.
__________________ Agustín Tomás In theory, there is no difference between theory and practice. In practice, however, there is. |
| | |
| | (permalink) |
| Experienced Member | Do you have a capacitor (0.1uF) close to the DS1302 chip between the power pins (1&4) and also pullup resistors (4.7K) on pins 5,6&7. Ommiting any of those items could make it unreliable. As others have already said, the crystal placement etc. is very important and it is dealt with in a Maxim app note: http://www.maxim-ic.com/appnotes.cfm/appnote_number/58 |
| | |
| | (permalink) |
| Experienced Member | Don't forget that you can simply connect the 32k crystal and caps to the Tmr1 pins of the 18F2620 and create you own RTC as shown in the Mchip users manual. |
| | |
| | (permalink) | |
| Experienced Member | Quote:
| |
| | |
| | (permalink) |
| Experienced Member | Well you need them. The datasheet will describe the part, not the system. Example in the 16F877A datasheet the USART does not describe a MAX232 and vice versa. |
| | |
| | (permalink) |
| Experienced Member | What I meant was I didn't see anything about the pullup resistors in the DS1302 datasheet. Btw, after soldering the circuit on a PCB and adding the pullup resistors, it appears that I am still getting the same result. Could the problem be with my code as well? |
| | |
| | (permalink) |
| Experienced Member | I hate to show myself wrong But to make up for it here's the DS1305 and PIC16F628 with schematic and code. http://www.maxim-ic.com/appnotes.cfm...te_number/2361 |
| | |
| | (permalink) | |
| Super Moderator | Quote:
| |
| | |
| | (permalink) | |
| Experienced Member | Quote:
| |
| | |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Thread | Thread Starter | Forum | Replies | Latest |
| Real Time FLIR Video Feed | digital0ne | Robotics Chat | 3 | 11th April 2004 06:21 PM |
| digital clock setting the time mode | Jay Duluguin | Electronic Projects Design/Ideas/Reviews | 0 | 19th February 2004 10:09 PM |
| real time clock | finst | Micro Controllers | 4 | 17th January 2004 12:11 AM |
| list of Real Time Clock | thendo | Micro Controllers | 2 | 8th November 2003 05:41 PM |
| time clock | gogo01 | Electronic Projects Design/Ideas/Reviews | 2 | 22nd August 2003 05:05 AM |