Traumflug / Teacup_Firmware

Firmware for RepRap and other 3D printers
http://forums.reprap.org/read.php?147
GNU General Public License v2.0
310 stars 198 forks source link

Wrong codes > 255 reported wrongly #308

Open thomaskilian opened 5 years ago

thomaskilian commented 5 years ago

I was puzzled why Teacup echoes 144 after a M400:

2018-10-17 11:19:08,262 - Send: N32239 M400*46 2018-10-17 11:19:08,319 - Recv: E: Bad M-code 144

Well, obviously it assumes the code to be < 256. A test shows that sending M255 will report a 0.

For sure no high priority. But probably not difficult to fix, I guess?

Wurstnase commented 5 years ago

Yes, gcode is parsed to 8bit. So numbers should be between 0 and 255. We could increase this to 16bit, but most gcodes are not supported > 255.

Teacup wants to be small and compact. So instead of M400 this command in Teacup is G4. You can use it with P. E.g. G4 P100. Then this will wait also for 100 milliseconds.

thomaskilian commented 5 years ago

Yes, I know about G4 (it's mentioned in the Reprap wiki). However, I thought that 16 instead of 8 bit would not blow the whole thing. And today you get 15€ boards with everything on it from Chine with a large processor. So the need for tiny tiny is not as demanding as, say, 1-2 years ago.

Maybe (dunno) it's possible to parametrize this so Scotsmen can use 8 bit and wealthy oligarchs can use 16 bits ;-)

Wurstnase commented 5 years ago

Yes, but why using 16bit, when you don't need it? 🤔 All teacup commands are between 0 and 255.