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.

I2C function routines in C for interfacing a micro

Status
Not open for further replies.

arup

Member level 2
Joined
Sep 6, 2004
Messages
46
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
441
I2C programming

hello,

I am new to microcontroller based applications.right now i am using a micro(ST7FLITE09) which is not having a I2C port.i need to communicate with 24c08.How can i do that...I need to write a software emulated code for interfacing the micro with eeprom.i know the steps..start+slave addr+r/w+ack+location addr+ack+data+........+stop
Can anyone help me giving some code written in C...What way i can write all those routine. what way and how can i make low & high those SDA & SCL lines...
pls help.


thanks,
arup
 

Re: I2C programming

What way i can write all those routine. what way and how can i make low & high those SDA & SCL lines...

Simply, put pull up resistor 4k7 on two (output) pins of mcu and thats it.

I will upload routines when I came home from work.

Tip: try to find routines on board, you're not first one which need those routines, or try with google.


Mr.Cube
 

Re: I2C programming

The attached zip includes software implemented I2C routines for the PIC and may be a useful starting point.

To view the schematic you will need a demo version (or better) of Proteus.

Iain.
 

Re: I2C programming

If your controller is not having I2C support. You can use port pin for this.
If you are interested in assembly written code then search on phillips semiconductor url. It is given there.
Any other supprt related to I2C write me???
 

Re: I2C programming

hello,
can anyone pls give I2C coding written in C.


Thanks,

arup
 

Re: I2C programming

I have write i2c function code in C. You can reference the code in attachment.
 

I2C programming

hello arup, there are free I2C routines both in C and assembly available in internet ( I believe you can find a good one in philips site). I suggest you first go to philips site and read I2C manual and understand I2C protocol thoroughly, because if you are planning to use a pre-written routine without understanding I2c there s a great chance that you will end up with spending much more time for troubleshooting
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top