Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

grbl on Sanguino #129

Closed
Greta-du-Velay opened this Issue · 14 comments

6 participants

@Greta-du-Velay

Hi,

I try to use grbl on Sanguino (ATmega644p). Some people reported it works (#87), but not for me...

Here is my workflow:

  • I changed the Makefile: DEVICE = atmega644p (tried also 328p)
  • I didn't configure anything else concerning the CNC itself.
  • make is ok
  • make flash fails for some reasons (-c avrisp2 not working).

I used: avrdude -cstk500v1 -P/dev/ttyUSB0 -b38400 -D -Uflash:w:./grbl.hex:i -pm644p

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.05s

avrdude: Device signature = 0x1e960a
avrdude: reading input file "./grbl.hex"
avrdude: writing flash (18560 bytes):

Writing | ################################################## | 100% 6.24s

avrdude: 18560 bytes of flash written
avrdude: verifying flash memory against ./grbl.hex:
avrdude: load data flash data from input file ./grbl.hex:
avrdude: input file ./grbl.hex contains 18560 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 5.57s

avrdude: verifying ...
avrdude: 18560 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

When I connect with the arduino console and type '$', nothing happens. I tried both on mac and linux. I tried a manual connection with command line, etc.

What do I miss? Any idea?

Thanks,
J.

@AVRsteffen

A ATmega644p have two UART. (UART0 and UART1) I think you must change this in code of serial.c

@daapp

I upload using:
avrdude -p m644p -c arduino -P /dev/ttyUSB1 -b 38400 -D -U flash:w:grbl.hex:i

Of cause, you need to apply my patch for atmega644.

@jej
jej commented

Thanks all for your answers.

Where can we find the atmega644 patch?

@chamnit
Owner

I pushed @daapp 's patch onto the edge branch. Not much to it, just add a 0 to both the send and receive USARTs (for example, USART0_UDRE_vect)

@rustyoz

I am trying to upload grbl to a sanguino but i can't make avr-dude work. what version @daapp are you using?

@daapp

avrdude -p m644p -c arduino -P /dev/ttyUSB0 -b 38400 -D -U flash:w:grbl.hex:i

I use Debian/testing with avrdude version 5.11.1

@rustyoz

I am trying to get grbl to work on a sanguino. I have uploaded it to the board and it responds to commands over serial, to the point where the stepper motor moves every command i send as if the driver is picking up the serial commands. Is there any tips on pin assignments? as in what pins not to use?

@daapp

As described in config.h step and dir pins by default are in portb, so for sanguino there are pins 10-15:
10 step x
11 step y
12 step z
13 dir x
14 dir y
15 dir z
Check datasheet for Atmega644 for more info.

@chamnit
Owner

Also make sure that the limit pins and runtime control pins are on different registers. Otherwise I think that's about it.

@rustyoz

Thanks. I seem to be able to get commands going to the stepper drivers alright now, except for some jitter which i put down to my electronics set up, its a bit homebrew on some stripboard so I think its picking up a lot of noise.

@rustyoz

I would like to report that I have successfully got my set up working. Thanks for your help.

@chamnit
Owner

Great! Thanks for the update. Was there anything that you needed to do to the code other than re-assigning the pins? I'm curious.

@rustyoz

Apart from re-assigning the pins, it was a matter of tuning the current limit pots on my stepper drivers. Now i just need to get my limit switches set up. Oh a question about that. is grbl set up to handle one or 2 limit switches per axis?. so one switch would be "home" at x, y, z = 0 and the other would be the "limit" at the maximum travel of each axis.

@chamnit
Owner

It can handle as many as you need per axis. All you need to do is wire them in parallel with the pin and ground, so that if any one of them trigger, it brings the limit pin down to ground. You can set the direction for the homing cycle to search with the homing mask setting.

@chamnit chamnit closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.