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.

CCS/TMS570LS1227: TMS570 using UART to communicate from computer terminal to board

Part Number: TMS570LS1227
Other Parts Discussed in Thread: HALCOGEN

Tool/software: Code Composer Studio

Hello, 

I'm working on a very basic "operating system" (I'm using the term loosely) and am hoping to have functionality where I am able to write to my TMS570ls1227 via PuTTy or an equivalent emulator. For reference, I currently have the board connected to my computer's usb via the SCI pins and a UART/USB breakout board and am outputting data via sciSend to PuTTy. In CCS, I have a simple FreeRTOS scheduler with three tasks running concurrently (GIO light blinking, reading sensor data from an SPI magnetometer, and the sciSend task). 

My desired functionality is as follows:

1) Begin scheduler

2) Press 1 in the terminal emulator to print data from sensor 1, press 2 to output from sensor 2 etc.

3) Some sort of ability to interrupt this process to change what data I am printing as the scheduler is running

I'm assuming that "sciReceive" task or something equivalent and an interrupt of some form would be the best solution to this, but I'm not sure where to start. 

I hope I made my issue clear, please let me know if any key information is missing. I know this is a novice question so if someone is even able to direct me to where I can read up on this topic that would be much appreciated. 

Thanks!

  • Hello Ben,

    Please use HALCoGen (code generator for Hercules MCUs) to generate the lower driver for SCI. The HALCoGen can also generate a freeRTOS project for LS1227 device.

    www.ti.com/.../HALCOGEN
  • Hello QJ,

    Thank you for the reply. I had prviously done those steps (HalcoGen driver and FreeRTOS project) but was wondering if it was as simple as using sciReceive to send messages to my board. Is this more of a FreeRTOS question than a TI one?


    Best,
    Ben
  • Ben,

    Great. You have a project ready. If you send chars using sciSend(..), can you get the chars in Putty Terminal? If yes, your sci settings are good for communication.

    Enabling the RX interrupt, and running sciReceive(..) first to define the global variable: rx_length, then wait for the incoming message from putty terminal.
  • Hello QJ,

    Thank you for the reply. I am following you up until you say "wait for the incoming message". I know how to set up the sciReceive, but how do I "pause" to wait for an incoming character or string from the terminal?

    Thank you
  • Hi Ben,

    The receive ready (RXRDY) flag is set when the newly received data is transferred from SCIRXSHF to SCIRD. The RXRDY flag therefore indicates that the SCI has new data to be read. If the RX interrupt is not enabled, you need keep checking the RXRDY flag.

    Receive interrupts are enabled by the SET RX INT bit. If the SET RX INT is set when the SCI sets the RXRDY flag, then a receive interrupt is generated. The received data can be read in the Interrupt Service routine.