Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 9th September 2005, 04:47 AM   (permalink)
New Member
elexhobby is on a distinguished road
Default Parallel port control port: is it Write Only or Read/Write

Hi Friends,
I read the parallel port tutorial on the site www.beyondlogic.org & experimented a bit with my computer.
In the tutorial it is written that the data port (0x378) is generally ‘Write Only’; however I found mine to be bi-directional – great!
The doubt I have is with the Control Port (0x37A). The tutorial says that the control port is Read/Write. So I sent all the control pins to high impedance state (sent F4, since some are hardware inverted). I then tried externally applying a low input (0 V) to certain pins– But it doesn’t read the external value. When I read back the control port, it simply reads the value sent earlier (F4).
Is it the case that not all control ports are bi-directional? I find mine to be ‘Write Only’.
Kindly help.

Thanks in advance.

Elexhobby
elexhobby is offline   Reply With Quote
Old 9th September 2005, 07:23 AM   (permalink)
Experienced Member
aibelectronics is on a distinguished road
Default reply

i'm also into computer interface. could you give us the code and lets see? i also read the tutorial at beyond-logic. REMEMBER pins 1, 14 and 17 are hardware inverted. please post what you did in code form.[/b]
__________________
Everybody can but not everybody will.
aibelectronics is offline   Reply With Quote
Old 9th September 2005, 12:36 PM   (permalink)
New Member
elexhobby is on a distinguished road
Default

Thanks for your interest.
I am attaching the C code herewith.

int a;
clrscr();
outportb(0x37A,0xf4);
getch();
a=inportb(0x37A);
printf("%x",a);
getch();

I have kept in mind that 1, 14, 17 are h/w inverted hence the data sent is F4 (1111 0100).
Thanks again.
elexhobby is offline   Reply With Quote
Old 9th September 2005, 11:22 PM   (permalink)
Experienced Member
 
mstechca can only hope to improve
Default

The actual pinout depends on the mode (SPP/EPP/ECP).

In SPP mode, you have about 13 output pins and 4 input pins (correct me if I am wrong here). 8 of the output pins are specifically data pins and the rest of them are control pins.

Go to Ralf Browns Interrupt Page. He has documentation on port addresses, and it will explain what each address corresponds to.

Because you have about 4 input pins (status registers), use the port that captures the status of these registers, and convert that into 4 bits. You will need to read from the port twice to obtain a full byte (4 bits * 2 = 8 bits = byte)

With EPP and ECP, data transfer with the port is supposed to be easier, but I can't help you further with these modes, because I don't deal with them.
__________________
-=: The best low-priced components to troubleshoot with are the speaker and the LED :=-
mstechca is offline   Reply With Quote
Old 10th September 2005, 04:28 PM   (permalink)
Experienced Member
Dialtone is on a distinguished road
Default

I think your problem is that you are confusing the terms bi-directional and read-write to be the same. They are not in this case.
The control port registers are read-write from the computer side, but not bi-directional from the device interface side.
As mentioned earlier, bi-directional capability on the data bits depends on the mode the port is operating under.
Continue reading the beyondlogic.org tutorials on the other modes and you can get a feel for the port functions in these modes.
From a programming standpoint, EPP mode is the easiest to impliment full bi-directional data flow with minimal programming involved.
Dialtone
Dialtone is offline   Reply With Quote
Old 12th September 2005, 12:01 PM   (permalink)
Experienced Member
aibelectronics is on a distinguished road
Default reply

check out h**p.senet.com - excellent!
__________________
Everybody can but not everybody will.
aibelectronics is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes




All times are GMT. The time now is 10:11 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.