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 Scanner

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



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

I2C Scanner
PostPosted: Thu Mar 15, 2018 1:26 pm     Reply with quote

Hi All,

I've got a new design with a DS3231 RTC connected by I2C. This is not the first time I've used this part, and I've never had issues before. This time, however, I can't get the part to work.

I have 3K resistors pulling up the SDA and SCL lines. I have a 3.0V coin cell connected to the 'Bat' terminal. All signals ring out correctly, but still no luck!

I tried PCM's I2C scanner, but it reports an 'ACK' at every address, for a total of 112 I2C devices found...... Is this indicative of a particular problem?

I'm using a 18F44K22 device with the internal 8MHz oscillator. SDA is pin C4, SCL is pin C3.

Compiler is 5.050, which I have used on other projects with the DS3231, but with a different PIC.

Board is running, and at the correct speed as verified by a blinking LED and serial data transmission to Hyperterminal.

A bit stumped here at the moment!

Jack
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Thu Mar 15, 2018 1:34 pm     Reply with quote

All addresses giving ACK, is normally a sign of the clock line being held low....
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Thu Mar 15, 2018 1:42 pm     Reply with quote

hmm. I've got the DS3231 running fine on an 18F46K22@8MHz, 4k7 pulls, Vdd=5V.
The DS3231 is on a PCB with an Atmel 24C32 EEPROM, but I use the '7 alarm bytes as battery backed RAM.
I have seen where I2C goes 'funny' with the clock > 16MHz though.

I'm thinking a possible short trace on the PCB ? Please post when you figure it out.

Jay
JAM2014



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

PostPosted: Fri Mar 16, 2018 12:54 am     Reply with quote

Hi All,

Both C3 & C4 can be toggled hi and lo, and each line goes hi when they are floated. I’ll have to check SDA & SCL with a scope to see what is going on. Unfortunately that has to wait 2 weeks as I’m traveling now.

Thanks,

Jack
Ttelmah



Joined: 11 Mar 2010
Posts: 19496

View user's profile Send private message

PostPosted: Fri Mar 16, 2018 8:55 am     Reply with quote

Are you sure you are setting the I2C to a rate that works with the chip?. Start at 100KHz. The other reason for getting all addresses acknowledged, is just trying to clock the bus much too fast.
Also when checking toggling, test one line at a time, and make sure that no other lines are moving at the same time.
JAM2014



Joined: 24 Apr 2014
Posts: 138

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 7:08 am     Reply with quote

Ttelmah wrote:
Also when checking toggling, test one line at a time, and make sure that no other lines are moving at the same time.


This suggestion led to finding the issue, a whisker of copper shorting the SDA and SCL lines right at the chip. I passed an x-acto blade between the adjacent pads on the IC foot print, and voila!, it started to work!

Thanks all!

Jack
temtronic



Joined: 01 Jul 2010
Posts: 9221
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Apr 02, 2018 7:22 am     Reply with quote

Sure glad you're 'up and running' ! Since SMD came out and the 'need' for itty-bitty ultra tiny PCBs, someone's made a pile of money selling HUGE magnifying glasses. I still prefer DIPs and premade modules, as I mainly do 'Proof of Concept' designs now, prefer that to full fledged productions these days.
Jay
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