This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

sd card + spi + Flash-Fs

Hi,
I am trying to interface LPC2138 with micrSD card(2-GB).
I picked up the demo code for LPC2148 based on Flash File system(since LPC2138 is almost the same as LPC2148 except for usb device peripheral).
On running the code:
I can see the menu on UART(uart is working fine).
But it gives error:
" MMC/SD card init failed.. Insert Card and press key... "

In SPI driver file SPI_LPC214x.c, its using SPI1/SSP port. As for the hardware, connections are perfect and i am able to read and write sectors from sd-card(using another sector read/write code ofcourse).

functions present in SPI_LPC214x.c are:

*----------------------------------------------------------------------------
 *      SPI Driver Functions
 *----------------------------------------------------------------------------
 *  Required functions for SPI driver module:
 *   - void spi_init     ()
 *   - void spi_ss       (U32 ss)
 *   - U8   spi_send     (U8 outb)
 *   - void spi_hi_speed (BOOL on)
 *---------------------------------------------------------------------------*/

I have even set the heap size to 0x1000 and all other configurations are correct.
Please help if i am missing something.

I am using RL-ARM v4.12 and MDK-ARM v4.21.

Regards,
Salman Liaquat.

Parents
  • It is common to use a MOS-FET transistor to drive external equipment, when there is a need to be able to cut the supply to reduce the current consumption.

    You can find many MOS-FET with very low on resistance. But you have to look carefully about what voltages you need to control them - for some designs, I have to switch the processor pin between actively driven low, and changed to input with a pull-up to 5V, because the used transistor can't be fully controlled with 3.3V. That obviously requires that the processor has 5V-tolerant inputs. In the case of LPC23xx, the input must be tristated or it will clip to 3.3V.

Reply
  • It is common to use a MOS-FET transistor to drive external equipment, when there is a need to be able to cut the supply to reduce the current consumption.

    You can find many MOS-FET with very low on resistance. But you have to look carefully about what voltages you need to control them - for some designs, I have to switch the processor pin between actively driven low, and changed to input with a pull-up to 5V, because the used transistor can't be fully controlled with 3.3V. That obviously requires that the processor has 5V-tolerant inputs. In the case of LPC23xx, the input must be tristated or it will clip to 3.3V.

Children
No data