READSIG/de

Aus MCS Wiki AVR
< READSIG(Weitergeleitet von READSIG)
Wechseln zu: Navigation, Suche

Inhaltsverzeichnis

= (**COPIED FROM ENGLISH PAGE**) === Action

This function reads a byte from the signature area in the XMEGA.

 

 

Syntax

var = READSIG(offset)

 

 

Remarks

Var

A byte that is assigned with the signature byte.

Offset

A byte variable or constant with an offset to the signature.

 

The Xmega has a number of signature bytes that are important.

For example the ADC is calibrated in the factory and the calibration data need to be loaded into the ADC registers in order to achieve 12 bit resolution.

 

The following offset table is copied from the Xmega128A1 definition file. It should be the same for all other Xmega chips but it is best to check it.

 

Const NVM_PROD_SIGNATURES_RCOSC2M_offset = &H00                ' RCOSC 2MHz Calibration Value

Const NVM_PROD_SIGNATURES_RCOSC32K_offset =&H02                ' RCOSC 32kHz Calibration Value

Const NVM_PROD_SIGNATURES_RCOSC32M_offset = &H03        ' RCOSC 32MHz Calibration Value

Const NVM_PROD_SIGNATURES_LOTNUM0_offset = &H08                ' Lot Number Byte 0, ASCII

Const NVM_PROD_SIGNATURES_LOTNUM1_offset = &H09                ' Lot Number Byte 1, ASCII

Const NVM_PROD_SIGNATURES_LOTNUM2_offset = &H0A                ' Lot Number Byte 2, ASCII

Const NVM_PROD_SIGNATURES_LOTNUM3_offset = &H0B                ' Lot Number Byte 3, ASCII

Const NVM_PROD_SIGNATURES_LOTNUM4_offset = &H0C                ' Lot Number Byte 4, ASCII

Const NVM_PROD_SIGNATURES_LOTNUM5_offset = &H0D                ' Lot Number Byte 5, ASCII

Const NVM_PROD_SIGNATURES_WAFNUM_offset = &H10                ' Wafer Number

Const NVM_PROD_SIGNATURES_COORDX0_offset = &H12                ' Wafer Coordinate X Byte 0

Const NVM_PROD_SIGNATURES_COORDX1_offset = &H13                ' Wafer Coordinate X Byte 1

Const NVM_PROD_SIGNATURES_COORDY0_offset = &H14                ' Wafer Coordinate Y Byte 0

Const NVM_PROD_SIGNATURES_COORDY1_offset = &H15                ' Wafer Coordinate Y Byte 1

Const NVM_PROD_SIGNATURES_ADCACAL0_offset = &H20        ' ADCA Calibration Byte 0

Const NVM_PROD_SIGNATURES_ADCACAL1_offset = &H21        ' ADCA Calibration Byte 1

Const NVM_PROD_SIGNATURES_ADCBCAL0_offset = &H24                ' ADCB Calibration Byte 0

Const NVM_PROD_SIGNATURES_ADCBCAL1_offset = &H25                ' ADCB Calibration Byte 1

Const NVM_PROD_SIGNATURES_TEMPSENSE0_offset = &H2E        ' Temperature Sensor Calibration Byte 0

Const NVM_PROD_SIGNATURES_TEMPSENSE1_offset = &H2F        ' Temperature Sensor Calibration Byte 0

Const NVM_PROD_SIGNATURES_DACAOFFCAL_offset = &H30        ' DACA Calibration Byte 0

Const NVM_PROD_SIGNATURES_DACACAINCAL_offset = &H31        ' DACA Calibration Byte 1

Const NVM_PROD_SIGNATURES_DACBOFFCAL_offset = &H32        ' DACB Calibration Byte 0

Const NVM_PROD_SIGNATURES_DACBGAINCAL_offset = &H33        ' DACB Calibration Byte 1

 

 

 

See also

NONE

 

 

Example


'----------------------------------------------------------------
' (c) 1995-2010, MCS
' xm128-readsig.bas
' This sample demonstrates how to read signature bytes
'-----------------------------------------------------------------
 
$regfile = "xm128a1def.dat"
$crystal = 32000000
$hwstack = 64
$swstack = 40
$framesize = 40
 
'include the following lib and code, the routines will be replaced since they are a workaround
$lib "xmega.lib"
$external _xmegafix_clear
$external _xmegafix_rol_r1014
 
'first enable the osc of your choice
Config Osc = Enabled , 32mhzosc = Enabled
 
'configure the systemclock
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
 
Config Com1 = 19200 , Mode = Asynchroneous , Parity = None , Stopbits = 1 , Databits = 8
 
 
Dim Offset As Byte , J As Byte
 
For J = 0 To 32
 Offset = Readsig(j) : Print J ; " - " ; Offset
Next
End

Languages   English Deutsch  
Meine Werkzeuge
Namensräume
Varianten
Aktionen
Navigation
In anderen Sprachen
Sprache