本應(yīng)用筆記介紹如何使用DS31256的接收BERT功能執(zhí)行分?jǐn)?shù)T1(FT1)環(huán)路或環(huán)路下降檢測(cè)(V.54),如分?jǐn)?shù)T1.403附錄B規(guī)范中所述。工作算法和編碼示例說(shuō)明了DS31256易于適應(yīng)終端用戶(hù)應(yīng)用。
DS31256只有一個(gè)BERT引擎,但有16個(gè)V.54引擎(每個(gè)端口一個(gè))。因此,如果測(cè)試多個(gè)端口,軟件帶寬必須處理所需的多路復(fù)用。
算法
下面圖 1 和圖 2 中的流程圖詳細(xì)描述了環(huán)上和下環(huán)操作。假定只有端口 0 在查找 FT1 模式。基本算法設(shè)置 BERT 以查找環(huán)路模式。同步后,算法檢查以確保BERT在可編程周期(代碼中為0.6秒)內(nèi)同步,然后查找全一模式。然后,對(duì)循環(huán)代碼遵循相同的同步和檢查方法,然后是 all one 模式。
盡管此示例使用 0.6s 作為確保 BERT 同步的時(shí)間段,但必須根據(jù) sync_loop 函數(shù)的執(zhí)行速度調(diào)整此時(shí)間段。
圖1.FT1(環(huán)上環(huán)和環(huán)下)探測(cè)器操作流程圖。
圖2.FT1(環(huán)上環(huán)和環(huán)下)檢測(cè)器操作流程圖(續(xù))。
編碼示例函數(shù)調(diào)用的定義
函數(shù)的編碼示例
測(cè)試 FT1 的功能
void FT1Test() { int status = 0; FT1Setting(0, 0); -- Configure the device for BERT status = sync_loop(1, 300, 5000); -- FT1 loop-up test if(status == 1) -- Return status is synced { status = sync_loop(3, 300, 5000); -- FT1 all ones test if(status == 1) { loopbackSetup(1); -- Place channelized in network loopback status = sync_loop(2, 300, 5000); -- FT1 loop-down test if(status == 1) { status = sync_loop(3, 300, 5000); -- FT1 all ones test if(status == 1) loopbackSetup(0); -- Take out from channelized loopback else checkstatus(3); -- Print out test status } else { checkstatus(2); -- Print out test status } } else { checkstatus(3); -- Print out test status } } else { checkstatus(1); -- Print out test status } }
1. 打印測(cè)試狀態(tài)消息的功能
void checkstatus(int type) { switch(type) { case 1: printf("Loopup pattern not found"); break; case 2: printf("Loopdown pattern not found"); break; case 3: printf("All 1's pattern not found"); break; } }
2. 配置FT1的功能
此示例假定端口 0 用于 FT1 檢測(cè)
void FT1Setting(int dev, int port) { int mc = 0; -- Variables to be used int ds0 = 0; int rcfg = 0; mc = read_reg (0x10); -- Read Master Control(MC) 0x00 register mc = mc & 0xf07f; -- Mask out the read-back value from MC write_reg (0x10, mc); -- Assign the BERT to port 0 (MC.BPS4-0) write_reg(0x0304, 0x4000); -- Configure port 0 in receive port for(ds0 = 0; ds0 < 128; ds0 = ds0 + 1) -- Configure register { --Assign timeslot R[0]CFG[ds0].RBERT bit write_ind_reg(0x0300, 0x0100 + ds0); -- Assign all 128 ds0’s to RBERT } printf("FT1 configuration completed."); }
3. 執(zhí)行FT1測(cè)試的功能
int sync_loop(int pattern, int sync_cnt, int timeout) { int timeCnt = 0; -- Variables will be used int cnt = 0; int status = 0; int temp = 0; int sync = 0; int bertc0 = 0; int bertec0 = 0; BertSetup(pattern); -- Set up the BERT bertc0 = read_reg (0x500); -- Toggle RESYNC bertc0 = bertc0 | 0x0001; -- Mask the read BERTC0 value write_reg (0x500, bertc0); -- Write a 1 into BERTC0.RESYNC bertc0 = bertc0 & 0xfffe; -- Mask out read-back value write_reg (0x500, bertc0); -- Write 0 into BERTC0.RESYNC bertc0 = read_reg (0x500); -- Read BERTC0 bertec0 = read_reg (0x518); -- Read BERTEC0 sync = ((bertec0 & 0x0001) == 0x0001); timeCnt = timeCnt + 1; while(cnt= timeout) { printf("Time Out while searching for pattern."); return status = 0; } } delay(2000); timeCnt = timeCnt +1; bertec0 = read_reg (0x518); -- Read value of BERTEC0 temp = ((bertec0 & 0x0010) == 0x0010); -- Check BERTEC0.RLOS if(temp == 1) { sync = 0; cnt = 0; } else { cnt = cnt+1; } if(cnt == sync_cnt) { printf("Synced to pattern."); return status = 1; } } return 0; }
4. 在BERT寄存器中設(shè)置模式
void BertSetup(int pattern) { switch (pattern) { case 1: write_reg (0x500, 0x0 & 0x003c); -- Disable BERTC0.RINV break; -- Set 2E7-1 pattern case 2: write_reg (0x500, 0x0020 & 0x003c);--Enable BERTC0.RINV break; -- Set 2E7-1 pattern default: write_reg (0x508, 0xffff); -- Set BERT Repetitive Pattern Set write_reg (0x50C, 0xffff); -- in BERTBRP0-1 write_reg (0x500, 0x0010 & 0x003c);-- Disable BERTC0.RINV break; -- Set to repetitive pattern } }
5. 設(shè)置環(huán)回模式的功能
此示例假定端口 0 放置在環(huán)回中。
void loopbackSetup(int val) { int a = 0; int tmp = 0; tmp = val<<11; write_reg(0x0304, tmp); -- Set port and channel 0 for (a = 0; a < 128; a++) -- Set T[0]CFG[a].CNLB to place channel in { -- loopback write_ind_reg(0x0300, 0x0200 + a); } if(val ==1) { write_reg(0x0200, 0x0008); -- Enable TP[0]CR.TFDA1 to allow data to printf("Loopup detected"); -- be transmitted normally printf("Channel placed in loopback"); } else { write_reg(0x0200, 0x0000); -- Disable TP[0]CR.TFDA1 bit printf("Loopdown detected"); printf("Channel taken out from loopback"); } }
結(jié)論
本應(yīng)用筆記介紹了如何在DS31256中使用接收BERT功能。示例代碼和軟件算法說(shuō)明了執(zhí)行FT1環(huán)路或環(huán)路檢測(cè)是多么容易。
審核編輯:郭婷
-
寄存器
+關(guān)注
關(guān)注
31文章
5363瀏覽量
121157 -
端口
+關(guān)注
關(guān)注
4文章
990瀏覽量
32206 -
引擎
+關(guān)注
關(guān)注
1文章
361瀏覽量
22630
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
銅絞線(xiàn)原材料紫銅牌號(hào)T1、T2、T3是什么意思
T1 ToneMatch音頻引擎
DS33R11 以太網(wǎng)映射器,集成了T1/E1/J1收發(fā)器
Dallas Semiconductor T1/E1/J1收
![Dallas Semiconductor <b class='flag-5'>T1</b>/E<b class='flag-5'>1</b>/J<b class='flag-5'>1</b>收](https://file1.elecfans.com//web2/M00/A4/C6/wKgZomUMNaOAH9Y7AAAmhRRRokA325.gif)
DS31256 and T1/E1 Interface
![<b class='flag-5'>DS</b>31256 and <b class='flag-5'>T1</b>/E<b class='flag-5'>1</b> Interface](https://file1.elecfans.com//web2/M00/A4/C6/wKgZomUMNaSAfUDFAACHM06WWgA020.gif)
Conversion Between T1 and E1
![Conversion Between <b class='flag-5'>T1</b> and E<b class='flag-5'>1</b>](https://file1.elecfans.com//web2/M00/A4/C6/wKgZomUMNaSAeMAnAABJ8Nocdek712.gif)
T1/E1 Framer Initialization an
什么是T1與E1線(xiàn)路
DS26324 E1/T1/J1系統(tǒng)端口短程線(xiàn)路接口單元
T1和E1之間的轉(zhuǎn)換
![<b class='flag-5'>T1</b>和E<b class='flag-5'>1</b>之間的轉(zhuǎn)換](https://file.elecfans.com//web2/M00/89/DE/poYBAGO8-4OAahklAABJoC2JYtk991.gif)
Maxim T1/E1/J1收發(fā)器的T1/E1環(huán)回操作
![Maxim <b class='flag-5'>T1</b>/E<b class='flag-5'>1</b>/J<b class='flag-5'>1</b>收發(fā)器的<b class='flag-5'>T1</b>/E<b class='flag-5'>1</b><b class='flag-5'>環(huán)</b><b class='flag-5'>回</b>操作](https://file.elecfans.com/web2/M00/8B/66/pYYBAGPE_haAGzZIAABJ1SpwHDI995.png)
使用TDMoP器件的FDL網(wǎng)絡(luò)環(huán)回支持
![使用TDMoP器件的FDL網(wǎng)絡(luò)<b class='flag-5'>環(huán)</b><b class='flag-5'>回</b>支持](https://file.elecfans.com/web2/M00/8E/D0/poYBAGPh-JiAcfSrAAA6-cf2c2U815.png)
利用TDMoP器件支持FDL網(wǎng)絡(luò)環(huán)回
![利用TDMoP器件支持FDL網(wǎng)絡(luò)<b class='flag-5'>環(huán)</b><b class='flag-5'>回</b>](https://file.elecfans.com/web2/M00/90/16/pYYBAGPktJiAQBTkAAA9kO0kwSY700.png)
DS31256的分?jǐn)?shù)級(jí)T1 (FT1)環(huán)回檢測(cè)
![<b class='flag-5'>DS</b>31256的<b class='flag-5'>分?jǐn)?shù)</b>級(jí)<b class='flag-5'>T1</b> (FT<b class='flag-5'>1</b>)<b class='flag-5'>環(huán)</b><b class='flag-5'>回</b><b class='flag-5'>檢測(cè)</b>](https://file1.elecfans.com//web2/M00/89/DF/wKgaomSMEM6AcUDOAABR_FvcsyQ691.gif)
評(píng)論