View previous topic :: View next topic |
Author |
Message |
JAM2014
Joined: 24 Apr 2014 Posts: 138
|
I2C Scanner |
Posted: Thu Mar 15, 2018 1:26 pm |
|
|
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
|
|
Posted: Thu Mar 15, 2018 1:34 pm |
|
|
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
|
|
Posted: Thu Mar 15, 2018 1:42 pm |
|
|
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
|
|
Posted: Fri Mar 16, 2018 12:54 am |
|
|
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
|
|
Posted: Fri Mar 16, 2018 8:55 am |
|
|
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
|
|
Posted: Mon Apr 02, 2018 7:08 am |
|
|
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
|
|
Posted: Mon Apr 02, 2018 7:22 am |
|
|
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 |
|
|
|