Where should I discuss SD/MMC FAT issues?


Closed Thread
Results 1 to 40 of 93

Hybrid View

  1. #1
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    I'm trying to avoid this huge 512 byte array, which won't fit on this PIC anyway.

    Speaking of the PIC, I was at the store today and picked up an 18F2050. It's not a 2025, but it should do. I loose one CCP but gain a USB. Past that I can't tell them apart.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JD123 View Post
    I'm trying to avoid this huge 512 byte array, which won't fit on this PIC anyway.

    Speaking of the PIC, I was at the store today and picked up an 18F2050. It's not a 2025, but it should do. I loose one CCP but gain a USB. Past that I can't tell them apart.
    2050? Maybe a 2550...
    Should do just fine. Combine that PIC with the examples from Mr.E's USB demo in another thread (or the config bit hassle that WILL follow...just seems to happen that way), and you'll be in great shape.

    And the 512 byte array won't fit, but the 32 byte or 64 byte array of the EEPROM page will...

  3. #3
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    {getting out my reading glasses...} Yup, it's a 2550.

    I don't see a "MrE, Mr. E, Mr.E or Mr E" in the member list???
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JD123 View Post
    I don't see a "MrE, Mr. E, Mr.E or Mr E" in the member list???
    http://www.picbasic.co.uk/forum/show...ghlight=mister

    I got this one in my hotlinks...

  5. #5
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    Thanks. That's a thread I wish I was around for back in 06.
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  6. #6
    Join Date
    Mar 2008
    Location
    Texas, USA
    Posts
    114


    Did you find this post helpful? Yes | No

    Default

    Something is wrong with my Tcy counter. It must be rolling over. I didn't make provisions for it rolling over because I couldn't imagin it taking more than 65K Tcy to move the data off the MMC and onto the F-RAM. I guess I was wrong... very wrong.

    Best condition Tcy's to move data:

    gosub to MMC read - 2Tcy

    get byte - 24Tcy (3Tcy per bit)

    return - 2Tcy

    gosub to write F-RAM - 2Tcy

    write F-RAM - 117Tcy (13Tcy per bit (min. clock delay 5Tcy), 9 bits w/ack)

    Ack overhead - 9Tcy if tested, 3Tcy if blind read

    return - 2Tcy

    total for single byte loops - 158Tcy

    repeat 512 times - 80,896Tcy

    I must be moving data WAY slower than I thought. Time to detect TMR1 rollover and see what it really is.
    Last edited by JD123; - 22nd March 2008 at 18:01. Reason: corrected F-RAM Tcy
    No, I'm not Superman, but I did stay at a Holiday Inn Express last night!

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by JD123 View Post
    Something is wrong with my Tcy counter. It must be rolling over. I didn't make provisions for it rolling over because I couldn't imagin it taking more than 65K Tcy to move the data off the MMC and onto the F-RAM. I guess I was wrong... very wrong.
    Make an interrupt for the overflow interrupt and increment another word based on that.
    Also, I was looking thru your code again.
    Whenever you multiply or divide by a power of 2, you can easily use a shift to accomplish the same thing. Saves a bunch of cycles, and some code space.
    For instance, you've got:
    OP = OP * 512 (at least 9 shifts, 9 double word adds + carry's, probably 100-ish cycles)
    That can be rewritten:
    OP = OP << 9 (9+ cycles)

    repeat 512 times - 91,136Tcy
    Put some of your shorter Gosub/Returns in-line with the loop that runs 512 times. For each Gosub/Return you eliminate in the loop, you save at least 2,048 cycles (about 2% for each one).

Similar Threads

  1. Reading and Writing from SD/MMC cards as FAT filesystem?
    By charliez in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd June 2006, 23:26

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