Embedded 版 (精华区)
发信人: hpnet (hpnet), 信区: Embedded_system
标 题: 使用MT8880 DTMF怎么没有信号发出
发信站: 哈工大紫丁香 (Sat Apr 13 14:52:47 2002) , 转信
各位大虾,我现在急于使用MT8880来发出双音多频信号,我是用FPGA来控制MT8880芯片,
其中FPGA的IO脚分别与MT8880的RS0,R/W,CS,@2,和D3,D2,D1,D0来连接。我用的是VHDL
语言设计的。我用MAX+PLUS2仿真波形感觉没有问题。但是下载到FPGA芯片后,TONE脚却不
能发出波形来。不知道是什么原因。请大虾指教。我是根据MT8880的数据手册来控制的。
先对MT8880进行初始化有4步,然后将‘B’音发送到数据线上。
我的程序如下
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_unsigned.all;
entity DTMF_TONE is
port(clk, send_dtmf : in STD_LOGIC;
MT8880cs, MT8880rw, MT8880rs0, MT8880fi2: out STD_LOGIC; -- MT8880irq is in
MT8880d0, MT8880d1, MT8880d2, MT8880d3 : out STD_LOGIC
);
end DTMF_TONE;
architecture rtl of DTMF_TONE is
signal MT8880d_reg : STD_LOGIC_VECTOR(3 downto 0);
signal control_reg : STD_LOGIC_VECTOR(3 downto 0);
signal pointer : integer range 0 to 10 := 0;
signal counter : integer range 0 to 30000000 := 0;
begin
MT8880d3 <= MT8880d_reg(3);
MT8880d2 <= MT8880d_reg(2);
MT8880d1 <= MT8880d_reg(1);
MT8880d0 <= MT8880d_reg(0);
MT8880fi2 <= control_reg(3);
MT8880cs <= control_reg(2);
MT8880rs0 <= control_reg(1);
MT8880rw <= control_reg(0);
process(clk,send_dtmf)
begin
if (clk`event and clk = `1`) then
-- if (send_dtmf = `0`) then
if(pointer = 0)then
--初始化MT8880 control_reg <= `1010` ;
MT8880d_reg <= `0000` ; -- Write 8880CRA
pointer <= pointer + 1;
elsif(pointer = 1)then
control_reg <= `1010` ;
MT8880d_reg <= `0000` ; -- Write 8880CRA
pointer <= pointer + 1;
elsif(pointer = 2)then
control_reg <= `1010` ;
MT8880d_reg <= `1000` ; -- Write 8880CRA
pointer <= pointer + 1;
elsif(pointer = 3)then
control_reg <= `1010` ;
MT8880d_reg <= `0000` ; -- Write 8880CRB
pointer <= pointer + 2;
elsif(pointer = 4)then
control_reg <= `1010` ;
MT8880d_reg <= `0100` ; -- Write 8880CRA, 8880MODE1 is DTMF,IRQ
pointer <= pointer + 1;
--向D3--D0写入字符“B”
elsif(pointer = 5)then
control_reg <= `1010` ;
MT8880d_reg <= `1101` ; --Write 8880CRA
pointer <= pointer + 1;
elsif(pointer = 6)then
control_reg <= `1010` ;
MT8880d_reg <= `0000` ; --Write 8880CRB
pointer <= pointer + 1;
elsif(pointer = 7)then
control_reg <= `1000` ;
MT8880d_reg <= `1110`; --Send digit `B`
pointer <= pointer + 1;
elsif(pointer = 8)then
-- control_reg <= `0100`;
end if;
-- else
-- control_reg <= `1100`; --Chip Select be invalid
-- end if;
end if;
end process;
end rtl;
--
※ 来源:.哈工大紫丁香 http://bbs.hit.edu.cn [FROM: 218.7.49.1]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:2.759毫秒