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
 

mrcube_ns

Advanced Member level 1
Joined
Apr 10, 2002
Messages
452
Helped
48
Reputation
96
Reaction score
34
Trophy points
1,308
Location
Europe
Activity points
3,814
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
 

Iain

Advanced Member level 4
Joined
Jan 9, 2004
Messages
113
Helped
17
Reputation
34
Reaction score
10
Trophy points
1,298
Activity points
1,136
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.
 

sacrpio

Member level 3
Joined
May 24, 2004
Messages
56
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
500
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???
 

arup

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

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


Thanks,

arup
 

amazonite

Member level 3
Joined
Sep 1, 2003
Messages
64
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
536
Re: I2C programming

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

Bluechem

Member level 4
Joined
Sep 5, 2004
Messages
70
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
698
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

Top