Home › Forums › TinyG › TinyG Support › Permanent cnc code on TinyG
- This topic has 7 replies, 3 voices, and was last updated 10 years, 8 months ago by suaveant.
-
AuthorPosts
-
February 7, 2014 at 4:21 am #5367nicolo.boscoloMember
Hi to everyone!
I’m new in the TinyG world and I’m wondering if there is an easy way to use the TinyG board like a “Arduino” board. It means:
-when you upload the gcode file the gcode is running in a loop mode;
-when you turn off and then turn on the board, it is going to run the last uploaded code.Until now, what i understand is that there is only an hard way: edit the firmware. Am I wrong?
Thank you in advance!!
February 7, 2014 at 5:00 am #5373aldenMemberNo, you are not wrong. There is no provision to load canned gcode other than including it in the main program.
There is a relatively simple way to do this if you are willing to recompile. Look in tinyg.h at how __CANNED_STARTUP functions. You can provide Gcode as a string array in a header file, compile it in, then have the machine run the Gcode whenever it starts up.
I know this is a compile option, so it’s not as easy as inserting an SD card or something like that. Watch this space, however, we are continuing to add features and this in not the first time we’ve had a request for a simple way to do canned motion.
February 7, 2014 at 6:06 am #5377nicolo.boscoloMemberThank you for the rapid reply! Really great news!
I’m using step motors then the I/O regarding the encoders (J17 to J20) are not used in my application. So, tell me if, in your opinion, this could be a good plan:
1. by a sd breakout board (probably http://www.adafruit.com/products/254)
2. in order to use the board, remap the I/O encoder pins (by editing the firmware)
3. Use the arduino sd library to manage the data inside the sd cardPS. About point 2, the GPIO is now mapped on some screw terminal blocks for cooling, PWM and other stuffs. Then, the encoder I/Os seems the most feasible solution, imho.
Cheers,
NicolòFebruary 7, 2014 at 9:11 am #5380aldenMemberNicolo, J17 – J20 are not encoders, these are stepper signal outputs. You might be able to use the SPI outputs to drive an external SD card. The XIO system can be extended to use the SD card as a primary input.
February 7, 2014 at 11:16 am #5383nicolo.boscoloMemberOk i read more documentation and i got to the same your conclusions. So, SPI for SD Card and J17 – J20 are output for possible external motor drivers.
Looking at cad docs and xmega documentation, i figured out that J17 – J20 are digital programmable ports. If so, I should be able to edit the firmware in order to use the ports as an half of input and an half of output.Thank you!
NicolòFebruary 7, 2014 at 12:31 pm #5384aldenMemberYou could use J17-J20, except that those are the stepper driver signals, so you would be disabling the steppers if you did so.
February 7, 2014 at 12:43 pm #5385nicolo.boscoloMemberOk, now everything it’s clear to start the dirty job! 🙂
Thanks again!
NicolòMarch 20, 2014 at 9:01 pm #5648suaveantMemberComing a little late in the game to this but I wonder if you could use a raspberry pi, which is very cheap and has a usb controller, to make something like this work for a very low cost.
-
AuthorPosts
- You must be logged in to reply to this topic.