Today 03:21
Forum: Proton Plus Compiler v3
Starter: xldaedalus
Views: 0
Replies: 27
Today 02:15
Forum: Proton Plus Compiler v3
Starter: rcurl
Views: 0
Replies: 5
Yesterday 22:09
Forum: WIKI Discussion
Starter: yvesmazzon
Views: 0
Replies: 3
Yesterday 15:13
Forum: Proton Plus Compiler v3
Starter: Tim
Views: 0
Replies: 3
+ Reply to Thread
Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Pulse counter memory problem30 days old

  1. #11
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,347
    Thumbs Up
    Received: 84
    Given: 23
    Total Downloaded
    3.86 GB

    1 Not allowed!

    Default Re: Pulse counter memory problem

    Les,

    With regards eeprom cycle lifespan, if I need to save say every half an hour, I use a method to write to different eeprom address. Reading back is simple.
    This is a summary of what I do.

    1) After programming a PIC, value in each slot is $FF
    2) So first power up will look for eeprom address 0, if it is greater than 0 then, erase all eeprom addresses, and last erase address 0
    3) Calculate the number of bytes or words to be written everytime a write is required. Take an example that we are writing just one byte
    4) Write to address 1. When another write is required write current address with 0, increase address by 1 and write.
    5) When the program starts over, 2 above will be 0 so it is not going to erase eeprom address again. Then it will begin reading addresses one by one until a value greater than 0 is found. This will be the address from where value will be read and next write is performed
    6) The only problem with this setup is that address location must have a number greater than 0. Otherwise, leave the $FF, and at 4 above, write current address with $FF, increase address by 1 and write. Then with 5 above, read eeprom, and when NOT $FF that will be the address to begin with
    Regards

    Joseph

  2. #12
    Fanatical Contributor Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,003
    Thumbs Up
    Received: 306
    Given: 109
    Total Downloaded
    1.50 GB

    1 Not allowed!

    Default Re: Pulse counter memory problem

    That is, essentially, how true professional eeprom access is done Joseph. The address for the writes and reads is cycled around so that the write cycles for the eeprom are lengthened many thousands of times.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  3. #13
    Prolific Poster joesaliba's Avatar
    Join Date
    Sep 2004
    Posts
    2,347
    Thumbs Up
    Received: 84
    Given: 23
    Total Downloaded
    3.86 GB

    1 Not allowed!

    Default Re: Pulse counter memory problem

    Thanks for your kind words.

    The idea came when I needed to write to eeprom every 20 minutes on an 18F26K22, which have 1024 eeprom address, and made my grey cells work harder.
    Regards

    Joseph

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Pulse counter using COUNTER command
    By amod in forum Absolute Beginners Section
    Replies: 33
    Last Post: 28th August 2018, 19:37
  2. [SOLVED !] Problem in pulse per second meter
    By amod in forum Absolute Beginners Section
    Replies: 20
    Last Post: 19th April 2018, 16:48
  3. pulse counter with single LED to display total
    By Automods in forum Proton Plus Compiler v3
    Replies: 17
    Last Post: 14th July 2011, 16:05
  4. [SOLVED !] Counter pulse width/rise time?
    By GregZ in forum Proton Plus Compiler v3
    Replies: 1
    Last Post: 22nd July 2009, 16:20
  5. Pulse counter using capture interrupts
    By HelpMe! in forum Proton Plus Compiler v3
    Replies: 10
    Last Post: 30th November 2007, 15:37

Posting Permissions

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