473,287 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

parallel port programming using C

nik
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

May 7 '06 #1
3 7234
In article <11*********************@g10g2000cwb.googlegroups. com>,
nik <am*******@gmail.com> 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)
May 7 '06 #2
"nik" <am*******@gmail.com> wrote in message
news:11*********************@g10g2000cwb.googlegro 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
May 7 '06 #3
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
May 7 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Yuancai \(Charlie\) Ye | last post by:
Hi, All: I am happy to annouce that we have formally released our latest SocketPro version 4 at www.udaparts.com, an advanced remoting framework written from batching/queue, asynchrony and...
6
by: Novice Experl | last post by:
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows...
9
by: MNQ | last post by:
Hi All I want to use my parallel port of my PC to control some external devices. I am writing a program in ANSI C using the PacificC compiler. What I need to know is how to access the parallel...
11
by: karan | last post by:
I would like to know how one can use the parallel port through c/c++.Also, how does one determine what port is installed(EPP/ECP/SSP/PS2)? What is the differnece between these? What are the...
11
by: Isaac T Alston | last post by:
Basically, I'm thinking about building a robot which can be controlled by programs which I write, I'm going to interface to the robot through the parallel port (like in this tutorial here:...
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
1
by: rajat varshney | last post by:
I am doing a project on controlling a stepper motor through computer parallel port over a network. I have also done parallel port programming in C but I need some help on how to send output on...
6
by: abhi | last post by:
Hello, I want to create a small project which will display scrolling text on LED that will be attached to Parallel port. I want to create this project in C language(possibly in Mingw) on Windows...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.