read accelerometer(LIS302DL) on STM32F4DISCOVERY ?

Posted on
Page
of 2
Prev
/ 2
  • Thanks a lot for your help.

    Now the SPI works perfectly well, even I must check what you changed in order to have it working ( MISO pin ? ) and I immediately was able to get data from the accelerometer, but most important from the SD card.
    It is to say that my last trouble was on the microSD card MISO pin.
    I soldered by hand .5 mm wires on the rear of the small SMD card connector and by change the only poor contact was on the Card response (MISO) pin…
    ( I can say that Murphy law is really true )

    Espruino is really a good design.
    I can imagine what could be done when it will be ported to the powerful STm32F429 architecture.


    1 Attachment

    • screenshot_566.png
  • Hi guys,
    I don't know if anybody still follows this thread, but I'm having a very similar problem with the 1v70 on this same board.
    The difference is that sometimes, after un-powering and re-connecting the board (most often I have to do it several times) I do get correct data.
    BUT, as soon as I re-run the "SPI1.send([0x20,0b01000111], E3);" line I keep getting 0 OR 255 as values.

    Thank you for your help,
    Dan

  • Sorry guys, I've actually found the fix. One really need to add the SPI1.setup() line, and by trial and error I've discovered that the 3 below parameters are the mandatory ones:

    SPI1.setup({sck:A5, miso:A6, mosi:A7});
    SPI1.send([0x20,0b01000111], E3);

    With them it works all the time, without it only works some times... (which is really strange :) )

  • That is a strange one... I'd have thought it would have defaulted to the lowest numbered SPI1 pins (which are the ones you've used).

    By the way, you know that's shared with the MEMS sensor - so you have to be sure that it hasn't got enabled.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

read accelerometer(LIS302DL) on STM32F4DISCOVERY ?

Posted by Avatar for JumJum @JumJum

Actions