By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,245 Members | 1,118 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,245 IT Pros & Developers. It's quick & easy.

parallel port programming using C

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.