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.

Sending Integers over SCI on F28335

Hi,

I have used the SCI example in with the control SUITE that has the ability to transmit and receive the character using the echo back example.  However, I am now trying to send an integer like a counter to the transmit register, but having no luck with it.

Please advise.

Thanks for the help.

  • Hi Kamal,

    Did you try using this function: scia_xmit(int a)

    Regards,

    Gautam

  • Thanks for a quick reply Gautam.

    Here is what I have in my main().

    void main()
    {
    
    	InitSysCtrl();
    	init_user();
    	//char *msg;
    	LoopCount = 0;
    
    	while(1)
    	{
    		// Get Acceleration Values
    		while(!GpioDataRegs.GPADAT.bit.GPIO9);
    		getAccelValues(&X_Acceleration,&Y_Acceleration,&Z_Acceleration);
    
    		//Get Gyroscope Values
    		while(!GpioDataRegs.GPADAT.bit.GPIO11);
    		getGyroValues(&X_AngularRate,&Y_AngularRate,&Z_AngularRate);
    
    		//msg = "\r\nKamal \0";
    		//scib_msg(msg); //Added for HSISCU
    
    		LoopCount++;
    		scib_xmit(LoopCount);
    	}
    }
    
    
    
    // Transmit a character from the SCI-B (Added for HSISCU)
    void scib_xmit(int a)
    {
        //while (ScibRegs.SCIFFTX.bit.TXFFST != 0) {}
        ScibRegs.SCITXBUF=a;
    
    }

    however, when I try to send this integer I can not read the values on my hyper terminal.

    I am using the USB2SER driver:

    http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=USB2SER

    Thanks.

  • Kamal,

    How is it not working? are you just receiving garbage from the SCI? I would think that hyperterminal is trying tor translate this integer value into a UTF-8 format. which looks like garbage on the screen but is in fact correct on the bit level. See if there are any settings you might be able to twiddle with. Another thought is that you might have to convert your integer to a char in order to have hyperterminal compatibility.

    -Mark

  • Kamal Joshi said:
    however, when I try to send this integer I can not read the values on my hyper terminal.

    Are you able to observe any garbage data on hyperterminal or no data at all?

    Regards,

    Gautam

  • Hi Gautam,

    I am able to see garbage data on the hyper terminal.  The client I am using is Terra-term.

    Mark - I will try to play around with its setting to see if I can work something out.

    Thanks for all the support guys.

    Kamal Joshi

  • Try Hyperterminal: 0576.hypertrm.rar

    (Don't forget to copy the dll file to system32 folder)

    Regards,

    Gautam

  • Hi Gautam,

    When using the hyperterminal you provided, I am still getting garbage out on the screen.  I have attached the screenshot of what I see on the terminal.

    However, in the observation in CCS I am able to see the LoopCount counter go up.

    Thanks,

    Kamal Joshi

  • Kamal, 

    After doing some research, you might try these few things: You can just log the data in a file and then view it as raw hex in a text editor. also there putty raw mode, which I have not used, but some people have mentioned that it might work.The last option I can find is another program called RealTerm that is targeted towards binary data. I have never used it, so if you do use it and get it working please post your results so that others might benefit!

    Regards,

    Mark

  • Selam Kamal;

    I think,you must change hyperterminal settings.

    in your screenshot, you got ASCII Characters,

    If you change the input options of your terminal to "decimal" from "ASCII" ,  you can get LoopCount good.

     

    Mehmet from Türkiye

    best regards.

  • Hi Mehmet,

    Which hyper terminal client are you using ? I am using Terra-term and I can not find the configuration that has the ability to change the type to decimal from ASCII.

    Please Advise.

    Thank You !