Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Pic 18f45k22 i2c assembler code

Status
Not open for further replies.

Emanuele77

New Member
Hi to all,
i need a simple assembler code to send/receive data with i2c module (in master mode) on pic18f45k22 .
I have see application note AN735 but is old and written for Pic16 (can be ported to a pic18c...).

Does any of you have a simple working example written in assembler to send and receive data in I2c?


Thx
 
Welcome to ETO Emanuele . I am wondering why assembler ? . PIC18 instruction set is optimised for C . The C code gets turned into asm and compiled to HEX . What you need is doable but I see no advantage ...
 
Hi to all,
i need a simple assembler code to send/receive data with i2c module (in master mode) on pic18f45k22 .
I have see application note AN735 but is old and written for Pic16 (can be ported to a pic18c...).

Does any of you have a simple working example written in assembler to send and receive data in I2c?

Thx

Nigel Goodwin, member here, has published a series of tutorials. is precisely about I2C. It took me little time to implement two PICs linked through I2C.

Now that I think of it, IIRC, it is done bit-banging style. I think I did it with a 18F as well but not sure.

Sorry but my PC where all it is buried is defunct. No time to retrieve my data where my test is for the moment.
 
There is also AN989 for the 18F series.
I did a version for the P18F2221 in assy.
Also check out the MAXIM MAX517/518/519 IC spec sheet.
Max.
 
Thanks to all Max Atferrari Granddad ....this site is a precious resource for a designer,
now i will study on the basis of what you have suggested to me,
Hi Granddad you're right but i have to modify a program entirely written in assembler and I did not want to redo everything in c.
 
I see now... best of luck with that . I usually cannot fathom my own previous / old asm ....
 
I design machines in esthetics field,
i tend to use the microcontrollers and the programming modes i already know, already tested even if in assembler.
I realize that it is wrong but many times there is little time for design and venturing with another processor or programming mode can be risky.
I am currently trying to learn stm32f429i-disk1 in C \ C ++ maybe i still need your help thanks to all.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top