Pushing the limits of a PIC10F222


Closed Thread
Results 1 to 6 of 6

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default RAM preserved in sleep

    You say "(the PIC cannot retain variable in sleep mode, and sleep is absolutely necessary)" but what do you base this on? I have skimmed the data sheet and I am led to believe that RAM IS preserved.

    Table 10.1 on page 53 says that data will be preserved as long as the supply voltage stays above 1.5 volts.
    Parameter D002 VDR RAM Data Retention Voltage(2) — 1.5* — V Device in Sleep mode
    Note 2: This is the limit to which VDD can be lowered in Sleep mode without losing RAM data.

    What I would be checking is voltage sag during writes to EEROM. Most EEROM has a 'high voltage generator' to provide the programming voltage and this briefly draws a high current. If you are using lithium thionyl chloride primary batteries there is a short but severe voltage drop usually attributed to 'passivation effects' as your device wakes up and draws current. That voltage sag will scramble RAM and make it look like data was not preserved during sleep. A big tantalum capacitor across the battery helps but beware the leakage current will shorten the battery lifetime. Careful PCB layout with fat power and ground tracks also helps.

    There are many varieties of lithium batteries. All have high internal energy but some are designed for very low drain such as memory protection and others are better at supplying spike currents. Read the Tadiran and Eagle Picher data sheets for details.


    Saving data in RAM and only writing the ten minute result will save you power if not codespace.

    Can you please explain what is going on here...
    'Word names aliased to Bytes using EXT
    ASM
    W0 = _B0 + 0
    W1 = _B0 + 2
    W2 = _B0 + 4
    ENDASM
    W0 VAR WORD EXT
    W1 VAR WORD EXT
    W2 VAR Word EXT

    I have not seen that construct before.

    Cheers
    BrianT

  2. #2
    Join Date
    Nov 2006
    Posts
    70


    Did you find this post helpful? Yes | No

    Default Good advice

    Thanks for the tips guys.

    Brian, I did some testing a long time ago and got the impression that the PIC10 did not retain RAM in deep sleep (WDT disabled etc). The drain from the EEPROM was a concern, but the system appears to be able to withstand it. I can do multiple reads and writes without going into sleep mode. So, I don't think voltage is a problem, but I think I will go back and do some basic testing again to get to the bottom of the RAM issue. As you say, if I can retain RAM data then I can eliminate a lot of code. Good guessing about those batteries.

    The Word variables are aliased using the EXT command. Read through these threads:
    Bits, Bytes Words and Arrays
    The EXT (external) modifier.

  3. #3
    Join Date
    Nov 2006
    Posts
    70


    Did you find this post helpful? Yes | No

    Default Acknowledge polling

    tenaja,

    I looked into acknowledge polling. I get the concept, but it seems way more expensive than a pause. You gotta have a loop with a shiftin or I2Cwrite command right? Is there a cheap way to do it? Am I missing something?

  4. #4
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    974


    Did you find this post helpful? Yes | No

    Default

    I am sure you will save a lot of room by doing it in ASM.

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