This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
In my project, the DE2 has to transfer data to computer through MSP430G2553 (this is the strict requirement). Hence, I have 2 connection must be done:
1. The communication between MSP430 and computer: I already have used UART module on MSP430 to realize this connection.
2. The communication between DE2 and MSP430 through GPIO : Currently, I do not know how to do this.
Could you guys here help me how to implement the second connection?. ( I just take charge of the MSP430 coding, my partner will charge on DE2).
tran vit2. The communication between DE2 and MSP430 through GPIO : Currently, I do not know how to do this.
tran vitI just take charge of the MSP430 coding, my partner will charge on DE2
You have to use SPI peripheral as slave, your partner have to implement master SPI on DE2.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
Since, I have only 5 weeks left to implement the communication between DE2 and MSP430. SPI is a way to do this but with the limit left time and knowledge in embedded system, I cannot use this protocol. Furthermore, MSP430 just needs to receive data from DE2 and transfer this data to computer through UART module.
In reply to tran vit:
tran vitSince, I have only 5 weeks left to implement the communication between DE2 and MSP430. SPI is a way to do this but with the limit left time and knowledge in embedded system, I cannot use this protocol. Furthermore, MSP430 just needs to receive data from DE2 and transfer this data to computer through UART module.
Look, SPI in it's simplest form is nothing more than 8 bits parallel-in serial-out register with clock output for master and opposite for slave. If you find this too complex to implement, then honestly - I have no idea what else to suggest you. For msp430 look for SPI master/slave examples in product page of your chip. FPGA shall have ready-to use SPI "library".
In reply to Ilmars:
I suggest programming the MSP as master. usually, the MSP controls the FPGA, so it should be in charge of the transfer. Also, SPI master is much easier (by far not so time-critical) than SPI slave, when the high-level protocol is under software control. On the FPGA side, the SPI is more or less put in hardware completely, so implementing an SPI slave (especially with a ready-to-use library) doesn't expose any timing problems.
And indeed, the transfer itself is more than simple. You may have a 'data vailable' signal from teh slave to the master, a 'start transfer' (chip select) signal form the master to the slave, and then you push out (and pull in) a bit at a time synchronized to the master-generated clock signal. It can be done by simple bit-banging or by using the hardware SPI of the MSP (USI, USCI or USART module, depending on used MSP)
Time to say goodbye - I don't have the time anymore to read and answer forum posts. See my bio for details.Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.I'm sorry that I can no longer provide help in the forum or by private conversation.
In reply to Jens-Michael Gross:
Thanks for your answer. In this case, I have already used USCI for the UART communication between MSP430 and PC, so
The first question: Can I use the USCI module for UART and SPI at the same time and how ? UART use UCA0 and SPI use UCA1?. For example: to implement the UART I used the code like below :
Hence, if I can use USCI for both SPI and UART, how can I get data from DE2 which used by SPI protocol and put this data to UCA0TXBUF buffer of UART ?. Do I need to write a buffer to store data get from DE2?
The second question is that if i used the USI for SPI protocol (use slave mode). How can get data from shift register USISR and put this data to UCA0TXBUF in a interupt of USI because I know that USISR will shift data to output at PIN1.6 in serial.
My questions may be so idiotic but I am very new with this board so I hope to receive your support
tran vitI am very new with this board
Then for you better to drop SPI idea, let your FPGA guy implement UART. Then you can make simple UART repeater out of msp430 or just solder msp430 out of board and rewire UART lines from FPGA to PC.
I must implement the SPI protocol like you guys here suggested because now it is compulsory. Hence, Could you instruct me more detail and answer my above questions? Thank you.
You shall start reading SPI and UART example code for your chip.
As your suggestion, I have already finished the code and tested the communication between MSP and DE2 this morning. The SPI protocol implemented on the DE2 seems to work properly when my partner simulated the MOSI & MISO and SCLK correctly on the Oscilloscope. However, when DE2 connects to Lauchpad, the data (DE2 send character "A") cannot send to PC through MSP, displaying on the Hyper terminal program is just the strange characters (special characters). Hence, I will post my code here and hope that you guys here can indicate the problems that I made? Thank you very much.
This code based on the examples from TI.
Could you guys here help me to indicate the problem in my code?.
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. 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.