Hi Everyone,
I've been facing difficulty in writing code in call back functions of i2c.
I mean I am totally blank.
Please help me.
I am trying to communicate in between LPC936.
I have programmed one as Master and the other as slave.
Thanks in Advance! Kaustubh
Thanks Erik!
I got my output.
Thank you! :-)
Kaustubh
as a matter of fact I do rccall correctly. I once used this as a base for something
Erik
I am sorry previously i hadn't mentioned Micro-controller used.
I am using P89LPC936.
And the problem i had discussed was seen on hardware.
Thanks!
Thanks Eric for your help! But I am gonna need more of it.
I have configured one Micro-controller as slave with address 0x01(I2ADR=address<<1. Therefore I2ADR = 0x02).
Now Master (another Micro-controller) calls slave i2c_receive(0x01). But unfortunately Master enters status, slave address + read transmitted, NACK received.
Now I2DAT in master is 0x03 i.e 0000 001 for address and LSB = 1 for read.
Please help me!
Where possibly did I go wrong?
Thanks in advance!
I might have been a bit fuzzy
The only 'response' a receiving slave has is ACK or NAK.
The only 'response' a receiving slave has to a master transmit is ACK or NAK.
If data is transmitted by master and received by slave and slave responds to masters' call, where is I2DAT value actually transferred from and where is it received?
as said before you need to read up on the I²C protocol.
Thank you Everyone!
But still I have one doubt.
one asimpe way to remember: An I²C slave can not 'send', it can only 'respond'
So you'd better start with some really basic documents, and really basic examples - then work your way up...
I2C transactions can be performed without callback functions.
View all questions in Keil forum