![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| Ive been writing a program in VB that uses the I2C protocol to write to eeproms and other microcontrollers via the parallel port on a PC. i was wondering if there is any one out there that can help me get started in designing a interface for my program. i really dont know much about designing Pcb or schematics but i have built many project and i study engineering at uni. for this one ill need all the help i can get | |
| |
| | (permalink) | |
| Quote:
If I can find it, I have a circuit somewhere!. I've also got Delphi code for reading and writing EEPROM's. | ||
| |
| | (permalink) |
| ive been programing under VB, i got asked to program it in VB and all i had was a 21 day crash course. its working well but i really need help with my read function, im still trying things and testing so hopefuly soon... agian if anyone could help me there, i really it. thanks | |
| |
| | (permalink) |
| I think you are looking for something like this: http://www.hut.fi/~iisakkil/stuff.html
__________________ "There is no way to peace, peace is the way!" | |
| |
| | (permalink) |
| Is all that really needed? i mean as far as i knew all i need where 2 lines. it is a nice schematic though and im considering it. still to do so i would have to modify it. my program uses pin 2 as the SCL line and pin 3 as the SDA line, but both pins are input and output. Ive noticed that alot of circuits use 4 pins, 2 for input and 2 for output, why? the protocol was meant for just 2 wasnt it? lets say i want to use that schematic, how would i adjust it to suit me? i noticed that he sets all his data pins (pins 2-9) high to power the circuit, my program uses those pins and i would need a external 5v power supply, thats easy. but im not farmilliar with the square and circle components. could you help me? | |
| |
| | (permalink) | |
| Quote:
The reason the circuit on the link is complicated is that it's opto-isolated, the 'squares' are the opto-couplers, and the 'circles' are FET's. If you don't need isolation, it can be a LOT! simpler. For a nice simple circuit try http://www.lancos.com/e2p/easyI2Cbus.gif. | ||
| |
| | (permalink) |
| SCL needs to be be-directional too... A slave device can hold SCL low if it needs more time to process a command. The master should wait until slave releases SCL If your SCL is not bi-directional how are you going to detect this ? | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| this is what i use. I wrote software for it in watcom C++ (dos) | |
| |
| | (permalink) |
| Ok so its not nessary but its better to seperate the lines into outout and input independant lines (ie 4 pins rather than 2) how do i porgram in VB so that i can get the state of the register pins on the parallel port? (pins 10 - 17) i noticed that most people are using pin 10(Ack), 11(Busy), 12(Paper end) or pin 13(Selected) as their input pins. Exo your Circuit looks simple and just what i need, but you havent given me any resister nor transistor values. could you also pass them on please. thanks for the help so far guys | |
| |
| | (permalink) |
| I use BC547 for the transistors, but any NPN that can sink a little current can be used. I use 10K for the base resistors, seem to work well with the '547 The pull-up resistor values are open for debate. The lower these values are (philips uses 330 ohm in some devices i have here) the less propagation delay the lines will have, but the more current you have to sink (and waste) when pulling a line low I currently use 1K as pull-ups. Does the trick for me. If you use this setup to connect the I²C bus of a existing device (a VCR, for example) to your pc then there's no need for pull-ups, as they are already in the device. about the parallel port in VB... I don't know about it, i made my software in dos, wich allows free access to the parallel port. But i've seen other posts on this forum covering that very subject. | |
| |
| | (permalink) | ||
| Quote:
I says so in the I²C specification. Incorporating it into the software is easy and makes it closer to the 'real' thing | |||
| |
| | (permalink) |
| How would i go about adding a buffer to the circuit that Exo gave me(above)? | |
| |
| | (permalink) | |
| Quote:
The selection of the input pin is mainly down to the fact that very few of the port pins can be inputs, and it's tended to become common practice to use the ones which almost everybody uses. I've always used the one which David Tait used in his original PIC programmer. | ||
| |