MPLAB IDE

Started by Chas Douvier April 21, 2003
I have read nothing but good things about MPLAB IDE so I want to try
it. I haven't written a single line of code yet and I fire the
program up. Maybe I am missing something, I seem to be able to
import code and add it from exisiting text files, but there is no
where to actually write code? Did I miss something?

What does "everyone else" use?




MPLAB IDE will work fine. Try this: start the IDE with no documents
loaded. Click on Project then New, fill out the form to create a
project and a project subdirectory.

Now select File then New to create a blank document and start writing
your code. An END statement is all that is required for proper
assembly. At some point you will want to do a Save As to your project
subdirectory and give the file a name.

Now, click on Project then Add Files To Project and select the file
you just saved. This will add the file to the Source Files section of
the Workspace window. Other files can be added as your project gets
larger.

At some point you may want to save the modified Project file (created
by Project->New) so click Project then Save Project.

That should get you started with the IDE. --- In , "Chas Douvier" <charles@k...> wrote:
> I have read nothing but good things about MPLAB IDE so I want to try
> it. I haven't written a single line of code yet and I fire the
> program up. Maybe I am missing something, I seem to be able to
> import code and add it from exisiting text files, but there is no
> where to actually write code? Did I miss something?
>
> What does "everyone else" use?




You go to "new" on the "file" menu in order to get a new text screen up. You
include the correct template (get from www.microchip.com) and you write your
code there. You save this file as a .asm file.



Thank you all for the recent help with MPLAB IDE. I read the Quick
Start Guide and I started writing my first program for the 18F452.
All went well, programmed it with my ICD2 on my PICDEM 2 Plus and my
test program to light up some led's and turn them off worked. I am
glad i bought the setup I have very handy for a begineer..

Now I want to do more, except there are things in IDE like "org
0x000" for starting at the reset vector and #define .. etc.. none of
these are in the quick start guide or my 18F452 instruction set.. To
be honest last time I did any assembly or machine language was when
I was working with my CDP1802 by HEX keypad byte by byte.. its been
a while so I am not sure if its suppose to be common knowledge stuff
or not.

Is there a PDF somewhere or something that I can find out exactly
how to use all of the extended functions for IDE? I have been
getting pretty lucky at just using well documented source code to do
modifications, but I want to know for sure what I am doing.

Thank you,
Charles




Well, the first place you can look is under Help->Microchip Language
Tools Help->MPASM Assembler Help. There are, apparently, two
documents of some use at www.microchip.com DS33014 and DS30400.

The other thing that is useful is to read code - a lot of code.
There are many great examples of code on the Microchip site. Maybe
not so much for the 18F452 but many of the examples for the 16F6xx
and 16F87x could be useful.

I was just looking at the datasheet and it has many code snippets.
Generally these are of a "do it this way or it won't work" type.

If you have followed along here the last couple of weeks you will
have seen quite a discussion on ORG, EQU, #DEFINE, CBLOCK, labels,
memory allocation, etc. These are specific to the chip or the IDE.
They are pseudo instructions and supported by many assemblers.

In general (and before anyone flames me, in my opinion only), use EQU
to assign a synonym (label) to a numeric value (including the result
of an arithmetic expression). An example:

NumberOfTasks...EQU...8

Do not use EQU to assign memory addresses unless they are fixed in
hardware. For example PORTB is EQUated to a fixed numeric value in
the include file because it is indeed fixed!

Use CBLOCK to allocate memory (yes I know the programmer is doing the
allocation but read on!):

BYTE...EQU...1...; one byte allocation unit
WORE...EQU...2...; two byte allocation unit

..CBLOCK..0x20...; allocate RAM starting at 0x20
..
..Period:..NumberOfTasks * WORD...; array of Period values for Tasks
..Delay:...NumberOfTasks * WORD...; array of Delay values for Tasks
..RunMe:...NumberOfTasks * BYTE...; array of RunMe flags for Tasks
..TaskIndex:...BYTE...............; index into arrays
..
..ENDC

