??? 09/17/04 15:10 Read: times |
#77579 - RE: Interfacing a parallel port Responding to: ???'s previous message |
"I actually read the complete 8052 tutorials section and have allready build some example projects."
Building projects (or copying source code from the internet) will not teach you anything unless you put a lot of effort into UNDERSTANDING what you are building. And that means putting some work into studying the background. "With the electrical knowledge I have I always assumed that the output of a pin would have to be connected to the led and the other leg of the led to GND, but it seems to be the opposite for 8051." This is not specific to the 8051, and hasn't to do with electrical knowledge, but more with convention. It is quite common practice that an output pin at 0 means on, and 1 means off. It's just beginners who let their gut feeling that 1 is on and 0 is off because 1 is more than 0 get in the way of the fact that it all depends on what you agree on. Search this forum for "negative logic" to learn how the convention that 0 means on and 1 means off came about. It is true that the 8051's 1 at a port pin is created because there is a resistor inside to +5V and the 0 is created because a transistor "short circuits" the pin to GND. This arrangement is called "open collector" or "open drain" (with built-in pullup resistor) and can make hardware design and software extremely simple and fool proof compared to tri-state outputs. You will probably understand from this that the 8051 is much better capable of sinking lots of current to GND (as you noticed) than to source current from +5V: you could say that its 1 is weak and its 0 is strong. Now, if you don't know the electrical characteristics of the inputs of your stepper motor board, you must prepare for the possibility that your stepper motor board will not be happy with the limited sourcing capability of the 8051, and that's why everybody is telling you to use a buffer IC: it will make for an interface towards the stepper board which has not only a strong 0, but also a strong 1. It's a precaution against the possibility that your stepper motor board's inputs are electrically incompatible with open collector outputs, totem pole outputs are much more universal outputs. Of course, the inputs of the advised buffer chip need to be satisfied with the electrical characteristics of the 8051's output port, but that's usually not a problem. Also, it is about 50% possible that you don't need the buffer and can directly hook the controller up with the board, but to be sure about that you must know details about the stepper board's inputs (ie.: study it, analyze what the input circuit is like, look up the IC's used etc). Port 0 is different in that in most derivatives the internal pullups are omitted (simply put). For more details and understanding, absolutely do as Erik suggested: download the "8051 bible", tattoo it to your hard drive and study it until you feel dizzy. |
Topic | Author | Date |
Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port![]() | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
Electrical knowledge - back to basics | 01/01/70 00:00 | |
RE: Electrical knowledge - back to basics | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 | |
RE: Interfacing a parallel port | 01/01/70 00:00 |