Welcome! Log In Create A New Profile

Advanced

Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?

Posted by comarius 
Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 09, 2017 07:00PM
Hi,
OS: Ubuntu 16, Adruino ide 1.0.5, Prusa I3 with Sanguinololu ATMEGA 1284P 16 Mhz
I am trying to Marlinuize the Sanguinololu.
I am following guide at: [reprap.org]

I am using usbtiny programmer connected to the I2C bus. I am fuse it by the
command, but I am usibng usbtiny and I am getting this


$ avrdude -p atmega1284p -c usbtiny -b 19200 -V -e -U lfuse:w:0xD6:m -U hfuse:w:0xDA:m -U efuse:w:0xFD:m -U flash:w:ATmegaBOOT_168_atmega1284p.hex:i

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: erasing chip
avrdude: reading input file "0xD6"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of lfuse written
avrdude: reading input file "0xDA"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of hfuse written
avrdude: reading input file "0xFD"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.01s

avrdude: 1 bytes of efuse written
avrdude: reading input file "ATmegaBOOT_168_atmega1284p.hex"
avrdude: writing flash (128986 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 128986 bytes of flash written

avrdude: safemode: Fuses OK (E:FD, Hgrinning smileyA, Lgrinning smiley6)

avrdude done. Thank you.



Then I am connecting the USB cable direct to the board and firing the arduino ide, load the Marlin.
I am selecting all Menu->Tools->Programmer from one by one and I am still getting.

Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 09, 2017 11:11PM
This could be a few things...

Do you have the auto reset jumper installed? "a 2-pin header to the "Autoreset Enable" jumper labeled AUTO RST on the silkscreen. This is located between the Z stepper motor socket and pins 8-10 of the ATMEGA1284P socket."

This enables the serial interface to be able to reset the board to run the bootloader you installed

Secondly make sure the boards.txt file for the 1284p matches the settings the boot loader expects

for eg the boot loaders I find online called ATmegaBOOT_168_atmega1284p the code shows
#define BAUD_RATE 19200

but boards.txt says

atmega1284.name=Sanguino W/ ATmega1284p 16mhz
atmega1284.upload.protocol=stk500
atmega1284.upload.maximum_size=131072
atmega1284.upload.speed=57600

so I would change the last line to atmega1284.upload.speed=19200 and try that (you need to restart IDE to reload this txt file)

Edited 1 time(s). Last edit at 04/09/2017 11:45PM by Dust.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 10, 2017 07:36AM
AFAIK the USBtinyISP does not support devices with more than 64kb flash, so it doesn't work with the ATmega1284.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 10, 2017 01:23PM
First, thank you for your answers.

Dust:, I will check that this afternoon as soon I am getting home.

Enif: I have an arduino nano as ISP, I made long ago for a copter. Would that work with firmwares over 64K.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 10, 2017 08:34PM
My setup:Ubuntu 16 64 bits, boards.txt changed as above, changed at 19200, and then even to 9600
USB /dev/ttyUSB0 from PC to USB connector on the sangaoulouloulou board.

There was a jumper thee already. I took it out, same response,

avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)


I put it back, reset the board, same response.

Experimental: JNI_OnLoad called.
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)
avrdude: stk500_recv(): programmer is not responding
Binary sketch size: 52,002 bytes (of a 131,072 byte maximum)


I tried with arduino ide 1.0 1.0.5 1.8.2 did not eat the sangoulououlouou hardware folder.

Edited 1 time(s). Last edit at 04/10/2017 08:36PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 10, 2017 08:55PM
Some boot loaders are just broken

I use the one from [reprap.org] use their bootloader-1284p-16mhz.hex
and set
upload.protocol=stk500v2
upload.speed=115200
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 13, 2017 07:41PM
Hi, avrdude: verification error
All the steps:

  1. download Gen7 zip version 2
  2. unzip it and copy it to arduino-1.0.5/hardware/Gen7
  3. unplug the LCD panel from the board to free the 6 pins for SPI
  4. and insert the programmer interface to prusa SPI

