• AVR Freaks

Hot!Easy example code for reading information on the i2c slave (PIC16F1825)?

Author
kart
Starting Member
  • Total Posts : 49
  • Reward points : 0
  • Joined: 2016/12/01 07:55:28
  • Location: 0
  • Status: offline
2019/04/08 02:43:20 (permalink)
0

Easy example code for reading information on the i2c slave (PIC16F1825)?

Dear all,
 
I want to distribute my robotic controlls to several PICs. My goal is to control every axis of my robot (including the end switches) via one PIC which are steared by a main controller.
 
To accomplish this I want to setup the PICs as i2c slaves. All they have to do is read information pushed by the master (8Bit) and then act according to the informations sent with the bitmask (direction, number of steps,...).
 
So far I have used MCC to get the slave setup and setup of the i2c adress on the PIC side.
 
As I haven't got any hands on experiance with i2c I would be very glad to get a pointer to a easy short example showing how implement this (reading information sent by the master).
 
thanks
Michael
#1

1 Reply Related Threads

    leadinglights
    Super Member
    • Total Posts : 392
    • Reward points : 0
    • Joined: 2003/11/07 12:41:48
    • Status: offline
    Re: Easy example code for reading information on the i2c slave (PIC16F1825)? 2019/04/08 06:35:17 (permalink)
    0
    Although I have not previously used a PIC micro as a slave yet I also now need to do so. I have found the following which you may find helpful.

    http://ww1.microchip.com/...appnotes/00000734c.pdf

    https://www.allaboutcircuits.com/projects/program-a-pic-chip-as-an-i2c-slave-device-for-custom-sensor-and-i-o-interfa/
     
    Mike
    #2
    Jump to:
    © 2019 APG vNext Commercial Version 4.5