With this formulation it is apparent that Period, Delay and RunMe are
arrays of WORD, WORD and BYTE respectively. It is also apparent that
TaskIndex is a BYTE. I could also do CHAR EQU 1 and use CHAR to
further clarify the type of allocation. Heck, you could even use
SIGNED8 EQU 1 and SIGNED16 EQU 2 to remind yourself that you plan to
use these variables in signed arithmetic. Now, the assembler is not
going to enforce any rules about variable type but it's a start.

If I change the number of tasks the assembler deals with the
reallocation. I don't know the RAM address of TaskIndex and I don't
need to know. The assembler knows and that is all that is important.

Now try this with EQU:

Period.....EQU..0x20
Delay......EQU..Period + (NumberOfTasks * WORD)
RunMe......EQU..Delay + (NumberOfTasks * WORD)
TaskIndex..EQU..RunMe + (NumberOfTasks * BYTE)

It could be worse:

Period.....EQU..0x20
Delay......EQU..0x30
RunMe......EQU..0x40
TaskIndex..EQU..0x48

Here you can't tell what is happening - did the programmer like a
fancy pattern in memory? Are these arrays or were certain temporary
variables removed? Really ugly!

Use #DEFINE to do two things: first you can just define the label to
exist without a value:

#DEFINE Debug

#IFDEF DEBUG
..include some debugging code
#ENDIF

You can also #UNDEFINE a label to remove it from the defined symbols
table. Then you can use:

#IFNDEF PRODUCTION
..well, we're not in production, add debugging code here
#ENDIF

Second you can use #DEFINE to create a text substitution. That is,
every occurance of the label is replaced by the entire string. So:

#DEFINE Motor CCPR2L......; PWM to motor
#DEFINE Actuator CCPR1L...; PWM to steering actuator

This keeps it clear in my mind and in the code: to which device am I
sending the PWM value?

Of course the obvious #DEFINEs substitute a name for a Port and Bit
combination:

#DEFINE LED PORTB,0....; define the flashing LED

Again, in my opinion only, I like to follow labels that represent
program memory addresses with a colon. It is still required in some
assemblers.

MySubroutine:...............; always on a separate line
....MOVWF TaskIndex.........; save the TaskIndex that is in W
....RETURN

Well, that leaves ORG. Use ORG to cause the assembler to use the
value as the starting address of the code that follows. This is used
at the Reset Vector , the Interrupt Vector and perhaps the address
for EEPROM data tables. There could be a few other cases on the
18F452 but I have never used the chip.

Hope this helps! If you want to see 16F876A code that uses these
ideas, send me an email. I will send you an improved copy of some
code I posted a week or so back. It's not for your chip but it may
give you some ideas. As always, feel free to keep what is useful and
trash the remainder.

I read a quote somewhere the other day about writing code: "Write
your code as though the person doing the maintenance is a psychopath
that has your home address!" Make it clear and keep it simple!
--- In , "Chas Douvier" <charles@k...> wrote:
> Thank you all for the recent help with MPLAB IDE. I read the Quick
> Start Guide and I started writing my first program for the 18F452.
> All went well, programmed it with my ICD2 on my PICDEM 2 Plus and
my
> test program to light up some led's and turn them off worked. I am
> glad i bought the setup I have very handy for a begineer..
>
> Now I want to do more, except there are things in IDE like "org
> 0x000" for starting at the reset vector and #define .. etc.. none
of
> these are in the quick start guide or my 18F452 instruction set..
To
> be honest last time I did any assembly or machine language was when
> I was working with my CDP1802 by HEX keypad byte by byte.. its been
> a while so I am not sure if its suppose to be common knowledge
stuff
> or not.
>
> Is there a PDF somewhere or something that I can find out exactly
> how to use all of the extended functions for IDE? I have been
> getting pretty lucky at just using well documented source code to
do
> modifications, but I want to know for sure what I am doing.
>
> Thank you,
> Charles






See fix in fourth paragraph - OOPS!

