Hi Matt,

Some more feedback about current sd_card.jal library:

  - send_command() should be prefixed with sd_send_command() to avoid
potential collision
  - I wanted to use sd_data_byte, to read card byte by byte, but it seems
already "infected" by some filesystems stuff: it increment a counter related
to sector, dealing with 512 bytes.
  - in the same procedure, there seems to be special values when reading SPI
(eg. 0xFE). What if I need to read these values ? I don't understand the
following loop:

   if sd_byte_count == 0 then               -- beginning of sector read
      while spi_master != 0xFE loop      -- wait till data is ready to read
      end loop
   end if

Basically this is why my sample doesn't work, commenting the "while" loop
fixes the issue.

Shouldn't I use this procedure ? Shouldn't it be completely independent from
filesystem concerns ?

Thanks for your light !

Cheers,
Seb



2011/4/19 mattschinkel <[email protected]>

> Sure, and also check if pragma inline is a good idea.
>
> Matt.
>
> On Apr 19, 12:33 pm, Sebastien Lelong <[email protected]>
> wrote:
> > 2011/4/19 mattschinkel <[email protected]>
> >
> > > I prefer to take the spi init procedure and split it into two.
> >
> > OK, do you want me to take care of this ?
> >
> > Cheers,
> > Seb
> >
> >
> >
> > > spi_master_hw_set_mode(byte in mode)
> > > spi_master_hw_set_speed(byte in speed)
> >
> > > The set speed procedure may not be used as often, however there are
> > > some devices that require SPI commands to be slower then SPI data
> > > transfers. For example, mp3 decoder vs1053b
> >
> > > Then add another alias to the sample
> >
> > > alias spi_master_set_mode is spi_master_hw_set_mode
> >
> > > Matt.
> >
> > > On Apr 19, 6:42 am, Sebastien Lelong <[email protected]>
> > > wrote:
> > > > OK, thanks for pointing this. How can we solve this in order
> sd_card.jal
> > > to
> > > > be fully generic ? I remember we have the exact same problem with
> > > ethernet
> > > > libs.
> >
> > > > Cheers,
> > > > Seb
> >
> > > > 2011/4/19 mattschinkel <[email protected]>
> >
> > > > > Thanks.
> >
> > > > > You may also want to pay attention to these lines (if you are using
> > > > > more then one SPI device that use different modes)
> >
> > > > >   -- put spi into mode 11
> > > > >   if SD_ALWAYS_SET_SPI_MODE == TRUE then
> > > > >      SSPCON_CKP = 1
> > > > >      SSPSTAT_CKE = 0
> > > > >   end if
> >
> > > > > All of my SPI libs use these lines so the devices can be used
> > > > > together.
> >
> > > > > SD_ALWAYS_SET_SPI_MODE is defined in the sample.
> >
> > > > > Matt.
> >
> > > > > --
> > > > > You received this message because you are subscribed to the Google
> > > Groups
> > > > > "jallib" group.
> > > > > To post to this group, send email to [email protected].
> > > > > To unsubscribe from this group, send email to
> > > > > [email protected].
> > > > > For more options, visit this group at
> > > > >http://groups.google.com/group/jallib?hl=en.
> >
> > > > --
> > > > Sébastien Lelonghttp://www.sirloon.nethttp://sirbot.org
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "jallib" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/jallib?hl=en.
>
>


-- 
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to