Hello,

Thank you for your response. I am new to MSP430 MCUs. But I already
experienced with AVR family MCUs such as Atmega128 which is a Modified
Harvard architecture MCU. But as I know MSP430 MCUs are Von Neumann
architecture MCUs. Here is the code snippet that I use to send a
string via serial port.

void send_string(const char *strptr, int len)
{

  int i;

    for (i = 0; i<len; i++)
    {
      send_char(strptr[i]);
    }
}

The function "send_string()" is called as " send_string("Hello I am
Kasun", 17) ".

The string which I send  via the function "send_string()" is a
constant string. When using AVR family MCUs, what I did was that store
the strings in Program Space and retrieve them as needed, This incurs
some extra overhead in terms of Program Space and execution time.
Usually, both the space and time overhead is minimal compared to the
space savings of putting data in Program Space.

It seems, this can not be done or no point of doing it in MSP430 MCUs
because they are Von Neumann architecture MCUs. Would you be able to
tell me that how can I gain an optimized RAM usage when dealing with
constant strings.

Thank you.

Best Regards,
-- 
..:: කසුන් චන්ද්‍රනාත් ::..
..:: Kasun Chandranath ::..



Matthias Hartmann wrote:
>Hello,
>
>if you want to manipulate (change) things, you have to change them in
>RAM or in registers.
>
>But best would be, to give us some code to look at, which you want to
>optimize for RAM usage.
>
>Kasun Hewage schrieb:
>> Hello,
>>
>> I am using MSP430F1612 and writing a program which manipulates
>> strings. I think it is better to load the strings directly from flash
>> without loading them into RAM first to save the RAM space. Is there
>> any mechanism to do that? Any suggestions? I am sorry if this question
>> has been answered previously.
>>

Reply via email to