Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
jamawg
PostPosted: Feb 09, 2012 - 02:55 AM
Wannabe


Joined: Jan 27, 2012
Posts: 76


I was told that each UC3 board has a unique serial number. How do I get it in software? Thanks.
 
 View user's profile Send private message  
Reply with quote Back to top
mikech
PostPosted: Feb 09, 2012 - 05:42 AM
Resident


Joined: Aug 19, 2003
Posts: 722
Location: Australia

It would help if you give an example of such a UC3 board.

The processor has system-registers which identify the type of cpu, revision and available features.
There is no unique serial number in the processor.

Some Atmel serial flash-memory chips have a unique ID. (eg the AT45DB321)
 
 View user's profile Send private message  
Reply with quote Back to top
catweax
PostPosted: Feb 09, 2012 - 10:06 AM
Hangaround


Joined: Aug 25, 2011
Posts: 463
Location: Europe

mikech wrote:
There is no unique serial number in the processor.
I disagree:
AT32UC3A3/A4 datasheet wrote:
12.10 Serial number in the factory page
Each device has a unique 120 bits serial number located in the factory page and readable from address 0x80800204 to 0x80800212.
AT32UC3B0/B1 datasheet wrote:
14.11 Serial Number
Each device has a unique 120 bits serial number readable from address 0x80800204 to 0x80800212.
AT32UC3C0/C1/C2 datasheet wrote:
15.11 Serial Number
Each device has a unique 120 bits serial number readable from address 0x80800284 to 0x80800292.
AT32UC3L0 datasheet wrote:
8.11 Serial Number
Each device has a unique 120 bits serial number readable from address 0x8080010C to 0x8080011A.
The only exception is the AT32UC3A0/A1 datasheet, which doesn’t mention a serial number.

I’ve tried it on the A3 and while several of the 15 bytes are identical between devices, none of my 16 A3 devices have all 15 bytes identical, so I assume the serial numbers to be unique.

Edit: The position of the L0’s serial number was changed in the latest datasheet revision.


Last edited by catweax on Feb 27, 2012 - 06:03 PM; edited 1 time in total
 
 View user's profile Send private message  
Reply with quote Back to top
danicampora
PostPosted: Feb 09, 2012 - 10:44 AM
Hangaround


Joined: Oct 10, 2007
Posts: 395
Location: Valls, Spain

Hey catweax,

Thanks a lot for this info, has been really helpful for me!!

_________________
Daniel Campora
http://www.lear.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
c4_esp
PostPosted: Feb 09, 2012 - 01:28 PM
Hangaround


Joined: May 03, 2011
Posts: 122
Location: Spain

You can do this in AT32UC3A3/A4

Code:

unsigned int UniqID[4];
getID(UniqID);

void getID(unsigned int *ID)
{
   volatile unsigned int *ptr_ID = 0x80800204;
      
   for (int i=0; i<4;i++)
   {
      ID[i] = *ptr_ID;
      ptr_ID++;
   }
   ID[3] = ID[3]>>16;
}
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
danicampora
PostPosted: Feb 09, 2012 - 03:19 PM
Hangaround


Joined: Oct 10, 2007
Posts: 395
Location: Valls, Spain

Or simply:

Code:

void getID(void *ID) {
   memcpy(ID, (void *)0x80800204, 15);
}

_________________
Daniel Campora
http://www.lear.com
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
AgwanII
PostPosted: Feb 09, 2012 - 03:39 PM
Posting Freak


Joined: Mar 17, 2005
Posts: 1348
Location: Stockholm, Sweden

Thanks for posting your function, makes it very fast to implement. At least three units I have tested here has uniq IDs. Do the numbers mean anything? Two of the chips has pretty similar number and they were both bought at the same time and are both TQFP. The third is BGA and has quite a lot more differance.
 
 View user's profile Send private message  
Reply with quote Back to top
catweax
PostPosted: Feb 09, 2012 - 04:56 PM
Hangaround


Joined: Aug 25, 2011
Posts: 463
Location: Europe

AgwanII wrote:
At least three units I have tested here has uniq IDs. Do the numbers mean anything?
The XMEGA datasheet sheds some light on this:
AVR XMEGA A Manual wrote:
The serial number consist of the production LOT number, wafer number, and wafer coordinates for the device.
Can’t remember where I got that information from, but in my XMEGA code I read 6 bytes LOT number, 1 byte wafer number, 1 uint16 X coordinate and 1 uint16 Y coordinate. I also read 3 bytes device ID and 1 byte revision ID, resulting in 15 bytes. That’s exactly as long as the AVR32 serial number. Hmm.... Wink

I just checked a bunch of AT32UC3A3256s:
Code:
996365DF3953343538372020FF151C
E08DDEBF3953343538372020FF1500
0B1FDBE23953343538372020FF160A
39D0B89F3953343538372020FF101F
5EDDAA2E3953343538372020FF0F0C
D1F68C833953343538372020FF1217
 d d d d i i i i i i i i i d d
