i am working  on pic16f877a. i wrote a simple program to drive the LED to
blink.
the simulation using gpsim say it work fine. Few LED should be blinking.
But, if i burn the
program to the PIC. nothing happen.

The circuit working ok. i did burn one hex files from another project
written in assembly and
program under MPLAB IDE (using M$ windows) - the LED blinking. But i want to
work in
Linux. Anyone come across the same problem. Anyone know the solutions?


#define __16f877a
#include "pic/pic16f877a.h"

/* Setup chip configuration */
typedef unsigned int config;
config at 0x2007 __CONFIG = _CP_OFF &
                          _WDT_OFF &
                          _BODEN_OFF &
                          _PWRTE_OFF &
                          _LVP_OFF &
              _XT_OSC;

//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++);
}

//main
void main(void) {

    while(1) {          /* Loop forever */
        //LED1-LED7
        TRISD = 0x00;
    PORTD = 0x3F; delay(1000);
    PORTD = 0x00; delay(1000);
    PORTD = 0x3F;

    }
}
-------------------------------------------------------------------------
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

Reply via email to