Activity Forums Questions & Troubleshooting SD card logging problem on Controllino maxi automation

  • SD card logging problem on Controllino maxi automation

  • Fruitdas

    Member
    May 25, 2021 at 10:13 am

    Hello everyone,
    We have installed a Controllino on our fruit press to do pressure logging and automation. For the pressure logging we use an SD card module connected to a TFT screen: https://www.adafruit.com/product/2050

    Currently we run into the problem that the SD-card can not be found. It used to work previously, but for some reason it doesn’t any more.

    Steps we have taken to isolate the problem:

    – SPI bus with TFT is still working

    – Logic analyser gives correct Chip select actions

    – When connecting the Card-reader to a Mega2560 it works without a problem

    – Manually set all the other CS-pins that we could think off: 53,10,One for the TFT.

    – Connected another card-reader to the Controllino and it also doesn’t work.

    – Tested 2 different cards, which are both working on Mega2560.

    – Tested Controllino configured as the MEGA2560 in Arduino IDE.

    We are running the simple SD cardinfo sketch with only CS pin modified.

    What we notice: The ethernet light blinks every time we want to connect to the SD-card.

    Do we need to manually turn the CS for the ethernet as well?

    Has anyone some suggestions we can test to make this work again?

    Thank you for any help you can give us.

    Wim

  • Fruitdas

    Member
    May 25, 2021 at 1:44 pm

    I have made some progress.

    As described in the FAQ: number 7:

    Call this function prior to usage of the SPI bus:

    Controllino_RTC_init();

    This was only part of the solution. When I connected the Logic analyser, it worked. When I disconnected, it stopped working. The logic analyser input has a 100kOhm pull down resistor. I also had to add a small (27pF) capacitor in parallel with the resistor. This is on the clock line and seems to filter enough for proper operations.

    I hope we have found a stable solution.

    • R4C3R

      Member
      May 18, 2023 at 12:28 pm

      Hello Wim,

      We ran into the same problem, did your solution result in a stable situation?

      I will try your solution.

      Regards,

      Rolf

      • R4C3R

        Member
        May 22, 2023 at 9:07 am

        It took me quite a while to figure this out, especailly as the code worked flawlessly on anArduino MEGA but not on a Controllino MEGA.

        So, I hope this post saves someone else time.

        On the internet I found this hint: “….However, it can be good to put a pulldown on the MISO line. That is because this line is only driven by a slave when it’s slave select line is asserted. When the bus is not used, all slave select lines are usually unasserted, so MISO floats…..”
        (source: https://electronics.stackexchange.com/questions/234703/spi-bus-termination-and-pull-up-resistors)

        After soldering a 100k between MISO & GND the SD Card adapter worked flawlessly on the Controllino MEGA as well.

        PS: Is there a way to upload an image in the forum so I can show the mod I did?

        • Fruitdas

          Member
          May 22, 2023 at 9:37 am

          Thank you very much for the extra information.
          I have implemented several improvements and got it working somewhat stable, but still not perfectly. I will add this solution as well. What I did was the following:

          – Added a shielded cable with a ferrite bead.
          – Added a powerline filter.
          – Cleaned up the code and implemented a more robust solution.

          I hope this might help with further issues.

        • R4C3R

          Member
          May 29, 2023 at 2:25 pm

          Unfortunately the solution works but it is not stable. After a few log entries the SD card gets corrupted and the data is no longer accesible. We use class 10 Samsung SD cards, I don’t think it the quality of the SD card is the cause, we also tried other A-brand cards with the same results. Maybe someone @ controllino can test an SPI SD card adapter and suggest a stable solution for logging data to the SD card.

  • Lukas

    Member
    May 31, 2021 at 10:51 am

    Hello Wim,

    yes, you have to configure the RTC and Ethernet chipselect signals to be able to use SPI on the CONTROLLINO pin header. Controllino_RTC_init() will do this for you.

    Regarding the SPI clock filtering … this is little bit strange. Which SPI speed do you use, please?

    Thanks,

    Lukas

    • Fruitdas

      Member
      May 31, 2021 at 11:48 am

      Hello Lukas,

      We use a flatcable from the Controllino to the screen/SD card. SPI is not really made for over wire transmission and glitches can occur. There is 400V running next to the controllino/screen and even this filtering is not enough. We will move to a shielded cable as well for improved performance. Cable length is about 350mm.

      Since the connectors on the Controllino are not pin compatible to Arduino, it would have been good if they were DB25 connectors or something similar. Those are easier and better to connect to and also more robust compared to flatcables. For prototyping, other equipment can be used.

      Regards,

      Wim

      • Lukas

        Member
        June 15, 2021 at 10:36 am

        Hi Wim,

        thank you for the idea. I will forward it to the responsible person 🙂

        Lukas

  • Johi

    Member
    July 10, 2021 at 1:11 pm

    Hello Wim,

    I might have a solution for you that lets you record all your variables of your press over ethernet into a PC?

    It is a standard package that i have made, it records over serial, ethernet, wifi, udp, tcp … for each variable you need 1 line of code.

    This is a video of the serial version, but the ethernet and others are also available.

    wawilib youtube – Bing

    If interested you can contact me via PM or via the links on my site.

    Best regards,

    http://www.SylvesterSolutions.com

Viewing 1 - 4 of 4 replies

Log in to reply.

Original Post
0 of 0 posts June 2018
Now