kar2on
Member level 1
configuration word with mikroc
I recently purchased a JDM PIC programmer, and successfully programed a PIC18f452, or so it seems. When I place the PIC into a test circuit, (blinking LED on portD) nothing happens. The PIC VDD has 5V from a voltage regulator. I really don't know what the problem is, my mikroC program is as follows:-
void main(){
TRISD=0;
while(1){
TRISD=0xFF;
Delay_ms(1000);
TRISD=0X00;
Delay_ms(1000);
}
}
THe ciruit is on a breadboard. Sometimes ALL the pins are high, most of the time ALL the pins are low. What is wrong? The circuit is on a breadboard, and the crystal frequency is 10Mhz. In mikroC I set the clock frequency to 2.5Mhz and HS mode for the crystal oscillator. What could be the problem. It's not the PIC as I've tried this with 3 different PICs. I connect pin 1 to 5V through a 10K Resistor. I'll upload a circuit diagram later but really need help on this. Thanx.
Added after 6 minutes:
while(1){
TRISD=0xFF;
Delay_ms(1000);
TRISD=0X00;
Delay_ms(1000);
}
It should read PORTD=0xFF;
and PORTD = 0x00;
I recently purchased a JDM PIC programmer, and successfully programed a PIC18f452, or so it seems. When I place the PIC into a test circuit, (blinking LED on portD) nothing happens. The PIC VDD has 5V from a voltage regulator. I really don't know what the problem is, my mikroC program is as follows:-
void main(){
TRISD=0;
while(1){
TRISD=0xFF;
Delay_ms(1000);
TRISD=0X00;
Delay_ms(1000);
}
}
THe ciruit is on a breadboard. Sometimes ALL the pins are high, most of the time ALL the pins are low. What is wrong? The circuit is on a breadboard, and the crystal frequency is 10Mhz. In mikroC I set the clock frequency to 2.5Mhz and HS mode for the crystal oscillator. What could be the problem. It's not the PIC as I've tried this with 3 different PICs. I connect pin 1 to 5V through a 10K Resistor. I'll upload a circuit diagram later but really need help on this. Thanx.
Added after 6 minutes:
while(1){
TRISD=0xFF;
Delay_ms(1000);
TRISD=0X00;
Delay_ms(1000);
}
It should read PORTD=0xFF;
and PORTD = 0x00;