avrdude -C /etc/avrdude.conf -c usbtiny -p atmega1284p -B 5 -U lfuse:w:0xF7:m -U hfuse:w:0xDC:m -U efuse:w:0xFC:m
fuse fuses:

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: reading input file "0xF7"
avrdude: writing lfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of lfuse written
avrdude: verifying lfuse memory against 0xF7:
avrdude: load data lfuse data from input file 0xF7:
avrdude: input file 0xF7 contains 1 bytes
avrdude: reading on-chip lfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of lfuse verified
avrdude: reading input file "0xDC"
avrdude: writing hfuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of hfuse written
avrdude: verifying hfuse memory against 0xDC:
avrdude: load data hfuse data from input file 0xDC:
avrdude: input file 0xDC contains 1 bytes
avrdude: reading on-chip hfuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of hfuse verified
avrdude: reading input file "0xFC"
avrdude: writing efuse (1 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 1 bytes of efuse written
avrdude: verifying efuse memory against 0xFC:
avrdude: load data efuse data from input file 0xFC:
avrdude: input file 0xFC contains 1 bytes
avrdude: reading on-chip efuse data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: 1 bytes of efuse verified

avrdude: safemode: Fuses OK (E:FC, Hgrinning smileyC, L:F7)

avrdude done. Thank you.


burn bootloader
avrdude -C /etc/avrdude.conf -c usbtiny -p atmega1284p -B 1 -U flash:w:./bootloader-1284P-16MHz.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9705 (probably m1284p)
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "./bootloader-1284P-16MHz.hex"
avrdude: input file ./bootloader-1284P-16MHz.hex auto detected as Intel Hex
avrdude: writing flash (130244 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 130244 bytes of flash written
avrdude: verifying flash memory against ./bootloader-1284P-16MHz.hex:
avrdude: load data flash data from input file ./bootloader-1284P-16MHz.hex:
avrdude: input file ./bootloader-1284P-16MHz.hex auto detected as Intel Hex
avrdude: input file ./bootloader-1284P-16MHz.hex contains 130244 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x1f800
0xff != 0x8f
avrdude: verification error; content mismatch


avrdude: safemode: Fuses OK (E:FC, Hgrinning smileyC, L:F7)

avrdude done. Thank you.


I decide to continue disregarding that error. I

  1. power off prusa
  2. uplug the SPI and unhook the programmer
  3. put back the LCD connector
  4. plug the USB to prusa usb port
  5. check arduino-1.0.5/hardware/Gen7/boards.txt
    Gen7-644-16.name=Gen7 with ATmega644 and 16 MHz
    Gen7-644-16.upload.protocol=stk500v2
    Gen7-644-16.upload.maximum_size=63488
    Gen7-644-16.upload.speed=115200
  6. fire arduino ide 1.0.5
  7. open Marlin.ino
  8. Menu->Tools->Board->Gen 7 with atmega 1284 16Mhz
  9. Menu->Tools->Programmer-> As found default option: AVR ISP MKII
  10. Compile
  11. Upload
  12. Result:
  13. Printer is bricked !!!

I think I had enough with the Sang... I even can spell this name...

Edited 1 time(s). Last edit at 04/13/2017 07:45PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 14, 2017 12:35AM
Yeah... I'm all for making what ever weird hardware work. And Marlin does support a very wide selection of hardware. But at some point, it is easier to spend $20 and get the same hardware that 1/2 the people are using.

My recommendation would be to get an ATMega-2560 with a RAMPS v1.4 board. For sure... you will have no problems getting that up and running how you want it to operate. And you can flash the processor chip with a USB connection. It really is easy to use.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 14, 2017 12:42AM
"avrdude: verification error, first mismatch at byte 0x1f800
0xff != 0x8f"

thats not good, either your chip is damaged or there is an issue with your programmer

do you have another ardunio laying about? you could install ArduinoISP on that and use it as a programmer
ie [www.arduino.cc]

I agree that Sanguino is a PITA!
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 17, 2017 06:16PM
Thank you,
Already ordered Mega 2560 Board + RAMPS 1.4 + 4X A4988 that on amazon.ca.
Looks like I am getting it by May.
I did not spend time to read about it. Does is require different display or I can reuse the LCD.

Edited 1 time(s). Last edit at 04/17/2017 06:19PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 17, 2017 06:18PM
I have a nano. Ill try the Arduino ISP until I get the new board.

Edited 1 time(s). Last edit at 04/17/2017 06:25PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 19, 2017 09:34PM
I soldered a nano as ISP.

avrdude -F -P /dev/ttyUSB0 -b 57600 -c avrisp -p attiny45 -U flash:w:./bootloader-1284P-16MHz.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATtiny45 is 1E 92 06
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "./bootloader-1284P-16MHz.hex"
avrdude: input file ./bootloader-1284P-16MHz.hex auto detected as Intel Hex
avrdude: ERROR: address 0x1f810 out of range at line 2 of ./bootloader-1284P-16MHz.hex
avrdude: read from file './bootloader-1284P-16MHz.hex' failed

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.


Edited 4 time(s). Last edit at 04/19/2017 10:40PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 20, 2017 05:30AM
huh. why are you trying to put a 1284p bootloader onto a attiny45?

or -p is in error and should be atmega1284p

-p is the target processor, not the isp processor

Edited 1 time(s). Last edit at 04/20/2017 05:31AM by Dust.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 21, 2017 02:55PM
S...t I did not noticed that. Thank you...


avrdude -P /dev/ttyUSB0 -b 57600 -c avrisp -p atmega1284p -U flash:w:./bootloader-1284P-16MHz.hex -F

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e950f (probably m328p)
avrdude: Expected signature for ATmega1284P is 1E 97 05
avrdude: NOTE: "flash" memory has been specified, an erase cycle will be performed
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file "./bootloader-1284P-16MHz.hex"
avrdude: input file ./bootloader-1284P-16MHz.hex auto detected as Intel Hex
avrdude: writing flash (130244 bytes):

Writing | ################################################## | 100% 0.00s

avrdude: 130244 bytes of flash written
avrdude: verifying flash memory against ./bootloader-1284P-16MHz.hex:
avrdude: load data flash data from input file ./bootloader-1284P-16MHz.hex:
avrdude: input file ./bootloader-1284P-16MHz.hex auto detected as Intel Hex
avrdude: input file ./bootloader-1284P-16MHz.hex contains 130244 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.00s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x1f800
0x0c != 0x8f
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK (E:00, H:00, L:00)

avrdude done. Thank you.


Edited 1 time(s). Last edit at 04/21/2017 03:34PM by comarius.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 21, 2017 09:10PM
Two different programmers, same results.. 1284p chip is probably damaged.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
April 22, 2017 11:12AM
Thank you for all your support.
Re: Sanguinololu ATMEGA 1284P 16 Mhz What PRogrammer ?
January 20, 2019 01:58PM
The problem was fixed: Here are details.

Boards.txt tweaked from first answer (scroll to top)

## atmega1284.name=Sanguino W/ ATmega1284p 16mhz
## atmega1284.upload.protocol=stk500
## atmega1284.upload.maximum_size=131072
## atmega1284.upload.speed=57600

## Sanguino W/ ATmega1284 or ATmega1284P 16MHz
sanguino.menu.cpu.atmega1284p=ATmega1284 or ATmega1284P (16 MHz)

sanguino.menu.cpu.atmega1284p.upload.maximum_size=130072
sanguino.menu.cpu.atmega1284p.upload.maximum_data_size=16384
sanguino.menu.cpu.atmega1284p.upload.speed=57600
sanguino.menu.cpu.atmega1284p.protocol=stk500

The jumper by pins 8 9 on the board
Sorry, only registered users may post in this forum.

Click here to login