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

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
Reply to
Tim Wescott
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.