View previous topic :: View next topic |
Author |
Message |
fmesquitta
Joined: 05 May 2009 Posts: 3
|
PIC24 (MASTER) Vs PIC18 (SLAVE) I2C PROBLEM |
Posted: Thu Aug 07, 2014 9:04 am |
|
|
Hello,
I am experiencing a trouble with I2C communication between two PIC microcontroller. The fact is that I have two boards, with PIC 18 (18F6722 and 18F8722) communicating without trouble. That one which uses the 6722 is a master by software and the other is the slave by hardware. The problem is that we are updating a product with a better HMI using a 24EP512GU814 microcontroller. For some reason I cannot explain the communication starts but hangs up after some time. When I look to the SCL and SDA lines I see something weird: there is something that seems to be data in the SDA while there is no clock in the SCL. I have already tried to use the PIC24 I2C master by hardware and by software and nothing different happens. I am actually using the CCS compiler, but same thing ocours if I use the my own routines based on 70000195f.pdf document from microchip website. Have ever anyone seen something like this? Any idea?
In the first image attached we see an overview, in the second we can see the the normal communication and finally in the third image we can see the starts and stops in the SDA line while in the SCL line there is no clock.
https://www.dropbox.com/s/mrli30t7blas1gr/imagem1.jpg
https://www.dropbox.com/s/mcaiv0z6jcffxi7/Imagem2.jpg
https://www.dropbox.com/s/lwbk5xwd84v19ur/Imagem3.jpg
Hi people.
Links from dropbox were updated and tested.
Dear temtronic,
I have already tryied versions 5.021, 5.024 and 5.026
Last edited by fmesquitta on Mon Aug 11, 2014 9:12 pm; edited 2 times in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Thu Aug 07, 2014 9:18 am |
|
|
you need to show us a small,compilable program that has the problem. While I don't use the 24 series, there's probably a fuse or peripheral setup you need to do or it could be a compiler versions bug so you need to tell us your version.
the more data you supply the easier it is to diagnose !
hth
jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 07, 2014 2:57 pm |
|
|
Images 1 and 2 don't load for me. I dropped the URLs into Firefox and
at the Dropbox website, it just says "imagem1.jpg" and "File uploading...".
This goes on forever. Same thing for Image 2.
Image 3 does load, and on the top trace (SDA) I see bus activity, and
on the lower trace (SCL), I see packets of clock pulses. I don't see a
problem on Image 3. |
|
|
fmesquitta
Joined: 05 May 2009 Posts: 3
|
PIC24 (MASTER) Vs PIC18 (SLAVE) I2C PROLBEM |
Posted: Wed Aug 13, 2014 1:29 pm |
|
|
Nothing yet people? No Idea? |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9225 Location: Greensville,Ontario
|
|
Posted: Wed Aug 13, 2014 1:59 pm |
|
|
without seeing your code it's near impossible to decide which of 100 things it could be !
create a small compilable program that shows us the problem.
first thing I would do is cut code on the 'new' master to interface with a HARDWARE I2C device( say an RTC chip) that is known to work.Use PCM's 'I2C scanner program to verify the master sees it. VERIFY that the master is working correctly.
you could have a hardware issue ( ie wiring or pullups or bad PCB etches).
you could have a bad 'slave' issue, confirm it qorks 100% with a KNOWN good master.
a marginal power supply could be an issue.
hth
jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 13, 2014 2:33 pm |
|
|
I suspect you are writing your own code and not using CCS i2c routines.
Post your master and slave test programs. Cut the code down to the
minimum necessary to show the problem. Test it, to prove that it still
causes the problem, then post it.
Also post your compiler version.
Also post a description of your hardware test setup:
1. Vdd voltage for each PIC.
2. Pull-up resistor values on the i2c bus.
3. Pull-up resistor voltage.
4. Any other circuits connected to the i2c bus, other than the pullups,
such as FET i2c level converters, etc.
5. What is the distance between the two i2c PICs (master and slave) ?
Are they on the same board ? Are they on different boards, but
connected by a cable ? Describe the cable, length, type, etc. |
|
|
|