Jump to content

[Example_F2802xSci_Echoback] Doesn't Work

Recommended Posts

Hello, I am new to application development at Texas Instruments. I bought the C2000 Piccolo LaunchPad Evaluation Kit (LAUNCHXL-F28027), installed the CCS version 5 and controlSUITE too. Have looked at several examples, but only Example_F2802xLaunchPadDemo works.
In my project, I want to get data from a ADCPin (using 0 ~ 5V) and show in the Hyperminal (or putty) using SCI port as a string. I want to use the IC LM35 (http://www.ti.com/lit/ds/symlink/lm35.pdf) to measure temperature. No, I do not want to use the internal temperature sensor of the C2000.
Then I want to be able to send data (like for example: integer the string "55", which would be the new desired temperature value, in °C) in hyperterminal for C2000, and generate a PWM increasing the temperature of a resistor that is close to LM35, with the aid of a BC337 transistor for current gain.
I tried to build the example Example_F2802xSci_Echoback to communicate, but it does not work.
The Warning that gives are these:
I open Hyperterminal, use the COM4 port (the port connected C2000), use baud rate 9600, default, 1 STOP bit, no parity, but shows nothing.


See the board:





Anyone could help me, please? Thank you.

Link to post
Share on other sites

Inserted a more detailed picture:






**** Build of configuration RAM for project Example_F2802xSci_Echoback ****

C:\ti\ccsv5\utils\bin\gmake -k all 
'Building file: ../Example_2802xSci_Echoback.c'
'Invoking: C2000 Compiler'
"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt -g --include_path="C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" --include_path="C:/ti/controlSUITE/device_support/f2802x/v200" --include_path="C:/ti/controlSUITE/libs/math/IQmath/v15c/include" --define="_DEBUG" --define="LARGE_MODEL" --quiet --verbose_diagnostics --diag_warning=225 --output_all_syms --cdebug_asm_data --preproc_with_compile --preproc_dependency="Example_2802xSci_Echoback.pp"  "../Example_2802xSci_Echoback.c"
"../Example_2802xSci_Echoback.c", line 143: warning: function declared
          ReceivedChar = SCI_read(mySci);

"../Example_2802xSci_Echoback.c", line 192: warning: function declared
      SCI_write(mySci, a);

'Finished building: ../Example_2802xSci_Echoback.c'
' '
'Building target: Example_F2802xSci_echoback.out'
'Invoking: C2000 Linker'
"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/bin/cl2000" -v28 -ml -mt -g --define="_DEBUG" --define="LARGE_MODEL" --quiet --verbose_diagnostics --diag_warning=225 --output_all_syms --cdebug_asm_data -z --stack_size=0x200 -m"Example_F2802xSci_echoback.map" --warn_sections -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/lib" -i"C:/ti/ccsv5/tools/compiler/c2000_6.1.0/include" -i"D:/Arquivos/CCS_workspace_v5_2/Example_F2802xSci_Echoback" -i"C:/ti/controlSUITE/device_support/f2802x/v200/F2802x_common/lib" -i"C:/ti/controlSUITE/libs/math/IQmath/v15c/lib" --reread_libs --verbose_diagnostics --issue_remarks --entry_point=code_start --rom_model -o "Example_F2802xSci_echoback.out"  "./Example_2802xSci_Echoback.obj" -l"C:/ti/controlSUITE/device_support/f2802x/v200/f2802x_examples/sci_echoback/../../F2802x_common/cmd/F2802x_generic_ram.cmd" -l"rts2800_ml.lib" -l"IQmath.lib" "C:/ti/controlSUITE/device_support/f2802x/v200/f2802x_headers/cmd/F2802x_Headers_nonBIOS.cmd" "C:/ti/controlSUITE/device_support/f2802x/v200/f2802x_common/lib/driverlib.lib" 
warning: creating output section "csm_rsvd" without a SECTIONS specification
warning: creating output section "csmpasswds" without a SECTIONS specification
warning: entry-point symbol other than "_c_int00" specified:  "code_start"
'Finished building target: Example_F2802xSci_echoback.out'
' '

**** Build Finished ****



Anybody help?

Link to post
Share on other sites

Hi Skinny,
Sorry for your troubles, these examples and the driver they use are relatively new and I've had very little help testing and making sure everything works.  I sincerely apologize for any bugs you may find, and I'm happy to work with you to fix them.
On to your problem:
There are a few minor issues that need fixed before the example will work.  I'll file a bug for these and get this fixed in the next release.

  • Warnings: SCI_read and SCI_write are functions defined in sci_io.c.  These were added to allow me to register the SCI as a STDOUT stream.  This allows us to use the printf functionality present in the RTS library with the SCI.  The warning is there because these functions are not properly declared in a header file.  I added these late in the game and they never got declared.  You can fix this by switching these calls to SCI_getData and SCI_putData, the arguments to the functions are the same so it should be a drop in replacement.
  • Hardware: Make sure the serial connection switch S4 is in the up position.  This connects the SCI peripheral's gpios to the USB/UART connection on the FTDI chip.
  • Baud Rate: This example was originally written for the F2802x0 devices which have a max speed of 50Mhz.  Two things need to be done to fix the baud rate.
    • Change the PLL to setup the device for 60Mhz
    •     PLL_setup(myPll, PLL_Multiplier_12, PLL_DivideSelect_ClkIn_by_2);
    • Replace the baudrate setup code with this:
    • #if (CPU_FRQ_60MHZ)
          SCI_setBaudRate(mySci, SCI_BaudRate_9_6_kBaud);
      #elif (CPU_FRQ_50MHZ)
          SCI_setBaudRate(mySci, (SCI_BaudRate_e)129);
      #elif (CPU_FRQ_40MHZ)
          SCI_setBaudRate(mySci, (SCI_BaudRate_e)129);


Once again, sorry for the trouble.  I've had a lot on my plate this year.  If you have any more questions don't hesitate to ask!

Link to post
Share on other sites
  • 2 weeks later...

Hello Trey,



Going beyond the question raised by the Skinny, I wonder if it is possible to associate the stdout and stdin to SCIA?
I saw an example where this was done with the stdout:
    //Redirect STDOUT to SCI
    status = add_device("scia", _SSA, SCI_open, SCI_close, SCI_read, SCI_write, SCI_lseek, SCI_unlink, SCI_rename);
    fid = fopen("scia","w");
    freopen("scia:", "w", stdout);
    setvbuf(stdout, NULL, _IONBF, 0);


How this code becomes to add the stdin?



Cristiano Scardini

Link to post
Share on other sites
  • 2 weeks later...


Absolutely yes!


In the C2000_LaunchPad out of box demo application I associate STDOUT to SCIA to allow for easy transmission of characters, but you could also associated STDIN.  I don't have the exact code for how to do this, but the CIO functions are discussed in detail in the compiler users guide (search for spru514 on the TI website).  You'll find the information in section 8.3 "The C/IO Functions".  There is also information on how to add other low level device drivers.




Link to post
Share on other sites
  • 7 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...