I am trying to interface 2 absoulte angle encoder chips(SPI) to SPI port of TMS320F28035. Since one of SPI of 28035 has been assigned to a fixed task, I have to use another SPI of 28035 connecting to the 2 encoder chips.
Just check if this method is workable or not:
--Hardware : the 2 encoder chips use the common CLK,MISO and MOSI with 28035's SPI, and 2 GPIOs of 28035 are used as chip select pins to ensure only one encoder chip is selected at any one time.
--Code: SPITX is operated in main loop and chip selecting is done by seting GPIOs either low or high while SPIRX interrupt routines recieve the data sending from the 2 encoder chips.
If this approach is funcational OK how to distinguish one encoder data from another as RX buffer is common used by the 2 streams. Are there any other better way to received the 2 way data through one SPI?
That is exactly how I would implement this design in hardware.
In regard to software, you should know how many bytes you are sending or receiving from each encoder. You should be able to use this information to pull the data from the buffer and separate it out. I can't think of any better ways to implement this.
Sorry for the late reply as I was out of office in past days. Thank you for your input! The 2 encoder chips are identical thus there is no way to separate the data by number of bit.
I am also referring to the thread: http://e2e.ti.com/support/microcontrollers/tms320c2000_32-bit_real-time_mcus/f/171/t/171156.aspx
it helps a lot, however how to ensure the data from 2 encoders are not mixed up is still an open issue.
Harvey Wangchip select pins to ensure only one encoder chip is selected at any one time ... how to distinguish one encoder data from another as RX buffer is common
Surely, if only one chip is selected at a time, then only that chip can send data - so you know exactly which encoder the data came from?!
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.