MCU Data size, I need a reference

Discussion in 'Embedded Systems and Microcontrollers' started by ke5nnt, Nov 25, 2011.

  1. ke5nnt

    Thread Starter Active Member

    Mar 1, 2009
    384
    15
    Hey, I've been learning some of the more "in-depth" aspects of microcontrollers and something I've never really understood is memory size. To explain what I don't understand a little more, let me say, I know that a "bit" is one binary digit, and I know that a nibble is 4 bits, a byte is 8 bits, and a "word" is 4 bytes. That being said, how do you really estimate how much memory a program is going to use? Or how much EEPROM memory you'll need, etc? Is one instruction (i.e. CLRF, GPIO) equal to one word, and therefore 4 bytes?

    Thanks
     
  2. AlexR

    Well-Known Member

    Jan 16, 2008
    735
    54
    You have the bits, nibbles and bytes right but not words. The number of bits in a word is very much dependant on the microcontroller. For example the PIC12 series uses 12 bit words, the PIC16 chips use 14 bit words and the PIC18 chips use 16 bit (2 byte) words, no doubt there are some processors that use 4 byte words. PICs (the chip I'm most familiar with) generally us 1 word per instruction but they do have a couple of instructions that use 2 words so it all boils down to read the data sheet for the processor you are using to find out the word size and the number of words used by any particular instruction.
     
  3. ke5nnt

    Thread Starter Active Member

    Mar 1, 2009
    384
    15
    Ah, thank you for the correction and info.
     
Loading...