Math operations execution time


Results 1 to 20 of 20

Threaded View

  1. #5
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: Math operations execution time

    Hi rasciodc,

    Something seems out of whack with your 200 ms timing. Not sure what is taking so long. The eeprom write cycles should take the longest at 5ms. For an example, I did an altimeter for this chip using a 16 bit oversampling routine (where 4096 samples are averaged an "upconverted" to a 16 bit result) with this same chip using an internal 8 mhz osc. The oversampling part with the altitude math took a little more than 100 ms. Just the oversampling I was doing took 99 ms. So, about 40,000 samples per second. If you are taking one sample at 8 or 10 bits, then things can definitely be sped up.

    You can do as Jumper suggested, editing out your math to see how much speed you gain, just from using raw ADC data. But I have a feeling something else it taking up time. There is a useful tool called codetimer.bas. I have used this on PIC18 chips. Not sure it will work on a PIC12 though. You could upgrade to the PIC12F1822 or PIC12F1840. This chip can run at 8 million instructions per second, rather than the PIC12F863 at 5 million instructions per second. And EEprom write cycles are sped up by about 20 percent (to 4 ms). It would be interesting to see your code for an idea of where the bottle neck is. Are you sure what speed you are running the osc at? Another thing you could do would be to change to a faster type of memory to write to. But again, this part should take 5 ms per sample, so that should not slow you down too much. Seems like you should be able to obtain 20 ms with the hardware you have.

    http://ramtron.com/about-us/what-is-f-ram.aspx Fast memory to write to, with more space.
    http://www.picbasic.co.uk/forum/cont...gital-readings Oversampling
    http://www.picbasic.co.uk/forum/cont...r-for-PBP-code CodeTimer (but built on a PIC18) author says should work on a PIC16
    http://www.picbasic.co.uk/forum/cont...-picbasic-code My PIC12F863 MPX4115 project
    Last edited by ScaleRobotics; - 24th January 2012 at 12:25.
    http://www.scalerobotics.com

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