+ Reply to Thread
Page 3 of 3 FirstFirst 123
Results 81 to 109 of 109
  1. #81
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Fixed it!

    found answer on parallax's website:

    I have had projects using a DS1302 where I didn't care about the seconds value so I never put a value to it. Some times the clock would start and sometimes it wouldn't. After adding a debug statement that displayed seconds along with∑hours, minutes, etc,∑I found that it would sometimes display a value of 80 seconds and not advance. If it was between 0 and 60 it ran fine. By simply writing a zero or any other valid seconds time it would be okay. Even if you are not using seconds be sure to put a value into it when you set the clock.

    So I just added rtcsec=0 to time setup menu an problem solved!

  2. #82
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    It is an old chip with some issues...

    Ioannis

  3. #83
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Yes I know, but programming is also not my strong point
    Now trying to read/write it's RAM, to enable alarm clock and other functions....

  4. #84
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Code:
       ' Enable write
       Shiftout IO, SCLK, LSBFIRST, [$8e, 0]
       RST = 0         ' Reset RTC
       RST = 1         ' Ready for transfer
    
       Shiftout IO, SCLK, LSBFIRST, [$c0h,128] 'write 3 to address c0h
       RST = 0         ' Reset RTC

  5. #85
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    When trying to run this code, it stops on shiftin, saying bracket is missing, but it is in place!

    Code:
    'test ram write
       ' Enable write
       Shiftout IO, SCLK, LSBFIRST, [$8e, 0]
       RST = 0         ' Reset RTC
       RST = 1         ' Ready for transfer
       Shiftout IO, SCLK, LSBFIRST, [$C0,128] 'write 3 to address c0h
       RST = 0         ' Reset RTC
    
    'test ram read
       ' Enable read
       Shiftout IO, SCLK, LSBFIRST, [$8F, 0]
       RST = 0         ' Reset RTC
       RST = 1         ' Ready for transfer
       Shiftin IO, SCLK, LSBFIRST, [$C1,T4] 'read variable from C1
       RST = 0         ' Reset RTC
    


  6. #86
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Maybe your error is earlier in your code.

    Ioannis

  7. #87
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    it does not likes 2nd variable in shiftin, but with 1 variable, it returns 0...…

  8. #88
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Maybe then it is the variable that is not declared or is System variable.

    T4 looks like system variable...

    Ioannis

  9. #89
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    no it is my variable, this is variable for 4th digit on nixie clock

  10. #90
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Yeah I know but I think PBP system also uses the same name for itself. Rename and try again. Use more than 4 characters for variable names.

    Ioannis

  11. #91
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Very interesting, I've submitted that instructable into a contest, and so far, it was #2 by number of favorites and views, but it does not made even to TOP 20. I've posted a question, why this happened, and they removed it without answering, now sending PM to their stuff. If still got no answer, I'm going to remove that instructable and post it somewhere else.

  12. #92
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Is it commission based? Very strange indeed!

    Ioannis

  13. #93
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    They won't disclose actual mechanism, based on which participants are selected, they say it is "internal thing".

  14. #94
    Join Date
    May 2013
    Location
    australia
    Posts
    1,743

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    its not the best documented , or the one most likely to work for a user or even the one thats been tested and works
    that gets chosen i bet.
    This is more entertaining than Free to Air TV

  15. #95
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Was referenced to "official rules" which says ""clarity, ingenuity, creativity, quality of presentation, and execution of the Instructable"
    "

  16. #96
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    OK, which part you missed? Come on now... Your presentation is great.

    Ioannis

  17. #97
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    I've asked about further details, no response yet

  18. #98
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    I've build another version, this time directly integrated DS1302 onto PCB, but it does not "tick" - does not advance the time, write read all are ok, rtcsec bug above is fixed, it is not an issue, so I guess oscillator not working, is there any way to check crystal on DS1302 operating or not?

  19. #99
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,236

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Quote Originally Posted by CuriousOne View Post
    I've build another version, this time directly integrated DS1302 onto PCB, but it does not "tick" - does not advance the time, write read all are ok, rtcsec bug above is fixed, it is not an issue, so I guess oscillator not working, is there any way to check crystal on DS1302 operating or not?
    Since it is a new design, why not use DS1307?

    You can have LEDs for days.
    Mon, TUE, WED,...

    You can also have a 1-second signal output directly from DS1307.

    just an idea.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  20. #100
    Join Date
    Sep 2009
    Posts
    779

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Check crystal capacitors, and crystal.

  21. #101
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    My programming skills are quite limited, even with DS1302, it took me almost month to make things going I've bought DS3231, but no luck with it so far

  22. #102
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Fixed, it was crystal issue. I've bought expensive, 6pf matched crystals from digikey, but they did not worked with DS1302. Installed some cheap one from China - works fine

  23. #103
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Not all crystals are the same. Others are for serial resonant and others for parallel.

    Do you have the data sheet of the digikey ones?

    Ioannis

  24. #104
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?


  25. #105
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    This comes in four different C load versions from 6 to 12,5 pF.

    Maybe you have wrong load capacitance.

    Also I suppose it is parallel loading, it is not noted in the pdf.

    Ioannis

  26. #106
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,202

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Directly from DS1302 data sheet page 4:

    Connections for Standard 32.768kHz Quartz Crystal. The internal oscillator is
    designed for operation with a crystal having a specified load capacitance of 6pF.
    For more information on crystal selection and crystal layout considerations, refer to
    Application Note 58: Crystal Considerations for Dallas Real-Time Clocks. The
    DS1302 can also be driven by an external 32.768kHz oscillator. In this
    configuration, the X1 pin is connected to the external oscillator signal and the X2 pin
    is floated.

    And from page 5:
    CLOCK ACCURACY
    The accuracy of the clock is dependent upon the accuracy of the crystal and the accuracy of the match between
    the capacitive load of the oscillator circuit and the capacitive load for which the crystal was trimmed. Additional
    error will be added by crystal frequency drift caused by temperature shifts. External circuit noise coupled into the
    oscillator circuit may result in the clock running fast. Figure 2 shows a typical PC board layout for isolating the
    crystal and oscillator from noise. Refer to Application Note 58: Crystal Considerations for Dallas Real-Time Clocks
    for detailed information.
    Table 1. Crystal Specifications*
    PARAMETER SYMBOL MIN TYP MAX UNITS
    Nominal Frequency fO 32.768 kHz
    Series Resistance ESR 45 kΩ
    Load Capacitance CL 6 pF
    *The crystal, traces, and crystal input pins should be isolated from RF generating signals. Refer to
    Application Note 58: Crystal Considerations for Dallas Real-Time Clocks for additional specifications.
    Dave Purola,
    N8NTA
    EN82fn

  27. #107
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,236

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    And here is another addition from me as an attention:

    I had DS1302 and an IR transmitter on the same board.

    PWM module was pushing 38Khz signal to IR LED.

    It turned out that the clock was shifting approx. 2 minutes per day.


    The chip was getting 38Khz IR signal from the board.

    So if you have a PWM frequency close to 32Khz crystal speed of DS1302, then be prepared to have huge clock shifts.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  28. #108
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    2,928

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Board layout is very critical around the Xtal. Datasheet recommendations should be taken very seriously into account.

    Also load capacitance. The circuit inside the chip is designed with low power consumption in mind so everything is very critical.

    Ioannis

  29. #109
    Join Date
    Feb 2013
    Posts
    553

    Default Re: Need to drive 40 pins on variable change, is there a way to do it in elegant way?

    Actually solved issue, now it works with all crystals, it was due to not fully cleaned flux from pcb.

Similar Threads

  1. Can not change variable while using DT_INT?
    By hvguy0 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 30th March 2013, 00:05
  2. Change a variable to the opposite?
    By Hylan in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 21st June 2012, 07:00
  3. LCD DB4-DB7 4bit mode change pins?
    By erice1984 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th March 2009, 02:36
  4. Accessing pins with a variable
    By Desterline in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th August 2004, 16:03
  5. Let a variable change from bin to dec.
    By Roy in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 25th May 2004, 19:57

Members who have read this thread : 36

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts