hi aim implementing i-button interface to lpc2148 using ds2482 1-wire to i2c bridge. my problem is i am using hardware i2c controller in lpc2148.i am writing 3 routine 1 detect the i button 2 read i-button 3 write i-button each routine using i2c interrupt.i seen some example in that all i2c code are written in side the interrupt routine only. im confused about how can i uses the interrupt routine for 3 main routine. and can i enable the i2c and initiate start and send slave addresses and receive the acknowledgment and come back from interrupt routine and do some work in main routine and again enter to i2c interrupt routine and continue the next i2c operation
It is trivial to bit-bang the one-wire protocol. The only real problem is if the processor is constantly busy, not having any time slots available where it may busy-wait for the bit delays and with multiple (or slow) high-priority interrupt routines that makes it hard to figure out a worst-case scenario.
Since everything in the one-wire interface is handled with varying pulse lengths, delays may only deviate with a few us.
"Since everything in the one-wire interface is handled with varying pulse lengths, delays may only deviate with a few us."
Note that timing only needs to be controlled within a timeslot - the timing between timeslots is completely uncritical.
Yes, infinite pauses are allowed, as long as they are not put within a bit read, bit write or presence detect. And a reset may be infinitely long.
If the target has other very high-priority tasks, the one-wire communication can be an interesting exercise in time multiplexing.