View previous topic :: View next topic |
Author |
Message |
Guest
|
MPSIM F8 and printf instruction |
Posted: Sat Jul 26, 2008 8:16 am |
|
|
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
|
|
Posted: Sat Jul 26, 2008 11:53 pm |
|
|
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
|
|
Posted: Mon Jul 28, 2008 1:48 am |
|
|
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
|
|
Posted: Mon Jul 28, 2008 2:21 am |
|
|
You should ask Microchip about it, on their forum. MPSIM is their product.
They should support it. I am done with this thread. |
|
|
|