Two Issues with PICbasic's Efficiency


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    I am not sure if doing the I2C in ASM will help much. PBP for the most part is pretty efficient, It just takes a lot of bit shifting to do I2C no matter what. Take a look at the ASM generated by PBP and see what you think.

    In your case I am thinking the fewer the I2C reads and writes no matter what language will be key. And that brings up adding the RTC... More I2C???

    Another thought.
    If the system has a few seconds of dead time now and then have more than on array to save the data in from the sensor. When ever there is time to spare write the oldest array to EEPROM and keep going. Kind of a home made interrupt.

    And like Alan Said about FRAM. Could be what you need.
    Dave
    Always wear safety glasses while programming.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It is a feature of SERIAL EEPROM like the internal PIC EEPROM or external EEPROM (like the 24LC64 and similar etc) that require (up to) 10mS for a WRITE operation (consult the Datasheet of the EEPROM you are using for the actual timing). All the worlds fastest Assembly routines will not help you. You must use a faster hardware product like Alain suggested.

  3. #3
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    Or else, M25P32 from ST ...
    I believe ST sold the M25P line to Numonyx and the line has been upgraded to the faster M25PE... series.
    See the M25PE80 for a sample data sheet.
    It's rated at writing 256 bytes in 11 ms.
    For M25P code example see M25P32 (warning other compiler).

    A full 256 byte per write is probably required however.
    Since only erase can convert 0 to 1's overwriting previous of new and following of new bytes with 1's can simulate a one byte write.
    Perhaps a low priority interrupt could do the 256 byte write in the background.


    Norm

  4. #4
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    M25PE80... The memory can be written or programmed 1 to 256 bytes at a time.
    Improved over old M25P series?
    I found with the previous M25P series after many 1 byte writes errors crept
    in thus a full 256 byte sector write was used.

    Norm

  5. #5
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Normnet View Post
    Improved over old M25P series?
    I found with the previous M25P series after many 1 byte writes errors crept
    in thus a full 256 byte sector write was used.

    Norm
    Thanks Norm the your suggestions and the sample codes. IN the manual it sounds like 1~256 is a flexiable range that can be written. Any way I will try it out later.

  6. #6
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    It is a feature of SERIAL EEPROM like the internal PIC EEPROM or external EEPROM (like the 24LC64 and similar etc) that require (up to) 10mS for a WRITE operation (consult the Datasheet of the EEPROM you are using for the actual timing). All the worlds fastest Assembly routines will not help you. You must use a faster hardware product like Alain suggested.
    Sounds good. The EEPROMs require a 5ms wirting circle typically from Microchips. While it can be reduced to about 3ms as I tried.

  7. #7
    Join Date
    May 2009
    Posts
    21


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    I am not sure if doing the I2C in ASM will help much. PBP for the most part is pretty efficient, It just takes a lot of bit shifting to do I2C no matter what. Take a look at the ASM generated by PBP and see what you think.

    In your case I am thinking the fewer the I2C reads and writes no matter what language will be key. And that brings up adding the RTC... More I2C???

    Another thought.
    If the system has a few seconds of dead time now and then have more than on array to save the data in from the sensor. When ever there is time to spare write the oldest array to EEPROM and keep going. Kind of a home made interrupt.

    And like Alan Said about FRAM. Could be what you need.
    Yes, Alian is right and hardware is the core constrain. I did some revise for the previous codes like reading the accelerometer(six bytes register for three axes) in one I2C read, and the same pracitice for I2C write. The final speed improved to about 150Hz, and then later I started to work on something else for a long time... I think it is my time to crack this trick and will see what's the maximum I will get later. Thanks a lot!~

Similar Threads

  1. SERIN2 buffer issues...
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 16th October 2008, 03:49
  2. Solved: notes on annoying little issues
    By Probotics in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 26th May 2008, 20:02
  3. Where should I discuss SD/MMC FAT issues?
    By JD123 in forum General
    Replies: 92
    Last Post: - 2nd April 2008, 21:41
  4. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 19:33
  5. Circuit reliability issues
    By hkpatrice in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd November 2007, 14:55

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