ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: TS-7300 ADC on FPGA

To:
Subject: Re: [ts-7000] Re: TS-7300 ADC on FPGA
From:
Date: Tue, 23 Jun 2009 08:18:33 -0700 (PDT)


OK, here's how:

You have to do reads and writes in blocks of 32bits, so your registers could be of the form:

reg [31:0] register0;
reg [31:0] register1;
reg [31:0] register2;
etc...

The framework for reading and writing in to the FPGA is already in ts7300_top:ts7300_wishbone_slave so to write in to the above you just add them to the  block in ts7300_top that handles wishbone writes i.e.:


always @(posedge wb_clk_i)
begin
    if (wb_rst_i)
    begin
        //reset - to defaults
            8'h00: register0 <= <reset register0 value>;
            8'h01: register1 <= <reset register1 value>;
            8'h02: register2 <= <reset register2 value>;
            8'h03: register3 <= <reset register3 value>;
    end

    else if (wb_cyc_i && wb_stb_i && wb_we_i)
    begin   
         // *** write is occuring ***

        case (wb_address[7:0])

        // decode address of register       

            8'h00: register0 <= wb_data;
            8'h01: register1 <= wb_data;
            8'h02: register2 <= wb_data;
            8'h03: register3 <= wb_data;
           
        endcase

    end
    else if ( wb_cyc_i && wb_stb_i && !wb_we_i)
        // Read is occuring
    begin
       

    endcase

    end
    else
    begin
    end
   
end


To access your registers from user space, you need to go through something like /dev/mem, for example:

fpga_base = open("/dev/mem", 0x72A00000)

Your pointers should be a 4 byte type:

volatile unsigned int *register0 = fpga_base;
volatile unsigned int *register1 = fpga_base + 1;
volatile unsigned int *register2 = fpga_base + 2;
volatile unsigned int *register3 = fpga_base + 3;

To write to register0, you would do:

*register0 = <new value>;


That's it about it. 
--- On Mon, 6/22/09, tylliot <> wrote:

From: tylliot <>
Subject: [ts-7000] Re: TS-7300 ADC on FPGA
To:
Received: Monday, June 22, 2009, 7:45 PM

Yes, that is one of my questions and I am also wondering how to read off of those registers using verilog. But, if you can help me with the first question I would be very greatful.

--- In .com, mike.mcdonald0@ ... wrote:
>
> First, the base address of the FPGA is 0x72A00000. It's not clear to me what you're question is. Are you asking how to create registers on the FPGA and write in to them from your C program?
>
> --- On Mon, 6/22/09, tylliot < > wrote:
>
> From: tylliot < >
> Subject: [ts-7000] Re: TS-7300 ADC on FPGA
> To: .com
> Received: Monday, June 22, 2009, 5:32 PM
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> --- In .com, "tylliot" <tylliot@ > wrote:
>
> >
>
> > I have read in the manual for this board that there is one available channel on the onboard A/D converter and I would like to be able to continuously sample from it for a control system I am working on. I am using the opencore TS-7300 project and I am not sure how to go about initializing the ADC in verilog and the FPGA to get input from the available channel. Any help is greatly appreciated!
>
> >
>
>
>
> I have had to change my design a little bit, now I am using the TS-ADC16 which is a 16 bit A/D converter that connects to the PC-104 bus. I am trying to get the digital output from the ADC to the FPGA on the TS-7300. I am thinking I will need to write the ADC output to one of the memory registers on the FPGA board and use my FPGA code to read that in and use it accordingly.
>
> I tried making a program that does the A/D conversion and then writes to 0xa7200000 which the CPU should send to the FPGA, but I'm not sure if that is working correctly. Any ideas here?
>



__._,_.___


Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: =Email Delivery: Digest | m("yahoogroups.com?subject","ts-7000-fullfeatured");=Change Delivery Format: Fully Featured">Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | =Unsubscribe

__,_._,___
<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU