Connection Problem

Hi, I am developing a small project (a people counter )with an arduino due. In the i2C port (SDA and SCL) I have connected a Panasonic Grid EYE. In the SPI port it is conected a TFT LCD from Adafruit that shows the Thermal image that the sensor provides. When I put all the code together , both things worked. When I started using the serial monitor (at 115200 baud )the LCD stoped working. First I thought that de LCD was broken and and I took it out of the project. Later I noticed that sometimes when I restart the board it takes a while to start and it works really slow until I change the USB port in my PC. I was for a certain time with this problem until I decided to try with another PC , and the same happened the program takes like 7 times more than usual :o . How can I fix this?????????
I decided to go back to the LCD option and it works , but now i need to use both things at the same time to check if the program is working fine.
I tried conecting the Due with another arduino (uno - nano) , so the Due reads the sensor and shows the thermal image in the LCD , then the number of people detected are sent to the Nano that print them on the serial monitor. But I didnt succeed in establishing the connection betwen arduinos.

Does anyone know how to solve the compatibility problem between the LCD and the serial monitor ? or how to establish the connection between the arduino due and the nano ?

This is the LCD:

You could have some blocking code parts inside the loop() , within the I2C or SPI sections of your code, interfering with Serial. I have seen several topics in this forum about issues when both SPI and I2C are used.

If this is the reason for the issue, a workaround would be to write your own non-blocking code for those parts (without the libraries). You'll need to spend quite some time deciphering Sam3x datasheet. Even though the Sam3x datasheet is ~1400 pages, reading through it is the best way to learn how to use it. It's intimidating, but as you go from chapter to chapter you will see that there are a lot of similarities in the way peripherals are setup and used.

Before going in that direction, you could:

  • try using SerialUSB (with the native USB port) instead of Serial which is much faster than Serial,
    -use the maximum speed for I2C transfers,
    -use the maximum speed for SPI transfers (see TurboSpi library for Sam3x).