Circuit Design Question


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2008
    Posts
    13

    Default Circuit Design Question

    I'm working on building a circuit to keep tracking of machine online time (An electronic hour meter). I'd like to do this with 2 wires, a 12 volt power while running and ground.

    My thought of the circuit is to use an IOC pin to detect when power is removed from the circuit. To keep power to the chip I want to use a large cap, the cap size will need to be determined once I get power consumption and time needed to shut down safely, but I'm thinking as long as I keep 90% of the charge on the cap for at least 50ms, that should be plenty of time.

    Basically when power is removed from the circuit, the IOC will interrupt instantly. I'll write my counter vairables from Timer 1 into eeprom using a DT Interupt routine, then set the chip into nap mode. As long as my cap is big enough I should have plenty of time to write my vars to the EEPROM (Green circled cap).

    When the circuit is powered up, I'll read my eeprom vars and then continue counting. Does anyone want to throw $.02 in on the design? Thoughts?

    I'll have no issue writing the code, I'm just wondering about using the large cap to store enough power to write the vars to eeprom.

    Thanks
    Brad

    Last edited by bradb; - 8th August 2009 at 07:01. Reason: readablility

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Hi Brad, here's my 2 cents. What do you think about putting the "storage cap" just after the diode and before the regulator, thereby storing 12v and feeding the regulator until it bleeds down ? I think it will give you more time to write and power down with full 5v drive.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    What Joe said and I will add run the PIC at maybe 3 volts.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Aug 2008
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Ah, that makes a lot more sense, yes! Thank you.

    I'm in love with the 18F4550 (or 2550) because of the USB, so I'm stuck with 5v. But I can use a TI 78ST105 switching regulator instead of the LM7805 which will bring my effeciency from 12v to v5 to > 85%.

    I've used the 4550 for a couple other projects so I'm familair with it. As far as power consumption I plan on using a USB sense from the 5V USB power to turn off the USB when not connected to save power, thus not affecting my ability to write to the EEPROM on shutdown. The USB will be used mainly for setup and to retrieve data, but will be disconnected 99.99% of the time.

    New Schematic:

  5. #5
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I am running the same chip at 48Mhz with a 4 Mhz osc at 3.3 volts.
    The only thing about USB that is 5 volts is the positive power line. That has nothing to do with the signal. As far as I know even a USB flash drive runs on 3 something. Part of the stuff in the stick is a 5 to 3.3 regulator.
    Dave
    Always wear safety glasses while programming.

  6. #6
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    At the second schematic, I would change the cap to 2200uf, and also I would add 100uf parallel to the 50K resistor on the interrupt pin.

    I would also add a BOR level or an endless loop, like a STOP command, immediately after the writing to the eeprom is complete.


    When the power is lost, 2200uf will go down far after 100uf.
    Once 100uf is down, you read zero at the interrupt pin and act right away to save to eeprom, and stop the PIC from doing anything else.
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  7. #7
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default Rtfm

    Hi,

    Read section 24.0.

    There is an on-board High Low Voltage Detection module present on the chip you are talking about.

    You can use an external analogue input or the dedicated HLVD pin. Causes an interrupt. Store your values to the eeprom in the int itself. A high priority int would not int itself.

    Take care not to get trapped by brownouts that affect your circuit but not the machine.

    Shut off outputs turn off peripherals within 1uS and have ample time

    Put an LED and see that the 2200 storage cap can give you over 2 seconds. You are asking for 20mS....

    I used it as last memory for an industrial depth counter. Otherwise the eeprom could have weared out in a week. Not on 4550 though another PIC18.

    PBP does not support oscillator switching, if you can handle it things become more sweeter... in terms of SLEEP.
    Your PIC gets more ..... you get less, implementing it.
    Last edited by sougata; - 11th August 2009 at 09:25. Reason: Typo as usual...
    Regards

    Sougata

Similar Threads

  1. Sine wave power inverter
    By sougata in forum mel PIC BASIC Pro
    Replies: 244
    Last Post: - 23rd February 2017, 06:16
  2. Replies: 6
    Last Post: - 18th September 2009, 20:30
  3. Circuit reliability issues
    By hkpatrice in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd November 2007, 15:55
  4. PCB Design Partnership Enquiry;
    By arbel in forum Adverts
    Replies: 0
    Last Post: - 15th February 2007, 09:07
  5. Replies: 3
    Last Post: - 29th October 2006, 10:16

Members who have read this thread : 0

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