Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I want to make 1 0 1 (pin no 16) of parallel port using C

Status
Not open for further replies.

manish12

Advanced Member level 3
Joined
Nov 21, 2006
Messages
983
Helped
66
Reputation
132
Reaction score
33
Trophy points
1,308
Activity points
6,117
printer port q ?

i want to make 1 0 1 (pin no 16) of parallel port useing c language . and whie doing so , no other pin status alter .

ref

0x378 = 8 bit
0x379 = 5 bit
0x37a = 4 bit (msb 17 16 14 1 lsb of 25 pin connector )

any small code ?
 

printer port q ?

use

temp = 0x0f

for (;;)
{
temp ^= 0x04
outp(0x37a, temp);
}
 

Re: printer port q ?

what was i discovered is as follows

"
{
int temp;
/* ~RD WR ~A1 ~A0 */
temp = inportb(CONTROL) ; /* xxxx read the control port */

temp = (temp | 0x4) & 0xF ; /* x1xx wr =1 and rest is unafected */

outportb(CONTROL,temp) ; /* x1xx sent it to control port */

delay(3); /* some delay */

temp = inportb(CONTROL) ; /* xxxx read the control port */

temp = (temp & 0xB) & 0xF ; /* x0xx wr =0 and rest is unafected */

outportb(CONTROL,temp) ; /*x0xx sent it to control port */

delay(3); /* some delay */

temp = inportb(CONTROL) ; /* xxxx read the control port */

temp = (temp | 0x4) & 0xF ; /* x1xx wr =1 and rest is unafected */

outportb(CONTROL,temp) ; /* sent it to control port */

delay(3);
}

"
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top