X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: AndrewC Newsgroups: comp.os.msdos.djgpp Subject: Re: RS232 transmission sometimes fail on AM2 Date: Thu, 19 Jul 2007 18:00:49 +1000 Message-ID: References: X-Newsreader: Forte Agent 4.1/32.1088 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 51 NNTP-Posting-Host: 220.233.169.234 X-Trace: 1184832066 un-2park-reader-01.sydney.pipenetworks.com.au 2996 220.233.169.234:1234 X-Complaints-To: Abuse, including message IDs to abuse AT pipenetworks DOT com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com >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. >I use Free DOS. What's the delay() for? You should not need this if you are using a proper ASYNC library that uses interrupts. Which version of LIC are you linking with? If you are using Win 2K or W2K3 or XP (don't know about Vista) then IMHO give the 2.04 beta a go. DO NOT USE THE BIOS SERIAL API!!! It is only designed for 9600 and is polled, so I would expect to see lost bytes if you are useing the BIOS API. >Is there any known problem with programs >written in DJGPP on 64bit processors? >Does delay() function work correctly on >such processors (unfortunatelly I can't >check it now)? Should be okay, so long as you are using 32 bit Windows. I have not seen anyone indicating issues with 64 bit Windows, but based on the 32 bit I would expect it to have some issues. >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. This sounds like you are using a polled ASYNC library, but it could be because of the FIFO buffer and the trigger setup of the PCI UART IC compared to the standard 16550 UART. Some UARTS are 16550 compatable, but they have allot bigger buffer and the ASYNC library needs to take care of the buffer management. Be aware that if you are running on Windows 2000/XP even at 9600 if the DOS box is not in the foreground you may be missing characters due to Windows not giving the DOS app enough time to run correctly in order to service the interrupts or the polling. Even with an interrupt driven ASYNC library you can still loose bytes if the dos box is in the background under Windows, but the faster the PC and the less apps running then the less chance you have of loosing a byte. Andrew