Page 1 of 1
Using 2 threads with i2c
Posted: Tue Feb 05, 2013 7:33 pm
by paul42
I have 2 pcbs on my i2c buss on different addresses. I want to talk to each from a separate python thread.
Will the Quick2wire i2c module take care of near simultaneous writes to the buss or must I use a single thread to keep things in order?
Thanks Paul
Re: Using 2 threads with i2c
Posted: Tue Feb 05, 2013 7:50 pm
by joan
I don't know but it sounds like a bad idea. "Hardware/firmware" is best used by one chunk of "software" at a time.
Re: Using 2 threads with i2c
Posted: Tue Feb 05, 2013 7:51 pm
by techpaul
As it is a bus, it should be possible as the driver queues the transactions internally.
Why not try it anyway
Re: Using 2 threads with i2c
Posted: Tue Feb 05, 2013 8:05 pm
by paul42
I will give it a try. One thread reads an 8 ch ADC & the plan is for the other to write to a 16 x 4 line lcd.
Currently I write to the lcd using the onboard serial but the system crashes after a couple of days. I am running a test now with the serial disabled to prove that's my issue.
I can use either for the lcd as I am using the Hobbytronics lcd backplate.
At first I thought my crashes were due to the usb serial cable to the mobile phone my program uses to send & receive texts, but I have had it running a test program accessing the phone every minute for just over 3 days with no problems.
Paul