473,396 Members | 2,154 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,396 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 7244
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.