Pages: [1] 2   Go Down
Author Topic: atmega 1284 help with pinnout  (Read 4790 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hy i have a problem with my atmega 1284 (got 2 of this chips)

I managed to hook one up and burn a bootloader on it, a sanguino 16mhz for 1284p.

For now all is working ok i am using the folowing pinnout for the sanguino :

Code:
// ATMEL ATMEGA644P / SANGUINO
//
//                     +---\/---+
// 0  INT0 (D 0) PB0  1|        |40  PA0 (AI 0 / D31) 31
// 1  INT1 (D 1) PB1  2|        |39  PA1 (AI 1 / D30) 30
// 2  INT2 (D 2) PB2  3|        |38  PA2 (AI 2 / D29) 39
// 3   PWM (D 3) PB3  4|        |37  PA3 (AI 3 / D28) 28
// 4   PWM (D 4) PB4  5|        |36  PA4 (AI 4 / D27) 27
// 5  MOSI (D 5) PB5  6|        |35  PA5 (AI 5 / D26) 26
// 6  MISO (D 6) PB6  7|        |34  PA6 (AI 6 / D25) 25
// 7   SCK (D 7) PB7  8|        |33  PA7 (AI 7 / D24) 24
//               RST  9|        |32  AREF
//               VCC 10|        |31  GND
//               GND 11|        |30  AVCC
//             XTAL2 12|        |29  PC7 (D 23) 23
//             XTAL1 13|        |28  PC6 (D 22) 22
// 8  RX0 (D 8)  PD0 14|        |27  PC5 (D 21) TDI 21
// 9  TX0 (D 9)  PD1 15|        |26  PC4 (D 20) TDO 20
//10  RX1 (D 10) PD2 16|        |25  PC3 (D 19) TMS 19
//11  TX1 (D 11) PD3 17|        |24  PC2 (D 18) TCK 18
//12  PWM (D 12) PD4 18|        |23  PC1 (D 17) SDA 17
//13  PWM (D 13) PD5 19|        |22  PC0 (D 16) SCL 16
//14  PWM (D 14) PD6 20|        |21  PD7 (D 15) PWM 15
//                     +--------+
//

had to wrap it into code to look good smiley-wink

It tooked me a wile to figure out the pins (number ones) but well i think i made it on the left side are the pin numbers wich works in arduino eg pin 0 is the pin pb0 ,  pin 14 is PD6 and pin 24 is PA7. (correct me if i am wrong)

all works ok except few of them :

18,19,20,21  (PC2 , PC3 , PC4 , PC5 ) can you please tell me can i use this pins as digital outputs or inputs? i am realy short on pins and this one do not work.

the blink code compiles but i do not get anything like the desired effect on pin 18, all i get is a faded led even if i connect to pin 19 or 20 or 21 with the same blink sketch on pin 18. ( i hooked up to power the other chip without bootloader and is dooing the same thing faded led without any sketch on it so it must be something hardware).

please tell me what does TCK   , TMS    ,TDO    and TDI stands for ?

thanks and please bare with me and excuse my poor english.

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

All pins are usable as digital input & and output. 

TCK   , TMS    ,TDO    and TDI  are for connecting a JTAG device if you have one.
There is a fuse bit associated with JTAG, you may need to re-program that bit.

See Table 26-4, page 298 of the datasheet.
High Fuse byte, bit 6, is the the JTAG enable bit, and it is enabled by defualt.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hy, thanks for the answer unfortunatly i did not find the page u were talking in the datasheets i found smiley-sad

but i did searched a bit afther the fuse stuff and i found this fuse calculator :

http://www.engbedded.com/fusecalc

but somehow i do not know exactly how to use it and wich options to chose from...

so i found another post of yours http://arduino.cc/forum/index.php/topic,131254.0.html

and you have atached a 1284boards to try.txt  where i found this settings for bobuino mega1284

##############################################################

mighty_1284.name=1284 Bobuino
mighty_1284.upload.protocol=arduino
mighty_1284.upload.maximum_size=130048
mighty_1284.upload.speed=115200
mighty_1284.bootloader.low_fuses=0xff
mighty_1284.bootloader.high_fuses=0xde
mighty_1284.bootloader.extended_fuses=0xfd
mighty_1284.bootloader.path=optiboot
mighty_1284.bootloader.file=optiboot_atmega1284p.hex
mighty_1284.bootloader.unlock_bits=0x3F
mighty_1284.bootloader.lock_bits=0x0F
mighty_1284.build.mcu=atmega1284
mighty_1284.build.f_cpu=16000000L
#bobuino.build.core=arduino:arduino
mighty_1284.build.core=standard
mighty_1284.build.variant=bobuino

##############################################################

can you please confirm me if this settings are corect, will it disable jtag?

will this work if i modify the file boards.txt in c:\arduino\hardware\sanguino\boards.txt and burn again the bootloader to the chip ?


now i have this in boards.txt :

##############################################################

atmega1284.name=Sanguino W/ ATmega1284p 16mhz

atmega1284.upload.protocol=stk500
atmega1284.upload.maximum_size=131072
atmega1284.upload.speed=57600

atmega1284.bootloader.low_fuses=0xFF
atmega1284.bootloader.high_fuses=0x9A
atmega1284.bootloader.extended_fuses=0xFF
atmega1284.bootloader.path=atmega
atmega1284.bootloader.file=ATmegaBOOT_168_atmega1284p.hex
atmega1284.bootloader.unlock_bits=0x3F
atmega1284.bootloader.lock_bits=0x0F

atmega1284.build.mcu=atmega1284p
atmega1284.build.f_cpu=16000000L
atmega1284.build.core=arduino
atmega1284.build.variant=standard
#


thanks.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This is what I use from the standard mighty1284 addition to the IDE.
Code:
bobuino.name=Bobuino
bobuino.upload.protocol=arduino
bobuino.upload.maximum_size=130048
bobuino.upload.speed=115200
bobuino.bootloader.low_fuses=0xff
bobuino.bootloader.high_fuses=0xde
bobuino.bootloader.extended_fuses=0xfd
bobuino.bootloader.path=optiboot
bobuino.bootloader.file=optiboot_atmega1284p.hex
bobuino.bootloader.unlock_bits=0x3F
bobuino.bootloader.lock_bits=0x0F
bobuino.build.mcu=atmega1284p
bobuino.build.f_cpu=16000000L
#bobuino.build.core=arduino:arduino
bobuino.build.core=standard
bobuino.build.variant=bobuino
You may have looked at the summary datasheet, vs the complete datasheet:
http://www.atmel.com/Images/doc8272.pdf
Table 27-4 on page 299
Looks like its been updated, this is the version, May 2012.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This code disables the JTAG on port C:

Code:
uint8_t tmp = 1<<JTD; // Disable JTAG
MCUCR = tmp; // Disable JTAG
MCUCR = tmp; // Disable JTAG
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is what I use from the standard mighty1284 addition to the IDE.

crossraods, can i ask where that bootloader is from that you used with that and what port it uses?
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 545
Posts: 27357
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

This one, sketch downloads on Serial 0.
I just bootloaded another blank part from Atmel AVR ISP MKii  & loaded a sketch with FTDI Basic - worked first time.

* optiboot_atmega1284p.hex (1.47 KB - downloaded 15 times.)

* Bootload-sketch-connections.jpg (103.92 KB, 806x910 - viewed 47 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

im trying to get arduino0022 blink to run with m1284 (not p). with so many bootloaders, conf and board files there are thousands of combinations. my head is spinning.

using your hex file and board.txt entry (m1284p) i get: "'output' not declared in this scope"

with the above mighty1284 board.txt entry (m1284) i get: "atmega1284 supported for assembler only"

i have updated avrdude.conf with m1284 and m1284p entries. any idea what im doing wrong?
Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2738
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

im trying to get arduino0022 blink to run with m1284 (not p). with so many bootloaders, conf and board files there are thousands of combinations. my head is spinning.

Note that earlier parts of this thread are referring to 1.x board.txt entries.

Quote

i have updated avrdude.conf with m1284 and m1284p entries. any idea what im doing wrong?
The updated 5.11svn avrdude that I gave you should have already had 1284p support in it.


There are several differing pinouts for the 644/1284 processors that are controlled by the core code.
Actually it is by the tables in data arrays stored in flash that changed depending on which core you have.

While I wasn't a fan of several of things that the Arduino team in Arduino 1.0
Arduino 1.x does have a mechanism that makes changing pin mappings easier.
Arduino 1.x allows you to specify the core and the variant of that core separately
in the boards.txt file.
This is very useful for the 644/1284 "Sanguino" core because of the different pin mappings
for the same core code.
If I were you, I'd bite the bullet and jump up to Arduino 1.x and then you can more easily
adjust things as needed.

--- bill
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ive had 0102 running for some time now but use 0022 on this machine for legacy reasons. the avrdude i got from you is running from command line (no ide) and solved all my xp assembler development issues. but not being used for arduino because its not needed. im using stock 0022 atm with whatever minimal mods are being suggested. cant get m1284 running though.

so youre thinking if i use the bootloader i just got from bob and add his bobuino boards.txt entry with 0102 then everything will work? ill try that.

btw this is for a bobuino board i just got hold of and unrelated to the other project.
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, i went into STOCK 0102 and added bobs "mighty1284" to boards.txt then added 1284 and 1284p entries to its avrdude.conf. same error as 0022:  "'output' was not declared in this scope"

btw as we discussed in the other thread m1284 support was not present in your avrdude. i had to go in and add that.

edit: further inspection shows "avrdude unknown mcu: atmega1284" so looks like something wrong with conf or board files. i attached copies:

* avrdude.conf (573.58 KB - downloaded 11 times.)
* boards.txt (14.94 KB - downloaded 19 times.)
« Last Edit: November 23, 2012, 05:02:23 pm by john1993 » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2738
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This rapidly turning into a thread hi-jack.
Another thread would probably be better to resolve this.

ok, i went into STOCK 0102 and added bobs "mighty1284" to boards.txt then added 1284 and 1284p entries to its avrdude.conf. same error as 0022:  "'output' was not declared in this scope"
Are you sure it isn't OUTPUT vs output.
It makes a difference.
And I'm assuming that there are other/additional error messages or information as well.
Make sure to build the code with verbose enabled in the IDE so it spits out everything
including the commands so you can see the include paths to make sure that the proper
include paths are being used.

It sounds like Arduino.h (arduino 1.x) or wiring.h (pre 1.x arduino) is not being found
which could mean that the 1284 core is not installed in the proper location
(in the Arduino tree hardware directory or under your sketch/hardware directory)

--- bill

Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

1284 core? maybe we have found the root of the problem. havent seen mention of "cores" so far and have not installed any. as i mentioned its a stock 0102 install. is it the standard download insufficient? im half way though the "1284 end to end" megatread (many hours of reading) and no indication of how to actually get a m1284 running. lots on pcb design and eagle files. is there another that might give a hint on proper install for m1284?

maybe littlej is having similar problems with no resolution so might not be too hijacked but i will start a new thread. i hate to clutter the forum with repeat issues. is there a thread showing how to get m1284 going in the ide? (bootloader, board.txt, avrdude.conf, "cores", etc)
« Last Edit: November 23, 2012, 06:21:33 pm by john1993 » Logged

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 70
Posts: 2738
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

https://github.com/maniacbug/mighty-1284p
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 8
Posts: 313
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thanks to you and to bob for the loader it went much smoother than i ever would have expected. in less than half a minute after dowloading that zip file the led was blinking. moving to arduino0102 and that link was the key. this should be a sticky in this forum.

i cant imagine massimos group can ignore this chip any longer. huge loss in profit once people wake up to the cost benefit of the m1284. i suspect before the end of the year this core will be part of the standard distribution. thanks again.
« Last Edit: November 23, 2012, 07:12:22 pm by john1993 » Logged

Pages: [1] 2   Go Up
Jump to: