Well, I installed Arduino IDE 1.0.5 and try to establish connection with no success. Then I connect 2 Arduino Leonardos (so 1 Leonardo for master and 1 Leonardo for slave, instead of DUE for master) and get half of communication successful established. Then I tried to program Leonardos (master and slave) with IDE 1.5.2 and it is working the same way as with IDE 1.0.5.
Arduino IDE is not causing problems.
Looks like something is wrong on master (DUE) hardware part. I will try to figure this out but untill I find a solution, I will work with 2 Leonardos.
Here I am for now: I have changed libraries to work with Leonardo (Serial.xxx to Serial1.xxx) and IDE 1.5.2 (no parity and stop bits selection). I have successfuly establish connection in one way: Master->Slave. With potentiometer on master side I can regulate LED connected to PWM pin on slave side. Slave is responding to master request (watched on oscilloscope), but master somekind does not proccess informations that he gets. So I can not regulate LED on master side over potentiometer on slave side. Also master stops sending request to slave after 10 requests sended to slave (when retry_count is set to 5).
Problem is:
- master send request to slave,
- slave gets request (physical, measured with oscilloscope),
- slave process request,
- slave returns answer to master
- master gets answer (physical, measured with oscilloscope)
6) master do not process slave answer
After 5 requests (10 actually: PRESET_MULTIPLE_REGISTERS - 5 times and READ_HOLDING_REGISTERS - 5 times), master stops sending request to slave, due to retry_count which is set to 5. If I set retry count to 5000000, it still stops sending requests.
What can be wrong?