Well well, where to begin…
I am using several Arduinos networked via I2C (and Serial, I’ll get to it) to eventually transmit all the datas to the PC via RS232 to log a series of comma separated printed values.
… and of course nothing is working as it should!
So first in line : the I2C was acting up but my cable was around 600pF so out of spec for I2C, I replaced it with 2meters of CAT5 cable and it was ok.
But this solved, time for the real problems :
- For some reasons, the communication between the Arduino reading the thermocouple values and transmitting on I2C request and the “main” / logging arduino doesn’t work. The main only reads bytes @255 (except for the first byte which does return the internal T° value).
- The RS232 to the Arduino MEGA is quite unstable and erratically returns values of 128, I guess this has to do with it being software serial but then again the UNO only has one hardware RS232…
- Conequently, I have to set the polling of the ADC to only once every 500mS or otherwise the RS232 from the mega doesn’t work. I guess it’s also related to it being bit-banging but I’d like a confirmation if possible…
- And on a more hardware level, when I scoped my I2C bus (WITH the 600pF cable!) the rising edges were nice and quick (go figure…) but I had also 1MHz spikes in between the clock tops… What the hell is that!!!
I’m using freqmeasure library which (I guess) is using a timer, would it have anything to do with it?
Attached is a printscreen of the scope reading.
Also a very badly done schematic of the general architecture and the sketches from the Main Arduino & The TK multiplexer.
Thanks for your help everyone!
ArduinoSketches.zip (6.5 KB)