CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I2C slave reactions to SDA+SCL locked low by master

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
bdeb



Joined: 05 Nov 2010
Posts: 42
Location: Sweden

View user's profile Send private message Visit poster's website

I2C slave reactions to SDA+SCL locked low by master
PostPosted: Mon Aug 17, 2020 1:54 pm     Reply with quote

CCS 5.075 MPLAB-X 5.15 PIC16F18346 @3.0V

Dear gurus,

Sorry to take your time, since this may well be a Microchip hardware question. I'm making (yet another) I2C slave connected to a GSM module.
PIC controls GSM on/off - but GSM is I2C master when active.

Problem is that this GSM module locks SDA+SCL low when off. I get fair warning before turning off, but I don't know what action to take!

PIC data sheets and NXP UM10204 give me no clues to this condition. What have I missed?

At the moment I do nothing and have no problems or "false" SSP interrupts, but even that feels scary..

Considered optional bus isolators/drivers, but most are dust-size BGA and have no quiescent current specified. (PIC + sensors <40uA)
Taking the easy way out and asking you first! Wink



All the best:

/Björn
Ttelmah



Joined: 11 Mar 2010
Posts: 19509

View user's profile Send private message

PostPosted: Tue Aug 18, 2020 1:07 am     Reply with quote

This is perfectly reasonable.

Point is that I2C 'start', is triggered by dropping the SDA line, while SCL
is high. With both lines held low, this can't happen (provided the hardware
ensures that SCL drops with or before SDA).
So your chip can never see a 'start'. The I2C hardware won't trigger a byte
receive, or a stop etc., till a start has been seen, hence no false SSP
interrupts.

If you want to be really careful, the obvious thing would be when the 'off'
triggers, simply disable the I2C peripheral.

Set up your I2C, with the 'NOINIT' option.
Then at the start of your code call i2c_init(streamname, TRUE); to initialise
the I2C.
Then when the master is going to stop, call i2c_init(streamname, FALSE);
to turn off the I2C peripheral. When you want to listen again, use the
TRUE syntax to turn the I2C back on.
bdeb



Joined: 05 Nov 2010
Posts: 42
Location: Sweden

View user's profile Send private message Visit poster's website

PostPosted: Tue Aug 18, 2020 3:46 am     Reply with quote

Thank you Ttelmah,

Yes, I want to be extra careful here - will do as you suggest.

All the best:

/Björn
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group