Announcement

Collapse
No announcement yet.

receiving data from usd

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • receiving data from usd

    hello
    i'm trying to receive data from usd card on a ulcd-24pt with picaso sgc to a picbasic host.
    i can write a byte on the card but when i'm trying to read this byte from the card i don't get the right data. i need help please!
    regards

  • #2


    Can you show us the command sequences used?
    Mark

    Comment


    • #3


      this is my code:

      1 serout 0,103,0,1,[&H40,&H69] ; memory initialisation
      delay 500
      serout 0,103,0,1,[&H40,&H41,&H00,&H00,&H00,&H00] ;point address 0x0000
      delay 500
      serout 0,103,0,1,[&H40,&H77,&H41] ; i'm writting the letter "A" in ascii into the memory
      delay 500
      serout 0,103,0,1,[&H40,&H41,&H00,&H00,&H00,&H00] ;point address 0x0000
      delay 500
      serout 0,103,0,1,[&H40,&H72] ;
      serin 1,103,0,2000,2,[i]; i want the value of address 0x0000 to be copy into 'i'

      but when i read 'i' i get a different value than $41. my processor (picbasic) never get the correct data.
      i need help about this code please
      regards

      kriss

      Comment


      • #4


        Here's a FAT Controller log of what you are sending
        Init uSD 0.187 [40 69]
        Get Status 0.000 [7A]
        Set Address 0.000 [40 41 00 00 00 00]
        Write Byte 0.015 [40 77 41]
        Set Address 0.000 [40 41 00 00 00 00]
        Read Byte 0.000 [40 72]
        A(41hex)
        So it looks like you are sending the right data, but by not waiting for and checking return codes you are asking for problems.

        I suspect the uSD is formatted as FAT and hence there is no RAW partiton, but regardless you need to check things properly
        Mark

        Comment

        Working...
        X