• 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

Thread starter #1
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
 

granddad

Active Member
#2
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 ...
 

atferrari

Well-Known Member
#3
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. One of them 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.
 
Thread starter #5
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.
 
Thread starter #7
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.
 

Latest threads

EE World Online Articles

Loading

 
Top