you can change the pin numbers to match your wiring: If you can see the I2C communication is intense to accentuate this behaviour, Also, I rarely miss a byte sent by master.The LDF seems to have a problem here. I believe that under the hood Wire and SoftwareSerial are using someting common that makes interfere with each other. So, the conclusion is that i cannot use Wire in conjunction with SoftwareSerial because SoftwareSerial will be messed up. If a decrease the speed for SoftwareSerial, the problems appears more rarely. Only using a Serial1 instead of a SoftwareSerial makes the those problems disappear. I switch the FONA on Arduino Mega, using different pins - same result. (attering = changing, not adding or cutting characters) If I send response to master (write), the output communication with SoftwareSerial is also destroyed, altering characters. When a communication takes place in I2C, the interrupt is messing up the input from SoftwareSerial, receiving altered chars (garbage). I am using SDA/SCL pins and a common GND for I2C and pin 3-4 for FONA. The problem is that the input from SoftwareSerial is altered when I2C is working. This is where I communicate with FONA 800 using SoftwareSerial this function is registered as an event, see setup() function that executes whenever data is received from master Wire.onReceive(receiveEvent) // register event Wire.begin(8) // join i2c bus with address
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |