Hi, This "Define RESET_ORG 800h" line is used for Microchip USB bootloader.
Regards,
Hi, This "Define RESET_ORG 800h" line is used for Microchip USB bootloader.
Regards,
Well, I've pointed this out before but the Define must be caps. If it's part of the bootloader that may be why it isn't loading. Which may be the issue.
I honestly think you need to take a step back and go for blinking a LED. A quick review of your posts only indicate nothing is working. If you're communicating properly with the PIC the LED will indicate that.
AvionicMaster1,
Can you give us some reference supporting your statement regarding the case sensitivity? I ask because I think you've got it wrong and I'll support that by quoting Darrel from another thread:
So in this case the line Define RESET_ORG 800h is perfectly valid since RESET_ORG is all upper case.The word "define" is a PBP statement, and PBP is not case sensitive. So it doesn't matter what case DeFiNe is.
What follows "define" is passed on to the assembler, and MPASM IS case sensitive.
Again, it's NOT the word define that must be upper case, it is what follows the word define that must match the case of however it's being used elsewhere.
In PBP's case (no pun intended) all defines are upper case but if you use or write an assembly routine which has some constants you can set it may, or may not, be all upper case. It might be myParticularSetting. If you then would try to set that to 123 by doing DEFINE MYPARTICULARSETTING 123 it wouldn't work since the assembly code is looking for myParticularSetting.
Apart from that I'm afraid I don't have much to contribute to this thread....
/Henrik.
Hi HenrikOlsson,
Thank you by your contribution.
Regards,
Well, from the PBP3 manual shows this for asm interrups which although doesn't specify DEFINE needs to be in caps they are all written that way.
6.2.2 DEFINEs
PBP offers a DEFINE to specify the name of the interrupt service routine label. The
label refers to the Assembly Language label that marks the beginning of your
service routine.
DEFINE INTHAND Label
For devices with multiple priority interrupts, PBP offers a single additional DEFINE
that allows you to specify a second label for a second service routine. This routine
will be used for low-priority interrupts.
DEFINE INTLHAND Label
And here it says they need to be in caps even a line that has the DEFINE RESET_ORG uses caps so I assume it needs caps.
2.3.2 Global DEFINEs
Other DEFINEs that are important, though less frequently used, are:
DEFINE NO_CLRWDT 1 'Dont insert CLRWDTs
DEFINE LOADER_USED 1 'Bootloader is being used
DEFINE OSCCAL_1K 1 'Set OSCCAL for 1K PIC12
DEFINE OSCCAL_2K 1 'Set OSCCAL for 2K PIC12
DEFINE RESET_ORG 0h 'Change reset address for PIC18
DEFINE INTHAND Label 'Assign assembler interrupt
handler label
DEFINE INTLHAND Label 'Assign assembler low priority
interrupt handler label for
PIC18
See section 8.6 for a condensed list of DEFINEs with brief explanations.
2.3.3 DEFINEs defined
For the user familiar with Assembly Language, the major clue to understanding is
that DEFINEs in PBP are converted literally to Assembly Language #DEFINE
directives.
For the practical PBP user, there are a couple of fundamental points to consider:
1) DEFINEs are CASE SENSITIVE!
2) Specific DEFINEs are generally associated with PBP commands. The
command pages will describe how the relevant DEFINEs affect the
operation of each command.
DEFINEs are used by PBP to change the generated Assembly Language that
makes up the compiled program. A DEFINE might simply change an internal
register setting, or it might result in the use of an alternative Assembly Language
routine to accomplish a task.
For what it's worth I'm not an experienced programmer but If I'm wrong I'd like to know for future use. In the few prorams I've written I've always had to use caps for the defines to work but I haven't been calling asm routines. So I'd at least try it to see if it matters.
It appears this isn't the problem anyway. If I am wrong I apologize for any waste of time my conributions to this thread has accumulated.
Hi,
But you have been calling ASM routines since that is exactly what PBP does, it "builds" your code into an ASM program by "stitching together" different library routines which are all in ASM. Some of these routines have "settings" which can be "configured" and this is done with the DEFINE directive. The DEFINE directive is a PBP "command" and PBP is not case sensitive so the DeFiNe can be any case but the name of the "setting" you want to configure must match the case of how it is written in the ASM routine it "configures" - and all the PBP library routies use all upper case.For what it's worth I'm not an experienced programmer but If I'm wrong I'd like to know for future use. In the few prorams I've written I've always had to use caps for the defines to work but I haven't been calling asm routines. So I'd at least try it to see if it matters.
Let's take the simple example of DEFINE OSC 20, in the library file you'll find something like (and this is ASM):See, here OSC is all upper case and since this is code that is directly used by the assembler IS case sensitive so if you, in your program, would do define osc 20 it wouldn't work. Not because define is lower case but because osc is. What happens is that the assembler creates a constant named osc (which is different from OSC that the library routines is looking for) and assignes the value 20 to it. The library routines checks if OSC has been defined but doesn't see it so it sets its value to 4 - when you intended for it to be 20.Code:ifndef OSC OSC = 4 endif
If you write a ASM routine where the assembler is looking for aBc then you'd need to use DEFINE aBc for it to work, define ABC wouldn't, neither would DEFINE ABC.
Man, I really hope I got that right but if I didn't I hope someone will jump in and correct me.
/Henrik.
Last edited by HenrikOlsson; - 13th August 2013 at 16:13.
Hi, my project has a LED. I use TOGGLE command in MAIN route and not has problem, the LED blink normally. In other words, the communication PIC is worked.
Regards,
Bookmarks