Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 3rd June 2009, 05:53 PM   #1
Default PIC Memory

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?
GatorGnet is offline  
Old 3rd June 2009, 05:59 PM   #2
Default

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.
BuffaloEngineer is offline  
Old 3rd June 2009, 07:17 PM   #3
Default

Quote:
Originally Posted by GatorGnet View Post
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 3rd June 2009, 07:47 PM   #4
Default

How does 100 words translate into memory size, < 100 bytes?

Thanks,
Mike
birdman0_o is offline  
Old 3rd June 2009, 08:08 PM   #5
Default

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.
__________________
Private messages are for personal communication, please do not use them to ask for help.
edeca is offline  
Old 3rd June 2009, 08:22 PM   #6
Default

Quote:
Originally Posted by birdman0_o View Post
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).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 3rd June 2009, 08:31 PM   #7
Default

Quote:
Originally Posted by Nigel Goodwin View Post
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.
How many words fit in 3.5k of memory?
GatorGnet is offline  
Old 3rd June 2009, 08:33 PM   #8
Default

Quote:
Originally Posted by GatorGnet View Post
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.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 3rd June 2009, 08:42 PM   #9
Default

Right after I asked that, the sim I am using showed 2k. sorry.
GatorGnet is offline  
Reply

Tags
memory, pic

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
SD memory help eldermalagon Electronic Projects Design/Ideas/Reviews 7 22nd April 2009 09:00 PM
How much memory do I need? Nrets Micro Controllers 12 6th January 2009 04:49 PM
memory? colin886 Datasheet/Parts Requests 2 12th December 2005 05:02 AM
PC ram memory mahinda jayasinghe General Electronics Chat 2 5th November 2004 07:36 AM
Memory on a PIC brentonw2004 Micro Controllers 7 19th December 2003 01:30 PM



All times are GMT. The time now is 04:04 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker