Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Difference between Software and Hardware I2C

Status
Not open for further replies.

tahir4awan

Full Member level 4
Joined
Nov 29, 2010
Messages
208
Helped
16
Reputation
32
Reaction score
17
Trophy points
1,308
Location
Germany
Activity points
3,084
Hi guys I have a problem and I hope you will help me.
I was writing program to simply read/write operation of I2C EEPROM. I did every thing but the program didn't work. Note that I was testing EEPROM on REAL PIC SIMULATOR. After searching MikroC manual I saw there are two library functions of I2C one is software I2C and Hardware I2C. This confused me because EEPROM is a hardware then where did the word software come from?

What I have understand is that software I2C library routines are for testing program on PC. While Hardware I2C library routines are for real world testing.

Please explain the difference?
 

It specifies if you wil use built-in I2C module form uC or if you will handshake signals by firmware.

+++
 

Hello,

Hardware I2C uses a piece of logic in the chip to automatically drive an I2C compatible output. You basically just throw your data at a register and it pretty much does the rest.

Software I2C requires the processor to basically repeat the operation of the inbuilt logic. Therefore your program has to do a lot more to output the connection. The upside to this is you are no longer tied down to which specific I/O pins you have to use.

I've never used the sim your using so I cant comment but I always prefare the actual hardware so you know for sure. You will also need external pull up resistors on your clock and data lines.
 

The great advantage to operate I2C protocol at Firmware instead Hardware is code portability ( talking about C language programming ).
Once at each uC you need access built-in hardware module via specific API by sintax commands allways not standardized, the program become strongly dependent of the core/compiler to wich were primary developed.

+++
 

What I understand that if you use builtin MSSP module which has default pins you have to use hardware I2C library
and if you don't want to use builtin MSSP module and want other pins to work as I2C module you use software I2C library.
am I right?

But i was using hardware library routines and was checking it on Real Pic Simulator. It didn't work
Then I used software library routines and assigned the default MSSP module pins it worked. Though it is working abnormal but atleast it is giving response.
 

I noticed the same behaviour at PIC16F87x with CCS compiler, at real-world circuit, not simulator.
Coincidentally, I had to change the mode from Hardware to Firmware, but I had not time to investigate the reason at that moment.

+++
 

andre_teprom I asked a very simple question about these two statements
"If you use builtin MSSP module which has default pins you have to use hardware I2C library."
and
"If you don't want to use builtin MSSP module and want other pins to work as I2C module you use software I2C library."

Am I right about software and hardware I2C library routines?
 

Thanks andre_teprom you have cleared a big confusion.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top