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

LPC1768 SPI failure for flash_fs

Hi
I had made a board with LPC1768 and wrote code for UART, ADC, SD_File, Ethernet, CAN etc. All working
I ordered for new boards with solder mask, with no difference on chip connections. Again almost everything such as UART, ADC, Ethernet and ... are working, just SD File is not working

I looked at SCK0 using an oscilloscope in the first board (Even with SD out) and I could see obvious clock pulses
Then I looked at SCK0 of the second board, I was just having SCK0 driven low for a short time and then high state again

Could anyone suggest me how I can figure out the problem?

To check SPI, I wrote another simple code, I could see pulses on SCK0, but when I use finit(NULL), it's not working

Thank you in advance for your help

Parents
  • Step one when you have issues with new electronics is to make use of the magic wonders that many microcontrollers allows us - their ability to wiggle on almost all of their pins.

    So make use of normal GPIO modes to validate all pins related to the memory card interface. Can your output lines correctly drive all signals low and high and generate distinct signal state changes? Can all input signals be correctly sampled by the processor when you hold the signals high or low?

    And then also check if the PCB has supply voltages on all points where it is expected to.

    If all signals are ok according to the above, then the PCB is good - the only remaining issue then would be that you either have a completely wrong crystal frequency making you run the processor as a different frequency than you think. Or maybe that the memory card holder is bad and doesn't make proper contact with the memory card.

    Another thing to consider is if all capacitors on supply lines are correctly mounted so you have stable supply voltages to the processor and to the memory card.

    If you have pull-up, pull-down or series resistors on the signals, then take a closer look at their values so they haven't been incorrectly mounted.

Reply
  • Step one when you have issues with new electronics is to make use of the magic wonders that many microcontrollers allows us - their ability to wiggle on almost all of their pins.

    So make use of normal GPIO modes to validate all pins related to the memory card interface. Can your output lines correctly drive all signals low and high and generate distinct signal state changes? Can all input signals be correctly sampled by the processor when you hold the signals high or low?

    And then also check if the PCB has supply voltages on all points where it is expected to.

    If all signals are ok according to the above, then the PCB is good - the only remaining issue then would be that you either have a completely wrong crystal frequency making you run the processor as a different frequency than you think. Or maybe that the memory card holder is bad and doesn't make proper contact with the memory card.

    Another thing to consider is if all capacitors on supply lines are correctly mounted so you have stable supply voltages to the processor and to the memory card.

    If you have pull-up, pull-down or series resistors on the signals, then take a closer look at their values so they haven't been incorrectly mounted.

Children