{"action":"created","issue":{"url":"https://api.github.com/repos/grbl/grbl/issues/837","labels_url":"https://api.github.com/repos/grbl/grbl/issues/837/labels{/name}","comments_url":"https://api.github.com/repos/grbl/grbl/issues/837/comments","events_url":"https://api.github.com/repos/grbl/grbl/issues/837/events","html_url":"https://github.com/grbl/grbl/issues/837","id":115225498,"number":837,"title":"Baud rate issue?","user":{"login":"109JB","id":10978476,"avatar_url":"https://avatars.githubusercontent.com/u/10978476?v=3","gravatar_id":"","url":"https://api.github.com/users/109JB","html_url":"https://github.com/109JB","followers_url":"https://api.github.com/users/109JB/followers","following_url":"https://api.github.com/users/109JB/following{/other_user}","gists_url":"https://api.github.com/users/109JB/gists{/gist_id}","starred_url":"https://api.github.com/users/109JB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/109JB/subscriptions","organizations_url":"https://api.github.com/users/109JB/orgs","repos_url":"https://api.github.com/users/109JB/repos","events_url":"https://api.github.com/users/109JB/events{/privacy}","received_events_url":"https://api.github.com/users/109JB/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-11-05T07:38:07Z","updated_at":"2015-11-05T22:21:48Z","closed_at":null,"body":"While doing some torture testing of my GUI I came across a problem that I am not sure of 100%. I am using an Arduino Nano clone  that uses the ch340g chip with the baud rate set to 115200. The pertinent GRBL settings were 250 steps/mm, 7200 mm/min max rate to achieve 30 kHz step rate. Then what I did was take one of my 130+ thousand line test files and modified it to only have G0 rapid moves. This file has lots of little short moves so there is fast communication required between the GUI and GRBL. Occasionally an error would be returned from GRBL, but I know the file is good having been run many times with the only change using a text editor to do a replace of G1 with G0. While investigating the error I turned on echo from GRBL to investigate\r\n\r\nAn example of what was happening occasionally is instead of getting the following 2 lines:\r\n\r\nX3.8212 Z1.0742 \r\nX3.8173 Z1.0765 \r\n\r\nGRBL would echo something like:\r\n\r\nX3.8212 Z1.X3.8173 Z1.0765 \r\n\r\nwhich is a truncated first line with the second line tacked on the end. The errors were not happening at the same spot in the file but the errors were always similar in fashion with a truncated line having the next line tacked at the end.\r\n\r\nAfter some searching on the internet I found some information from the Atmega328P datasheet that indicates that at 115200 there is a higher chance of errors than at 250000 when at a 16MHz clock. It actually shows 115200 as one of the worst choices for baud rate matching at 16Mhz\r\n\r\n![atmega328](https://cloud.githubusercontent.com/assets/10978476/10962246/68110696-835c-11e5-8a4b-9fd3f4f57cc7.png)\r\n\r\nSo, I switched my GRBL install to 250000 baud rate and no more errors. I ran the same code file about 10 times with no errors. Then for an additional test, I switched back to 115200, and ran the same code file and experienced an error on the first run.\r\n\r\nHaving said all of this I must say that my testing means are limited and the test file I am using is not a realistic file that anyone would run in a real life situation. Also,with G1 commands in it there were no problems due to slower communications I suppose, and the errors never showed up at less than about 60,000 lines into the test program. Most people won't get to this issue anyway, but it does show a potential problem.\r\n\r\nWhat this brings up is whether 115200 should be the default baud rate, or if 250000 should be due to the lower error rate indicated in the above table."},"comment":{"url":"https://api.github.com/repos/grbl/grbl/issues/comments/154213708","html_url":"https://github.com/grbl/grbl/issues/837#issuecomment-154213708","issue_url":"https://api.github.com/repos/grbl/grbl/issues/837","id":154213708,"user":{"login":"109JB","id":10978476,"avatar_url":"https://avatars.githubusercontent.com/u/10978476?v=3","gravatar_id":"","url":"https://api.github.com/users/109JB","html_url":"https://github.com/109JB","followers_url":"https://api.github.com/users/109JB/followers","following_url":"https://api.github.com/users/109JB/following{/other_user}","gists_url":"https://api.github.com/users/109JB/gists{/gist_id}","starred_url":"https://api.github.com/users/109JB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/109JB/subscriptions","organizations_url":"https://api.github.com/users/109JB/orgs","repos_url":"https://api.github.com/users/109JB/repos","events_url":"https://api.github.com/users/109JB/events{/privacy}","received_events_url":"https://api.github.com/users/109JB/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T22:21:47Z","updated_at":"2015-11-05T22:21:47Z","body":"@chamnit - From your comment:\r\n\"Either way, serial RX/TX comm is handled on a hardware level on the 328p. As long as the serial ISR is serviced before the next RX byte comes in, Grbl shouldn't lose any data.\"\r\n\r\nFrom this I infer that the error I experienced is a result of a \"perfect storm\" and would likely only rear its ugly head if a similar set of circumstances presented. I guess what I mean is that this would only be an extremely rare occurrence and not too much to worry about in real life machining applications, and that if wanting to err on the safe side just use 2500000 baud rate. Is this your take?\r\n\r\nThanks"}}