The project is writing and reading (on/from) a 1Mb memory with I2C. We have used the Panamahitek library in Java for communicating with Arduino and serial port. It can read and write (from/on) the memory of about 4 to 5 minutes. But we miss some addresses during this process. I think the main reason is getting full of UART buffer. With adding delay, the problem is disappearing but it takes time a lot about 45 minutes or 1 hour. How can I solve the problem? (It is working very slowly)
Serial.begin(200000); //Serial port initialisation
Generally many errors occur when using speeds above 115200 for serial communication with low quality cables, especially in noisy environments, noisy power supply also harms.
To avoid data jamming, you can use a traffic control, usually the receiver responds that they are ready to receive more data, flow control can be done by software or hardware, in case of simple serial port (only with RX and TX) will have to be via software.
Is it Arduino which is reading data from a 1Mbyte capacity EEPROM using I2C Bus and then sending them (the data) to a destination (PC or whatever it is) using UART Port? Put your sketch on line with code tags (</>). What is the type number of the EEPROM?
I have never had a problem operating at 500,000 baud between my Arduino and my PC programs. Nowadays they are written with Python but a while back I was using JRuby which is based on Java. I don't recall ever taking any trouble to select my USB cables.
Can you write a short program that illustrates your problem? Problems like this should be eliminated long before a program grows to 10k in size.
Thanks, rtek100 for your response!
Also, I have checked with different baud rate and the same problem is appearing (115200 and lower). Can you guide me more using traffic control by software?
g_krn:
Robin2, sorry I couldn't understand your meaning. I had sent all the program yesterday. Please let me know what you mean?
I thought your Reply #6 was a response to my suggestion in Reply #3 to write a short program that illustrates the problem.
For example, I have been working on a Python program that uses a browser. There was a big problem with one part when I tried it on Windows. Writing a 17 line HTML file enabled me to understand the problem and devise a solution.
g_krn:
Thanks, rtek100 for your response!
Also, I have checked with different baud rate and the same problem is appearing (115200 and lower). Can you guide me more using traffic control by software?
Maybe this post can give you some direction about this:
This article will explain the following topics in details:
Step 1: Understand RS232 Connection and Signals
Step 2: Learn about the Protocol
Step 3: Control your RS232 devices by using 232Analyzer