Alfat Sd/mmc


Closed Thread
Results 1 to 32 of 32

Thread: Alfat Sd/mmc

Hybrid View

  1. #1
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by PaulBarter
    Did you ever get this sorted? I'm about to embark on a very similar exercise with a 16F877 and alfatSD board using PBP. Any snippets of code or other advice would be greatly appreciated. TIA
    Sorry, I've been out of the country till last night. If at all possible, work with the SD or development board for these units to start with.I am a huge proponent of development kits, they are more money, but cheap in time.
    Alfat is extremely finicky in regards to syntax and timing, and I have spent many hours over "spelling errors" and formatting issues.
    Next, if possible, use text mode with the UART. This is the easiest, and most forgiving.Also, the learning curve is more gentle. I was one of the unlucky few that had to use SPI in framed mode. Now, there are plenty of programming examples in "C", and also Proton basic. The latter was invaluable, but required some translation.
    SPI gives you the ability to free up your hardware UART and run at some impressive speeds, especially with a MSSP module as on the 18 series chips. You have to account for every single bit going into and out of the Alfat, but it works reliably. I went with framed mode, because it was easier to parse data and error responses(i've had more than my share!). The Alfat user's forum is quite helpful too.

  2. #2
    PaulBarter's Avatar
    PaulBarter Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks for that,

    I have ordered the ALFATSD board but it'll be a couple of weeks to get to New Zealand. I am planning on using UART in text mode since my application is a simple serial logger.

    I've also looked at the proton basic stuff and it looks helpful but I won't know how helpful until I dive into the actual project.
    I was hoping you or eoasap had a bare bones PBP program to get me started since I'm not using the proton development board.
    Perhaps when I get my chip I'll cobble one together and may re-post if I hit a brick wall. I'm still a bit of a newbie but have had pretty good sucess with serial comms on these chips already. the only unkown is writing this serial data to a text file. Thanks again for the timely reply.

  3. #3
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    As far as getting text from Alfat, if you know the length of the text string, you can assign a variable array to Alfat's response. Call it Alfat_response.
    Let's say you block out 60 bytes to the array. When you use serin2, you can declare,in statement, (Alfat_response\4) the \4 means serin2 will get four consecutive bytes from the input pin. I don't have the book, so syntax is up to you. The display sequence would be to create a loop and LCDout the characters using the loop counter to increment the array

    For loop = 0 to 3 ; One less since we start from zero
    LCDOUT (Alfat_response[loop])
    Next loop

    Now, if you don't know how many characters are coming out of Alfat, do the loop, and time it out after 10 milliseconds. Keep in mind that some characters will not print to the LCD. You may have to use 'DEC' or 'HEX' to make any sense of them.

    That's all for now,
    Ron

  4. #4
    PaulBarter's Avatar
    PaulBarter Guest


    Did you find this post helpful? Yes | No

    Default Example PBP program

    Hello again:

    I got my Alfat SD board and have made an attempt at getting it to go but with limited success.

    Attached is a PBP program that should reset the ALFATSD and then list the files/folders on the card using text mode.

    When I run it, all I get as replies from the ALfat are null characters (Dec 0). It doesn't go to the error routine (except once), so I'm pretty sure the connections are good. Note that I'm using B5-7 rather than B0-2.

    I'm still a bit of a newbie when it comes to this stuff so any suggestions on how to get this to go would be gratefully accepted. Also, feel free to tell me how crap I am at programming, I've got a pretty thick skin.

    I thought the file list would be the simplest way to ensure I was communicating properly but if there's a simpler way to show on the LCD that things are working then let me know.
    TIA

    -Paul
    Attached Files Attached Files

  5. #5
    Join Date
    Sep 2003
    Location
    Vermont
    Posts
    373


    Did you find this post helpful? Yes | No

    Default

    Hey Paul. You should look at the Proton+ routines on the GHI website. They gave me some excellent insight into timing that the GHI docs were sadly lacking in. After powering up the board, do a hard reset by bringing the reset pin to gnd, then let it float by making the associated pin an input. Do not use weak pullups on portB at this point. The reset routine for proton is what I followed. Next, if all is well, you should see a "BL". This will tell you the bootloader is ready to either load the Alfat firmware, or update it. At this point send "R" or "RS" ? Check the Alfat docs on this. You should get the Alfat startup message complete with version number. If you get this far, you're 3/4 of the way there....
    Ron

Similar Threads

  1. Where should I discuss SD/MMC FAT issues?
    By JD123 in forum General
    Replies: 92
    Last Post: - 2nd April 2008, 22:41
  2. pic + alfat sd
    By ranaz in forum General
    Replies: 0
    Last Post: - 27th July 2006, 07:08
  3. SD/MMC Adapter
    By lester in forum Adverts
    Replies: 1
    Last Post: - 11th July 2006, 16:47
  4. 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
  5. GHI Electronics ALFAT and USBWiz products.
    By lester in forum Adverts
    Replies: 1
    Last Post: - 15th June 2005, 13:59

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