ATMega1284p Sketch issues

Hey everyone,

soo i picked up a couple of the atmega1248p-pu chips and burned the bootloader no problem, but I just cant get any sketches on to it.

I tried a few diffrent setups and bootloaders, all burn with no issues. Im using the Mighty with optiboot at the moment.

when I try and upload a program i get this from avrdude:

         Using Port                    : /dev/tty.usbmodem1431
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Send: 0 [30]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [10] 
         AVR Part                      : ATMEGA1284P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

         Programmer Type : Arduino
         Description     : Arduino
avrdude: Send: A [41] . [80]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [03] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [81]   [20] 
avrdude: Recv: . [14] 
avrdude: Recv: . [04] 
avrdude: Recv: . [10] 
avrdude: Send: A [41] . [82]   [20] 
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

So I know that avrdude can see the chip, but just not upload the sketch. Ive got a cheap programmer from eBay (kmtronic v1.1) also using a uno, the output above is from the uno.

Any advice?

Thanks

Do not upload sketch via usbasp, but from arduino IDE (via serial)..
Trying burning a sketch via the usbasp will delete your bootloader probably..
Try to set the full swing oscillator fuse..
And do not forget the 100nF capacitor from dtr to reset.

Thanks for that, I have the cap in place all ready.

Im not sure how to set the full swing fuse?

Thanks

Hello Kapakra,
Visit that page http://www.engbedded.com/fusecalc
select the desired chip from the dropdown list. Then check the first dropdown box in the "features" section. Remember, messing up with fusebits may brick the chip. Be very careful with fusebit selection.
All the best.
:slight_smile:

Thanks for that, i set the fuses and still the same, also reburnt the boot loader.

is there a good layout for using this on a breadboard somewhere, there are hundreds of variations on line, anyone got on that works?

Thanks.

Like this?

Thanks for the advice so far, im still not having any joy, could someone take a look at my setup and advise what im doing wrong?

Thanks

Check your connections to pins 30 & 31, check data sheet.

Hi,

Do you mean the two caps I have on there? I read somehwere that mght work.

ive alos used this setup with the same results:

) pin 9 to 5V via a 10K resistor
2 ) pin 10 to 5V
3 ) pin 11 to GND
4 ) pin 12 to GND via a 22pF capacitor
5 ) pin 13 to GND via a 22pF capacitor
6 ) place 16/20MHz crystal between pins 12 & 13
7 ) pin 14 to arduino pin RX
8 ) pin 15 to arduino pin TX
9 ) pin 30 to 5V
10 ) pin 31 to GND
11 ) pin 6 to anode of an LED with cathode to GND via a 220ohm resistor (for the blink program)
12 ) connect GND and 5V of the arduino board to the bread board.

Or am I missing something very obvious!

Thanks

Ok, sounds like you’re close to describing this, which is a minimal setup.
The diode is optional, it helps prevent any reset problems with the part thinking you want to go into high voltage programming mode with spikes on the reset line.

Your 30 and 31 are floating in the picture you gave us.
Connect your 1284 up as Crossroads has supplied.

Also double check your RX and TX connections to the 1284 they may be backwards:
Arduino pin D0 is RX, with pin 14 of the 1284 marked as RX
Arduino pin D1 is TX, with pin 15 of the 1284 marked as TX

Hi Thanks for the help with this! Im able to upload and all seems well now.

i do have another issue if someone might be able to point me in the right direction,

Im using the ethercard library and im not sure what pins to use, at the moment is using 5,6,7,8 as cs, si, so, sck.

But im not getting anything back.

Has anyone used a similar setup?

Thanks.