Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 17th October 2004, 11:56 PM   #1
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.
dak246 is offline  
Old 18th October 2004, 05:40 AM   #2
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.
evandude is offline  
Old 18th October 2004, 11:24 AM   #3
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
Nigel Goodwin is offline  
Old 18th October 2004, 08:03 PM   #4
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?
dak246 is offline  
Old 19th October 2004, 06:33 AM   #5
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
Nigel Goodwin is offline  
Old 20th October 2004, 02:03 AM   #6
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.
dak246 is offline  
Old 20th October 2004, 06:44 AM   #7
Default PIC

PIC is good platform
__________________
The world without engineer is the world without control!
amady is offline  
Old 20th October 2004, 06:53 AM   #8
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
Nigel Goodwin is offline  
Old 20th October 2004, 08:23 AM   #9
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.
dak246 is offline  
Old 20th October 2004, 09:07 AM   #10
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
Nigel Goodwin is offline  
Reply

Tags
asm, i2c, software

Thread Tools
Display Modes




All times are GMT. The time now is 10:55 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker