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.
Hi, I'm debugging SCI echo back example for f28069. But it is halting at
// Wait for inc character
while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { } // wait for XRDY =1 for empty state
Seems like it is not accepting any char!!.
Any help??
Thanks,
Rahul
Hi Rahul,
I hope you've not modified the example coz the echoback example runs fine. I've attached the sample code; please check it out.
//########################################################################### // //! \addtogroup f2806x_example_list //! <h1>SCI Echo Back(sci_echoback)</h1> //! //! This test receives and echo-backs data through the SCI-A port. //! //! The PC application 'hypterterminal' 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 //! -# Configure hyperterminal: //! Use the included hyperterminal configuration file SCI_96.ht. //! To load this configuration in hyperterminal //! -# Open hyperterminal //! -# Go to file->open //! -# Browse to the location of the project and //! select the SCI_96.ht file. //! -# Check the COM port. //! The configuration file is currently setup for COM1. //! If this is not correct, disconnect (Call->Disconnect) //! Open the File-Properties dialog and select the correct COM port. //! -# Connect hyperterminal Call->Call //! and then start the 2806x SCI echoback program execution. //! -# The program will print out a greeting and then ask you to //! enter a character which it will echo back to hyperterminal. //! //! \note If you are unable to open the .ht file, you can create //! a new one with the following settings //! - Find correct COM port //! - Bits per second = 9600 //! - Date Bits = 8 //! - Parity = None //! - Stop Bits = 1 //! - Hardware Control = None //! //! \b Watch \b Variables \n //! - \b LoopCount, for the number of characters sent //! - ErrorCount //! //! \b External \b Connections \n //! Connect the SCI-A port to a PC via a transceiver and cable. //! - GPIO28 is SCI_A-RXD (Connect to Pin3, PC-TX, of serial DB9 cable) //! - GPIO29 is SCI_A-TXD (Connect to Pin2, PC-RX, of serial DB9 cable) // //########################################################################### // $TI Release: F2806x C/C++ Header Files and Peripheral Examples V130 $ // $Release Date: November 30, 2011 $ //########################################################################### #include "DSP28x_Project.h" // Device Headerfile and Examples Include File // Prototype statements for functions found within this file. void scia_echoback_init(void); void scia_fifo_init(void); void scia_xmit(int a); void scia_msg(char *msg); // Global counts used in this example Uint16 LoopCount; Uint16 ErrorCount; void main(void) { Uint16 ReceivedChar; char *msg; // Step 1. Initialize System Control: // PLL, WatchDog, enable Peripheral Clocks // This example function is found in the F2806x_SysCtrl.c file. InitSysCtrl(); // Step 2. Initalize GPIO: // This example function is found in the F2806x_Gpio.c file and // illustrates how to set the GPIO to its default state. // InitGpio(); Skipped for this example // For this example, only init the pins for the SCI-A port. // This function is found in the F2806x_Sci.c file. InitSciaGpio(); // Step 3. Clear all interrupts and initialize PIE vector table: // Disable CPU interrupts DINT; // Initialize PIE control registers to their default state. // The default state is all PIE interrupts disabled and flags // are cleared. // This function is found in the F2806x_PieCtrl.c file. InitPieCtrl(); // Disable CPU interrupts and clear all CPU interrupt flags: IER = 0x0000; IFR = 0x0000; // Initialize the PIE vector table with pointers to the shell Interrupt // Service Routines (ISR). // This will populate the entire table, even if the interrupt // is not used in this example. This is useful for debug purposes. // The shell ISR routines are found in F2806x_DefaultIsr.c. // This function is found in F2806x_PieVect.c. InitPieVectTable(); // Step 4. Initialize all the Device Peripherals: // This function is found in F2806x_InitPeripherals.c // InitPeripherals(); // Not required for this example // Step 5. User specific code: LoopCount = 0; ErrorCount = 0; scia_fifo_init(); // Initialize the SCI FIFO scia_echoback_init(); // Initalize SCI for echoback msg = "\r\n\n\nHello World!\0"; scia_msg(msg); msg = "\r\nYou will enter a character, and the DSP will echo it back! \n\0"; scia_msg(msg); for(;;) { msg = "\r\nEnter a character: \0"; scia_msg(msg); // Wait for inc character while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { } // wait for XRDY =1 for empty state // Get character ReceivedChar = SciaRegs.SCIRXBUF.all; // Echo character back msg = " You sent: \0"; scia_msg(msg); scia_xmit(ReceivedChar); LoopCount++; } } // Test 1,SCIA DLB, 8-bit word, baud rate 0x0103, default, 1 STOP bit, no parity void scia_echoback_init() { // Note: Clocks were turned on to the SCIA peripheral // in the InitSysCtrl() function SciaRegs.SCICCR.all =0x0007; // 1 stop bit, No loopback // No parity,8 char bits, // async mode, idle-line protocol SciaRegs.SCICTL1.all =0x0003; // enable TX, RX, internal SCICLK, // Disable RX ERR, SLEEP, TXWAKE SciaRegs.SCICTL2.bit.TXINTENA =1; SciaRegs.SCICTL2.bit.RXBKINTENA =1; SciaRegs.SCIHBAUD =0x0001; // 9600 baud @LSPCLK = 20MHz (80 MHz SYSCLK). SciaRegs.SCILBAUD =0x0003; SciaRegs.SCICTL1.all =0x0023; // Relinquish SCI from Reset } // Transmit a character from the SCI void scia_xmit(int a) { while (SciaRegs.SCIFFTX.bit.TXFFST != 0) {} SciaRegs.SCITXBUF=a; } void scia_msg(char * msg) { int i; i = 0; while(msg[i] != '\0') { scia_xmit(msg[i]); i++; } } // Initalize the SCI FIFO void scia_fifo_init() { SciaRegs.SCIFFTX.all=0xE040; SciaRegs.SCIFFRX.all=0x2044; SciaRegs.SCIFFCT.all=0x0; } //=========================================================================== // No more. //===========================================================================
Regards,
Gautam Iyer
Rahul; I hope the baud rates are same; check for their respective baud rates using DSO once. One question; are you atleast able to send data from controller to the terminal? If not, then pakka the baud rates are not matching!
Regards,
Gautam
Baud rates same!... I'll able see the char's printed in terminal. But it seems like UART is not receivig any char form terminal and processor is halting there while waiting for char to be received.
Thanks,
Rahul
Hi Rahul,
Please comment the "while statement" where your code is getting stuck and check what value you get in "ReceivedChar" variable. If you get some values in that variable then we'll have to seriously look into the while statement.
Regards,
Gautam
Gautam, I tried that too... But some how it is not receiving any thing.
Thanks,
Rahul
Hi Rahul,
I'm simply amazed with such kind of behavior. First of all when Tx is working fine, there should be no problem with Rx. Finally what I can suggest to you is look for the Rx pulses on DSO; check whether there's a pulse on the Rx pin of F28069, when you enter any data on hyperterminal.
Regards,
Gautam
Rahul,
What Gautam has suggested will likely get you closer to solving your problem.
Another thought might be that this is hardware related. What hardware are you running this example on? A TI EVM or a custom board? If a TI EVM, which controlCARD and which baseboard are you using and how are you connecting your computer to the UART of the C2000 device? Note that on certain boards, the RX line can be held by a transceiver (however there is usually a jumper or switch to get around this).
Thank you,
Brett
Rahul,
If the problem is indeed with hardware, more information would be helpful:
- Which controlCARD? It will probably be either a 'F2806x controlCARD' or a 'F2806x ISO controlCARD'. This should be written on the silkscreen of the cCARD.
- What motherboard is the controlCARD plugged into? 'DockingStn USB-EMU [R3]' or some other board?
- How have you connected your computer to the F2806x's SCI port to test out this example?
Thank you,
Brett
Thanks Brett,
I'm using F2806x controlCARD. Since the example uses UART0, I've not connected anything external to the board and computer.
Hi Rahul,
Please check whether all the components are alive. Especially the IC and the regulator; if any of them is getting heated up then you'll have to replace them.
Regards,
Gautam
I was thinking that!
Thanks Gautam. But my SCI receive prob not yet solved. Lets see how it goes after replacing the components/CARD.!!!
Just stumbled upon this. FWIW I had the same problem. My code, for that line, now reads:
while(SciaRegs.SCIFFRX.bit.RXFFST ==0) //Was !=1
I can't remember how I got there, but I believe the docs indicated that, as the line was originally written, it was looking for a special code/character, when I wanted all the characters. It then worked immediately as a true echo-back.
Hello Rahul,
Have you solved your SCI problem?
I have the same problem.
I tried sci echo back example for f28069 but it was halting in that line too.
I used f28069m control card and TMDSHVMTRINSPIN kit. I connect TX and RX from PC to TX and RX of the kit (that what suggested by the datasheet, and I also checked the schematic, everything seemed OK), but there was no message appeared in my Hyperterminal when I ran this example.
If you have solved your problem, can you share it?
Thanks for your help!
Best regards,
Maria
Hello all,
I have succeed to transmit data to PC from SCI using echo back example but still can not receive any data from PC.
It halted in the line while(SciaRegs.SCIFFRX.bit.RXFFST !=1) { }
I tried to change it into:
while(SciaRegs.SCIFFRX.bit.RXFFST == 0) { }
and also into:
while(SciaRegs.SCIRXST.bit.RXRDY == 0) { }
Both of them without success.
I checked the schematic again and checked the pin connection and power, everything seemed fine.
Can anybody advice me what to do?
Thanks a lot!
Best regards,
Maria
are you using the controlCARD 69MISO?
are you trying to use the FTDI UART or the UART through the DIMM to the power stage?
controlCARD 69MISO SW 3 Position 2
:
ON -
RS-232 transceiver will be enabled and allow communication through a serial cable via pins 2 and 42 of the DIMM-100 socket. Putting SW3 in the "ON" position will allow the F28069 controlCARD to be DIMM signal compatible with the F2808, F28044, F28335, F28035 and F28027 controlCARDs. GPIO-28 will be stuck as logic high in this position.
OFF -
The default option. SW3 in the "OFF" position allows GPIO-28 to be used as a GPIO. Serial communication is still possible, through the FTDI – FT2232 chip.
and then from qsg_hw_hvmtr_r1p1.pdf:
IMPORTANT
: The kit may also be used with isolated versions of these controlCARDs. The "-ISO" suffix on the controlCARD model i.e. TMDSCNCD28069MISO, indicates the card provides emulation and USB-to-UART functionality. There are additional switches present on the card one of which can disconnect the UART-to-Serial adapter on the card from the C2000 device. Due to a contention problem with the UART connection on the board, the UART-to-Serial adapter on "–ISO" controlCARDs MUST ALWAYS be disconnected.
SW1 on controlCARD- Position 1 = 1 Position 2 = 1 SW3’s Position 1 on the controlCARD should be OFF |
SW3’s Position 2 on the controlCARD should be OFF See the subsection IMPORTANT below |
SW3’s Position 1 on controlCARD should be ON Insert jumper [M3]-J5 Remove jumper [Main]-J9 (JTAG connection will occur via USB connector |
Hello Chris,
Thank you for your reply.
I use TMDSCNCD28069MISO Rev 0.2.
This is the connection in the schematic: (card means ControlCARD, kit means TMDSHVMTRINSPIN)
TX and RX for MUC and DIMM100 are connected to the same pins (GPIO28 and GPIO29).
I connected USB-card to the PC.
SW3 - 2 was OFF. SW3 - 1 was ON (TRST-card connected).
SW1 position 1 and 2 were ON (boot flash). I didn't change the echo back example code.
I used CCS to debug, and also opened Hyperterminal.
These setting result was: the messages before checking SciaRegs.SCIFFRX.bit.RXFFST were appeared in Hyperterminal, but then halted in that line. When I pressed keyboard, the blue LED (D3) in the card was flashed, but the line was still halted.
Did I miss something here?
Can you tell me the conclusion about the setting of SW1 and SW3 to use SCI?
I think SW3 position 2 should be OFF (am I right?), but then how can I connect the SCI pin (RX pin) to PC?
Should I connect another pin instead of GPIO28 to ISO pin in this card? (However I have tried to connect GPIO7 instead of GPIO28 to RX-S but the line RXFFST was still halted)
Or how can I connect the kit (TMDSHVMTRINSPIN) to PC to use SCI?
Actually, when I use CCS for debug, can I use SCI too (for GPIO28 and GPIO29)?
Thanks a lot for your help!
Hello Chris,
I also have tried to use USB-kit.
I connected USB-kit to the PC.
SW3-1 and SW3-2 in the card were both OFF.
SW1 position 1 and 2 in the card were ON (boot flash). Jumper J9 (main) was populated. J5 (M3) was unpopulated.
I didn't change the echo back example code.
I can't use CCS to debug in this case. It said that it was unable to connect the target (is it normal?).
The PC recognized new COM, and I opened Hyperterminal based on this COM. Then I turned OFF and ON the kit but nothing was appeared in the Hyperterminal.
I tried to press my keyboard, also nothing was appeared.
Did I also miss something here?
Thanks a lot for your help!
I can't use CCS to debug in this case. It said that it was unable to connect the target (is it normal?).
No, this isn't. Can you please attach a screenshot of the error displayed while debugging?
Regards,
Gautam
Hello Gautam, thanks for your reply. This is the screenshot of the error.
However, I checked the connection between MCU and DIM100, that there is no connection for this JTAG (TMS, TCK, etc). Also in the schematic, there is no connection for this JTAG from MCU to DIM100. So I think this JTAG (in the kit) is intended to be used by another ControlCard that has no USB emulator. Am I right?
However, GPIO28 and GPIO29 are connected to DIM100 and it means they are connected to ISO chip in the kit and then to FTDI chip in the kit.
I checked the communication between TX and RX test pins of M3 (in the kit) by connecting them together using a cable (J5 unpopulated, J9 unpopulated, USB-kit is connected to PC), the character that I pressed was shown in the Hyperterminal.
So actually, how can I communicate with PC using SCI while debugging using CCS? I am very confused.
Please help.
Hello all,
Finally I have succeed to develop receive-transmit of SCI !!
This is the situation:
- I need to connect USB (of the card) to PC to debug using CCS but USB (of the kit) should not be connected before the program loaded by CCS.
- SW3-1 is ON (TRST connected)
- SW3-2 is OFF (RX-S is not connected to MCU nor DIM100)
- For the kit, J5 is unpopulated, J9 is unpopulated.
- In debug window of CCS, after the program is loaded and before running, plug the USB (of the kit) to PC, and open this COM port in Hyperterminal.
- Finally, run the code.
So the key is to manage COM port connection between the COM for debug and COM for SCI.
Now my question is:
Should we use separate COM (separate FTDI/serial adapter) for JTAG and SCI?
Thanks for your patience to help me.
Best regards,
Maria
Thats a good news, Maria.
Should we use separate COM (separate FTDI/serial adapter) for JTAG and SCI?
For SCI comm you can use SCIA etc... and for JTAG SCIB
BrandonAzbell says:You will need to have F28335 target application code running which interacts with the SCI in UART mode to make use of the DB9 connector P12. However, this does not provide the same level of debug access as JTAG.
My assumption would be that you can use a Terminal program like HyperTerminal, TeraTerm, etc. on the PC side, but again, your target hardware is going to have to run a program that can communicate to the UART, perhaps directing any printf() to the UART, etc.
Regards,
Gautam
Maria,
The issue is that the HVMTRKIT was originally designed for the standard (no-JTAG no-ISO) controlCARD. We started building the ISO+JTAG controlCARDs a couple years later (for use in many other kits) and just expected we would use the JTAG and UART on these new controlCARDs. The problem is that the HVKIT doesn't have a way to turn off the serial connection that goes from the HVKIT XDS100v1 to the DIMM connector, so if you try to use the 69MISO controlCARD's ISO UART there is a contention. This is the only "mother board" that has this contention for the controlCARD.
The functionality that you are seeing is expected, in that you need for the program to boot into flash before you connect the debugger.
I'm glad you figured it out!
Thank you Chris, and also Gautam.
Now I am struggling to program the code (the echoback example) in flash so I can run it after turning it OFF and ON without CCS debug (it is possible, right?).
Maybe I will need your help again.
Thanks in advanced!
Hi Maria,
To run the code on Flash, you'll have to go through this doc:
3301.3301.TI_Running_from_Flash_spra958l.pdf
Just follow the guidelines and you'll be able to run the code through flash.
Regards,
Gautam
Hello Gautam,
Yes, I read the documentation and tried the flash example and I have succeed to run the echoback example and also the Motorware example project from flash.
Thanks once again!
Your welcome!
Please close this topic by pressing the green button. Its been stagnant since a long time. Also for any further queries start a new thread please :)
Regards,
Gautam
Gautam, I really want to verify it since the beginning but I could not find the verify button :D
So strange that it doesn't appear. Can you help?
Maybe the button appears only in the first person who made this thread and I think his similar problem has not been solved yet.
Thanks!
hi to all,
i m facing same problem with sci(uart) protocol in piccolo control stick.
In my communication piccolo will be master and msp430 will be slave
my problem is i m receiving for only once and its halting for while receiver buffer condition.
1) only transmitter function is working fine from piccolo.
2) when i m club both transmitter and receiver function in piccolo for the 1st time is send 0x01 from piccolo and i m receiving string from msp430 i can see in tera term and for second time when piccolo will send 0x01 its not receiving that same string again but i can see across receiver pin of piccolo in tera term
Hello Pradeep,
I don't know what you mean about 'Master' and 'Slave' in SCI, is it RS485/Modbus or some other protocol that you use?
Maybe this is mostly hardware problem, just like I faced before.
Maybe you can send us the block diagram (or even schematic) of your SCI connection between these two MCUs.
Thanks.
Best regards,
Maria