472,811 Members | 1,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,811 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 7199
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 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.