CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

MPSIM F8 and printf instruction

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest








MPSIM F8 and printf instruction
PostPosted: Sat Jul 26, 2008 8:16 am     Reply with quote

Hi

I use mpsim 8.14 together with ccs *.cof file.

One problem is on all printf statement i must have a breakpoint at the following line and select F9="run".
If I use F8="step over" the simulator hang up, only way to get out of this is selection "Debugger" -> "Reset" -> "MCLR Reset" and start all over.

Any hints.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Jul 26, 2008 11:53 pm     Reply with quote

You have a previous thread here on a similar topic:
http://www.ccsinfo.com/forum/viewtopic.php?t=35365

If you make a test program with a printf() statement in it,
and look at the "Disassembly Listing" window in MPLAB, and
press the F8 key, you will see that it gets stuck at the two lines
indicated below. It is polling the TXIF bit and waiting for
it to go high. When TXIF = 1, the transmit buffer is empty.
This means the character has been transmitted.
Code:
                 printf("Hello ");
  002C    01A1     CLRF 0x21
  002D    0821     MOVF 0x21, W
  002E    2004     CALL 0x4
  002F    0AA1     INCF 0x21, F
  0030    00F7     MOVWF 0x77
  0031    0877     MOVF 0x77, W

// It gets stuck in the following two lines of code:
  0032    1E0C     BTFSS 0xc, 0x4  // Skip if TXIF = 1
  0033    2832     GOTO 0x32

  0034    0099     MOVWF 0x19
  0035    3006     MOVLW 0x6
  0036    0221     SUBWF 0x21, W
  0037    1D03     BTFSS 0x3, 0x2
  0038    282D     GOTO 0x2d


You should ask your question on the on the Microchip MPSIM forum:
http://forum.microchip.com/tt.aspx?forumid=18
Ask them what the simulator is doing.
Guest








PostPosted: Mon Jul 28, 2008 1:48 am     Reply with quote

Hi

Thanks for informing. There are no report or entry at Microchip's forum. Maybe there are small bug in the "cof" file?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 28, 2008 2:21 am     Reply with quote

You should ask Microchip about it, on their forum. MPSIM is their product.
They should support it. I am done with this thread.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group