Pages: 1 2 3 [4] 5 6   Go Down
Author Topic: Using the 1284p/664p (IDE, bread board and boot loaders)  (Read 24644 times)
0 Members and 1 Guest are viewing this topic.
UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just clicked on the serial monitor and the board and connection are clearly working as the program I originally downloaded is churning out data:


Port A = B10101010
Port B = B10101010
Port C = B00000000
Port D = B11111111
Port A = B01010101
Port B = B01010101
Port C = B11111111
Port D = B00000000
Port A = B10101010
Port B = B10101010
Port C = B00000000
Port D = B11111111
Port A = B01010101
Port B = B01010101
Port C = B11111111
Port D = B00000000
Port A = B10101010
Port B = B10101010
Port C = B00000000
Port D = B11111111

etc etc etc
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Will do but at the moment I have a 1284p happily flashing away whilst running at 20MHz.  I will give it some further testing later.

Your original posts talk about 20MHz.  Are you still running at 20?  This bootloader was compiled for 16MHz.

Also, in a case like this it's useful if you could turn on verbose output and post the ENTIRE error message stream, including the avrdude call.
Logged


UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nope I have it running at 16Mhz as the outputs were more important than the speed.  I can't remember how to get the full output from Arduino's IDE so will just have a look.....
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

SHIFT button smiley

Ok I get this error:

avrdude: error: could not find USB device "USBasp" with vid=0x16c0 pid=0x5dc
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ignore the above I had a setting wrong due to messing....

I still get:

avrdude: stk500_getsync(): not in sync: resp=0x00

Whilst holding down SHIFT
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Right now I've sorted the verbose output using the tick box in preferences, this is the output:

/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cstk500v1 -P/dev/tty.usbserial-AFU83LO2 -b57600 -D -Uflash:w:/var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build2628191641529732676.tmp/Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/darren/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-AFU83LO2
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [00]
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.
« Last Edit: January 03, 2012, 07:06:02 pm by cowasaki » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Right next thing.....

If I plug in my AVRISP MK II and select upload using programmer it does work but it takes quite a while (maybe 90 seconds) to upload a small program.

I would still rather get it to work using the FTDI lead though.
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Wacky.  Works for me.  As you can see, quite similar to yours except the not working part.  The "not in sync" error is the most unhelpful error in the world.

Code:
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cstk500v1 -P/dev/tty.usbserial-A40081RP -b57600 -D -Uflash:w:/var/folders/Iy/IyymAOAIFPKmxm-fGSEuf++++TI/-Tmp-/build3529885193917945027.tmp/Blink_1284P.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/maniacbug/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbserial-A40081RP
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 57600
<snip>
avrdude: verifying ...
avrdude: 1188 bytes of flash verified
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.
[code]

You did just recently re-flash the bootloader, and you were certain to flash the 16MHz bootloader and not the 8MHz one?
[/code]
Logged


UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is strange.  I've put the boot loader from your download onto the 1284p using AVR studio and then tried again.  It still refuses to upload giving the following output:

Binary sketch size: 3200 bytes (of a 129024 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cstk500v1 -P/dev/cu.usbserial-AFU83LO2 -b57600 -D -Uflash:w:/var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/darren/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbserial-AFU83LO2
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [00]
avrdude: stk500_getsync(): not in sync: resp=0x00

avrdude done.  Thank you.


However if I hold down shift as I press upload it uses the AVRISP Mk2 instead of the FTDI lead and programs in a second without any problem:

Binary sketch size: 3200 bytes (of a 129024 byte maximum)
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega1284p -cstk500v2 -Pusb -Uflash:w:/var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 18:52:52
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/darren/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : usb
         Using Programmer              : stk500v2
avrdude: usbdev_open(): Found AVRISP mkII, serno: 000200049968
avrdude: usbdev_open(): using read endpoint 0x82
avrdude: Sent: . [01]
avrdude: Recv: . [01] . [00] . [0a] A [41] V [56] R [52] I [49] S [53] P [50] _ [5f] M [4d] K [4b] 2 [32]
avrdude: stk500v2_getsync(): found AVRISP mkII programmer
         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 : STK500V2
         Description     : Atmel STK500 Version 2.x firmware
         Programmer Model: AVRISP mkII
avrdude: Sent: . [03] . [90]
avrdude: Recv: . [03] . [00] . [01]
avrdude: Sent: . [03] . [91]
avrdude: Recv: . [03] . [00] . [01]
avrdude: Sent: . [03] . [92]
avrdude: Recv: . [03] . [00] . [0e]
         Hardware Version: 1
         Firmware Version Master : 1.14
avrdude: Sent: . [03] . [94]
avrdude: Recv: . [03] . [00] 2 [32]
         Vtarget         : 5.0 V
avrdude: Sent: . [03] . [98]
avrdude: Recv: . [03] . [00] . [02]
         SCK period      : 0.50 us

avrdude: Sent: . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00]
avrdude: Recv: . [10] . [00]
avrdude: AVR device initialized and ready to accept instructions

XXXX

avrdude: Device signature = 0x1e9705
avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed
         To disable this feature, specify the -D option.

XXXX

avrdude: erasing chip

XXXX

avrdude: reading input file "/var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex"
avrdude: writing flash (3200 bytes):

