need eeprom to save values


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,622


    Did you find this post helpful? Yes | No

    Default Re: need eeprom to save values

    Hi,
    If you go the ADC route I suggest putting a voltage divider in between Vdd and the ADC input. Otherwise you're overdriving the ADC input, the internal protection diode from the input to Vdd may be forward biased (depending on its actual Vf compared to the 1N4148 or whatever).

    If the PIC has a comparator you may want to use that instead of the ADC because then you can set it up to trip an interrupt when the comparator output toggles - may be better than continously sampling the ADC. (The voltage divider still applies though.)

    /Henrik.

  2. #2
    Join Date
    Jun 2011
    Location
    Indian Harbour Nova Scotia
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: need eeprom to save values

    Thanks all for responding. All good ideas that I will be sure to use in the future.

    I looked back at my project, which was to automate a 1/87 scale (HO train scale) dump truck so it's box would dump, reset, then dump again. For this I was using a servo with a sweep motion of about 90 degrees, not the full range of the servo (180 deg from stop to stop). This worked well except when I would shut off power and power-up. The servo would immediately jump to one of the stops, which was out of range of my sweep, then the program would run and everything would be fine. If the dump truck box had been connected, the servo would have lifted the entire truck off the layout. This is why I was wondering how I could save the last value I sent to the servo, power off, and when power came back on again, the servo would know where to start. (I put the initial value at the beginning of my program but this did not work: the servo still swung to one of the limits. In other words it did this BEFORE the program could actually run).

    So...employing the KISS principle (Keep it Simple Stupid), I decided there was a MUCH simpler way. I was so happy to be controlling servos, my judgement became cloudy. My solution is to use a simple DC gear motor under PWM control (easy with a PIC 12F1501), and operate the truck box with a crankshaft coming off the motor, basically an eccentric. Voila! Smooth operation, total speed control (and lots of torque thanks to PWM), no extra electronics required.

    All the ideas you gave me guys are still useful and I will use them in the future. I ain't done with servos.

Similar Threads

  1. Save a port number into the EEPROM?
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 20th August 2009, 10:06
  2. Save number cell in to EEprom
    By piombazzo in forum GSM
    Replies: 0
    Last Post: - 18th August 2008, 21:49
  3. Using serial eeprom to save data ?
    By iugmoh in forum General
    Replies: 4
    Last Post: - 8th February 2008, 09:36
  4. Replies: 5
    Last Post: - 29th January 2008, 10:19
  5. Replacing an ARRAY with EEPROM write to save space?
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 12th March 2005, 19:31

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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