Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microprocessor to FPGA serial interface> SPI ?

Status
Not open for further replies.

albert22

Full Member level 6
Full Member level 6
Joined
Jul 20, 2004
Messages
332
Helped
68
Reputation
136
Reaction score
65
Trophy points
1,308
Visit site
Activity points
5,005
Hi,
I am trying to implement a DDS on a FPGA and I need a serial interface to program the registers associated with it.
For example the incremental phase and the start phase may take 2 x 48 bit registers or 12 x 8 bit registers. A second DDS will have more registers.
I found several VHDL implementations of SPI slaves. But they seem to handle only one register of configurable length.
Eventually I want to be able to update the waveform RAM of the DDS thru the same interface.
Can this be done with SPI or there is something else that I can use? Any ideas ?

Thanks
 

That can be done with SPI just fine. You will have to write something to handle the multiple registers. You can for example have a little FSM that handles incoming SPI commands. Say you have 4 internal registers, then have the first 2 bits be the register address, and the following bits are the data to be written.
 
As mentioned by mrflibble,
you have to write a FSM glue logic in between... which will receive 8 or 16 bits of SPI data and store it in RAM one by one... once you have 2x48 bits of data in RAM copy that data to you DDS phase increament register...it simple..
 

SPI is just an interface - you can transmit whatever data you want and decode it how you want. So you can encode your own packets on to the bus to contain any information.
 

Thank you all, guys. I have downloaded a SPI core from opencores. As a beginner on FPGA and VHDL it is going to take me time to figure it out. I have implemented FSM in software and I have some examples in VHDL. But I am a little confused about keeping all synchronous to a single clock in a FPGA. And how to sense the event that triggers the FSM.
Now I see that it may be simpler to me to implement a shift register, a downloadable counter for the address and separate control lines. Somewhat similar to the R/S line on a LCD interface. In this way I can set a start address in the address counter, send 8 bits of data. Then a strobe will transfer the parallel bits to the addressed register and increment the address counter.
I guess that I can do this asynchronously of the global clock by using a general IO for the serial clock.
 

You can do it asynchronounsly or synchronously....But it is easy to use some signal indication when some data is received... This may be included in SPI code.
So as soon as you get data in SPI receive register....shift it to some memory or FIFO...Like this you recevie bunch of data so that you can form a complete Phase increamentor register data....Once it is form you can straight a way load phase increment register...
Thats it...
Best of Luck...
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top