Mail Archives: djgpp/2002/07/16/16:07:12
From: | "Denys Redon" <denys DOT redon AT free DOT fr>
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | serial port
|
Date: | Tue, 16 Jul 2002 20:13:05 +0200
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2615.200
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2615.200
|
Lines: | 53
|
Message-ID: | <3d3461b6$0$570$626a54ce@news.free.fr>
|
Organization: | Guest of ProXad - France
|
NNTP-Posting-Date: | 16 Jul 2002 20:11:02 MEST
|
NNTP-Posting-Host: | 62.147.149.127
|
X-Trace: | 1026843062 news2-2.free.fr 570 62.147.149.127
|
X-Complaints-To: | abuse AT proxad DOT net
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I try to put on a del with the serial port with this programm but it doesn't
work, why?
#include <stdio.h>
#include <conio.h>
#include <pc.h>
/////////////////////
#define COM1 0x3F8
/////////////////////
#define COMx COM1
#define TxD COMx
#define RxD COMx
#define DLLB COMx
#define IER (COMx+1)
#define DLHB (COMx+1)
#define IIR (COMx+2)
#define FCR (COMx+2)
#define LCR (COMx+3)
#define MCR (COMx+4)
#define LSR (COMx+5)
#define MSR (COMx+6)
void initia(void);
void Init_COM1(void);
int main (void)
{
initia();
getch();
return(0);
}
void initia(void)
{
printf("\n-DEBUT-\n");
Init_COM1();
outportb(COM1+4,0x02);
}
void Init_COM1(void)
{
outportb(LCR,0x80); // DLAB = 1
// 9600 bauds
outportb(DLLB,0x0C); // Vitesse adresse basse
outportb(DLHB,0x00); // Vitesse adresse haute
outportb(LCR,0x07);
}
- Raw text -