PWM and MEMORY


Closed Thread
Results 1 to 34 of 34

Thread: PWM and MEMORY

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    No need to change microcontroller. The 12F683 has 256 bytes of EEPROM in which you can store whatever you want. Use the WRITE and READ commands to store and retrieve your values.
    How to implement it depends on how often the value changes. The EEPROM has an finite number of write cycles so if the value changed several times per second it's not a good idea to constantly write it to the EEPROM, in that case you need som power fail signal which triggers a write. If the value doesn't change very often a simple timer which triggers a write after 5 seconds (or whatever) of unchanged value should be good enough.

    /Henrik.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    You could use the EEPROM area, but the regular memory area is flash, and so it will also preserve the value for years when the power is off.
    The 12F series can't write to its own FLASH memory so you have to use the EEPROM if you want the value to be changeable AND persistent.

    /Henrik.

  3. #3
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    The 12F series can't write to its own FLASH memory so you have to use the EEPROM if you want the value to be changeable AND persistent


    uh oh - what? - I cant use a 12f683?
    My dad never liked you...

  4. #4
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    The rate changes with the push of a button - duty cycle decrements from 128 to 10 and start back to 128. I found 128 is the brightest my leds will go. The user can hold the button in and it auto counts down, goes dim, then goes back to 128. I dont know how but the PWM command resets itself to 128 - the original value - without me having to maker it 128. If that makes sense. I'll post my simple code in next post.
    Last edited by pescador; - 13th May 2016 at 13:06.
    My dad never liked you...

  5. #5
    Join Date
    Sep 2009
    Posts
    755


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    Quote Originally Posted by HenrikOlsson View Post
    No need to change microcontroller. The 12F683 has 256 bytes of EEPROM in which you can store whatever you want. Use the WRITE and READ commands to store and retrieve your values./Henrik.
    Com on, you won't read what is written here, won't read datasheet. And you are willing to throw little money someone, just to write you what is already said few times..

  6. #6
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: PWM and MEMORY

    Quote Originally Posted by pedja089 View Post
    Com on, you won't read what is written here, won't read datasheet. And you are willing to throw little money someone, just to write you what is already said few times..
    I was in a rush this morning - I'm getting it.. I admit I panicked.. I do read - I work 80- hours a week - 40 hours at a real good job and 40 my own business... I try to save time sometimes...
    My dad never liked you...

Similar Threads

  1. Replies: 1
    Last Post: - 4th March 2013, 21:57
  2. Replies: 11
    Last Post: - 17th August 2010, 16:45
  3. Memory use - how much do you use?
    By keymuu in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 10th June 2009, 22:39
  4. Replies: 4
    Last Post: - 2nd March 2007, 06:12
  5. Use internal program memory like DATA memory
    By flotulopex in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th December 2006, 18:38

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