Changeset 68


Ignore:
Timestamp:
Nov 22, 2009, 11:13:56 PM (15 years ago)
Author:
demin
Message:

add I2C master and switch from 24 to 32 bit histogram

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MultiChannelUSB/Paella.v

    r65 r68  
    55
    66                inout   wire    [3:0]   TRG,
    7                 inout   wire    [6:0]   CON_A,
     7                inout   wire                    I2C_SDA,
     8                output  wire                    I2C_SCL,
     9                inout   wire    [4:0]   CON_A,
    810                inout   wire    [15:0]  CON_B,
    911                input   wire    [12:0]  CON_C,
     
    5355        //      Turn inout ports to tri-state
    5456        assign  TRG                     =       4'bz;
    55         assign  CON_A           =       7'bz;
     57        assign  CON_A           =       5'bz;
    5658        assign  CON_B           =       16'bz;
    5759        assign  USB_PA0         =       1'bz;
     
    114116        reg                     hst_reset [3:0];
    115117        reg     [11:0]  hst_addr [3:0];
    116         wire    [23:0]  hst_q [3:0];
     118        wire    [31:0]  hst_q [3:0];
    117119
    118120        wire                    mux_reset, mux_type;
     
    136138
    137139    assign      osc_thrs[0] = 16'd40;
    138     assign      osc_thrs[1] = 16'd300;
     140    assign      osc_thrs[1] = 16'd60;
    139141    assign      osc_thrs[2] = 16'd40;
    140142    assign      osc_thrs[3] = 16'd1650;
     
    154156    assign      adc_data[3] = CON_C[11:0];
    155157*/
     158/*
    156159        adc_para adc_para_unit (
    157160                .lvds_dco(ADC_DCO),
     
    160163                .para_data(CON_C[11:0]),
    161164                .adc_data(adc_data[3]));
    162 
     165*/
    163166/*
    164167        wire                    adc_pll_clk;
     
    201204                .lvds_fco(ADC_FCO),
    202205                .lvds_d(ADC_D),
    203                 .adc_data({     adc_data[0],
     206                .adc_data({ adc_data[0],
    204207                                        adc_data[1],
    205                                         adc_data[2]}));
     208                                        adc_data[2] }));
    206209 
    207210        genvar i;
    208211        generate
    209                 for (i = 1; i < 4; i = i + 1)
     212                for (i = 0; i < 3; i = i + 1)
    210213                begin : MCA_CHAIN
    211214                        adc_fifo adc_fifo_unit (
     
    286289                                mux_max_byte = 2'd2;   
    287290                                mux_min_addr = 16'd0;
    288                                 mux_max_addr = 16'd4095;
     291                                mux_max_addr = 16'd4096;
    289292                        end
    290293                endcase
     
    300303                        3'b101: mux_q = hst_q[mux_chan][15:8];
    301304                        3'b110: mux_q = hst_q[mux_chan][23:16];
     305                        3'b111: mux_q = hst_q[mux_chan][31:24];
    302306
    303307                        default: mux_q = 8'd0;
    304308                endcase     
    305309        end
    306        
     310
     311        wire                    i2c_aclr;
     312        wire                    i2c_wrreq;
     313        wire                    i2c_full;
     314        wire    [15:0]  i2c_data;
     315
     316        i2c_fifo i2c_unit(
     317                .clk(CLK_50MHz),
     318                .aclr(i2c_aclr),
     319                .wrreq(i2c_wrreq),
     320                .data(i2c_data),
     321                .full(i2c_full),
     322                .i2c_sda(I2C_SDA),
     323                .i2c_scl(I2C_SCL));
     324
    307325        control control_unit (
    308326                .clk(CLK_50MHz),
     
    325343                .ram_addr(RAM_ADDR),
    326344                .ram_data({RAM_DQA, RAM_DQAP, RAM_DQB, RAM_DQBP}),
     345                .i2c_wrreq(i2c_wrreq),
     346                .i2c_data(i2c_data),
     347                .i2c_full(i2c_full),
    327348                .led(LED));
    328349
Note: See TracChangeset for help on using the changeset viewer.