--- In , "rtstofer" <rstofer@p...> wrote:
>
> Well, the first place you can look is under Help->Microchip
Language
> Tools Help->MPASM Assembler Help. There are, apparently, two
> documents of some use at www.microchip.com DS33014 and DS30400.
>
> The other thing that is useful is to read code - a lot of code.
> There are many great examples of code on the Microchip site. Maybe
> not so much for the 18F452 but many of the examples for the 16F6xx
> and 16F87x could be useful.
>
> I was just looking at the datasheet and it has many code snippets.
> Generally these are of a "do it this way or it won't work" type.
>
> If you have followed along here the last couple of weeks you will
> have seen quite a discussion on ORG, EQU, #DEFINE, CBLOCK, labels,
> memory allocation, etc. These are **NOT** specific to the chip or
the IDE.
> They are pseudo instructions and supported by many assemblers.
>
> In general (and before anyone flames me, in my opinion only), use
EQU
> to assign a synonym (label) to a numeric value (including the
result
> of an arithmetic expression). An example:
>
> NumberOfTasks...EQU...8
>
> Do not use EQU to assign memory addresses unless they are fixed in
> hardware. For example PORTB is EQUated to a fixed numeric value in
> the include file because it is indeed fixed!
>
> Use CBLOCK to allocate memory (yes I know the programmer is doing
the
> allocation but read on!):
>
> BYTE...EQU...1...; one byte allocation unit
> WORE...EQU...2...; two byte allocation unit
>
> ..CBLOCK..0x20...; allocate RAM starting at 0x20
> ..
> ..Period:..NumberOfTasks * WORD...; array of Period values for Tasks
> ..Delay:...NumberOfTasks * WORD...; array of Delay values for Tasks
> ..RunMe:...NumberOfTasks * BYTE...; array of RunMe flags for Tasks
> ..TaskIndex:...BYTE...............; index into arrays
> ..
> ..ENDC
>
> With this formulation it is apparent that Period, Delay and RunMe
are
> arrays of WORD, WORD and BYTE respectively. It is also apparent
that
> TaskIndex is a BYTE. I could also do CHAR EQU 1 and use CHAR to
> further clarify the type of allocation. Heck, you could even use
> SIGNED8 EQU 1 and SIGNED16 EQU 2 to remind yourself that you plan
to
> use these variables in signed arithmetic. Now, the assembler is
not
> going to enforce any rules about variable type but it's a start.
>
> If I change the number of tasks the assembler deals with the
> reallocation. I don't know the RAM address of TaskIndex and I
don't
> need to know. The assembler knows and that is all that is
important.
>
> Now try this with EQU:
>
> Period.....EQU..0x20
> Delay......EQU..Period + (NumberOfTasks * WORD)
> RunMe......EQU..Delay + (NumberOfTasks * WORD)
> TaskIndex..EQU..RunMe + (NumberOfTasks * BYTE)
>
> It could be worse:
>
> Period.....EQU..0x20
> Delay......EQU..0x30
> RunMe......EQU..0x40
> TaskIndex..EQU..0x48
>
> Here you can't tell what is happening - did the programmer like a
> fancy pattern in memory? Are these arrays or were certain
temporary
> variables removed? Really ugly!
>
> Use #DEFINE to do two things: first you can just define the label
to
> exist without a value:
>
> #DEFINE Debug
>
> #IFDEF DEBUG
> ..include some debugging code
> #ENDIF
>
> You can also #UNDEFINE a label to remove it from the defined
symbols
> table. Then you can use:
>
> #IFNDEF PRODUCTION
> ..well, we're not in production, add debugging code here
> #ENDIF
>
> Second you can use #DEFINE to create a text substitution. That is,
> every occurance of the label is replaced by the entire string. So:
>
> #DEFINE Motor CCPR2L......; PWM to motor
> #DEFINE Actuator CCPR1L...; PWM to steering actuator
>
> This keeps it clear in my mind and in the code: to which device am
I
> sending the PWM value?
>
> Of course the obvious #DEFINEs substitute a name for a Port and Bit
> combination:
>
> #DEFINE LED PORTB,0....; define the flashing LED
>
> Again, in my opinion only, I like to follow labels that represent
> program memory addresses with a colon. It is still required in
some
> assemblers.
>
> MySubroutine:...............; always on a separate line
> ....MOVWF TaskIndex.........; save the TaskIndex that is in W
> ....RETURN
>
> Well, that leaves ORG. Use ORG to cause the assembler to use the
> value as the starting address of the code that follows. This is
used
> at the Reset Vector , the Interrupt Vector and perhaps the address
> for EEPROM data tables. There could be a few other cases on the
> 18F452 but I have never used the chip.
>
> Hope this helps! If you want to see 16F876A code that uses these
> ideas, send me an email. I will send you an improved copy of some
> code I posted a week or so back. It's not for your chip but it may
> give you some ideas. As always, feel free to keep what is useful
and
> trash the remainder.
>
> I read a quote somewhere the other day about writing code: "Write
> your code as though the person doing the maintenance is a
psychopath
> that has your home address!" Make it clear and keep it simple! >
> --- In , "Chas Douvier" <charles@k...> wrote:
> > Thank you all for the recent help with MPLAB IDE. I read the
Quick
> > Start Guide and I started writing my first program for the
18F452.
> > All went well, programmed it with my ICD2 on my PICDEM 2 Plus and
> my
> > test program to light up some led's and turn them off worked. I
am
> > glad i bought the setup I have very handy for a begineer..
> >
> > Now I want to do more, except there are things in IDE like "org
> > 0x000" for starting at the reset vector and #define .. etc.. none
> of
> > these are in the quick start guide or my 18F452 instruction set..
> To
> > be honest last time I did any assembly or machine language was
when
> > I was working with my CDP1802 by HEX keypad byte by byte.. its
been
> > a while so I am not sure if its suppose to be common knowledge
> stuff
> > or not.
> >
> > Is there a PDF somewhere or something that I can find out exactly
> > how to use all of the extended functions for IDE? I have been
> > getting pretty lucky at just using well documented source code to
> do
> > modifications, but I want to know for sure what I am doing.
> >
> > Thank you,
> > Charles