420878AE3950303239342020FF061C
 d d d d i d d d d d i i i d d
The first six are from the same order: Four differing bytes, nine identical, then another two differing bytes.
The last one is from an earlier order and has more differing bytes, but some of them are similar to the identical ones from the other batch.

Maybe this information is useful for someone.
 
 View user's profile Send private message  
Reply with quote Back to top
mikech
PostPosted: Feb 09, 2012 - 08:40 PM
Resident


Joined: Aug 19, 2003
Posts: 722
Location: Australia

Well., I just learned something., to be more specific about which UC3A processor I am talking about !

The UC3A0xxx/1xxx do not have a serial number and I misread the UC3B0/1 blurb and thought that the serial number was in the rewritable userpage.

Sorry.
 
 View user's profile Send private message  
Reply with quote Back to top
jamawg
PostPosted: Feb 10, 2012 - 06:30 AM
Wannabe


Joined: Jan 27, 2012
Posts: 76


@mikech, I - the OP - learned the same thing. I also learned 1) the answer to my question, and 2) that other people want to know this too.

This is my first post here (unlikely to be my last) and I am very impressed by the response. Thanks a 1,000,000 everyone!
 
 View user's profile Send private message  
Reply with quote Back to top
AgwanII
PostPosted: Feb 10, 2012 - 07:50 AM
Posting Freak


Joined: Mar 17, 2005
Posts: 1348
Location: Stockholm, Sweden

I think it is very good manners to explain how a problem was solved when it has been. Does not matter if you solved it your self or if you solved it getting help. As you say jamawg, other people might want to know too, and that is what this forum is for.

Back to the subject of this thread. Is it not possible to just define a variable placed into that position of the memory? Something like this:
Code:
volatile unsigned int *HardWareID = ((void *)0x80800204);
 
 View user's profile Send private message  
Reply with quote Back to top
c4_esp
PostPosted: Feb 10, 2012 - 08:14 AM
Hangaround


Joined: May 03, 2011
Posts: 122
Location: Spain

Code:
Is it not possible to just define a variable placed into that position of the memory? Something like this:


Yes, it is. You can use a pointer and then get value from this pointer, you can see above this post.

But we can do this with extremely careful, becouse there are some part of flash that cann't read or write with a pointer or memcpy function like user page or fuses. In user page, for example, we ought to use flashc_memcpy for write it.

And yes, this forum is great Wink
 
 View user's profile Send private message Visit poster's website 
Reply with quote Back to top
jamawg
PostPosted: Feb 13, 2012 - 03:13 AM
Wannabe


Joined: Jan 27, 2012
Posts: 76


Quote:
The only exception is the AT32UC3A0/A1 datasheet, which doesn’t mention a serial number.


Aaargh!! I am currently using an EVK1100, which has an AT32UC3A0 Crying or Very sad
 
 View user's profile Send private message  
Reply with quote Back to top
catweax
PostPosted: Feb 13, 2012 - 10:45 AM
Hangaround


Joined: Aug 25, 2011
Posts: 463
Location: Europe

Read the whole factory calibration page (0x80800200-0x808002FF) and look for something that looks serial number-ish? Razz
 
 View user's profile Send private message  
Reply with quote Back to top
jamawg
PostPosted: Feb 16, 2012 - 02:00 AM
Wannabe


Joined: Jan 27, 2012
Posts: 76


jamawg wrote:
Quote:
The only exception is the AT32UC3A0/A1 datasheet, which doesn’t mention a serial number.


Aaargh!! I am currently using an EVK1100, which has an AT32UC3A0 Crying or Very sad


I asked Atmel tech support & got this reply:


The serial number is defined by a 120-bit data located at address 0x80800204-0x80800212 for UC3A. For each chip, the serial number is unique.

Here is an example:

volatile unsigned int* id_data = 0x80800204;

unsigned int ID_get[4];

for(int i=0;i<4;i++)

ID_get[i] = *id_data++;
 
 View user's profile Send private message  
Reply with quote Back to top
MBLANK
PostPosted: Jun 04, 2012 - 01:06 PM
Rookie


Joined: Sep 21, 2007
Posts: 36


is it possible to change the 120-bit data?
 
 View user's profile Send private message  
Reply with quote Back to top
catweax
PostPosted: Jun 04, 2012 - 01:39 PM
Hangaround


Joined: Aug 25, 2011
Posts: 463
Location: Europe

The factory page, where the serial number is located, is not writeable.

Otherwise it would defeat the purpose of a globally unique serial number.
 
 View user's profile Send private message  
Reply with quote Back to top
MBLANK
PostPosted: Jun 04, 2012 - 01:59 PM
Rookie


Joined: Sep 21, 2007
Posts: 36


ok, that`s a good info for me.
So I can use this number to make a licencenumber.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits