www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/07/17/13:51:07

From: "Denys Redon" <denys DOT redon AT free DOT fr>
Newsgroups: comp.os.msdos.djgpp
Subject: serial port 2
Date: Wed, 17 Jul 2002 18:57:01 +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: 55
Message-ID: <3d35a160$0$583$626a54ce@news.free.fr>
Organization: Guest of ProXad - France
NNTP-Posting-Date: 17 Jul 2002 18:54:56 MEST
NNTP-Posting-Host: 62.147.149.170
X-Trace: 1026924896 news2-2.free.fr 583 62.147.149.170
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 LED 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);
>           outportb(DLHB,0x00);
>           outportb(LCR,0x07);
>     }
>
>
>
>


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019