Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20639

BASCOM-AVR : XMEGA serial lost characters : REPLY

$
0
0
Hi Mark and all Guy, Sorry for the delay, but i was not in France and with very limited internet access. Yes, with small delay it's better, nearly 100%. but somme time one character is lost (now only one !!!). For information, result is better with Waitkey than Inkey with a test data<>0 For the test, i try (with success) to update an electronic's module (ATXMEGA128D3) located in an harbor at Hawai.(outside) Module have a radio Module Xbee-Pro 2.4GHZ 9600 Bauds inside, communicate to --> radio base with another Xbee-Pro connected in the harbor office to a Lantronix Module (IP adress - Port / serial). distance between base and module around 200m. There is 80 other modules on the site. The software to downloading is on a server in the office. I manage the software from France with a Teamviewer access. it's takes 6 minutes to download the software (32K) in the main program, there is an instruction to jump to the bootloader ($10000), only the module concerned receive this instruction (there is an identification in the serial communication to communicate only with the concerned module). include a display of DataCoCom software, it's like terminal, but include specific function like download softwrare (OSCAR, TEXAS, ALIX is the name of the modules ...) When test will be finished, ,i will posted the entire software (PC and Bascom boot). So, i never had problem with interrupts, if it's possible to have a $bootvector, it will be perfect. An exemple how i use serial commmunication, with interrupt, i create an buffer (buf) when charact 13 (CR) is received, a flagrx is on. In the main program i check the flagrx and read the buffer when i have time .... never lost character. of course, i must clean the buffer manually (when read is OK). [code:1:3f2c8871b5] Config Com1 = 9600 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8 Open "COM1:" For Binary As #1 On Usartc0_rxc Rxdata Enable Usartc0_rxc , Lo '------------------------------------------------------------------------------- Rxdata: Data_rx = Inkey(#1) If Data_rx = 13 Then Flagrx = 1 End If If Data_rx <> 0 Then Buf(rxptr) = Data_rx Incr Rxptr If Rxptr > 64 Then Rxptr = 64 End If End If Return [/code:1:3f2c8871b5] Patrick

Viewing all articles
Browse latest Browse all 20639

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>