void main(){
TRISD = 0x00;
TRISC = 0x00;
TRISA = 0x00;
TRISB = 0x00;
PORTD = 0xff;
PORTC = 0xff;
PORTA = 0xff;
PORTB = 0xff;
}
betwixt said:1. there are no LEDs in the schematic !
2. Short out R1 and remove C3, they do nothing at all.
3. You MUST fit decoupling capacitors across 5V and Ground. I suggest 10uF and 100nF in parallel.
4. What does your software do when it finishes the program? Try wrapping the code inside the main function in a "while(1)" loop so it repeats rather than falling off the end of the code.
Also make sure the wiring to the crystal is as short as possible and the ground side of C1/C2 is a short connection to the processor ground too.
Brian.
aj9999 said:You dont show pins 11,12,31 and 32 are they connected?
aj9999 said:It is best to show those pins, if you choose not to show Vss and Vdd on the part you should at least show the capacitors that you have between pwr and gnd close to the part so that people know you have them. If you dont have those capacitors you need to add them. Also did you add the while() loop as betwixt suggested?
aj9999 said:Add a 10uF and a 0.1uF cap , place them betweeen Vdd and Vss. Place it physically close to the PIC. You can tie the 2 pwrs and 2 grounds together.
You might want to increase the xTal caps from 10pf to the standard 22pf. Make sure it is very close to the PIC and that the wires/traces are as short s possible.
Please post the updated schematic with these changes to ensure we are all understanding what you have and also post your complete code with the while loop and your include and config statements.
void main(){
TRISD = 0x00;
TRISC = 0x00;
TRISA = 0x00;
TRISB = 0x00;
while(1){
PORTD = 0xff;
PORTC = 0xff;
PORTA = 0xff;
PORTB = 0xff;
}
}
betwixt said:Ummmm.....
The capacitors go in parallel not series!!
The idea is they ensure there is no signal across the supply lines, only the 5V DC needed to power the micro. Without them, you will get noise across the supply and the internal oscillator will probably fail to start up, or at best it would be erratic.
You can safely drop R2 to 1KΩ, it's present value will make the LED very dim.
And... you must connect all VSS and VDD pins.
Brian.
aj9999 said:After you make the changes betwixt suggested , check that you have the WDT,BOREN both turned off. Maybe even make sure that SSPCON1 is set to zero to disable the SPI port, although it should start up with it disabled.
Have you checked the Vss and Vdd pins at the uC with a multimeter or oscope to ensure that the device is getting power, then have you checked that the LED pin is not changing its value,check it with a DMM or oscope not just with the LED, also check the other port pins.
Next how do you know the part is programmed and not defective, try a different PIC or try your PIC in a different demo board. Check the crystal, they are easily damaged, maybe even go with a slower one until you get everything else working. Generally the higher speed crystals are more susceptable to trace/wire resitance and capacitance than a lower speed ones.
Alex
nikhil_damle said:if u are using ISIs for the circuit simulation then no need to show the VCC & Gnd pins they are taken care of . now about the schematics connect the MLCR pin to +5v, connect 330ohms resistr to led then ground,
the program should be
#include"16f877A.h"
# use delay(clock=16000000)
main()
{
toputput_c(0x00);
delay_ms(100);
output_c(0xff)
goto top;
}
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?