SNLA371B December   2020  – February 2024 DP83TG720R-Q1 , DP83TG720S-Q1

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. Introduction
  5. Hardware Configuration
    1. 2.1 Schematic
  6. Software Configuration
  7. Testing PMA
    1. 4.1 PMA Testing Procedure
  8. Testing IOP: Link-up and Link-down
    1. 5.1 IOP Testing Procedure
  9. Testing SQI
    1. 6.1 SQI Testing Procedure
    2. 6.2 Mapping SQI with Link Quality
  10. Testing TDR
    1. 7.1 TDR Testing Procedure
  11. Testing EMC/EMI
  12. 10Revision History

SQI Testing Procedure

GUID-189F9C03-7FC0-4EC6-B2BC-4AE8C1A28888-low.gifFigure 6-1 SQI Procedure For Extra Hysteresis

Sample Code for Extra Hysteresis :

cyg_uint8 TI_DP83TG720::GetSQI() {
	static cyg_uint16 first_time = 1;
	static cyg_uint16 prevSQI = 0;
    cyg_uint16 regValue;
	cyg_uint16 reg_link;
	cyg_uint16 mse_lock;
	cyg_uint16 currSQI;
	cyg_uint16 result;
	static cyg_uint32 mse_iir = 0;
	cyg_uint16 mse_out;

    reg_link = ReadRegister(0x1F, 0x0180);
	regValue = ReadRegister(0x1F, 0x0875);
	mse_lock = (regValue & 0x3FF);

	if (first_time == 1) {
		mse_iir = mse_lock << 8;
	}
	else {
		mse_iir = mse_lock + mse_iir - ((mse_iir + 128) >> 8);
	}
	mse_out = (mse_iir + 128) >> 8;	

//comparison without hysterisis	
	
	if ((first_time == 1) && ((reg_link & 0x3007) == 0x3007)){
		if (mse_out >= 0x5E) {
			currSQI = 0x1; }
		else if (mse_out >= 0x4E) {
			currSQI = 0x2; }
		else if (mse_out >= 0x3E) {
			currSQI = 0x3; }
		else if (mse_out >= 0x2B) {
			currSQI = 0x4; }
		else if (mse_out >= 0x1E) {
			currSQI = 0x5; }
		else if (mse_out >= 0xD) {
			currSQI = 0x6; }
		else {
			currSQI = 0x7; }
		first_time = 0;
	}

//comparison with hysterisis

	else if ((first_time == 0) && ((reg_link & 0x3007) == 0x3007)){
		if (prevSQI == 0x1) {
			if (mse_out < 0x5E) 		//threshold1_down
					    {
				currSQI = 0x2; }
			else {
				currSQI = 0x1; } }
		else if (prevSQI == 0x2) {
			if (mse_out < 0x4E) 	        //threshold2_down
					     {
				currSQI = 0x3; }
			else if (mse_out > 0x67)        //threshold2_up  
					      {
				currSQI = 0x1; } 
			else {
				currSQI = 0x2; } }
		else if (prevSQI == 0x3) {
			if (mse_out < 0x3E) 		//threshold3_down
					     {
				currSQI = 0x4; }
			else if (mse_out > 0x56)        //threshold3_up
					     {
				currSQI = 0x2; }
			else {
				currSQI = 0x3; } }
		else if (prevSQI == 0x4) {
			if (mse_out < 0x2B) 		//threshold4_down
					     {
				currSQI = 0x5; }
			else if (mse_out > 0x46)	//threshold4_up
					     {
				currSQI = 0x3; }
			else {
				currSQI = 0x4; } }
		else if (prevSQI == 0x5) {
			if (mse_out < 0x1E) 		//threshold5_down
					    {
				currSQI = 0x6; }
			else if (mse_out > 0x36)	//threshold5_up
					     {
				currSQI = 0x4; }
			else {
				currSQI = 0x5; } }
		else if (prevSQI == 0x6) {
			if (mse_out < 0xD) 		//threshold6_down
					     {
				currSQI = 0x7; }
			else if (mse_out > 0x26)	//threshold6_up
					     {
				currSQI = 0x5; }
			else {
				currSQI = 0x6; } }
		else if (prevSQI == 0x7) {
			if (mse_out > 0x16) 		//threshold7_up
					    {
				currSQI = 0x6; }
			else {
				currSQI = 0x7; } }
		else {
			currSQI = prevSQI; }
	}

//sqi at link-loss

	else {
		first_time = 1;
		currSQI = 0x0;
	}

	result = currSQI;
	prevSQI = result;
	return static_cast<cyg_uint8>(result);
}