1. Attachments are working again! Check out this thread for more details and to report any other bugs.

Prius C Clock Driving Me Crazy

Discussion in 'Prius c Main Forum' started by PiPLosAngeles, Jan 1, 2014.

  1. PiPLosAngeles

    PiPLosAngeles Senior Member

    Joined:
    Nov 18, 2012
    1,550
    720
    0
    Vehicle:
    2021 Prius Prime
    Model:
    LE
    There's really very little cost other than the cost of running wire, but ridding the car of an extra clock should make up for it. The GPS already has a clock in it. It's just a matter of wiring that clock to the display in the car instead of whatever timekeeping mechanism is in the current clocks.
     
  2. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    I was referring to microchip redesign, but then again, perhaps every sort of clock chip already exists, and no one is interested in redesigning it.
     
  3. fuzzy1

    fuzzy1 Senior Member

    Joined:
    Feb 26, 2009
    17,557
    10,324
    90
    Location:
    Western Washington
    Vehicle:
    Other Hybrid
    Model:
    N/A
    The lower end cars without Nav and GPS will still need the separate clock, so the overall design will still need to accommodate it. Any extra wiring can easily exceed the cost of the clock itself.
     
    minkus likes this.
  4. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    What happened to the craftsmanship that delivered accurate clocks? Do we need to rely on satellites and the internet to have accurate timekeeping? I've had a battery-operated wall clock that uses one AA battery, and in 10 years, I may have had to adjust the time twice.
     
  5. PiPLosAngeles

    PiPLosAngeles Senior Member

    Joined:
    Nov 18, 2012
    1,550
    720
    0
    Vehicle:
    2021 Prius Prime
    Model:
    LE
    Getting off-topic, but in the days before wristwatches that received WWV signals there used to be a little screw inside the watch that would control the 'speed' of the watch. If you were careful you could dial it in to lose less than a second per week. I used to dream about making a rig to allow finer adjustments to get it down to one second a month. The best I could do was take macro shots of the screw with a digital camera and measure the angle to the pixel and calculate the amount of turn required to produce the needed offset.
     
  6. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Don't you think that the same type of adjustment could be easily built in to a digital clock? I'm guessing it would be, but since all the clock chips were designed decades ago, no one has ever improved on the basic design.
     
  7. 2k1Toaster

    2k1Toaster Brand New Prius Batteries

    Joined:
    Feb 14, 2010
    6,035
    3,855
    0
    Location:
    Rocky Mountains
    Vehicle:
    2006 Prius
    Model:
    Three
    You think a digital clock takes a screw adjustment? :eek:

    A digital clock just uses a crystal that resonates when a potential is applied. Every crystal is unique but generally they are within a certain tolerance.

    The "hack" you want to the Prius would involve replacing its standard crystal with something of similar configuration but higher accuracy. This also assumes that the clock always has power and that the transient voltage drops involved in starting the vehicle (post-start button, pre-READY mode) don't slow the crystal.

    Usually 2-4 pins, and a relatively accurate one could be $5 in low quantities. Or if you wanted to get super geeky, just replace the entire clock screen with a radio synced signal.
     
  8. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Why would your imagination go towards a screw-adjustment? Chips work by adding and subtracting bits. For example: if it's been 40 hours since the clock was last adjusted, and it's 5 minutes fast, the clock should be able to reprogram itself to subtract 5 minutes of clock cycles from every 40 hours. I'm a little astounded and disappointed that this is not already being done.
     
  9. 2k1Toaster

    2k1Toaster Brand New Prius Batteries

    Joined:
    Feb 14, 2010
    6,035
    3,855
    0
    Location:
    Rocky Mountains
    Vehicle:
    2006 Prius
    Model:
    Three
    Uhhhh, because that's what YOU said:

    Just so you know I design semiconductors. I build these "chips". So please school me on how you know how they work and how easy it is to adjust a RTC (Real Time Clock).

    How does the clock know that 40 minutes has past? I thought the clock was inaccurate to begin with?
    How does the clock know that it is 5 minutes fast? No idea how you expect a crystal to know this. It needs external synchronization which usually comes via a radio sync or internet time sync.

    And all clock that have a data path to an external network (radio waves broadcasting the atomic clock time, satellite GPS broadcasting time stamps, internet connection to ping a time server, etc) use it to resync. Sometimes once a day, sometimes every boot, it could be anything.


    Digital clocks resonate a crystal (1). This tiny amplitude low frequency (32.768KHz generally) signal (2) then gets amplified (3,4&5) and phase locked (6) to lock on to the signal. Every time the analog amplified signal raises above a threshold (6) it interrupts a microcontroller (or whatever digital device there is) (7) and this keeps time by counting.

    All the (#)'s are sources of error that are gross and easy to spot. This is a very simple RTC built on a crystal. You also have parasitic and non-ideal problems. The time delay in signal traces. Radio bursts messing with your loops, and user inputs screwing around.

    (1) Frequency varies with temperature. Frequency varies with input voltage. Frequency does not immediately appear after being excited, it takes time to resonate. The filter caps are also hard to match precisely.
    (2) Could be 1% accurate, so 32.44KHz - 33.095KHz and not ideal 32.768 or sometimes 2%, 3%, or in really cheap ones 10%. You can also get 0.5%, 0.1%, or ones that are spec'd in error pulses per million accurate pulses or even billion accurate prices. Price increases very fast the better the specs.
    (3) Gain error - Trying to multiply by lets say 100. What if it is 99.7 instead? Error.
    (4) Offset error - Assuming that the gain is dead nuts 100x, and you put in a unitless value of X, you would expect 100X on the output. What if it is 100X +/- 0.1 or something? Error.
    (5) Linearity error - You want the gain to be 100, but then when multiplying small signals maybe it is 99.7 and then at high signals maybe 100.6. More error.
    (6) How are you detecting this threshold? Every way has error. What if you detect an edge that is not an actual pulse, but a small glitch from high frequency noise? Hopefully your PLL can filter this out, sometimes pulses get through.
    (7) Latency between interrupt being generated and microcontroller servicing it? Even if the micro gets the interrupt as the highest priority, it has to save its current state to the stack and flush the pipeline before it can service an interrupt. At 200MHz, it might take 20-40 cycles to do it. If we say 20 cycles, that's 100 nano-seconds every time best case. What if it has to finish another higher priority interrupt? Maybe a few hundred extra cycles? But 100nS every 30.5uS or 0.3% best case.


    Easy? No. Go ahead and take a stab at it. Actually think through your response this time.


    (6)
     
  10. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    Can you design a clock chip that can keep good time? I haven't seen very many of them in my 40+ years of working with them.

    If you care to scroll back, I said the way self-adjusting clocks work is to advance or retard the speed of the clock, based on how much they were adjusted.
     
  11. 2k1Toaster

    2k1Toaster Brand New Prius Batteries

    Joined:
    Feb 14, 2010
    6,035
    3,855
    0
    Location:
    Rocky Mountains
    Vehicle:
    2006 Prius
    Model:
    Three
    Yeah we do all the time. You don't see them because they don't go in consumer devices that actually display the time. Rarely do they go in any consumer level device. Try synchronizing multi-gigahertz signals with a poor clock. It ain't gonna happen. Consumer electronics expect things to be cheap and margins are slim.

    We generally make very stable and precise time clocks that are not accurate. Remember what that means. Over temperature, time, and transients the output barely changes. But "from the factory" it is not at exactly the right frequency and they vary wildly in accuracy. They keep that same "bad" frequency very very well. But that isn't very useful.

    Then you use laser trims to take away parts of resistors and capacitors on the silicon itself to try and home in that accuracy. On some of our higher end devices with non volatile memory we program a many-bit signed offset to get the accuracy most of the way corrected and then laser to make it exact. It will then keep this time without external stimulus. At least until the NVM corrupts itself after 85-200 years.

    But these are expensive high end chips that you won't find in the Prius' $0.30 clock.
     
  12. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    I once tried out a Russian-made Lada. Most of the car was rubbish, but the electric clock was a fine piece of engineering. According to the manual, if you adjusted it every 24 hours, just a few adjustments would make it super accurate, and this proved to be true.

    For example, if you adjusted it ahead by 10 minutes, the clock mechanism was automatically speeded-up by 10 minutes a day. All I'm asking for is a digital equivalent of this principle.
     
  13. 2k1Toaster

    2k1Toaster Brand New Prius Batteries

    Joined:
    Feb 14, 2010
    6,035
    3,855
    0
    Location:
    Rocky Mountains
    Vehicle:
    2006 Prius
    Model:
    Three
    That is changing the frequency of the crystal. All that is. And again that won't work over temperature or during transients. But that is exactly what we do with our laser and NVM trimming. We turn the part on, see it is super crappy and way off in the weeds. Then we dial it in slowly so that it matches a precise very expensive clock and lock that in. Never needs to be set again. You were doing the same thing in your russian car except your adjustments were much more macro with much longer increments inbetween.

    No cheap consumer clock will do this anymore, it is too expensive. The way it is done now for the masses is to sync with an external signal. That simple. 1 master keeper of time for millions of devices broadcasting "the time is now ______" signals and the clocks say "ok, whatever you say the time is now _______" no matter what it originally thought.

    We have a satellite box where the billing address is in a different timezone than where it is located. No matter what you set the time to on the on screen guides or front panel (like an old VCR type display) it will always reset every 2-3 minutes to the time published by the satellite provider and the billing postal code. Same interval it checks to make sure you have paid your bill and the image can still stay on the screen. ;)
     
  14. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    It makes no sense to change the crystal. The processor counts the cycles and uses simple math is used to register the time. Nothing needs to be reinvented; just a circuit that adjusts the math based on user input to improve accuracy.
     
  15. 2k1Toaster

    2k1Toaster Brand New Prius Batteries

    Joined:
    Feb 14, 2010
    6,035
    3,855
    0
    Location:
    Rocky Mountains
    Vehicle:
    2006 Prius
    Model:
    Three
    You obviously don't understand basic circuitry so just give it up already. You have shown your inability to grasp this over and over. Find something you're good at, semiconductors and circuit design isn't it.

    "Processor counts the cycles"... Yeah but the time base for counting is what is inaccurate! And it is not a static inaccuracy (offset if you will) like a mechanical device where the parts just aren't machined or aligned 100%. This is a variable error based on many different factors, even temperature. It just won't work.
     
    #55 2k1Toaster, Jul 1, 2014
    Last edited by a moderator: Jul 1, 2014
  16. Paradox

    Paradox Prius Enthusiast / Moderator
    Staff Member

    Joined:
    Sep 22, 2005
    29,110
    8,591
    201
    Location:
    USA
    Vehicle:
    2014 Prius v wagon
    Model:
    Five
    Alright everyone, thread cleaned, if you've got issues with someone take it up via pm/conversation. Don't let it get to throwing insults/curt remarks at one another in a thread.

    Back on topic now, thanks.
     
  17. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    It would still be nice to have a discussion about whether a digital equivalent of the self-adjusting analog clock could be or ever has been designed. I'm sure it could. I believe this was the discussion before it went astray.
     
  18. fuzzy1

    fuzzy1 Senior Member

    Joined:
    Feb 26, 2009
    17,557
    10,324
    90
    Location:
    Western Washington
    Vehicle:
    Other Hybrid
    Model:
    N/A
    Looks like I missed a spirited discussion while offline several days.

    Yes, it has been done. But it doesn't do squat about the various stability issues that 2k1Toaster has been telling you about in that cheap quartz crystal in cheap consumer products, where pennies matter to the bean counters.
     
    #58 fuzzy1, Jul 3, 2014
    Last edited: Jul 3, 2014
    ztanos likes this.
  19. GregP507

    GregP507 Senior Member

    Joined:
    Apr 5, 2014
    3,002
    480
    0
    Vehicle:
    2012 Prius Plug-in
    Model:
    Plug-in Base
    All I ever wanted was a digital clock that could keep time as well as some of the analog clocks I've owned.
     
  20. fuzzy1

    fuzzy1 Senior Member

    Joined:
    Feb 26, 2009
    17,557
    10,324
    90
    Location:
    Western Washington
    Vehicle:
    Other Hybrid
    Model:
    N/A
    Many of my digital clocks handily beat every mechanical clock I've ever owned.