#include<pic.h>
__CONFIG(0x3B31);
void delay_ms(unsigned int x)
{
unsigned int a,b;
for(a=x;a>0;a--)
for(b=110;b>0;b--);
}
void main()
{
unsigned char i;
TRISD = 0x00;
while(1)
{
PORTD = 0x01;
for(i=0;i<7;i++)
{
delay_ms(50);
PORTD = PORTD*2;
}
for(i=0;i<7;i--)
{
delay_ms(50);
PORTD = PORTD*2;
}
}
}
Oh I see... but when you change the configuration bits on MPLAB, does the compiler pick that configuration? or the one on the code like __CONFIG(0x3B31)?
I'm using PICkit 2.
PORTD=0x03; // Port pin 0 and 1 are high
dealy_ms(1000)
PORTD= 0x00;// Port pin 0 and 1 are Low
Have you tried simply erasing the device, not programming it? And then performing a blank check on the device.
You may have inadvertently enabled Code Protection.
BigDog
The code protection is turned off in MPLAB.
__CONFIG( );
The schematic diagram of my circuit is on top, my first post.
Pull the RB3/PGM pin low, this disables LVP and is sometimes an issue.
Do you have anything other than the PICkit attached to RB6/PGC or RB7/PGD?
Is the MCLR/Vpp connection from the PICkit to the device direct?
Is your clock properly defined?
an external voltage of 6V and regulated as 5V (using 7805)
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?