12F683 PWM output not remembering.


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: 12F683 PWM output not remembering.

    I use the EEPROM Address in my commands. For example, "READ 0, Duty" and "WRITE 0, Duty". Writing to the EEPROM takes an eternity in computer time.

    Another method might be to use a rather large capacitor for the PIC power supply so that it takes a couple hundred milliseconds for it to drop below threshold Vdd voltage. Use an input to monitor when the main switch is turned off. Write to the EEPROM only when the main switch powers down. EEPROMs have a limited number of writes, usually rated around 100,000 times. If you are writing to the EEPROM every time your value changes, you could be using up those 100,000 Writes in a relatively short product lifetime. I use a 2200 uF cap in one of my projects to ballast noise. There is sufficient Vdd for over a second after I power down, ample time to write to the EEPROM.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: 12F683 PWM output not remembering.

    Yes that code is going to kill the EEPROM location quickly.
    You need to write only every “so many” loops.

    You could try turning brownout detect on, to ensure you have enough current because EEPROM writing is the most power hungry thing the pic can do,
    and if you’re on the edge, that’s when it will fail.
    and also check the EECON1 register after the write to verify the self timing worked, and the write actually completed (if not, try again).

Similar Threads

  1. 12F683 2 x PWM Outputs
    By retepsnikrep in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 23rd July 2021, 20:20
  2. PWM using the 12F683
    By pescador in forum General
    Replies: 6
    Last Post: - 26th April 2016, 01:13
  3. 12F683 Logic Output Problem?
    By shockwave in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 25th February 2012, 19:48
  4. What's the best way to output 30 to 40 kHz from a 12F683 pin?
    By fizyxman in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 1st June 2009, 00:08
  5. 12f683 comparator and pwm
    By Automan in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd May 2007, 18:05

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