This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

same variable for two different

Hi All,

I have a IIC routine file i2c.asm,which has routines to read and write into a IIC device.

Now I am using the i2c.asm for two devices RTC and serial memory which are connected on different pins.

Question:
---------
How to use the same routines (read & write) to send signals on different pins,right now I am trying to use "SDA set p3.1" and changing the addrs of the sda and scl pin each time before accessing different device ,but it doesnt seem to work.

Is there any other way to get around this problem...

Rgds
Raj Shetgar

Parents
  • Hi Hans,

    I dont understand from where you got the impression that I grabbed the i2c.asm file"grabbed from wherever"...

    Anyways as you suggested I went through the code and It dindt take the whole day since I myself had written this long back.

    I understood why I cant use the "SET" directive.And as you suggested the two different ways to solve this,I used jump tables since the MCS-51 uC I am using doesnt support IAP.

    Thanx a lot...problem solved :-)

    Rgds
    Raj

Reply
  • Hi Hans,

    I dont understand from where you got the impression that I grabbed the i2c.asm file"grabbed from wherever"...

    Anyways as you suggested I went through the code and It dindt take the whole day since I myself had written this long back.

    I understood why I cant use the "SET" directive.And as you suggested the two different ways to solve this,I used jump tables since the MCS-51 uC I am using doesnt support IAP.

    Thanx a lot...problem solved :-)

    Rgds
    Raj

Children
  • I dont understand from where you got the impression that I grabbed the i2c.asm file"grabbed from wherever"...

    Mainly from the fact tha you only mentioned you "have this module", but didn't appear to understand how it works. That's typical for people grabbing source code from the internet, but without the necessary background knowledge to understand it.

    Anyways as you suggested I went through the code and It dindt take the whole day since I myself had written this long back.

    Well, you just found out that taking source code from your own younger self can be every bit as hard as grabbing from a third party.