This is kind of a new direction, but people on this thread may be curious - I am trying to program a smart battery (smbus master), to recognize whether or not a level 2 smart charger (smbus slave) is attached to it. I figure if the charger is not there, I could look for an acknowledge bit to be false when I send the charger address. The problem is, the ACKSTAT bit never sets and is always low (asserted) with no charger present. I thought it would be easy because the master is just talking to an open bus (with pullups attached), but it won't work for me. Here is my code:

SSP1CON1 = %00101000 'MSSP1 is the smbus master
SSP1CON2 = %00000000 'default
SSP1ADD = $27 'baud rate for 100KHz smbus (16 MHz osc, PIC18F67K90)

SSP1IF = 0 'reset interrupt flag
WCOL = 0 'clear the collision flag
SEN = 1 '(SSP1CON2.0) initiate smbus START
DO WHILE SEN = 1 'wait for start delay to complete
LOOP
SSP1BUF = $12 'send address 18 (level 2 smart charger)
SSP1IF = 0 'reset interrupt flag
DO WHILE BF = 1 'wait for buffer to empty
LOOP
IF ACKSTAT = 1 THEN.....(skip smart charger module)

The hardware is functioning correct - the /ACK bit is high at the falling edge of the ninth clock with no charger. I tried to use I2CWRITE but it hangs up for some reason and my 1 second watchdog resets the pic.