控制器成品功能:
BlueTooth将用户的配置传输给FPGA,
1.用户配置应该能永久保存。----公用flash
2.
图中标注的是39KHz采样
dBFS值是负数,越接近0越大。
dBFS = 20 * log10(采样信号(24’b) / 24’hFFFFFF)。
WS2812灯
最大0.3W/灯
系统时钟 20ns
0.4us=400ns=20x20ns
0.85us=850ns=42.5x20ns = 42x20ns
0.8us = 800ns= 40x20ns
0.45us=450ns = 22.5x20ns = 22x20ns
1.25us= 62x20ns
50us= 2500x20ns
需要注意din与dout,别接反了。
module INMP441(
input clk ,
input rst ,
output reg [23:0] L_RD ,
output reg [23:0] R_RD ,
//
output ws ,
output sck ,//max 3.2MHz
input sda ,
);
// wire [000:000] clk ;
reg [6:0] cnt_n ;//下降沿计数
reg [6:0] cnt_p ;//上升沿计数
reg [1:0] cur_sta ;
parameter RSTS='d0 ;
parameter WORK='d1 ;
always@(negedge clk or posedge rst)begin
if(rst)
cur_sta <= #1 'd1;
else if(cnt_n<64)
cnt_n <= #1 cnt_n + 'd1;
else
cnt_n <= #1 'd1;
end
//做好ws与sd的同步
always@(negedge clk or posedge rst)begin
if(rst)
cnt_n <= #1 'd1;
else if(cnt_n<64)
cnt_n <= #1 cnt_n + 'd1;
else
cnt_n <= #1 'd1;
end
always@(posedge clk or posedge rst)begin
if(rst)
cnt_p <= #1 'd1;
else if(cnt_p<64)
cnt_p <= #1 cnt_p + 'd1;
else
cnt_p <= #1 'd1;
end
endmodule
https://blog.csdn.net/u011444705/article/details/109027241