+ Reply to Thread
Results 1 to 10 of 10

Thread: Software I2C in ASM

  1. #1
    dak246 Newbie
    Join Date
    May 2004
    Location
    PSU
    Posts
    53

    Default Software I2C in ASM

    I just finished making a successful rs-232 interface and now i want to add an I2C interface between my microcontroller and a memory IC. I want code my own virtual I2C interface instead of using the hardware. Im not looking for anything to specific, just a general reference about coding somthing like this in ASM ( or C, i could use it to get an idea and then redo it in ASM ). Can someone point me in the right direction? Also any suggestions on what type of memory IC to use? 4mb should be sufficient, but the more the better. By the way im using a pic16f877. Thanks.


  2. #2
    evandude Good evandude Good evandude Good
    Join Date
    Oct 2003
    Location
    Maine, USA
    Posts
    1,395

    Default

    http://www.winpicprog.co.uk/

    nigel's got an I2C tutorial there. don't know if it's what you're looking for... but thought i'd mention it anyway.

  3. #3
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Yes, my tutorials include what you want, assembler routines for master mode I2C - but most EEPROM's are far smaller than 4Mb, this is more of a FLASH memory size, which is a totally different interface.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  4. #4
    dak246 Newbie
    Join Date
    May 2004
    Location
    PSU
    Posts
    53

    Default

    Thanks i just took a look at the some of the zip files from your tutorials and it looks like it will be a big help. For some reason I think I overlooked these zip files last time I was on your site. As far as memory size, could I perhaps use a combination of EEPROM's and set the interface up with multiple slaves, and use addresses that designate both what chip and then the address on that chip? Or would it be better to look into using flash memory instead?

  5. #5
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Quote Originally Posted by dak246
    Thanks i just took a look at the some of the zip files from your tutorials and it looks like it will be a big help. For some reason I think I overlooked these zip files last time I was on your site. As far as memory size, could I perhaps use a combination of EEPROM's and set the interface up with multiple slaves, and use addresses that designate both what chip and then the address on that chip? Or would it be better to look into using flash memory instead?
    Yes, you can use multiple EEPROM's, what are you actually wanting to store?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  6. #6
    dak246 Newbie
    Join Date
    May 2004
    Location
    PSU
    Posts
    53

    Default

    I want store a few minutes of audio in the EEPROM's. Im doing this so I can learn A/D conversion at the same time.

  7. #7
    amady Newbie
    Join Date
    Sep 2004
    Posts
    55

    Default PIC

    PIC is good platform
    The world without engineer is the world without control!

  8. #8
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Quote Originally Posted by dak246
    I want store a few minutes of audio in the EEPROM's. Im doing this so I can learn A/D conversion at the same time.
    You do realise that EEPROM is very slow to write to?.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

  9. #9
    dak246 Newbie
    Join Date
    May 2004
    Location
    PSU
    Posts
    53

    Default

    No i didnt actually. How slow. By your response im assuming to slow for audio? Is there somthing else you can recommend? Thanks for your responses by the way.

  10. #10
    Super Moderator Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent Nigel Goodwin Excellent
    Join Date
    Nov 2003
    Location
    Derbyshire, UK
    Posts
    29,794

    Default

    Quote Originally Posted by dak246
    No i didnt actually. How slow. By your response im assuming to slow for audio? Is there somthing else you can recommend? Thanks for your responses by the way.
    The datasheet for a 24LC256 (256KBit EEPROM) gives a maximum 5mS write cycle, although you can write using a paging mode which completes more than byte at a time in a single cycle.

    I think FLASH memories are probably better, faster read/write times and larger capacity - but using a totally different interface.
    PIC programmer software, and PIC Tutorials at:
    http://www.winpicprog.co.uk

+ Reply to Thread

Tags for this Thread