MCU User Forum
  MCU User Forum
  Reporting a Serial Number

Post New Topic  Post A Reply
profile | register | preferences | faq | search

UBBFriend: Email This Page to Someone! next newest topic | next oldest topic
Author Topic:   Reporting a Serial Number
HatakeKakashi
New Member
posted April 06, 2006 01:40 AM     Click Here to See the Profile for HatakeKakashi     Edit/Delete Message
I am looking for my chip to just output a unique serial number over the uart when it powers up. My recently bought C8051F020DK dev kit is overkill for such a simple thing, and unfortunately, does not even have knowledge of its own serial number. I'm going to try a suggested Dallas chip, however:

Can anyone make a recomendation for a board that would be able to just output a unique serial number repeatedly over a uart when it is powered up, and a company that would sell me these, with barcodes on the packaging, in quantities of 6,000 a year or so? (Any idea on the price would also be welcome)


(Why would they put a serial number for the chip, seperate from the one for the dev kit, on the box if they didn't intend to have the chip aware of it's own serial number.)

IP: Logged

WITTROCK
Member
posted April 06, 2006 10:43 AM     Click Here to See the Profile for WITTROCK   Click Here to Email WITTROCK     Edit/Delete Message
Hello,

If you just want to buy a ready made product, you might check out some of the dongles that some software companys use to protect the licensing of their products. I have seen parrallel port and USB dongles, and I presume someone makes a simple RS232 one as well. I also imagine these devices can be had with a unique number already assigned.

Happy Hunting,
WITTROCK

IP: Logged

erikm
Member
posted April 07, 2006 10:06 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
I went through this a year ago and found no better solution than the DS2411. and I definitely did not find any even remotely that economical.

Erik

IP: Logged

pblase
Member
posted April 10, 2006 09:55 AM     Click Here to See the Profile for pblase   Click Here to Email pblase     Edit/Delete Message
Send me an e-mail at pblase@aol.com. I'd be interested in producing such a thing.
Paul Blase

------------------
Paul Blase

IP: Logged

erikm
Member
posted April 10, 2006 09:57 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
Send me an e-mail

that would defy the purpose of havin a forum, would it not?

Erik

IP: Logged

Zig
Member
posted April 10, 2006 10:32 AM     Click Here to See the Profile for Zig   Click Here to Email Zig     Edit/Delete Message
that would defy the purpose of havin a forum, would it not?

Then would you post your solution? I too have incorporated a DS2411 into a design, but would be interested in seeing how others have implemented the interface software.

Zig

IP: Logged

erikm
Member
posted April 10, 2006 11:13 AM     Click Here to See the Profile for erikm   Click Here to Email erikm     Edit/Delete Message
////////////////////////////////////////////////////////////
//
// FUNCTION U1 GetUnique(void)
//
// get unique 64 bit byte number to GCXserBuf
// GUCmomma not neded, inserted for debuggng
// when product release combine read and wrire lines
//
// return true if number fetched

U1 GetUnique(void)
{
U1 GUCBea;
U1 GUCBret;
U8 GUCCtemp;
U8 GUCmomma;///////////

GUCBea = SBG_IE_EA;
GUCBret = Reset1W();
if (GUCBret == FALSE)
{
return (GUCBret);
}
WriteRrom() ; // select read ROM (read serial number mode)
// read 8 bytes (CRC 6 bytes family code) (read in reverse, no matter)
for ( GUCCtemp = 7 ; GUCCtemp!= 0xff ; GUCCtemp-- )
{
GUCmomma = Read1W(); // read a byte from the ID chip
GCXserBuf[GUCCtemp] = GUCmomma;
// GX_str_sgty.SGTYser[GUCCtemp] = GUCmomma;
}
SBG_IE_EA = GUCBea;
}


////////////////////////////////////////////////////////////
//
// FUNCTION void WriteRrom(void)
//
// transmit read serial number mode
//

void WriteRrom(void)
{
U8 RROCbits;
U8 RROCdata;

Delay10u ( 50 ); // Tw1l
RROCdata = 0x33;
for ( RROCbits = 8; RROCbits !=0 ; RROCbits--)
{
SBG_P3_1W = 0;
if (RROCdata & 1)
{
Delay10u ( 1 ); // Tw1l
SBG_P3_1W = 1;
Delay10u ( 7 ); // Tslot - Tw1l
}
else
{
Delay10u ( 6 ); // Tw0l
SBG_P3_1W = 1;
Delay10u ( 1 ); // Trec
}
RROCdata >>= 1;
}
}

////////////////////////////////////////////////////////////
//
// FUNCTION void U8 Read1W(void)
//
// read a byte from ID chip
//

U8 Read1W(void)
{
U8 R1WCtemp;
U8 R1WCret;
U1 R1WBtemp;
U1 R1WBmomma1;
U1 R1WBmomma2;
U1 R1WBmomma3;
U1 R1WBmomma4;
U1 R1WBmomma5;
U1 R1WBmomma6;

for ( R1WCtemp = 8; R1WCtemp!= 0; R1WCtemp--)
{
R1WCret >>= 1;
SBG_P3_1W = 0;
Delay10u ( 1 ); // Trl
SBG_P3_1W = 1;
R1WBmomma1 = SBG_P3_1W;
Delay10u ( 1 ); // Tmsr
R1WBtemp = SBG_P3_1W;


Delay10u ( 1 ); // Tmsr
R1WBmomma2 = SBG_P3_1W;
Delay10u ( 1 ); // Tmsr
R1WBmomma3 = SBG_P3_1W;
Delay10u ( 1 ); // Tmsr
R1WBmomma4 = SBG_P3_1W;
Delay10u ( 1 ); // Tmsr
R1WBmomma5 = SBG_P3_1W;

R1WBmomma6 = R1WBmomma1 & R1WBtemp & R1WBmomma2 & R1WBmomma3 & R1WBmomma5 & R1WBmomma5;

if (!R1WBmomma6)
{
Delay10u ( 1 ); // Trl // bekpt
}



Delay10u ( 6 ); // Tslot - Trl - Tmsr
if (R1WBtemp)
{
R1WCret |= 0x80;
}
Delay10u ( 12 ); //
}
return (R1WCret);
}


IP: Logged

Tsuneo
Member
posted April 11, 2006 02:56 AM     Click Here to See the Profile for Tsuneo   Click Here to Email Tsuneo     Edit/Delete Message
Other than DS2411, these 1-wire devices also have unique serial#.
DS2415 RTC + unique serial#
DS18S20 temp.sensor + unique serial#

From Maxim,
"AN162: Interfacing the DS18X20/DS1822 1-Wire Temperature Sensor in a Microcontroller Environment"
- including DS5000 (8051 compatible) 'C' code
http://pdfserv.maxim-ic.com/en/an/app162.pdf

"1-Wire Public Domain Kit"
http://www.maxim-ic.com/products/ibutton/software/1wire/wirekit.cfm
"Assembly language routines that represent low-level 1-Wire bus protocol algorithms such as reset/presence detect, byte I/O, and bit I/O. The routines are available for the following types of microcontrollers: 6303, 8051, 808X, ATMEL (ATmega103), and PIC (16C54, 12C508A)."

Tsuneo

PS.
HatakeKakashi - scarecrow in a field !?

[This message has been edited by Tsuneo (edited April 11, 2006).]

IP: Logged

All times are CT (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | MCU User Forum

Have you seen our MCU Knowledge Base?


Ultimate Bulletin Board 5.47b

Site Guide Privacy Legal