I2C library for Pic16F

Discuss with MikroElektronika software developers about current library development.
Post Reply
Author
Message
nadeemkhan
Posts: 3
Joined: 25 Jan 2018 16:23

I2C library for Pic16F

#1 Post by nadeemkhan » 25 Jan 2018 20:05

Hi There,

I am using PIC16F913. This microcontroller has SPI and I2C. I have EasyPIC6 development board and MIkroB. I used SPI library without issues.
Now I am trying to use I2C library however I am unable to find I2C library in library manager.

Can someone please point me in the right direction where I can get this library? Or what do I need to do to enable this library in library manager?

Thanks in advance

User avatar
strahinja.jacimovic
mikroElektronika team
Posts: 200
Joined: 18 Dec 2017 18:19

Re: I2C library for Pic16F

#2 Post by strahinja.jacimovic » 26 Jan 2018 11:07

Hi,

The main reason for that is because PIC16F913 doesn't have MSSP(master synchronous serial port) but instead has SSP(synchornous serial port).

An MSSP adds logic to act as a Master I2C device. An SSP can only act as a slave, you have to "bit-bang" to act as a master.

Additionally, the SSP-module doesn't support the General-Call-Address (slave-mode), which the MSSP-module supports.

That's the reason why there is no library.

As I mentioned before, you would have to "bit-bang".

Bit banging is a technique for serial communications using software instead of dedicated hardware.

Software directly sets and samples the state of pins on the microcontroller, and is responsible for all parameters of the signal: timing, levels, synchronization, etc.

In contrast to bit banging, dedicated hardware (such as a modem, UART, or shift register) handles these parameters and provides a (buffered) data interface in other systems, so software is not required to perform signal demodulation.

Bit banging can be implemented at very low cost, and is used in, for example, embedded systems.

Kind regards,
Strahinja Jacimovic

nadeemkhan
Posts: 3
Joined: 25 Jan 2018 16:23

Re: I2C library for Pic16F

#3 Post by nadeemkhan » 26 Jan 2018 19:37

Thank you Strahinja.

nadeemkhan
Posts: 3
Joined: 25 Jan 2018 16:23

Re: I2C library for Pic16F

#4 Post by nadeemkhan » 30 Jan 2018 02:20

Hi Strahinja,

DO you have an example of I2c bit banging?

Thanks

User avatar
strahinja.jacimovic
mikroElektronika team
Posts: 200
Joined: 18 Dec 2017 18:19

Re: I2C library for Pic16F

#5 Post by strahinja.jacimovic » 30 Jan 2018 16:44

Hi,

I believe you have something regarding this matter here:
viewtopic.php?f=13&t=67971&view=previous

Kind regards,
Strahinja Jacimovic

Post Reply

Return to “Library Development Discussion”