migrating from Atmega328 to Atmega644

I am using an Arduino Duemilanove Atmega328 but will run out of code space soon.
I would like to use the Atmega644.
But the port function are different, Atmega328 port PC0-PC5 is analog while Atmega644 port PA0-PA7 is used for analog
How do I "alter" the code to make it go to the correct port?
Thanks

I would suggest reading http://sanguino.cc/, an entire site dedicated to the atmega644 in the arduino environment

If you start out with Arduino you will most likely set ports with DigitalWrite, however you can do it directly with Port Manipulation: Arduino Reference - Arduino Reference

Under hardware (Contact Support) you can find the pinout diagram of the atmega644.

Cheers!

Jack

With the IDE 1.5.2, for example, you may reuse the variant and the core from 1284p (mighty, bobulino, avr-developers layouts), which is pin compatible.
Optiboot does support 644 ("omake sanguino").

The 644 also has 40 pins rather than 28-pins so you need a new pcb. Plus the 1284
has the same pinout as 644, and 2X or so as much code and ram space. Look at the
Bobuino boards, as they are closest to 328 compatible pinouts.
http://www.crossroadsfencing.com/BobuinoRev17/

I made my own 1284 pcbs, and have been using them the past few weeks, and I love
the extra pins, etc.

pito:
With the IDE 1.5.2, for example, you may reuse the variant and the core from 1284p (mighty, bobulino, avr-developers layouts), which is pin compatible.
Optiboot does support 644 ("omake sanguino").

That's what I did to get a 644P working on a bobuino board. I added the below board entry into the boards.txt file and of course parked a copy of the 644P optiboot hex file into the maniac bootloader folder. Works fine.

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

bobuino644.name=Bobuino 644P optiboot
bobuino644.upload.protocol=arduino
bobuino644.upload.maximum_size=63488
bobuino644.upload.speed=115200
bobuino644.bootloader.low_fuses=0xff
bobuino644.bootloader.high_fuses=0xdc
bobuino644.bootloader.extended_fuses=0xfd
bobuino644.bootloader.path=optiboot
bobuino644.bootloader.file=optiboot_atmega644p-4-5.hex
bobuino644.bootloader.unlock_bits=0x3F
bobuino644.bootloader.lock_bits=0x0F
bobuino644.build.mcu=atmega644p
bobuino644.build.f_cpu=16000000L
#bobuino644.build.core=arduino:arduino
bobuino644.build.core=standard
bobuino644.build.variant=bobuino

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

Lefty

bobuino644.build.variant=bobuino

Very cool, you're using the 644 bootloader chip with the Bobuino pinout file for
compiling sketches. Good thing we've been fixing the couple of bugs in there, ;-).

oric_dan:

bobuino644.build.variant=bobuino

Very cool, you're using the 644 bootloader chip with the Bobuino pinout file for
compiling sketches. Good thing we've been fixing the couple of bugs in there, ;-).

Yea, hoping we aren't building castles on sand foundations. :wink: But it's fun getting these very useful chips to play on the arduino IDE, they really do fit a nice nitch between the 328P and SMD mega1280/2560 boards.

Lefty

they really do fit a nice nitch between the 328P and SMD mega1280/2560 boards.

I was using a 328 board to control my ServoTank robot, but ran out of code+RAM
space a year ago, and am planning to start development again with my new pcb and
the 1284 chip - with 4X the code space and 8X the RAM space, yay! I haven't had a
chance to work on it yet, but the 328 robot sketch compiles fine on the 1284. So far,
everything is going good with the 1284 board.

Hi All
Ok it seems that the 1280 is the way to go for more code and ram space.
So I compile my program under the board type ATMega128 and that should be it?
This chip 128 is the same pin outs as the 644 so it should work on a 644?
As It is easier to work on a 644 (pin and wire pad) is there any thing I should look out for?

Maybe I should stop typing and just give it a go.....

In the end I would want the CPU to run on 3.3v so a 8MHz would be used...

Best regards every one that chipped in

jamesvote:
Hi All
Ok it seems that the 1280 is the way to go for more code and ram space.
So I compile my program under the board type ATMega128 and that should be it?
This chip 128 is the same pin outs as the 644 so it should work on a 644?
As It is easier to work on a 644 (pin and wire pad) is there any thing I should look out for?

Maybe I should stop typing and just give it a go.....

