Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

TMS570 using UART to communicate to another device

$
0
0

I am trying to do a simple project where I connect the microcontroller to another device with a UART connection (Rx to Tx and Tx to Rx). I would like to send data from USB to the microcontroller, through UART, to the other device, back through USB and to the computer.

I am not exactly sure how to use the UART pins to send data/how to send data through them. It appears that I need to use the Serial Communication Interface to do so, but I'm not exactly sure how - do I need to do something in HALCoGen to indicate that I want to use the pins to communicate with another device?

What I have done so far is follow the instructions here: https://training.ti.com/hercules-how-tutorial-using-sci-uart-communication

The project in the tutorial was to use sciSend and sciReceive to communicate between the terminal (COM port) on the computer and the microcontroller using the SCI. However, it appears that this does not use the UART pins at all, because it worked without a jumper wire from Rx to Tx.

Here is the pin map if it helps: http://www.ti.com/lit/ml/spnu611/spnu611.pdf

I followed these instructions in HALCoGen:'

In this view, we will see a block diagram of the microcontroller. We can navigate through HALCoGen by either using this block diagram or by using the tabs located near the top of the screen. The next step is to go to the Driver Enable tab and enable only the SCI2 driver. We do this by selecting Unmarked Mark All Drivers and then selecting Enable SCI2 Driver.

The next step is to go to the SCI2 tab, and in the SCI Global sub-tab, enable the receiver interrupt. With this configuration, the SCI will generate a CPU interrupt every time data is received by the module. Next, we click on the SCI data format tab and ensure that the module is setup with a 9,600 baud rate, 8 data bit length, and 2 stop bits, and no parity.

The final configuration to be made in HALCoGen is to go to the VIMM, or Vector Interrupt Manager Module, and enable channel 13. This will enable our SCI interrupt in the VIM module. Next, we need to generate code. To do this, we go to File, Generate Code. HALCoGen now generate all the startup and peripheral drivers that are needed to complete this exercise.

TLDR:
- Enable drivers tab -> enable only SCI2/LIN
- SCI2 tab -> SCI Global sub tab -> enable Rx interrupt
- Enable VIM channel 13 (LIN High)

How should I modify this to use the UART to communicate with another device? Should I enable the SCI driver instead? What should I do from there? (Or should I do something else)

Am I missing the fundamental understanding of how the SCI and UART work?

I would really appreciate any advice you might have - thanks!


Viewing all articles
Browse latest Browse all 262198

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>