|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
MPLAB Variable Simulator?
This is really the first time I've used this MPLAB software and the first time I've coded in C language. Normally I code in Ladder Logic, (Programming Logic Controllers), Visual Basic, or what ever proprietary language or mnemonic language of the week that might be in whatever servo controller I get my hands on. However I’ve notice a nice tool in MPLAB I'd like to know a bit more about.
When I program my C program offline, I see that I can use the MPLAB simulator much like a Visual Basic debugger. The problem is I can't see or figure out how to simulate variables to keep executing in my code. Example: My offline debugging gets STUCK in a loop here: PHP Code:
|
|
#2
|
||||
|
||||
|
Re: MPLAB Variable Simulator?
what you actually need to do is define the macro "_SIMULATOR" - hence the #ifndef lines around that particular loop. there are certain parts of the code that will get stuck without that macro defined. just go into the mplab project settings window and look for where you can define preprocessor macros, and add _SIMULATOR to the list.
|
|
#3
|
||||
|
||||
|
Re: MPLAB Variable Simulator?
I eye! Captain. Found it under Build Options. Well give that a whirrlly gig..
|
|
#4
|
|||||
|
|||||
|
Re: MPLAB Variable Simulator?
You'll also find yourself running into problems if you are using the internal timer interrupts. The easiest way around that is to add your own #ifdef _SIMULATOR around the timer initializations to turn the interrupts off for debugging.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Interrupt Handlers and Variable Scope | kaszeta | Programming | 2 | 14-02-2004 18:30 |
| If you're having MPLAB problems, LOOK HERE. | Jeremy_Mc | Programming | 0 | 20-01-2004 18:06 |
| Im am having trouble with the MPLAB | hedgehogger | Programming | 7 | 19-01-2004 17:37 |
| using the MPLAB IDE MPLAB SIM simulator | WizardOfAz | Programming | 1 | 03-11-2003 01:24 |
| what teams have a variable transmissions? | Greg Perkins | Technical Discussion | 4 | 06-03-2002 06:10 |