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.

RAM requirements in a microcontroller

Hi,

I am new in the selection procedure of a microcontroller. I would like to know how to calculate the amount of the RAM and the memory required on the microcontroller if an LCD , I2C port and UART port are used. Currently Iam planning to decide on MSP4302616 controller. Please help me in calculating and deciding the controller.

  • I never achieve to determine the amount of memory required if I have nothing to compare to.

    What I do is to select a family not a microcontroller, so the first selected microcontroller could be replaced by another one in the same family  with more memory (or less);) It is my easy way not to get stucked in a design.

    The F2616 could be replaced by the F2617 which hase twice the RAM in case there is not enough on the F2616, but of course if you need 16k of RAM, you'll have a problem.

    I know I'm not very helpfull...

  • Hi deepthi,

    how much RAM you require also depands on your programming style/skills! You can't say I need this or that without knowing more details (i.e. how large will your UART/I2C data buffers be (if you need any), which type of LCD do you plan to use, ...).

    If money doesn't matter take the largest availabe part (use the selector here http://focus.ti.com/paramsearch/docs/parametricsearch.tsp?sectionId=95&tabId=1200&familyId=342&family=mcu) and start your development. You will end up with the MSP430F66xx family which is not available at the moment.

    You can also use a Stellaris part http://focus.ti.com/mcu/docs/mculuminaryprodsearch.tsp?sectionId=95&tabId=2485&familyId=1755 which will give you 96kbytes RAM at maximum (at around $4,80 per piece). They have plenty of I/O and Flash, so no need to worry!

    Sorry man, but that is the wrong approach your currently doing! Sit down, define your requirements (in case of hardware). Then you will need to make an assumption how much RAM/ROM you need (or you have some knowlage from earlier projects) and then decide which MCU to use.
    It's always good to select a device which has the option of down- or upgrading the memory on the same footprint.

    Rgds
    aBUGSworstnightmare

  • aBUGSworstnightmare said:
    Sorry man, but that is the wrong approach your currently doing! Sit down, define your requirements (in case of hardware). Then you will need to make an assumption how much RAM/ROM you need (or you have some knowlage from earlier projects) and then decide which MCU to use.
    It's always good to select a device which has the option of down- or upgrading the memory on the same footprint.

    Yes you need to make an assumption, the assumption will not tell you if you need 4k or 6k but tell you if you are close to 4k or 50k. This will let you chose a family with all other hardware requirements.

    If you expect to use 60k RAM I will not select a family with a maximal RAM of 16k. But a family wich goes from 40k to 80k so you are "safe" and during the developpment with more informations you will select the MCU you'll use.

  • Argail said:
    If you expect to use 60k RAM I will not select a family with a maximal RAM of 16k. But a family wich goes from 40k to 80k so you are "safe" and during the developpment with more informations you will select the MCU you'll use.

    Youre surely right, bu tnot entirely. aBwn made a valid point when ssaying that the hardware requirements are the first step. Often the ram requirements follow implicitely:

    If you need to collect an dprocess A/D data on 16 bit per sample, two channels and with 96kHz sampling rate, you'll either need MUCH ram or a fast way to get rid of this data. If oyu need to process it with an FFT, the MSP is definitely too slow and has not enough memory. If you just have to pass it to external RAM or further processing using an SPI, it is an easy task, you don't need much ram (2k is enough for double-buffering). The 5438 can easily handle this.
    If you need much ram but don't need it that fast, an external flash or ram memory with SPI will do the trick and even a small MSP (with 1k ram) might be enough.

    For most projects, the majority of the ram depends on the prroject topic itself, and not the implementation.

    Of course, then it comes to the programming skills. One of my projects is an energy meter. 3-phase, energy, voltage, phase (provided by an external source using SPI), generating a virtual digital counter, also counting S0 port pulses on two additional inputs, implementing a communication protocol using RS485. All this (including the 32bit counters for all 8 channels, timing counters for the S0 inputs and more) runs on an MSP1232 with only 256 bytes ram. I must admit that I get a stack overflow when I use sprintf with more than 2 parameters :) And I'm near the end with the 8kB Flash.

    Of course I don't use any float or double variables, don't use C++ classes, templates or any other fancy stuff. And I'm sure I could write the very same program with a minimum memory requirement of 2k.

    Without detailed project information, the question for the ram is as futile as asking which shoe size to buy for my grownup son when he's still unborn.

  • Thank you all for ur replies.

**Attention** This is a public forum