Thanks or the help, that was very helpful .. those DS numbers didn't really come easy to find on the website but through some looking the real document to have is
 
http://www.microchip.com/download/tools/picmicro/code/mpasm/30400f.pdf
 
the MPASM quick reference guide.
 
Thanks again,
Charles
-----Original Message-----
From: rtstofer [mailto:r...@pacbell.net]
Sent: Tuesday, April 29, 2003 10:01 AM
To: p...@yahoogroups.com
Subject: [piclist] Re: MPLAB IDE


Well, the first place you can look is under Help->Microchip Language
Tools Help->MPASM Assembler Help.  There are, apparently, two
documents of some use at www.microchip.com DS33014 and DS30400.

The other thing that is useful is to read code - a lot of code. 
There are many great examples of code on the Microchip site.  Maybe
not so much for the 18F452 but many of the examples for the 16F6xx
and 16F87x could be useful.

I was just looking at the datasheet and it has many code snippets. 
Generally these are of a "do it this way or it won't work" type.

If you have followed along here the last couple of weeks you will
have seen quite a discussion on ORG, EQU, #DEFINE, CBLOCK, labels,
memory allocation, etc. These are specific to the chip or the IDE. 
They are pseudo instructions and supported by many assemblers.

In general (and before anyone flames me, in my opinion only), use EQU
to assign a synonym (label) to a numeric value (including the result
of an arithmetic expression).  An example:

NumberOfTasks...EQU...8

Do not use EQU to assign memory addresses unless they are fixed in
hardware.  For example PORTB is EQUated to a fixed numeric value in
the include file because it is indeed fixed!

Use CBLOCK to allocate memory (yes I know the programmer is doing the
allocation but read on!):

BYTE...EQU...1...; one byte allocation unit
WORE...EQU...2...; two byte allocation unit

..CBLOCK..0x20...; allocate RAM starting at 0x20
..
..Period:..NumberOfTasks * WORD...; array of Period values for Tasks
..Delay:...NumberOfTasks * WORD...; array of Delay values for Tasks
..RunMe:...NumberOfTasks * BYTE...; array of RunMe flags for Tasks
..TaskIndex:...BYTE...............; index into arrays
..
..ENDC

With this formulation it is apparent that Period, Delay and RunMe are
arrays of WORD, WORD and BYTE respectively.  It is also apparent that
TaskIndex is a BYTE.  I could also do CHAR EQU 1 and use CHAR to
further clarify the type of allocation.  Heck, you could even use
SIGNED8 EQU 1 and SIGNED16 EQU 2 to remind yourself that you plan to
use these variables in signed arithmetic.  Now, the assembler is not
going to enforce any rules about variable type but it's a start.

