Posted: Sun Nov 13, 2016 7:02 pm Post subject: Some tip about Uno serial
Hello.
For my colegue I wrote some code for ethernet nodes (Arduino Uno + shield W5100)
Program is universal because you can set each node IP, mask, gate, port for UDP, target IP, even MAC and much more with AT commands.
You simply connect it to USB and type AT+IP=192.168.1.20 or ask AT+IP?
..but then, when I send Hex to Him for program with Xloader only two of six nodes talk on serial port with terminal.
Gues what? Not all arduino bootloaders are same. They work on 115200 baud but error is big for this speed if you not use U2X
So..some bootloaders enable U2X and after program with Xloader programmed baudrate is double.
You can check this with this simple code.
I also solve problem by reseting U2X bit in my software.
Look at the errors calculations and why they enable U2X and this is propably not taken into account by Bascom.
I understand that but "this is the trap for young players" Hahaha
bascom also uses u2x when it result in a better baud. but only when the u2x is defined in that dat file.
if you do not like u2x to be set/used, you can remark the u2x constants from the dat file. _________________ Mark
I think that in my case, where my desired baud is comparatively low and compiler don`t use U2X then it stay untouched after bootloader.
I don`t have any problems with Bascom and only want inform that such a situation could happend if you want lower baudrate after bootloader set it to 115200.
This can save a day for someone
yes, it can save a day indeed. that is why i added comment about the u2x constant.
older bascom versions did not use u2x (because this options was not available in all chips). the problem arises when you have a boot loader using an older bascom version, and then compile code using a new bascom version. _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum