PIC Memory

Status
Not open for further replies.

GatorGnet

New Member
How much memory does a typical 100 line ASM program take up in a PIC? The 16f628A shows 3.5k but is a little overkill on some of our needs. I am looking at the 10F2## for small needs.

Also, does the 10F2## PIC's have a built in internal oscillator?
 
All in the 10F series have internal oscillators, but be careful - not all the chips in the 10F and 12F series have interrupts. Check the datasheet if you need to use interrupts.
 
How much memory does a typical 100 line ASM program take up in a PIC? The 16f628A shows 3.5k but is a little overkill on some of our needs. I am looking at the 10F2## for small needs.

16F and lower PIC's are easy - all instructions are a single word long - so a 100 line program will take LESS than 100 words of memory, as some lines generate no code.
 
For smaller PIC parts, all instructions are 14 bits long. So 100 NOP instructions take up the same space as 100 complex operations involving the stack.

However, some instructions take more than one cycle to run. So instruction "length" in PIC flash memory does not relate to execution speed.

The Wikipedia page PIC microcontroller - Wikipedia, the free encyclopedia shows the instructions and their binary equivalents once assembled.
 
How does 100 words translate into memory size, < 100 bytes?

PIC's don't use bytes, 16F series use 14 bit words, 12C series use 12 bit words, and 18F use 16 bit words.

The 'bytes' listed for a PIC is purely for advertising comparisons, multiply the number of words by the number of bits, then divide by 8 to get the number of bytes (a completely useless and pointless value).
 
How many words fit in 3.5k of memory?

3.5k of what, and in what processor?.

Read the datasheet and look how many WORDS a processor can hold, that's all that matters.

For an example a 16F627 holds 1K, a 16F628 2K, and a 16F877 8K.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…