Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers

Board Serial

Altera_Forum
Honored Contributor II
1,138 Views

Hello, 

 

We have a PCB in who is connected to an main board via spi. 

I want be able read a unique serial number who is defferent for every board. 

 

any sugestions how to do this? 

 

Charlie,
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
452 Views

I assume you want to store the serial number inside the FPGA without making anything on each board unique (for example, not willing to do something like create a hard-wired serial number on FPGA device pins). 

 

I knew of someone who stored something similar to a serial number using the ECO flow documented in the Quartus handbook. A script was used to do the ECO steps to change a number in the FPGA. (I don't remember how the number was stored in the FPGA. It might have been hard-coded registers set up not to synthesize away.) The ECO script allowed making this change and creating a new programming file with the new number without doing a full compilation. Only the number got changed, so every board with a different number had exactly the same place and route in the FPGA for everything else. 

 

That was before incremental compilation. Another option might be to create a tiny design partition to store the serial number and have everything else (the Top partition and any other partitions you create for their own purposes) set to preserve placement and routing. You can change the serial number and do a regular recompile to get a new programming file. The place and route for everything else will be preserved. 

 

If you have a Nios CPU in the FPGA and it can write to flash, you could store the serial number in the flash. 

 

Someone else might have a simpler solution.
0 Kudos
Altera_Forum
Honored Contributor II
452 Views

If you don't mind adding a small device to your board and you've got a wire to spare, you might be interested in the Dallas/Maxim DS2401 device.  

 

You can see the datasheet here: 

 

http://datasheets.maxim-ic.com/en/ds/ds2401.pdf
0 Kudos
Altera_Forum
Honored Contributor II
452 Views

thx for all replies. 

 

adding an extra coponent is excluded the board is already finiched 

 

the device on the board is a cpld(epm570f100c5n). 

 

is was first thinken to write a program that opens a vhdl file changes a number compiles the project and downloads to the cpld. 

 

i will studie the eco solution from altera, i going to look for it. 

 

altrough the feature af having this serial number in to the cpld is not a priority.
0 Kudos
Altera_Forum
Honored Contributor II
452 Views

My incremental compilation suggestion isn't applicable to MAX II, but I think the ECO flow is supported for that device family. In the QII 7.1 handbook see Volume 2, Section IV, Chapter 14.

0 Kudos
Altera_Forum
Honored Contributor II
452 Views

Maybe you can use the UFM in max II cpld(like epm570). It has 8Kbits user flash memory. I think it is enough to record a serial number. The master device can read the number from the UFM.

0 Kudos
Altera_Forum
Honored Contributor II
452 Views

Best choice might be to create a SW or manufacturing API program that can read or write to the device with SPI or I2C interface, if you don't already have that. The MAX II UFM has enough space for serial numbers and the megafunction has SPI and I2C interfaces it will build in LEs for you. Those may take around 150 LEs though, so you'd need the space available in your 570 design. In manufacturing you need to add the SPI serial number programming step AFTER the CPLD programming step. You could have a scripted SPI tool that changes file source serial number information for each device coming down the line.  

 

Its possible , its just whether the stars align...
0 Kudos
Reply