Other Parts Discussed in Thread: CONTROLSUITE, C2000WARE
Tool/software: Code Composer Studio
Hi,
I Have tried UART communication code by changing the pin from the example code,the Tx line does not seem to be transmitting at all .I am having some trouble with the SCI modules not being able to output anything through the pins on the launchpad,When I were edited controlsuite code its work fine.I posted my code bellow, any suggestions as to what I'm missing would be appreciated.
//#############################################################################
//
// FILE: sci_ex3_echoback.c
//
// TITLE: SCI echoback example.
//
//! \addtogroup driver_example_list
//! <h1>SCI Echoback</h1>
//!
//! This test receives and echo-backs data through the SCI-A port.
//!
//! A terminal such as 'putty' can be used to view the data from
//! the SCI and to send information to the SCI. Characters received
//! by the SCI port are sent back to the host.
//!
//! \b Running \b the \b Application
//! Open a COM port with the following settings using a terminal:
//! - Find correct COM port
//! - Bits per second = 9600
//! - Data Bits = 8
//! - Parity = None
//! - Stop Bits = 1
//! - Hardware Control = None
//!
//! The program will print out a greeting and then ask you to
//! enter a character which it will echo back to the terminal.
//!
//! \b Watch \b Variables \n
//! - loopCounter - the number of characters sent
//!
//! \b External \b Connections \n
//! Connect the SCI-A port to a PC via a USB cable.
//! Refer to the hardware user guide for the UART/USB connector information.
//
//#############################################################################
// $TI Release: F2837xD Support Library v3.10.00.00 $
// $Release Date: Tue May 26 17:13:46 IST 2020 $
// $Copyright:
// Copyright (C) 2013-2020 Texas Instruments Incorporated - http://www.ti.com/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the
// distribution.
//
// Neither the name of Texas Instruments Incorporated nor the names of
// its contributors may be used to endorse or promote products derived
// from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// $
//#############################################################################
//
// Included Files
//
#include "driverlib.h"
#include "device.h"
//
// Defines
//
// Define AUTOBAUD to use the autobaud lock feature
//#define AUTOBAUD
//
// Globals
//
uint16_t loopCounter = 0;
//
// Main
//
void main(void)
{
uint16_t receivedChar;
unsigned char *msg;
uint16_t rxStatus = 0U;
//
// Configure PLL, disable WD, enable peripheral clocks.
//
Device_init();
//
// Disable pin locks and enable internal pullups.
//
Device_initGPIO();
//
// Configuration for the SCI Tx pin.
//
GPIO_setMasterCore(18, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_18_SCITXDB );
GPIO_setDirectionMode(18, GPIO_DIR_MODE_OUT);
GPIO_setPadConfig(18, GPIO_PIN_TYPE_STD);
GPIO_setQualificationMode(18, GPIO_QUAL_ASYNC);
EALLOW;
//
// Configuration for the SCI Rx pin.
//
GPIO_setMasterCore(19, GPIO_CORE_CPU1);
GPIO_setPinConfig(GPIO_19_SCIRXDB);
GPIO_setDirectionMode(19, GPIO_DIR_MODE_IN);
GPIO_setPadConfig(19, GPIO_PIN_TYPE_PULLUP);
GPIO_setQualificationMode(19, GPIO_QUAL_ASYNC);
//
// Initialize interrupt controller and vector table.
//
Interrupt_initModule();
Interrupt_initVectorTable();
//
// Initialize SCIB and its FIFO.
//
SCI_performSoftwareReset(SCIB_BASE);
//
// Configure SCIB for echoback.
//
SCI_setConfig(SCIB_BASE, DEVICE_LSPCLK_FREQ, 9600, (SCI_CONFIG_WLEN_8 |
SCI_CONFIG_STOP_ONE |
SCI_CONFIG_PAR_NONE));
SCI_resetChannels(SCIB_BASE);
SCI_resetRxFIFO(SCIB_BASE);
SCI_resetTxFIFO(SCIB_BASE);
SCI_clearInterruptStatus(SCIB_BASE, SCI_INT_TXFF | SCI_INT_RXFF);
SCI_disableLoopback(SCIB_BASE);
SCI_enableFIFO(SCIB_BASE);
SCI_enableModule(SCIB_BASE);
SCI_performSoftwareReset(SCIB_BASE);
#ifdef AUTOBAUD
//
// Perform an autobaud lock.
// SCI expects an 'a' or 'A' to lock the baud rate.
//
SCI_lockAutobaud(SCIB_BASE);
#endif
//
// Send starting message.
//
msg = "HELLO";
for(;;)
{
SCI_writeCharArray(SCIB_BASE, (uint16_t*)msg, 6);
}
}
//
// End of File
//
Thanks in advance.