If I change the number of tasks the assembler deals with the
reallocation.  I don't know the RAM address of TaskIndex and I don't
need to know.  The assembler knows and that is all that is important.

Now try this with EQU:

Period.....EQU..0x20
Delay......EQU..Period + (NumberOfTasks * WORD)
RunMe......EQU..Delay + (NumberOfTasks * WORD)
TaskIndex..EQU..RunMe + (NumberOfTasks * BYTE)

It could be worse:

Period.....EQU..0x20
Delay......EQU..0x30
RunMe......EQU..0x40
TaskIndex..EQU..0x48

Here you can't tell what is happening - did the programmer like a
fancy pattern in memory?  Are these arrays or were certain temporary
variables removed?  Really ugly!

Use #DEFINE to do two things:  first you can just define the label to
exist without a value:

#DEFINE Debug

#IFDEF DEBUG
..include some debugging code
#ENDIF

You can also #UNDEFINE a label to remove it from the defined symbols
table.  Then you can use:

#IFNDEF PRODUCTION
..well, we're not in production, add debugging code here
#ENDIF

Second you can use #DEFINE to create a text substitution.  That is,
every occurance of the label is replaced by the entire string.  So:

#DEFINE Motor CCPR2L......; PWM to motor
#DEFINE Actuator CCPR1L...; PWM to steering actuator

This keeps it clear in my mind and in the code:  to which device am I
sending the PWM value?

Of course the obvious #DEFINEs substitute a name for a Port and Bit
combination:

#DEFINE LED PORTB,0....; define the flashing LED

Again, in my opinion only, I like to follow labels that represent
program memory addresses with a colon.  It is still required in some
assemblers.

MySubroutine:...............; always on a separate line
....MOVWF TaskIndex.........; save the TaskIndex that is in W
....RETURN

Well, that leaves ORG.  Use ORG to cause the assembler to use the
value as the starting address of the code that follows.  This is used
at the Reset Vector , the Interrupt Vector and perhaps the address
for EEPROM data tables.  There could be a few other cases on the
18F452 but I have never used the chip.

Hope this helps!  If you want to see 16F876A code that uses these
ideas, send me an email.  I will send you an improved copy of some
code I posted a week or so back.  It's not for your chip but it may
give you some ideas.  As always, feel free to keep what is useful and
trash the remainder.

I read a quote somewhere the other day about writing code: "Write
your code as though the person doing the maintenance is a psychopath
that has your home address!"  Make it clear and keep it simple!
--- In p...@yahoogroups.com, "Chas Douvier" <charles@k...> wrote:
> Thank you all for the recent help with MPLAB IDE. I read the Quick
> Start Guide and I started writing my first program for the 18F452.
> All went well, programmed it with my ICD2 on my PICDEM 2 Plus and
my
> test program to light up some led's and turn them off worked. I am
> glad i bought the setup I have very handy for a begineer..
>
> Now I want to do more, except there are things in IDE like "org
> 0x000" for starting at the reset vector and #define .. etc.. none
of
> these are in the quick start guide or my 18F452 instruction set..
To
> be honest last time I did any assembly or machine language was when
> I was working with my CDP1802 by HEX keypad byte by byte.. its been
> a while so I am not sure if its suppose to be common knowledge
stuff
> or not.
>
> Is there a PDF somewhere or something that I can find out exactly
> how to use all of the extended functions for IDE? I have been
> getting pretty lucky at just using well documented source code to
do
> modifications, but I want to know for sure what I am doing.
>
> Thank you,
> Charles



to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

">Yahoo! Terms of Service.




