Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > parallel port programming using C

Reply
Thread Tools

parallel port programming using C

 
 
nik
Guest
Posts: n/a
 
      05-07-2006
hello frinds,
last night i am using C prog to get output at my
parallel port the following source code is
#include<dos.h>
#include<conio.h>
#include<process.h>
void main()
{
outportb( 0x378,00ff);
delay(1000);
outportb(0x378,0000);
delay(1000);
}
i have conected a bulb between LED PIN 2 & PIN 25 .the LED is not
glowing. what r the reasons Plz tell me .Can we get output in serial
port using int17 if yes plz tell me the code for it.Can this code is
working properly for my pc (configuration r AMD 3200+ processor and
ASUS motherboard) .
waiting for ur response

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      05-07-2006
In article <(E-Mail Removed). com>,
nik <(E-Mail Removed)> wrote:
> last night i am using C prog to get output at my
>parallel port the following source code is


>#include<dos.h>
>#include<conio.h>


Sorry, that is DOS/Windows specific: you will need to ask in
a DOS/Windows newsgroup.
--
"law -- it's a commodity"
-- Andrew Ryan (The Globe and Mail, 2005/11/26)
 
Reply With Quote
 
 
 
 
Rod Pemberton
Guest
Posts: n/a
 
      05-07-2006
"nik" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> hello frinds,
> last night i am using C prog to get output at my
> parallel port the following source code is


You have standard C coding errors:

> #include<dos.h>
> #include<conio.h>
> #include<process.h>


#include<stdlib.h> /* missing */

> void main()


int main(void) /* corrected */

> {
> outportb( 0x378,00ff);


/* this could be a problem */
/* you're compiler may be using the 00 from 00ff */
/* as the byte which is being output to port 0x378 */

outportb(0x378,0xff); /* you want a byte in hex */

> delay(1000);
> outportb(0x378,0000);


outportb(0x378,0x00); /* not needed, but I like it in hex */

> delay(1000);


return(EXIT_SUCCESS); /* missing */
> }


> i have conected a bulb between LED PIN 2 & PIN 25 .the LED is not
> glowing. what r the reasons Plz tell me .Can we get output in serial
> port using int17 if yes plz tell me the code for it.Can this code is
> working properly for my pc (configuration r AMD 3200+ processor and
> ASUS motherboard) .
> waiting for ur response
>


I don't know anything about that stuff...


Rod Pemberton


 
Reply With Quote
 
Julian V. Noble
Guest
Posts: n/a
 
      05-07-2006
nik wrote:
> hello frinds,
> last night i am using C prog to get output at my
> parallel port the following source code is
> #include<dos.h>
> #include<conio.h>
> #include<process.h>
> void main()
> {
> outportb( 0x378,00ff);
> delay(1000);
> outportb(0x378,0000);
> delay(1000);
> }
> i have conected a bulb between LED PIN 2 & PIN 25 .the LED is not
> glowing. what r the reasons Plz tell me .Can we get output in serial
> port using int17 if yes plz tell me the code for it.Can this code is
> working properly for my pc (configuration r AMD 3200+ processor and
> ASUS motherboard) .
> waiting for ur response
>


If your C runs under DOS and you are using DOS then it should work.

However, if you are using Windoze you can't because it prevents you
from getting access to any of the silicon. There are workarounds
(software interfaces) available that let you avail yourself of the
machine's resources, but I don't know current versions. I suggest
you Google for "Parallel port access under Windoze xxx" (your version
here).

--
Julian V. Noble
Professor Emeritus of Physics
University of Virginia
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parallel port control with USB->Parallel converter Soren Python 4 02-14-2008 03:18 PM
Parallel port programming on windows XP/2000? Novice Experl Python 6 08-03-2005 05:38 PM
use com port as parallel port b3ny Java 11 11-20-2004 06:50 AM
Java Parallel Port Programming with the Java Communications API Paul Perrone Java 0 08-21-2003 03:45 PM
Parallel port programming in Java karthik Java 5 07-25-2003 05:22 AM



Advertisments