00001
00002 #ifndef PPINC
00003 #define _ATMEGA324P // device select: _ATMEGAxxxx
00004 #define _B4096 // boot size select: _Bxxxx (words), powers of two only
00005 #ifdef __ICCAVR__
00006 #include "ioxm128A1.h"
00007 #endif
00008 #if __GNUC__
00009 #include <avr/io.h>
00010 #endif
00011
00012 #include "avr_compiler.h"
00013
00014 #define LARGE_MEMORY
00015
00016
00017 #define PROGPORT PORTD.OUT
00018 #define PROGPIN PORTD.IN
00019 #define PROG_NO PIN4_bp
00020
00021
00022 #define CPU_FREQ 2000000
00023 #define BAUD_RATE 9600
00024 #define BRREG_VALUE 12
00025
00026
00027 #define UART_PORT PORTD
00028 #define UART_TX_PIN PIN3_bm
00029 #define BAUD_RATE_LOW_REG USARTD0.BAUDCTRLA
00030 #define UART_CONTROL_REG USARTD0.CTRLB
00031 #define ENABLE_TRANSMITTER_BIT USART_TXEN_bp
00032 #define ENABLE_RECEIVER_BIT USART_RXEN_bp
00033 #define UART_STATUS_REG USARTD0.STATUS
00034 #define TRANSMIT_COMPLETE_BIT USART_TXCIF_bp
00035 #define DATA_REG_EMPTY_BIT USART_DREIF_bp
00036 #define RECEIVE_COMPLETE_BIT USART_RXCIF_bp
00037 #define UART_DATA_REG USARTD0.DATA
00038
00039
00040 #define SPMCR_REG NVM.CTRLB
00041 #define PAGESIZE 512
00042 #define APP_END 0x20000
00043
00044
00045 #define EEPROM_NO_PAGES 64
00046 #define EEPROM_BYTES_IN_PAGE 32
00047
00048 #define EEPROM_BYTE_ADDRESS_MASK 0x1f
00049
00050
00051 #define PARTCODE 0xFA
00052 #define SIGNATURE_BYTE_1 0x1E
00053 #define SIGNATURE_BYTE_2 0x97
00054 #define SIGNATURE_BYTE_3 0x4C
00055
00056
00057 #define PPINC
00058 #endif