Thanks for doing the work - the Quick Reference Guide is quite
handy. I'm going to have to take another look at the 16 bit
devices. It would have simplified by most recent project. --- In , "Charles Douvier" <charles@k...>
wrote:
> Thanks or the help, that was very helpful .. those DS numbers
didn't really
> come easy to find on the website but through some looking the real
document
> to have is http://www.microchip.com/download/tools/picmicro/code/mpasm/30400f.pdf
>
> the MPASM quick reference guide.
>
> Thanks again,
> Charles
> -----Original Message-----
> From: rtstofer [mailto:rstofer@p...]
> Sent: Tuesday, April 29, 2003 10:01 AM
> To:
> Subject: [piclist] Re: MPLAB IDE >
> Well, the first place you can look is under Help->Microchip
Language
> Tools Help->MPASM Assembler Help. There are, apparently, two
> documents of some use at www.microchip.com DS33014 and DS30400.
>
> The other thing that is useful is to read code - a lot of code.
> There are many great examples of code on the Microchip site.
Maybe
> not so much for the 18F452 but many of the examples for the 16F6xx
> and 16F87x could be useful.
>
> I was just looking at the datasheet and it has many code snippets.
> Generally these are of a "do it this way or it won't work" type.
>
> If you have followed along here the last couple of weeks you will
> have seen quite a discussion on ORG, EQU, #DEFINE, CBLOCK, labels,
> memory allocation, etc. These are specific to the chip or the IDE.
> They are pseudo instructions and supported by many assemblers.
>
> In general (and before anyone flames me, in my opinion only), use
EQU
> to assign a synonym (label) to a numeric value (including the
result
> of an arithmetic expression). An example:
>
> NumberOfTasks...EQU...8
>
> Do not use EQU to assign memory addresses unless they are fixed in
> hardware. For example PORTB is EQUated to a fixed numeric value
in
> the include file because it is indeed fixed!
>
> Use CBLOCK to allocate memory (yes I know the programmer is doing
the
> allocation but read on!):
>
> BYTE...EQU...1...; one byte allocation unit
> WORE...EQU...2...; two byte allocation unit
>
> ..CBLOCK..0x20...; allocate RAM starting at 0x20
> ..
> ..Period:..NumberOfTasks * WORD...; array of Period values for
Tasks
> ..Delay:...NumberOfTasks * WORD...; array of Delay values for
Tasks
> ..RunMe:...NumberOfTasks * BYTE...; array of RunMe flags for Tasks
> ..TaskIndex:...BYTE...............; index into arrays
> ..
> ..ENDC
>
> With this formulation it is apparent that Period, Delay and RunMe
are
> arrays of WORD, WORD and BYTE respectively. It is also apparent
that
> TaskIndex is a BYTE. I could also do CHAR EQU 1 and use CHAR to
> further clarify the type of allocation. Heck, you could even use
> SIGNED8 EQU 1 and SIGNED16 EQU 2 to remind yourself that you plan
to
> use these variables in signed arithmetic. Now, the assembler is
not
> going to enforce any rules about variable type but it's a start.
>
> If I change the number of tasks the assembler deals with the
> reallocation. I don't know the RAM address of TaskIndex and I
don't
> need to know. The assembler knows and that is all that is
important.
>
> Now try this with EQU:
>
> Period.....EQU..0x20
> Delay......EQU..Period + (NumberOfTasks * WORD)
> RunMe......EQU..Delay + (NumberOfTasks * WORD)
> TaskIndex..EQU..RunMe + (NumberOfTasks * BYTE)
>
> It could be worse:
>
> Period.....EQU..0x20
> Delay......EQU..0x30
> RunMe......EQU..0x40
> TaskIndex..EQU..0x48
>
> Here you can't tell what is happening - did the programmer like a
> fancy pattern in memory? Are these arrays or were certain
temporary
> variables removed? Really ugly!
>
> Use #DEFINE to do two things: first you can just define the
label to
> exist without a value:
>
> #DEFINE Debug
>
> #IFDEF DEBUG
> ..include some debugging code
> #ENDIF
>
> You can also #UNDEFINE a label to remove it from the defined
symbols
> table. Then you can use:
>
> #IFNDEF PRODUCTION
> ..well, we're not in production, add debugging code here
> #ENDIF
>
> Second you can use #DEFINE to create a text substitution. That
is,
> every occurance of the label is replaced by the entire string.
So:
>
> #DEFINE Motor CCPR2L......; PWM to motor
> #DEFINE Actuator CCPR1L...; PWM to steering actuator
>
> This keeps it clear in my mind and in the code: to which device
am I
> sending the PWM value?
>
> Of course the obvious #DEFINEs substitute a name for a Port and
Bit
> combination:
>
> #DEFINE LED PORTB,0....; define the flashing LED
>
> Again, in my opinion only, I like to follow labels that represent
> program memory addresses with a colon. It is still required in
some
> assemblers.
>
> MySubroutine:...............; always on a separate line
> ....MOVWF TaskIndex.........; save the TaskIndex that is in W
> ....RETURN
>
> Well, that leaves ORG. Use ORG to cause the assembler to use the
> value as the starting address of the code that follows. This is
used
> at the Reset Vector , the Interrupt Vector and perhaps the address
> for EEPROM data tables. There could be a few other cases on the
> 18F452 but I have never used the chip.
>
> Hope this helps! If you want to see 16F876A code that uses these
> ideas, send me an email. I will send you an improved copy of some
> code I posted a week or so back. It's not for your chip but it
may
> give you some ideas. As always, feel free to keep what is useful
and
> trash the remainder.
>
> I read a quote somewhere the other day about writing code: "Write
> your code as though the person doing the maintenance is a
psychopath
> that has your home address!" Make it clear and keep it simple! >
> --- In , "Chas Douvier" <charles@k...>
wrote:
> > Thank you all for the recent help with MPLAB IDE. I read the
Quick
> > Start Guide and I started writing my first program for the
18F452.
> > All went well, programmed it with my ICD2 on my PICDEM 2 Plus
and
> my
> > test program to light up some led's and turn them off worked. I
am
> > glad i bought the setup I have very handy for a begineer..
> >
> > Now I want to do more, except there are things in IDE like "org
> > 0x000" for starting at the reset vector and #define .. etc..
none
> of
> > these are in the quick start guide or my 18F452 instruction
set..
> To
> > be honest last time I did any assembly or machine language was
when
> > I was working with my CDP1802 by HEX keypad byte by byte.. its
been
> > a while so I am not sure if its suppose to be common knowledge
> stuff
> > or not.
> >
> > Is there a PDF somewhere or something that I can find out
exactly
> > how to use all of the extended functions for IDE? I have been
> > getting pretty lucky at just using well documented source code
to
> do
> > modifications, but I want to know for sure what I am doing.
> >
> > Thank you,
> > Charles > Yahoo! Groups Sponsor >
> to unsubscribe, go to http://www.yahoogroups.com and follow the
> instructions
>
> Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.


