Go to Post FIRST is good for us. It is good for our own Children. Don't give up, even if you are as tired as I am! - Kyle Hughes [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-02-2004, 21:21
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 746
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
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:
/*******************************************************************************
* FILE NAME: ifi_utilities.c
*
* DESCRIPTION:

snippppeddd a few lines of code…..........................................


/* Used when transmitting data serially.  It waits for each byte to finish.   */
void Wait4TXEmpty(void)
{
#ifndef _SIMULATOR
  
while (!TXINTF)
  {
    continue;
  }
#endif

I need to be able to SIMULATE the variable !TXINTF so that I can get past this part of the code while performing a STEP function in the debugger. I am sure may other spots will be required to be simulated imputs also to get the loop area where the user code is executing. Is there anyway in MPLAB to setup this variables and many more to toggle or force values?
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #2   Spotlight this post!  
Unread 17-02-2004, 21:27
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
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.
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #3   Spotlight this post!  
Unread 17-02-2004, 21:37
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 746
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: MPLAB Variable Simulator?

I eye! Captain. Found it under Build Options. Well give that a whirrlly gig..
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #4   Spotlight this post!  
Unread 18-02-2004, 12:08
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,756
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 20:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi