sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Signatures.h
Go to the documentation of this file.
1 // Signatures.h
2 //
3 // Signatures and extra information for known chips
4 //
5 // Author: Nick Gammon
6 
7 /* ----------------------------------------------------------------------------
8 NOTE: This file should only be modified in the Atmega_Hex_Uploader directory.
9 Copies in other directories are hard-linked to this one.
10 After modifying it run the shell script:
11  fixup_links.sh
12 This script needs to be run in the directories:
13  Atmega_Board_Programmer and Atmega_Board_Detector
14 That will ensure that those directories now are using the same file.
15 ------------------------------------------------------------------------------ */
16 
17 
18 // copy of fuses/lock bytes found for this processor
19 byte fuses [5];
20 
21 // meaning of positions in above array
22 enum {
28 };
29 
30 // structure to hold signature and other relevant data about each chip
31 typedef struct {
32  byte sig [3]; // chip signature
33  char desc [14]; // fixed array size keeps chip names in PROGMEM
34  unsigned long flashSize; // how big the flash is (bytes)
35  unsigned int baseBootSize; // base bootloader size (others are multiples of 2/4/8)
36  unsigned long pageSize; // flash programming page size (bytes)
37  byte fuseWithBootloaderSize; // ie. one of: lowFuse, highFuse, extFuse
38  bool timedWrites; // true if pollUntilReady won't work by polling the chip
40 
41 const unsigned long kb = 1024;
42 const byte NO_FUSE = 0xFF;
43 
44 
45 // see Atmega datasheets
46 const signatureType signatures [] PROGMEM =
47  {
48 // signature description flash size bootloader flash fuse timed
49 // size page to writes
50 // size change
51 
52  // Attiny84 family
53  { { 0x1E, 0x91, 0x0B }, "ATtiny24", 2 * kb, 0, 32, NO_FUSE, false },
54  { { 0x1E, 0x92, 0x07 }, "ATtiny44", 4 * kb, 0, 64, NO_FUSE, false },
55  { { 0x1E, 0x93, 0x0C }, "ATtiny84", 8 * kb, 0, 64, NO_FUSE, false },
56 
57  // Attiny85 family
58  { { 0x1E, 0x91, 0x08 }, "ATtiny25", 2 * kb, 0, 32, NO_FUSE, false },
59  { { 0x1E, 0x92, 0x06 }, "ATtiny45", 4 * kb, 0, 64, NO_FUSE, false },
60  { { 0x1E, 0x93, 0x0B }, "ATtiny85", 8 * kb, 0, 64, NO_FUSE, false },
61 
62  // Atmega328 family
63  { { 0x1E, 0x92, 0x0A }, "ATmega48PA", 4 * kb, 0, 64, NO_FUSE, false },
64  { { 0x1E, 0x93, 0x0F }, "ATmega88PA", 8 * kb, 256, 128, extFuse, false },
65  { { 0x1E, 0x94, 0x0B }, "ATmega168PA", 16 * kb, 256, 128, extFuse, false },
66  { { 0x1E, 0x94, 0x06 }, "ATmega168V", 16 * kb, 256, 128, extFuse, false },
67  { { 0x1E, 0x95, 0x0F }, "ATmega328P", 32 * kb, 512, 128, highFuse, false },
68  { { 0x1E, 0x95, 0x16 }, "ATmega328PB", 32 * kb, 512, 128, highFuse, false },
69  { { 0x1E, 0x95, 0x14 }, "ATmega328", 32 * kb, 512, 128, highFuse, false },
70 
71  // Atmega644 family
72  { { 0x1E, 0x94, 0x0A }, "ATmega164P", 16 * kb, 256, 128, highFuse, false },
73  { { 0x1E, 0x95, 0x08 }, "ATmega324P", 32 * kb, 512, 128, highFuse, false },
74  { { 0x1E, 0x96, 0x0A }, "ATmega644P", 64 * kb, 1 * kb, 256, highFuse, false },
75 
76  // Atmega2560 family
77  { { 0x1E, 0x96, 0x08 }, "ATmega640", 64 * kb, 1 * kb, 256, highFuse, false },
78  { { 0x1E, 0x97, 0x03 }, "ATmega1280", 128 * kb, 1 * kb, 256, highFuse, false },
79  { { 0x1E, 0x97, 0x04 }, "ATmega1281", 128 * kb, 1 * kb, 256, highFuse, false },
80  { { 0x1E, 0x98, 0x01 }, "ATmega2560", 256 * kb, 1 * kb, 256, highFuse, false },
81 
82  { { 0x1E, 0x98, 0x02 }, "ATmega2561", 256 * kb, 1 * kb, 256, highFuse, false },
83 
84  // AT90USB family
85  { { 0x1E, 0x93, 0x82 }, "At90USB82", 8 * kb, 512, 128, highFuse, false },
86  { { 0x1E, 0x94, 0x82 }, "At90USB162", 16 * kb, 512, 128, highFuse, false },
87 
88  // Atmega32U2 family
89  { { 0x1E, 0x93, 0x89 }, "ATmega8U2", 8 * kb, 512, 128, highFuse, false },
90  { { 0x1E, 0x94, 0x89 }, "ATmega16U2", 16 * kb, 512, 128, highFuse, false },
91  { { 0x1E, 0x95, 0x8A }, "ATmega32U2", 32 * kb, 512, 128, highFuse, false },
92 
93  // Atmega32U4 family - (datasheet is wrong about flash page size being 128 words)
94  { { 0x1E, 0x94, 0x88 }, "ATmega16U4", 16 * kb, 512, 128, highFuse, false },
95  { { 0x1E, 0x95, 0x87 }, "ATmega32U4", 32 * kb, 512, 128, highFuse, false },
96 
97  // ATmega1284P family
98  { { 0x1E, 0x97, 0x05 }, "ATmega1284P", 128 * kb, 1 * kb, 256, highFuse, false },
99  { { 0x1E, 0x97, 0x06 }, "ATmega1284", 128 * kb, 1 * kb, 256, highFuse, false },
100 
101  // ATtiny4313 family
102  { { 0x1E, 0x91, 0x0A }, "ATtiny2313A", 2 * kb, 0, 32, NO_FUSE, false },
103  { { 0x1E, 0x92, 0x0D }, "ATtiny4313", 4 * kb, 0, 64, NO_FUSE, false },
104 
105  // ATtiny13 family
106  { { 0x1E, 0x90, 0x07 }, "ATtiny13A", 1 * kb, 0, 32, NO_FUSE, false },
107 
108  // Atmega8A family
109  { { 0x1E, 0x93, 0x07 }, "ATmega8A", 8 * kb, 256, 64, highFuse, true },
110 
111  // ATmega64rfr2 family
112  { { 0x1E, 0xA6, 0x02 }, "ATmega64rfr2", 256 * kb, 1 * kb, 256, highFuse, false },
113  { { 0x1E, 0xA7, 0x02 }, "ATmega128rfr2", 256 * kb, 1 * kb, 256, highFuse, false },
114  { { 0x1E, 0xA8, 0x02 }, "ATmega256rfr2", 256 * kb, 1 * kb, 256, highFuse, false },
115 
116  }; // end of signatures
117 
118 
Definition: Signatures.h:25
const byte NO_FUSE
Definition: Signatures.h:42
uint8_t byte
Definition: Arduino.h:123
bool timedWrites
Definition: Signatures.h:38
unsigned long pageSize
Definition: Signatures.h:36
unsigned int baseBootSize
Definition: Signatures.h:35
Definition: Signatures.h:26
Definition: Signatures.h:31
Definition: Signatures.h:27
Definition: Signatures.h:23
unsigned long flashSize
Definition: Signatures.h:34
Definition: Signatures.h:24
byte fuses[5]
Definition: Signatures.h:19
const signatureType signatures[] PROGMEM
Definition: Signatures.h:46
byte fuseWithBootloaderSize
Definition: Signatures.h:37
const unsigned long kb
Definition: Signatures.h:41