Go to www.microchip.com. They have pdf's for every PIC they made.

One more thing:
Where you stick ORG 0x000 is where your code will start when your PIC boots up. 4 assembler instructions later is ORG 0x004, where your code will go if an interrupt occurs. Read to learn more about interrupts. Eugene So



Try the HELP button in MPLAB....
 

Chas Douvier wrote:

 Thank you all for the recent help with MPLAB IDE. I read the Quick
Start Guide and I started writing my first program for the 18F452.
All went well, programmed it with my ICD2 on my PICDEM 2 Plus and my
test program to light up some led's and turn them off worked. I am
glad i bought the setup I have very handy for a begineer..

Now I want to do more, except there are things in IDE like "org
0x000" for starting at the reset vector and #define .. etc.. none of
these are in the quick start guide or my 18F452 instruction set.. To
be honest last time I did any assembly or machine language was when
I was working with my CDP1802 by HEX keypad byte by byte.. its been
a while so I am not sure if its suppose to be common knowledge stuff
or not.

Is there a PDF somewhere or something that I can find out exactly
how to use all of the extended functions for IDE? I have been
getting pretty lucky at just using well documented source code to do
modifications, but I want to know for sure what I am doing.

Thank you,
Charles
 


to unsubscribe, go to http://www.yahoogroups.com and follow the instructions

">Yahoo! Terms of Service.

--
*******************************************
VISIT MY HOME PAGE:
<http://home.online.no/~eikarlse/index.htm>
LAST UPDATED: 05/01/2002
*******************************************
Best Regards
Eirik Karlsen
 

Attachment (not stored)
C:\WINDOWS\TEMP\nsmailT8.gif
Type: image/gif

Attachment (not stored)
C:\WINDOWS\TEMP\nsmail5S.gif
Type: image/gif