MemberMay 25, 2021 at 10:13 am
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.
MemberMay 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:
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.
MemberMay 18, 2023 at 12:28 pm
We ran into the same problem, did your solution result in a stable situation?
I will try your solution.
MemberMay 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…..”
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?
MemberMay 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.
MemberMay 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.
MemberMay 31, 2021 at 10:51 am
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?
MemberMay 31, 2021 at 11:48 am
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.
MemberJune 15, 2021 at 10:36 am
thank you for the idea. I will forward it to the responsible person 🙂
MemberJuly 10, 2021 at 1:11 pm
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.
If interested you can contact me via PM or via the links on my site.
Log in to reply.