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.

*** USER INPUT and COMMAND LINE implementation in CCSv4****

Other Parts Discussed in Thread: MSP430F2013

Hi Everyone,

I have recently programmed a MSP430F2013 to give out a finite pulse train. I am using CCS v4 as my IDE. It has been only a month or so that I have been using it; hence I am stuck every now and then.

The next step of the program would be design a UI that will allow the user to

i) input the number of pulses desired (this is nothing but having the ability to change a volatile int)

ii) set the desired frequency (this is a value in TACCR0-- a register in timer A)

iii) set the desired duty cycle (this is a value in TACCR1--another register in timer A)

 

*** The user should not have a working knowledge of MCU or anything, but should be able to intuitively enter the values--the parameters for the pulses***

 

My problem seems to be:

a) I cannot figure out a way in which I can use scanf/cin command lines in my program that will prompt the user to enter a value--I tried a lot of different ways, but CCS never asks for it

b) Apart from allowing the user to enter the value, I would like the program to calculate the number of tick in TACCR0-1 w/o the user having to do the calculation--this part of the problem will be solved once I solve i)

 

Moreover, if anyone can point me to any literature/books that address these sorts of user i/o issues, I will be indebted. I have minimal working knowledge of C++, for I am learning it simultaneously while learning the MCU details.

 

If anyone has any idea of how to accomplish this, I will be really grateful.

Thanks,

UE

  • Hi,

    Please check the page below. It talks about console I/O and details necessary to make it work:

    http://processors.wiki.ti.com/index.php/Tips_for_using_printf

    I checked and both scanf and cin work for me in CCSv4.2.3.

    However, keep in mind that any Console I/O function is intrinsically costly in memory and therefore will not "fit" in such a small device like the F2013.

    Best regards,

    Rafael

     

  • Hi Rafael,

     

    Thanks for dropping by. When you say, they worked, did you debug the project and the program asked for an input? If yes, would you mind pointing me how to do it?

    I also appreciate the fact that you brought up the memory issues. Since scanf and printf are costly procedures, are there any other sort of i/o functionality issues that you may suggest?

     

    Thanks again

    UE