abstract: application note for interfacing the max195 and max194 analog-to-digital converters (adcs) to the tms320c3x evaluation module. example demo code is given. the demo software configures the tms320c30 so that fsr1 and dr1 are inputs and clkr1 and xf1 are outputs. to read the max194/max195, the software briefly drives the xf1 output low. the demo software polls the serial receiver until a complete frame has been received. because this is just an interface demo, the software simply writes the received data word to the evm host data port.
overviewthe max195 16-bit adc can be interfaced to texas instruments' tms320c30 dsp by means of its serial interface. the interface uses four wires plus ground. this application note explains how to interface the max194/max195 evaluation kit to the tms320c3x evaluation module.
the example program was assembled using the tms320c3x/4x coff assembler version 4.50 and the tms320c3x/4f coff linker version 4.50 (copyright 1987 through 1992 by texas instruments incorporated).
interfacing the max194/max195 evkit to the tms320c3x evmmaxim's max194/max195 evaluation kit can be interfaced to texas instruments' tms320c3x evaluation module as follows:
set the max194/max195 evkit jumpers according to table 1.
solder a 2-x-5-pin berg strip into max194/max195 evkit area j3. the pc board is already wired as shown in table 2.
connect a +5v power supply to the max194/max195 evkit.
connect a 10-pin ribbon cable between the tms320c3x evm and the max194/max195 evkit.
run the demo software. table 1. jumper settings
jumper
position
function
ju1
closed
connects the max195 sclk to ground
ju3
ext
tms320 clkr1 drives the max195 conversion clock.
ju4
cs = gnd
connects the max195 active-low cs to ground
ju5
qspi
tms320 xf1 drives the max195 conv.
ju6
open
max195 reset/calibration command
ju7
uni or open
selects unipolar or bipolar transfer function
table 2. ribbon-cable signals
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
how it worksthe demo software (see the program-code listing that follows) configures the tms320c30 so that fsr1 and dr1 are inputs and clkr1 and xf1 are outputs. the software uses the xf1 output to initiate a conversion. the xf1 pulse drives the max194/max195 conversion start input. the clkr1 output provides the conversion clock to the max194/max195. data output from the max194/max195 is received on the dr1 input. the fsr1 frame start signal is driven by the max194/max195 eoc (end of conversion) signal, which marks the beginning of the serial frame.
to read the max194/max195, the software briefly drives the xf1 output low. the demo software polls the serial receiver until a complete frame has been received. because this is just an interface demo, the software simply writes the received data word to the evm host data port.
tms320c3x/4x coff assembler, version 4.50
copyright (c) 1987-1992, texas instruments incorporated tms320c30 serial port initialization
project: max195 evkit interface to tms320c3x evm
project file = max195i
filename = max195i.asm
command file = max195i.cmd
compile with the following commands:
asm30 max195i -l
lnk30 max195i.cmd
pin assignments:
note: jumper ju8 must be open
and cs must be tied to gnd
timing diagram:
fastest clock 1mhz = (1 / 1000 nsec)
minimum receiver timer period = 4h
receive timer period = 4 = 0.9375mhz
(system clock frequency = 30mhz)
word diagram:
.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
figure 1. schematic.
figure 2. timing
中国联通已在雄安新区完成了5G规模部署
人工智能和区块链会擦出怎样的火花
FP5207在拉杆音箱中的运用
ARM架构是什么 限制ARM对华为的影响
电动车电池怎样修复_电动车电池修复方法
Interfacing the MAX195 ADC to
脉冲变压器型号有哪些_脉冲变压器如何选型
RY-BJQ-PM粉尘报警器/检测仪
苹果13配置的运存是多少
Carbon发布全球首款采用碳纤维材质智能手机
stc12c5a60s2晶振频率如何计算
三位行业专家谈商用AR和VR技术
3D打印技术正与防护产品“结缘”
物联网技术管理授权的关键是什么
电梯物联网技术到底有什么优势呢?
海信推出黑钢453L冰箱 目前澳大利亚市场上最节能的冰箱
物联网正在推动电力行业达到新的效率、测试策略和创新水平
一文了解STM32启动过程
盘点凯翼X3的icar智能互联系统四大看点
CW32L083智能温湿度监控系统