X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: "Francisco Pastor" Newsgroups: comp.os.msdos.djgpp Subject: Re: help on DOS serial communication using DJGPP Date: Wed, 5 May 2004 08:05:46 +0200 Organization: Universitat de Valencia Lines: 47 Message-ID: References: <000001c43214$915618d0$f088e783 AT emilda> NNTP-Posting-Host: 83.red-80-24-166.pooles.rima-tde.net X-Trace: peque.uv.es 1083737150 24686 80.24.166.83 (5 May 2004 06:05:50 GMT) X-Complaints-To: newsmanager AT uv DOT es NNTP-Posting-Date: Wed, 5 May 2004 06:05:50 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Is your cable ok? BIOS serial com use the modem control lines and, if this signal are not correct, the communication dont work Francisco Pastor "mohd hamizi ahmad" escribió en el mensaje news:000001c43214$915618d0$f088e783 AT emilda... > i've tried to communicate between embedded system to PC using serial > communication. my embedded system using DOS operating system. i've tried > to send a character to PC and should be display on hyperterminal. i've > tried but nothing happen. i've check my program, and i think there is no > problem. could anybody check my simple program down here? maybe i make a > mistake and you can tell me where my mistake. > > #include > #include > #include > #include > > int main() > { > > unsigned com1_send; > unsigned com1_init; > > > // open serial port at 9600 baud, 8 data bits, > // No parity, 1 stop bit > com1_init = _bios_serialcom(_COM_INIT, 1, > _COM_CHR8 | _COM_NOPARITY | _COM_STOP1 | _COM_9600); > printf("Init status: 0x%4.4X\n", com1_init); > > while(1) > { > // send a push keyboard character to com2 > com1_send = _bios_serialcom(_COM_SEND, 1, (unsigned)getch()); > printf("Send status: 0x%4.4X\n", com1_send); > } > > return(1); > } > >