> But, if i burn the program to the PIC. nothing happen.
>
> //delay
> void delay(unsigned char a)
> {
> unsigned char i, j, k;
> for(i = 0; i<a; i++)
> for(j = 0; j < 10; j++)
> for(k = 0; k < 255; k++);
> }
Your delay loop might be optimized away, causing your output ports to be
high most of the time. Try making i, j, and k volatile (maybe a volatile
k suffices) or insert an _asm nop _endasm; (or even an empty _asm
_endasm;) into the inner loop body.
> //main
> void main(void) {
>
> while(1) { /* Loop forever */
> //LED1-LED7
> TRISD = 0x00;
> PORTD = 0x3F; delay(1000);
> PORTD = 0x00; delay(1000);
> PORTD = 0x3F;
> }
> }
You might want to move the line "TRISD = 0x00;" out of the loop (should
not solve the problem, though ;-) ).
HTH,
Raphael
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user