In the end I would want the CPU to run on 3.3v so a 8MHz would be used...

Best regards every one that chipped in

This is all very confused as to what you mean. The 1280 and 128 are different chips
entirely from 1284 and 644. If you are meaning the 1284, then you should say 1284.

'644PA, '1284P will run 3.3V, 8MHz. See para. 27.2 in the datasheet.

Data sheets to all chips of interest can be found here.

ATmega644 8-bit AVR Microcontroller, 64KB Flash, 40/44-pin >> 40 pin DIP, 44 pin SMD

ATmega644A 8-bit AVR Microcontroller, 64KB Flash, 40/44/49-pin

ATmega644P 8-bit picoPower AVR Microcontroller, 64KB Flash, 40/44-pin

ATmega644PA 8-bit picoPower AVR Microcontroller, 64KB Flash, 40/44/49-pin

ATmega1284 8-bit AVR Microcontroller, 128KB Flash, 40/44-pin

ATmega1284P 8-bit AVR Microcontroller, 128KB Flash, 40/44-pin

ATmega128 8-bit AVR Microcontroller, 128KB Flash, 64-pin >> SMD

ATmega128A 8-bit AVR Microcontroller, 128KB Flash, 64-pin >> SMD

ATmega1280 8-bit AVR Microcontroller, 128KB Flash, 100-pin >> SMD

So now I have the 644P setup, I am using the "sparkfun" pocket AVR programmer to program the chip, rather then use the Arduino Duemilanove Atmega328 board as ISP.
I have set my programmer to USBtinyISP, gone to "file" and used "Upload using programmer", but it is VERY SLOW.
I noticed the web site about a command line switch "-B 1" to make it go faster, but were do I find this command line in the Arduino folder?
Also as I use Visual Studio, I will need to find the command line in there as well.....any ideas on were it is?
Thanks

We are building a 1284p platform that will be compatible with Uno pin layout.

Please take a look here and pledge if you can.
http://pozible.com/goldilocks

We've reached the same point that the Uno is underr resourced, but Mega doesn't work with most existing Shields without work.

[Note from Moderator - this site may cause your IE to hang up after it opens]

Such a platform already exists in a couple of formats.
Didn't take thousands of dollars to develop. Can be purchased now.
Your format is not Uno compatible. ICSP header is in the wrong place.


Ok, but it does not really answer my question...!
Were are the command line parameters held for AVRdude?
Or do I have to purchase another "cable" from "Sanuino" to program the 644P?
Thanks...

I have set my programmer to USBtinyISP, gone to "file" and used "Upload using programmer", but it is VERY SLOW.

Which part is slow? Turn on verbose mode to check. I believe "upload using programmer" will default to a full verify pass, which can indeed be slow on big cpus.

I noticed the web site about a command line switch "-B 1" to make it go faster, but were do I find this command line in the Arduino folder?

You can try looking up in info you can put in hardware/arduino/programmers.txt
I don't know whether that's sufficiently flexible to handle all options to all programmers, though.

Looking at prices it seems most places sell the 1284 cheaper than the 644 anyway.

Whatever you get you'll need to set the fuses as a minimum. For this you'll need an ISP programmer or another Arduino to use as an ISP.

The easiest way would be to burn the 644 or 1284 bootloader and then use a USB > UART converter to continue uploading via USB. You could upload sketches directly using ISP as well.

If using Arduino IDE the you'll need to add some entries to the boards.txt file and also some pin definitions.

The 644 and 1284 optiboot bootloaders can be done using IDE with either an external ISP or an Arduino as ISP.

I'm now using Nick Gammons programmer sketch to bootloader 1284's but it doesn't have 644 capability at the moment so that has to be done via ArduinoISP. I'm going to go back and see if I can work out how to add 644 to Nicks sketch.

I'm now using 1284 on my own board design for my project. This includes onboard ports for directly plugging in nRF radio modules, SD card, Ethernet, Bluetooth, GPS, accelerometer, matrix keypad, custom buttons, digital audio amplifier, RGB LED strip, shift register control, dual power input with 3 voltage monitor circuits and multiple I2C device headers. My v2 design includes RTC connectors, RFID and the ability to use a 328 with limited peripherals where minimum functionality is required.

I'm finding the 1284 to be a great coding workspace after the 328. I have some 644's that I need to try boot loading and testing on my board.