Page 1 of 1

SKFYP-01 UIC00B debug mode

PostPosted: Fri Mar 08, 2013 6:31 pm
by khmok
Hi, SKFYP is my first project of using PIC and I am using "SK40C 16F877A Sample Program - led blinking" to blink the two LEDs on SK40C. I would like to try the feature of single stepping the program and found out that:

Problem: In debug mode, LED is always light up regardless of whether step over "off LED" or "toggle LED"
Description: As you can see that, LED1 and LED2 are connected to RB6 and RB7 respectively. When stepping over below code, LEDs do not turn off.

LED1=0; //OFF LED1
LED2=0; //OFF LED2

LEDs do not toggle when stepping over below code:

LED1^ = 1; //toggle LED1
delay(delay_time);
LED2^ = 1; //toggle LED2
delay(delay_time);

When I WATCH RB6 and RB7, it is always 0x00 (as you can see from the attachment) but the LEDs are light up.

Can anyone please tell me what is the problem or if the debug mode is working?

Debug_5.PNG

Re: SKFYP-01 UIC00B debug mode

PostPosted: Fri Mar 08, 2013 6:37 pm
by robosang
in debug mode, RB7 and RB6 is being used for communication, so basically you cannot use it for code.

Use other pin for LEDs.

Re: SKFYP-01 UIC00B debug mode

PostPosted: Fri Mar 08, 2013 6:46 pm
by khmok
Is this because of RB6 and RB7 also use as function PGC and PGD when connecting UIC00B and stepping over?
the clashing of toggling LED with the function of PGC and PGD?

Regards,
KH

Re: SKFYP-01 UIC00B debug mode

PostPosted: Fri Mar 08, 2013 11:04 pm
by ABSF
Yes, that's exactly what Robosang meant. :mrgreen:

Allen