element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Embedded and Microcontrollers
  • Technologies
  • More
Embedded and Microcontrollers
Embedded Forum I2c peripheral library for PIC24 and example code for I2C for PIC24
  • Blog
  • Forum
  • Documents
  • Quiz
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Embedded and Microcontrollers to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 2 replies
  • Subscribers 474 subscribers
  • Views 2093 views
  • Users 0 members are here
  • i2c
  • pic24 i2c
Related

I2c peripheral library for PIC24 and example code for I2C for PIC24

vchop003
vchop003 over 7 years ago

Hello,

I am working on PIC24 and Would like to have the I@C example code for PIC24 and I2C peripheral library for PIC24.

Please suggest some documents and code. Thank you in advance!!

  • Sign in to reply
  • Cancel

Top Replies

  • genebren
    genebren over 7 years ago +3
    Greetings, I did a really quick google search and came up with the following hits: https://www.microchip.com/forums/m745734.aspx I2C Library https://engineering.purdue.edu/ece477/Archive/2009/Spring/S09…
  • 14rhb
    14rhb over 7 years ago +1
    Hi Vishal, Which toolchain are you using for development? If you are using MPLAB X or MPLAB Xpress IDE (the cloud based version) then you can use an add in tool called Microchip Code Configurator (MCC…
  • genebren
    genebren over 7 years ago

    Greetings,

     

    I did a really quick google search and came up with the following hits:

    https://www.microchip.com/forums/m745734.aspx

    I2C Library

    https://engineering.purdue.edu/ece477/Archive/2009/Spring/S09-Grp06/Code/PIC/pic24_code_examples/docs/textbookexamples.h…

     

    Hopefully one of the above links will be helpful to you.

    Good luck,

    Gene

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • 14rhb
    14rhb over 7 years ago

    Hi Vishal,

     

    Which toolchain are you using for development?

     

    If you are using MPLAB X or MPLAB Xpress IDE (the cloud based version) then you can use an add in tool called Microchip Code Configurator (MCC) to make things a bit easier. In MCC you select the peripherals you want to work with using an intuitive GUI - then you click generate code and all the skeleton code is generated for you. You then just have to utilise it i.e. call the function to send a byte out, poll the interrupts for a I2C byte received.

     

    The nice thing about MCC is that it draws to your attention all those register flags that are required to get something working. If you work directly from the datasheet you can sometimes omit to set a single bit and .....nothing happens !

     

    regards,

     

    Rod

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube