I am using ALFAT SD Module as data storage.
I want to write 160 byte data to SD Module with a period of 40 ms.
But the communication between SD Module and a microcontroller is stopped immediatly after power on.
How can I write 160 byte data to SD Module.
just checking. Have you tried writing 40 bytes (or some smaller number) every second (ie not very frequently) and that work? Or have you never had ALFAT working on your microcontroller?
Thank you for your comments.
I can write 16 bytes every second, but can’t write larger data.
This is first time to use ALFAT module.
ALFAT module is running correctly, because I can read time and date and write 16 bytes data to the SD card.
ok, so changing one thing, and one thing only, at a time… Can you write 80 bytes per write, every second? 100 bytes every second? 120? 140? 160? 180? 240?
That proves your code works for those byte counts.
Then, for 40 bytes per write, can you do that every second, then twice per second, then 3x per sec, etc.
Using this will show you the limits of your code/microcontroller/SD card that you have.
regarding this:
I asked, because in your original post you said:
[quote=“Yuya, post:1, topic:21944”]
But the communication between SD Module and a microcontroller is stopped immediatly after power on[/quote]
which made me wonder if you had no comms to ALFAT at all… but that’s not the case. Go do some more tests and tell us what you find
What kind of interface do you use? UART or I2C or SPI??
I am making a system that writes 512 bytes of data every second, but there is no problem at all.
For example, what is the return code after sending the following command from the microcontroller?
O 1A>M:\LOG.TXT
W 1>A0
-----160bytes data-----
C 1
It takes about 132 milliseconds by actual measurement until !00 is returned by executing the normal W command. (@115.2kbps UART)
So if you are executing the W command every 40 milliseconds, it will not be enough.
More than 40 milliseconds elapse while one W command completes.
If the microcontroller is checking the ACK for each command ( O, W, C …etc…) , it is impossible to write data every 40 milliseconds.
You need to check the signal with a bus analyzer or an oscilloscope.
Please upload those images and ask questions to solve the problem.