Writing | avrdude: Sent: . [06] . [00] . [00] . [00] . [00]
avrdude: Recv: . [06] . [00]
avrdude: Sent: . [13] .

XXXX

avrdude: Recv: . [13] . [00]
## | 100% 0.14s

avrdude: 3200 bytes of flash written
avrdude: verifying flash memory against /var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex:
avrdude: load data flash data from input file /var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex:
avrdude: input file /var/folders/vw/l5qhwynx30lbtcf34bjd6w4w0000gn/T/build3720295610697355183.tmp/_1284p_test.cpp.hex contains 3200 bytes
avrdude: reading on-chip flash data:

Reading | avrdude: Sent: . [06] . [00] . [00] . [00] . [00]

XXXX

avrdude: verifying ...
avrdude: 3200 bytes of flash verified
avrdude: Sent: . [11] . [01] . [01]
avrdude: Recv: . [11] . [00]

avrdude done.  Thank you.
Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Just looking at the board and there appears to be no capacitor between pin 6 of the FTDI cable and the RST pin on the chip.  Its a while since I built the board and it must have been before I sorted the design (I must have been using the reset button and timing it myself).  Will have to see if I can modify the board to include the cap, should be able to.

EDIT:  Just pulled up the board design in Eagle and it would appear that I did put the capacitor in as required BUT I also added a jumper which disconnects pin 6 of the FTDI from the IC.....  Yes the jumper is not fitted smiley-grin  So that's the problem....  I have no idea why my design had a jumper there but it does.

EDIT 2:  I shorted out the link and it still does not work.  It did before and the circuit is correct!

The circuit runs and it "talks" to the host computer without issues - I know this because the board has 8 LEDs on one port which flash in sequences and whilst running the 1284p sends data to the serial port on the host which can be seen displayed as per post above.....

So 5v & 0v are ok....  TX & RX are ok....  so just leaving the line from the FTDI that should reset it.  On the board this goes through a 100nF capacitor (which I have tested and works), through a link (which is shorted out) to pin 9 (reset).  I have checked and the circuit is ok from pin 6 of FTDI through to the cap and from the cap to pin 9.


So it would appear that there is an issue with the software setup ????????

I am running a Mac but I do have a MBP running W7 which I use for AVR etc.  I will now install Arduino v1.0 on that machine just to check. 
« Last Edit: January 04, 2012, 10:45:35 am by cowasaki » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Latest update:

Tried an alternative FTDI connection - no change...
Installed Arduino 1.0 on Windows 7 computer and tried again (with both FTDI) - no change.
Tried 3 different (known working 1284p chips) - no change
Re-built the circuit on bread bread - no change.

The 1284p will program using the AVR ISP Mk2 from Windows or MacOS
The 1284p will communicate with AVR Studio v 5.0 with no issues
The 1284p is running as it is communicating with the host computer along the FTDI whilst flashing LEDs in sequence.

Confirming that I have placed the folder in the Hardware folder of both machines as it was downloaded.
I have uploaded the boot loader called ATmegaBOOT_1284P.hex not the one called ATmegaBOOT_1284P_8MHz.hex
The boot loader was uploaded to the 1284p using AVRstudio v5 and verified.

I have also programmed the 8MHz version of the boot loader onto one of the 1284p chips and uploaded this, selected the 8MHz version in the menu and tried with that but I get the same result again.
« Last Edit: January 04, 2012, 12:26:46 pm by cowasaki » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Questions....

The verbose output states overriding baud rate to 57600 is the boot loader expecting this same speed ?

It is using STK500v1 whilst the AVR ISP MK2 works using STK500v2 is this correct?

The program on the 1284p is talking to the Arduino IDE correctly and all the connections are working - Is your test setup the same as the one I showed on page 1?
Logged

Seattle, WA
Offline Offline
God Member
*****
Karma: 11
Posts: 673
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The biggest difference here I see is that I am using mega-isp running on an Arduino to do the programming.  This is on a mac.  Try that and see.  If it still fails, then something really wierd is going on.  If it works, then we at least know where to look.

Yes, the bootloader expects 57k.  See the makefile, like 18.

I am using an FTDI breakout board instead of running through a duemilanove.

Btw, are you able to burn some other bootloader now and upload sketches using that?
Logged


UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Eureka!

Having re-programmed the 8MHz part to 16MHz and hit upload it worked.......

I thought that it must have been because I have the AVR ISP Mk2 still plugged in so I unplugged it but it worked again.....

After trying another part I realised that it does all work but ONLY if the 1284p is RESET AFTER UPLOADING THE BOOTLOADER or alternatively something else has happened.

I now have two parts that work using the circuit I posted at the beginning of the thread and using your folder.



Thanks for the help!

I was using a pair of FTDI breakouts (2 different manufacturers)
« Last Edit: January 04, 2012, 12:55:47 pm by cowasaki » Logged

UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh well it appears that that wasn't it after all.  Doing the same on the Mac (2 different installations), will reboot into Windows 7 and see if it improves.

I did think that maybe it was a crystal issue but I've just moved the crystal to 2mm from the IC and re-positioned the caps where the crystal was (just in case) and that made no difference.  The program is still working and the board still programs via the AVR ISP Mk2 with the LEDs still flashing in sequence and the device still talking to the host computer via serial......
Logged

Pages: 1 2 3 [4] 5 6   Go Up
Jump to: