Re: what is the usual way of transmitting/receiving data via SPI port?

Sep 03, 2007 0 Replies


Assume the main CPU wants to send/receive data to an FPGA chip.


> From the CPU's point of view, it only sends out byte by byte, and
> FPGA vice versa. How does the FPGA distinguish whether this byte
> is a command, parameter of a command, a byte of data, etc?
>
> Can I use the ideas of XML/HTML to do this?
>

You could, but it would be odd.



What you're looking for is a communications protocol, to help you pick out bytes from the bit stream, commands from data, &c. SPI doesn't give you a strong way to distinguish bytes in the bitstream, at least at the receiving end. I'd suggest that you use at least one chip select/framing bit. After that you just need a more or less standard serial protocol that lets you organize your commands and data into packets.



This isn't really a DSP question at all -- this is an embedded computing question. I'm taking the liberty of cross-posting this response over there, where you should have posed the question in the first place.


Tim Wescott Control systems and communications consulting http://www.wescottdesign.com Need to learn how to apply control theory in your embedded system? "Applied Control Theory for Embedded Systems" by Tim Wescott Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required