atmega 1284 help with pinnout

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

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:

Table 27-4 on page 299
Looks like its been updated, this is the version, May 2012.

This code disables the JTAG on port C:

uint8_t tmp = 1<<JTD; // Disable JTAG
MCUCR = tmp; // Disable JTAG
MCUCR = tmp; // Disable JTAG

CrossRoads:
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?

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)

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?

john1993:
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.

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

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.

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 (574 KB)

boards.txt (14.9 KB)

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

john1993:
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

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)

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.

john1993:
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.

I doubt it. Have you seen support for any other board not made by "Arduino Inc" in a Arduino s/w release?

That is why you are already seeing forks.
mpide,
the guy that forked the ide to get lots of fixes and really nice feature updates into the windows IDE.
Paul with his teensy3.
(I have several personal updates I do to the "standard" core code to make the code smaller and faster for my builds)

While the source may be open, and it is possible to extend an Arduino s/w release with new core support,
the process of getting things into the official release is still very closed.

--- bill

While the source may be open, and it is possible to extend an Arduino s/w release with new core support,
the process of getting things into the official release is still very closed.

Yes it is frustrating at times. Several years back I got a 644p based board and installed the files needed to make the IDE work with it (around version 11 or 12 I think), but every time there was a new IDE release I would have to redo the mods and after a while I just stopped bothering. I understand the newer versions of the IDE make that effort easier but I keep misplacing the links for the detailed information steps required for actually adding a new board to the IDE.

But I can also kind of see their position too. If they indeed provided direct support to any and all 3rd party 'arduino' boards using different processors or clock speeds with their 'official' offerings, would they then not end up 'owning' all the support issues, bug reports, request for minor changes, etc, they included with the official release including the bootloaders? Sounds like a support headache they would probably like to avoid.

Lefty

what i meant was massimo should come out with an m1284 board himself. this would establish a standard pinout which, from browsing the "end to end" thread, seems to account for 2/3rd of the difficulties with this chip. the current thread being another example. the remaining 3rd may be a result of arduino deciding to abandon atmel pin designations in favor of arbitirary numbers but not much to be done about that at this point. however producing a new "official" 1284duino might force some of these wild and crazy innovators (present company excepted of course lol! ) to use more reasonable pinouts.

What would you consider a reasonable pinout?
For my '1284P designs, I tried to select the pins for shield compatability:
D0, D1 for serail(0),
D13-12-11-10 for SPI,
A4/A5-D18/D19 for I2C
The rest just followed from what was open.
That seemed reasonable to me, vs having to hunt around for Serial tie-ing up these pins, SPI tie-ing up those, and I2C yet somewhere else.
So more Uno like than Mega like.

Everything is a tradeoff.
The "standard pinouts" do not take full advantage of available pins. The Leonardo for instance, a few more IO pins could hve been made availabe in my opinion.
Fortunately the open source nature allows one to come up with a form factor & pinout, and if catches on, great, and if not, other things are always possible.

with only a few hours experience imo the bobuino has reasonable pinout and if adruino company does produce a board hopefully they will adopt it. ive read the whole "end-to-end" thread now and the process for choosing pins made a lot of sense but it wasnt always like that. for example some designs had the led on pd7 instead of pd5 which caused me some confusion ruunning the official blink demo. and as mentioned using uart1 instead of uart0 prevents use of 2 very useful direct ints on those pins. the uart0 pins do not have any more useful function and make a better boot interface. i realize there were rare and early problems with uart0 but this is now. and the story behind the extra adc pin selection was interesting too. as a hardware engineer i understand picking and choosing pinouts can be the secret to success and glad your board turned out so well. anyway thanks again to you guys and maniac bugs effort for helping me get this running.

hey john no problem for the hijack :wink: i solved my problem burning the original-mighty 1284p 16mhz bootloader and got the jtag fuses disabled the pinnout changed a bit but not much. im down to etching some pcb today :wink: hope all goes ok :wink:

glad to hear your problem was solved as easy as mine. these guys are great. i also ran into the same jtag lockout a while back but on a different chip. im curious, did you fix the jtag issue by changing fuses or from within the program like in florincs post?