hkei
Newbie level 6
Please help me with my PIC16F877A. It works well on Proteus simulation but it doesn't work with actual hardware as it should be.
All of the voltage terminals are correctly connected to the source including MCLR
The PIC can burn successfully without any problem. So I think there's no problem with the PIC itself. Although,when I write the program on an empty PIC, it only writes 6bytes on the memory (XXXX XXXX XXXX 3FFF 3FFF 3FFF ...).
I don't know what is the problem. I even increase the VDD to 6V from 5V.
The LEDs doesn't output anything
Here are the programs I'm using:
Here is the code I found somewhere just to test the LEDs:
Here is the configuration bits on MPLAB:
Here is the circuit diagram:
**broken link removed**
Thanks in advance!
All of the voltage terminals are correctly connected to the source including MCLR
The PIC can burn successfully without any problem. So I think there's no problem with the PIC itself. Although,when I write the program on an empty PIC, it only writes 6bytes on the memory (XXXX XXXX XXXX 3FFF 3FFF 3FFF ...).
I don't know what is the problem. I even increase the VDD to 6V from 5V.
The LEDs doesn't output anything
Here are the programs I'm using:
MPLAB IDE v8.50
HI-TECH ANSI C Compiler
PICkit 2 v2.61
Here is the code I found somewhere just to test the LEDs:
Code:
#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;
}
}
}
Here is the configuration bits on MPLAB:
OSC - XT
WDT - OFF
PUT - ON
BODEN - OFF
LVP - DISABLED
CPD - OFF
WRT_ENABLE - 0H TO 7FFH WRITE PROTECTED
CP - OFF
WDT - OFF
PUT - ON
BODEN - OFF
LVP - DISABLED
CPD - OFF
WRT_ENABLE - 0H TO 7FFH WRITE PROTECTED
CP - OFF
Here is the circuit diagram:
**broken link removed**
Thanks in advance!