I2C and CAN protocols not working

I2C and CAN not working in LPC1768
I am using two nos. LPC1768 header boards from different manufacturers. And if I try to communicate using I2C and CAN through both controllers, nothing is transmitting. But if I try to use UART on each controller and its working wonderful. Also whatever the I2C and CAN code written is working with other controllers which are of same manufacturers. I am not getting whats the wrong with these controllers and any hardware configuration to be changed. Also I want to know how to debug I2C protocol in this scenario and I don't have any oscilloscope or analyzer.

Parents
  • How do you know that?

    The trouble with trying to implement both ends of the link at once is that you cannot tell if the problems are in the master, or if the problems are in the slave - or both!

    So don't do that!

    Because the microcontroller as Master is by far the most common case, you should start with that - using a simple, known slave.

    See: http://www.keil.com/forum/63920/

    "I want to know how to debug I2C protocol"

    The first requirement is that you understand how the I2C protocol works.

    The protocol definition is here: www.nxp.com/.../UM10204.pdf

    There is tons of information on the interwebs; eg,

    en.wikipedia.org/.../I²C

    learn.sparkfun.com/.../all

    http://www.i2c-bus.org/

    http://i2c.info/

    At the software level, pay attention to checking status - eg, are you getting the ACK in response to the Slave address?

    Use your software debugger to step through your code and see what's happening.

    "I don't have any oscilloscope or analyzer"

    Then you need to get an oscilloscope or analyser!

    It is a hardware link - so you are going to need hardware tools!

    You need to be able to see that activity on the lines!

    There are some very low-cost (~$5) analysers available on the likes of ebay

    None of this has anything specifically to do with Keil.

Reply
  • How do you know that?

    The trouble with trying to implement both ends of the link at once is that you cannot tell if the problems are in the master, or if the problems are in the slave - or both!

    So don't do that!

    Because the microcontroller as Master is by far the most common case, you should start with that - using a simple, known slave.

    See: http://www.keil.com/forum/63920/

    "I want to know how to debug I2C protocol"

    The first requirement is that you understand how the I2C protocol works.

    The protocol definition is here: www.nxp.com/.../UM10204.pdf

    There is tons of information on the interwebs; eg,

    en.wikipedia.org/.../I²C

    learn.sparkfun.com/.../all

    http://www.i2c-bus.org/

    http://i2c.info/

    At the software level, pay attention to checking status - eg, are you getting the ACK in response to the Slave address?

    Use your software debugger to step through your code and see what's happening.

    "I don't have any oscilloscope or analyzer"

    Then you need to get an oscilloscope or analyser!

    It is a hardware link - so you are going to need hardware tools!

    You need to be able to see that activity on the lines!

    There are some very low-cost (~$5) analysers available on the likes of ebay

    None of this has anything specifically to do with Keil.

Children
More questions in this forum