Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 void main() { TRISA = 0xFF; TRISB = 0; loop: PORTB=0B1; delay_ms(500); PORTB=0B0; delay_ms(500); goto loop; }
Hi,
If that is your actual circuit then I'm afraid it is totally wrong.
Have a look at this tutorial -
**broken link removed**
I will add a valid schematic for your 877a in a few minutes, though there is a chance you may have already damaged it as it can only cope with +5V.
Here is a complete diagram for your led flasher.
If you are not using In Circuit programming then you can leave out the 6 pin ICSP socket and D2.
The Reset switch is not essential either but can be handy.
will iwana try it on my bread board so how to take 4v of from my 9v battrey
thankyou
Hi,
You really need to use a 5V regulator like that shown in the diagram.
Using a dropper resistor would work if your current was constant, but its not as the led is flashing on an off.
The 877A takes about 3ma and the led about 20ma so the voltage would fluctuate badly; the micro is designed for stable power only
The best solution would be to use a 4.5v battery or 3 x 1.5v cells connected in series.
You could possibly create a potential divider across the battery to produce 4.5 volts but thats not something I have tried.
To progress onto anything more complex you will need that voltage regulator.
Another thing to be careful of when using the breadboard, the 22pf capacitors and the xtal have very thin leads and they do not always make good connection into the beadboards sockets.
If possible solder some thicker wire onto them to make the connection stronger.
Also its important those three parts are as close to the 877s pins as possible.
void main()
{
TRISA = 0xFF;
TRISB = 0x00;
while(1) {
PORTB=0b00000001;
delay_ms(500);
PORTB=0b00000000;
delay_ms(500);
}
}
Try this code with the circuit in the 2nd post.
Code:void main() { TRISA = 0xFF; TRISB = 0x00; while(1) { PORTB=0b00000001; delay_ms(500); PORTB=0b00000000; delay_ms(500); } }
- - - Updated - - -
Just omit the button in the circuit in the 2nd post and make the circuit. (v input is given to 7805 and 5v output is taken.
Try this code with the circuit in the 2nd post.
Code:void main() { TRISA = 0xFF; TRISB = 0x00; while(1) { PORTB=0b00000001; delay_ms(500); PORTB=0b00000000; delay_ms(500); } }
- - - Updated - - -
Just omit the button in the circuit in the 2nd post and make the circuit. (v input is given to 7805 and 5v output is taken.
after the tris settings add CMCON = 0x07; and ADC)N1 = 0b00000111; and try.
-----------------uiupdate-------------------
you don't need these settings as you are not using port a. Have you set the clock frequency in mikroC and proteus properly? Are you using internal / external oscillator?
void main()
{
TRISA = 0xFF;
TRISB = 0x00;
CMCON = 0x07;
ADCON1 = 0b00000111;
while(1) {
PORTB=0b00000001;
delay_ms(500);
PORTB=0b00000000;
delay_ms(500);
}
}
is my circet ok
...
...
and the clock frequency in mikroC and proteus is 8MHz
It is unclear whether you are attempting to simulate the design in Proteus or implement the design in physical hardware.
Which is it?
The breadboard circuit shown in the photos is incomplete as wp100 mentioned.
BigDog
It is unclear whether you are attempting to simulate the design in Proteus or implement the design in physical hardware.
Which is it?
The breadboard circuit shown in the photos is incomplete as wp100 mentioned.
BigDog
It is unclear whether you are attempting to simulate the design in Proteus or implement the design in physical hardware.
Which is it?
The breadboard circuit shown in the photos is incomplete as wp100 mentioned.
BigDog
hesho90
iwant to do it on my bread board with the pic
Fez877 PIC JDM Programmer for Microchip MCUHi,
I think we are having problems in understanding each other.
Let us know if you do not understand anything, we are here to help.
The circuit diagram and pictures you show of your hardware are Wrong, they will not work.
The minimum circuit you can have to make it work is as I showed in posts #10 and # 13.
Have you built that circuit ?
yes i have every thing and dont know where C3 goez
Have you tried the proven flasher .hex code I also sent ?
i have ues the code you give and built it in bread board nothing happen
What kind of programmer are you using ?
Hi,
Thats looking better with the correct parts but its not quiet right - simple to correct though.
The 100nf cap should be removed from the led, the led + should connect directly to your + rail.
What you are missing are the + pos and -neg connections to the 877A to give it the power to run !
The + pos should be connected to pins 11 and 32
The - neg should be connected to pins 12 and 31.
Then connect the 100nf cap across pins 31 and 32, this helps reduce any interference on the power lines.
The 27pf caps should be fine with your crystal
Hopefully that should work .. let us know how you get on.
It does get easier ... !:-D
but in proteus the vdd and vss are not there
and i relly didnt get the pins of the pic
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?