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 eoasap
    what i'm doing is declaring bufchar as a byte, and then loop at the end of

    read:
    serin2 ALFAT_TX,84,[bufchar]
    lcdout bufchar
    goto read

    like that, i get a bunch of gibberish. yesterday i was getting numbers like 292 (clears screen) 302 (clears screen) 306 (clears screen) .... etc
    When I get to my lab, I will send you a snippet of code. bufchar is a byte variable. It can't go over 255, so there must be a couple of variables in there.

  2. #2
    eoasap's Avatar
    eoasap Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks Ron, i'm sure there's just something minor i'm leaving out (hopefully!) you've already been such a big help! thanks

  3. #3
    PaulBarter's Avatar
    PaulBarter Guest


    Did you find this post helpful? Yes | No

    Default

    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

  4. #4
    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.

  5. #5
    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.

  6. #6
    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

  7. #7
    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

Similar Threads

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