Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

I2C communication between PIC24f and PIC18F

Status
Not open for further replies.

puneetnepsam

New Member
Two microcontrollers 18f and 24f are connected through a I2C interface. i want to test that I2C interface.

18f i2c address is 1000001......

i have sended the command
send_i2c_byte(0x82)....//write mode

and then sended some data eg.

send_i2c_byte(0x02)

should i receive this data automatically to the I2C recieve register of the 18f?

thanks in advance
Puneet
 
If you have the settings right, after you send the address and have the last bit high (to indicate you want a receive), the PIC should have a register that will fill up with the next transmission from the slave.
 
i want to send a data to the pic 18f controller's eeprom

if i send the address of the pic in the write mode

i.e. 10000010 (0x82)

and then i send the data through the bus.....
can i receive that data onto the i2c receive register of pic 18f??

so that after taking the data from the register, i can put it onto my eeprom location
 
I've never implemented an I²C slave but I would imagine that as long as you write 0x82 to the SSPADD register of the slave then it would work as you describe. You may have to check the D/A bit in SSPSTAT to differentiate between the address and data bytes.

Be aware that writing to EEPROM is slower than I²C and so you may have to implement clock stretching.

Mike.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top