This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help: I want to measure time of Flash Write operation

Dear Friends.

I am using LPC 2138 (ARM) processor. I am using its flash memory to store large data. I want to measure exact time, processor requires to complete whole write operation.

To do this can any one tell me how to make use of onchip hardware timers [Timer0 or Timer1] to measure require to complete such write operation. Please note I am new to hardware Timers.

- Thanks in advace
Raj Mittal

  • If your are new to hardware timers you should:

  • I want to measure exact time, processor requires to complete whole write operation.
    Please note I am new to hardware Timers.


    since you are 'new' I suspect you may ask this question at the beginning of the wrong road.

    WHY do you want to "measure exact time, processor requires to complete whole write"

    Erik

  • "WHY do you want to 'measure exact time, processor requires to complete whole write'"

    And why do you want to have it in your code?

    Would it not be simpler to just set some port pin at the start of the operation, clear it at the end, and use an external timing device to do the timing?
    (an oscilloscope should be sufficient)

  • Spoken like a true hardware guy :)

    Scopes aren't so common that everyone always has one at their desk. I'd be tempted just to set a timer and read the result just so that I didn't have to go back into the lab, round one up, and start probing pins on a BGA package.

    Besides, I've got the code sitting around anyway, as I always wind up having to do minor bits of profiling and timing here and there. Much faster just to throw in a couple of procedure calls into the source and rebuild.

    I'm somewhat curious as to why measuring the actual time matters, since the system has to be designed to tolerate the worst case found in the data sheets. And that worst case is usually significantly larger than the typical case. If you code failure timeouts and the like for a typical case, your system will just fail in actual operation when you happen to hit a slow bit pattern. Measuring a few actual cases doesn't tell you much about the requirements of the part. But the OP could be creating a test rig, or just investigating, I suppose.

  • Dear erik and other
    thanks for kind responce.

    quot "I am new to H/w timers"
    It means i have not need to deal more with H/W timers till now, but requirments arised to evaluate performance of current flash system. I want to use timer JUST as counter "that can start timer at beginneing of FLASH write (IAP) operation and stop timer at end of Flash write operation" , and then i can calculate timer click and can evaluate write time performance summary in terms of micro secoands.

    That is simple version of my query "How can i use timer as JUST only COUNTER"

  • So Reinhard's answer should give all you need?

  • I have taken look of that app notes and samples, it worked for my system, thanks

  • but requirments arised to evaluate performance of current flash system.

    just look at the datasheet for your flash memory. You will, find that Twr is max some number - for this I will assume it is 750 ns. Now you 'measure' you flash performance and find that they all perform in the 300 - 500 ns range and design based on this and Murphy guarantees that the next flash chips you receive will have a Twr of more than 500ns.

    The way to 'measure performance of a flash system' is to calculate based on worst case found in the datasheets.

    Erik

  • Murphy guarantees that the next flash chips you receive will have a Twr of more than 500ns.

    Murphy guarantees that in the next revision of the flash chip data sheet, Twr will be longer.

    Don't laugh. That's the real world.