Hi all,
i decided to rewrite the bootloader for the Xmega.
Not the initial was "bad" but, i use many kind of serial communication (Wireless with Xbeepro, IP with Lantronix or internal mesh RS422),
and for some system, (like radio) it's not good to do binary serial communication (with character < 5).
That's why i write a bootloader with only (other than ack, nack and etx), ASCII / Hexadecimal character.
there is more character, but no issue.
i use this format for all my communication system since many years with success.
include the program xboot V2.1
of course i write a program (DataCoCom) able to download program via serial or IP communication according with this Xboot.
when it will finish, i will put the program on the net for any users.
My issue is, some time, i lost characters in one part of program. (data receive !!!)
[code:1:8e9ecca902]
'----------------------------------------------------------- DATA BLOACK RECEIVE 256 characters (00-FF ASCII) end with ETX(03)
Da5 = 1
Do
Da1 = Waitkey(#1)
If Da1 <> 0 Then
Buf2(da5) = Da1
Incr Da5
End If
Loop Until Da1 = 3
Print 'for DEBUG
Print "DA5: " ; Da5 'for DEBUG
If Da5 < 264 Then 'lose characters --> OUT
Waitms 10
Print Chr(nak);
Goto Fin_case1
End If
[/code:1:8e9ecca902]
Usally, i use interupts for my serial communications, but it's not possible with bootloader.
that's why i add a check if i receive < 264 characters.
Waitkey or inkey same issue.
Speed is 9600 Bauds. (not possible to change)
i introduce a transmit delay between each characters, no change ?
IP, Wireless or direct communication same issue.
either complex card or single processor.
What's wrong in my code ?
Any idea ?
Patrick
[b:8e9ecca902][color=red:8e9ecca902](BASCOM-AVR version : 2.0.7.6 )[/b:8e9ecca902][/color:8e9ecca902]
↧