X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f NNTP-Posting-Date: Thu, 19 Jul 2007 01:35:36 -0500 From: "Alexei A. Frounze" Newsgroups: comp.os.msdos.djgpp References: Subject: Re: RS232 transmission sometimes fail on AM2 Date: Wed, 18 Jul 2007 23:33:06 -0700 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="koi8-r"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 Message-ID: Lines: 61 X-Usenet-Provider: http://www.giganews.com NNTP-Posting-Host: 67.170.73.174 X-Trace: sv3-4idLeFpViXZU5kzCOTJdsuc89CpQr9+OWgyPyAoAnMj2Kn/YtqxKdKL2DThHmy+/K9dyomqQzgJj3IH!qFVcilrdl67QfQpds2KaGUmmiB0MT+ielHpk1yUuLrUP3AGFj+4ie6RBVJ0ytqsLk5DJ1CHqbsYK!ix/eOAtAlnJPrabO67qh6qvccHer7Q== X-Complaints-To: abuse AT comcast DOT net X-DMCA-Complaints-To: dmca AT comcast DOT net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.35 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Robbo wrote: > Hello, > > I wrote some program on PC which controlls > an industrial machine. There is also electronic > device (with microcontroller Atmel AVR) > connected with RS232 to the PC. > I found that there are sometimes problems > with serial transmission, since I have moved to > 64bit processors (AM2 Sempron). > Not so frequently, the electronic device doesn't > catch command sent by the PC and vice versa > - the PC doesn't catch command sent by > the electronic device to it. > I use delay() function in my program. What for? Can it be that while the CPU is executing it, too many bytes arrive and start getting lost? > I use Free DOS. I have no idea about anything specific to any sort of DOS. However, serial communication in DOS apps *running under Windows* is known to be unreliable. Because of that many years ago I had to change the protocol to account for lost or corrupt data packets. > Is there any known problem with programs > written in DJGPP on 64bit processors? I doubt that. > Does delay() function work correctly on > such processors (unfortunatelly I can't > check it now)? If you've got an oscilloscope, you could execute this sort of code: 1. disable all interrupts 2. call delay() 3. output 1 to say parallel port or speaker pin or some RS232 control pin (RTS/CTS/whatever) 4. call delay() 5. output 0 to the same port as in step 3 6. go to 2 If on the oscilloscope you see correct timings of the pulses on that port, you're good not only in delay(), but also with respect to SMIs. > One more thing: I installed special 2xRS232+1xLPT > expansion card in the PC and connected the electronic > device with RS232 to it. I found that problems with > loosing sent commands are more frequently than > when I connected RS232 cable directly to a main board. Btw, do you use BIOS to do the serial I/O or something else? The reason for the question is that BIOS serial I/O is rather limited and might even be buggy and I don't remember any decent terminal application using it. At the same time, if it's all your code, not the BIOS'es, there might be some bug just as well. Alex