ATmega324P 1.0 IDE

HI.

Does anyone have a pins_ardunio.h file for the pins mapping for a ATmega324P

I have used this chip on 0022 and would like to program it using Arduino 1.0

Thanks

Richard

Sure, the 324 is in the '1284 ‘family’.
Set up your IDE with maniacbugs '1284 cores

and copy the 1284 stuff into a '324 section, modifying the signature bytes:

Part Signature Bytes Address
0x000 0x001 0x002
ATmega164A 0x1E 0x94 0x0F
ATmega164PA 0x1E 0x94 0x0A
ATmega324A 0x1E 0x95 0x15
ATmega324PA 0x1E 0x95 0x11
ATmega644A 0x1E 0x96 0x09
ATmega644PA 0x1E 0x96 0x0A
ATmega1284 0x1E 0x97 0x06
ATmega1284P 0x1E 0x97 0x05

I’d give you better direction, but I haven’t looked at it in a while, and it’s late here …

Hi.

Thanks for that.. I am almost working now.

Now sure where to change the Signature Bytes Address..?

Thanks

Looks like they are in:

/mighty-1284p/bootloaders/standard/ATmegaBOOT.c

Need to get someone more knowledgable to figure out what to do with that file once its modified.

Or maybe it doesn't need modifying?

This looks close

#elif defined AVR_ATmega32
#define SIG2 0x95
#define SIG3 0x02
#define PAGE_SIZE 0x40U //64 words

Probably have to make a new entry under boards.txt as well.

Yes they are in there.. as this is used only to make the bootloader I do not need it just yet as I program via SPI

I think the basic stuff is working..

Added this to the boards.txt

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

arduino_324p.name=ATmega324P via AVRII

arduino_324p.upload.protocol=avrispmkii
arduino_324p.upload.using=avrispmkii
arduino_324p.upload.speed=19200
arduino_324p.upload.maximum_size=30720

arduino_324p.bootloader.low_fuses=0xFF
arduino_324p.bootloader.high_fuses=0xD2
arduino_324p.bootloader.extended_fuses=0x05
arduino_324p.bootloader.path=optiboot
arduino_324p.bootloader.file=optiboot_atmega1284p.hex
arduino_324p.bootloader.unlock_bits=0xFF
arduino_324p.bootloader.lock_bits=0xEF

arduino_324p.build.mcu=atmega324p
arduino_324p.build.f_cpu=16000000L
arduino_324p.build.core=arduino
arduino_324p.build.variant=bobuino

Thank you for your help...

Okay, just be aware that this

arduino_324p.build.variant=bobuino

will go give you the pinouts I use, which puts SPI on D11-12-13, I2C on A4/A5, Rx/Tx on D0/D1.
other versions use a different mapping.

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