MAX195和MAX194模數(shù)轉(zhuǎn)換器(ADC)與TMS320C3X評(píng)估模塊接口的應(yīng)用筆記。給出了示例演示代碼。演示軟件配置 TMS320C30,使 FSR1 和 DR1 為輸入,CLKR1 和 XF1 為輸出。為了讀取MAX194/MAX195,軟件將XF1輸出短暫驅(qū)動(dòng)為低電平。演示軟件輪詢串行接收器,直到收到完整的幀。由于這只是一個(gè)接口演示,軟件只需將接收到的數(shù)據(jù)字寫入 EVM 主機(jī)數(shù)據(jù)端口即可。
概述
MAX195 16位ADC可通過串行接口連接至德州儀器TMS320C30 DSP。該接口使用四根電線加接地。本應(yīng)用筆記說明如何將MAX194/MAX195評(píng)估板連接至TMS320C3X評(píng)估模塊。
示例程序是使用 TMS320C3X/4X COFF 匯編程序版本 4.50 和 TMS320C3X/4F COFF 鏈接器版本 4.50(1987 年至 1992 年版權(quán)歸德州儀器公司所有)組裝的。
MAX194/MAX195評(píng)估板與TMS320C3X EVM接口
Maxim的MAX194/MAX195評(píng)估板可與德州儀器TMS320C3X評(píng)估模塊接口,如下所示:
根據(jù)表1設(shè)置MAX194/MAX195評(píng)估板跳線。
將2 x-5引腳伯格條焊接到MAX194/MAX195評(píng)估板J3區(qū)域。這 PC 板已接線,如表 2 所示。
將+5V電源連接至MAX194/MAX195評(píng)估板。
連接 TMS320C3X EVM 和 MAX194/MAX195 之間的 10 針帶狀電纜 評(píng)估板。
運(yùn)行演示軟件。
跳線 | 位置 | 功能 |
JU1 | Closed | 將MAX195 SCLK接地 |
JU3 | EXT | TMS320 CLKR1驅(qū)動(dòng)MAX195轉(zhuǎn)換時(shí)鐘。 |
JU4 | CS = 接地 | 將MAX195/CS接地 |
JU5 | QSPI | TMS320 XF1 驅(qū)動(dòng) MAX195 CONV。 |
JU6 | Open | MAX195復(fù)位/校準(zhǔn)命令 |
JU7 | UNI 或 OPEN | 選擇單極或雙極傳遞函數(shù) |
Pin | MAX195 | TMS320 | Pin | MAX195 | TMS320 |
1 | DGND | GND | 2 | Active-Low EOC | FSR1 |
3 | Not used | 4 | DOUT | DR1 | |
5 | Not used | 6 | Not used | ||
7 | Not used | 8 | Active-Low CONV | XF1 | |
9 | CONCLK | CLKR1 | 10 | DGND | GND |
演示軟件(請(qǐng)參閱下面的程序代碼列表)配置 TMS320C30,以便 FSR1 和 DR1 為輸入,CLKR1 和 XF1 為輸出。該軟件使用 XF1 輸出來啟動(dòng)轉(zhuǎn)換。XF1脈沖驅(qū)動(dòng)MAX194/MAX195轉(zhuǎn)換啟動(dòng)輸入。CLKR1輸出為MAX194/MAX195提供轉(zhuǎn)換時(shí)鐘。MAX194/MAX195的數(shù)據(jù)輸出由DR1輸入端接收。FSR1幀啟動(dòng)信號(hào)由MAX194/MAX195 EOC(轉(zhuǎn)換結(jié)束)信號(hào)驅(qū)動(dòng),該信號(hào)標(biāo)志著串行幀的開始。
為了讀取MAX194/MAX195,軟件將XF1輸出短暫驅(qū)動(dòng)為低電平。演示軟件輪詢串行接收器,直到收到完整的幀。由于這只是一個(gè)接口演示,軟件只需將接收到的數(shù)據(jù)字寫入 EVM 主機(jī)數(shù)據(jù)端口即可。
TMS320C3x/4x COFF 匯編程序,版本 4.50
版權(quán)所有 (c) 1987-1992,德州儀器公司
TMS320C30 串行端口初始化
項(xiàng)目:MAX195 評(píng)估板與 TMS320C3X EVM
項(xiàng)目文件接口 = MAX195I
文件名 = MAX195I。ASM
命令文件 = MAX195I。CMD
使用以下命令進(jìn)行編譯:
asm30 MAX195I -l
lnk30 MAX195I.CMD
引腳分配:
注意:跳線 JU8 必須打開
,CS 必須連接到 GND
時(shí)序圖:
最快時(shí)鐘 1MHz = (1 / 1000 nsec)
最小接收器定時(shí)器周期 = 4H
接收計(jì)時(shí)器周期 = 4 = 0.9375MHz
(系統(tǒng)時(shí)鐘頻率 = 30MHz)
字圖:
.sect "vectors" reset .word init int0 .word init int1 .word init int2 .word init int3 .word init xint0 .word init rint0 .word init xint1 .word init rint1 .word init tint0 .word init tint1 .word init dint .word init .data STCK .word 0809F00H ; initial stack pointer CTRL .word 0808000H ; peripheral interface base address HOST_DATA .word 0804000H ; host data port address IOF_AMASK .set 0000EH ; clear all XF1 bits in IOF register IOF_SET_XF1 .set 00060H ; make XF1 pin an output; value = 1 IOF_RESET_XF1 .set 00020H ; make XF1 pin an output; value = 0 IOF_INPUT_XF1 .set 00080H ; make XF1 pin an input; read its value FS_AMASK .set 0F0FFH ; mask for an FS pin SET_FS .set 00600H ; make FS a high output RESET_FS .set 00200H ; make FS a low output GET_FS .set 00800H ; input mask for FS pin D_AMASK .set 0FF0FH ; mask for a Data pin SET_D .set 00060H ; make D a high output RESET_D .set 00020H ; make D a low output GET_D .set 00080H ; input mask for D pin CLK_AMASK .set 0FFF0H ; mask for a CLK pin SET_CLK .set 00006H ; make CLK a high output RESET_CLK .set 00002H ; make CLK a low output GET_CLK .set 00008H ; input mask for CLK pin Serial Port Global Control Register SerGlob1 .word 08100280H 08000000H: RRESET - reset / enable the receiver 0080H: RCLKSRCE - use internal receive clock (CLKR pin is an output) 0200H: RVAREN - Receiver Variable Data Rate 00100000H: RLEN = 2 bytes (16 bits) Pin Assignment Register for FSX, CLKX, DX SerPrtX1 .word 00H assign CLKX pin to general I/O make CLKX an input assign DX pin to general I/O make DX an input assign FSX pin to general I/O make FSX an input Pin Assignment Register for FSR, CLKR, DR SerPrtR1 .word 0111H 0001H: assign CLKR pin to serial port clock 0010H: assign DR pin to serial port receive data 0100H: assign FSR pin to serial port frame start Serial Port Timer Global Control Register SerTim1 .word 03C0H XHLD 0=hold transmit timer XC/P 0=pulse mode XCLKSRC 0=CLKX pin increments the counter 0040H: RGO=1 -- start the receive timer 0080H: RHLD 1=run receive timer 0100H: RC/P 1=clock (50% duty cycle) 0200H: RCLKSRC 1=use 7.5MHz time base (30MHz system clock/4) Serial Port Timer Period Register SerTim1Val .word 040000H 0 H: Transmit Counter Period 4 H: Receive Counter Period Receive Timer Period = 4 = 0.9375MHz .text init LDI 0,ST ; initialize status register LDI 0,DP ; point data page pointer into rom LDI @STCK,SP ; initialize stack pointer ; start with XF1 high ; LDI IOF,R1 ; get XF1 settings AND IOF_AMASK,R1 ; don't touch XF0 settings OR IOF_SET_XF1,R1 ; make XF1 output a high value LDI R1,IOF ; write new XF1 settings ; initialize serial port ; LDI @CTRL,AR0 ; peripheral interface address LDI @HOST_DATA,AR1 ; host interface address LDI @SerTim1Val,R0 STI R0,*+AR0(86) ; serial ch1 timer period LDI @SerGlob1,R0 STI R0,*+AR0(80) ; serial global register LDI @SerPrtX1,R0 STI R0,*+AR0(82) ; serial transmit control register LDI @SerPrtR1,R0 STI R0,*+AR0(83) ; serial receive control register LDI @SerTim1,R0 STI R0,*+AR0(84) ; serial ch1 timer register XF1 signal is named Active-Low CONV to MAX195 EVKIT This is how we set XF1: LDI IOF,R1 ; get XF1 settings AND IOF_AMASK,R1 ; don't touch XF0 settings OR IOF_SET_XF1,R1 ; make XF1 output a high value LDI R1,IOF ; write new XF1 settings This is how we clear XF1: LDI IOF,R1 ; get XF1 settings AND IOF_AMASK,R1 ; don't touch XF0 settings OR IOF_RESET_XF1,R1 ; make XF1 output a low value LDI R1,IOF ; write new XF1 settings next_sample: generate conversion start pulse LDI IOF,R1 ; get XF1 settings AND IOF_AMASK,R1 ; don't touch XF0 settings OR IOF_RESET_XF1,R1 ; make XF1 output a low value LDI R1,IOF ; write new XF1 settings AND IOF_AMASK,R1 ; don't touch XF0 settings OR IOF_SET_XF1,R1 ; make XF1 output a high value LDI R1,IOF ; write new XF1 settings wait until serial receive is complete loop LDI *+AR0(80),R2 ; read global control register AND 01H,R2 ; test the receiver ready bit BZ loop ; loop until data is received get the received data LDI *+AR0(92),R3 ; copy received data into R3 this demo application does no processing -- it just makes the value available to the TMS320C3X EVM's host. STI R3,*+AR1(0) ; send R3 to host LDI 100,R0 ; delay wait_loop: SUBI 1,R0 BNZ wait_loop BR @next_sample ; this program runs forever .end
圖1.圖解的。
圖2.定時(shí)。
審核編輯:郭婷
-
接收器
+關(guān)注
關(guān)注
14文章
2468瀏覽量
71871 -
德州儀器
+關(guān)注
關(guān)注
123文章
1706瀏覽量
140691 -
adc
+關(guān)注
關(guān)注
98文章
6495瀏覽量
544461
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論