hassankhan
New Member
i provided the complete code above, i m using mikroc compiler, tell me plz what should be the code?Where's the rest of it.... This couldn't possibly have compiled... What compiler are you using...
Last edited:
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
i provided the complete code above, i m using mikroc compiler, tell me plz what should be the code?Where's the rest of it.... This couldn't possibly have compiled... What compiler are you using...
i wrote a program in mikro c & put it into 16f877a, led didnt glow but when i touch one of the probe of multimeter with vdd pin of controller & other with osc2 then it was glowing, what is this?
please tell where i m making mistake??
code is
Code:void main() { TRISB = 0; // TO MAKE ALL PORT OUTPUT PORTB = 0; // TO OFF PORTB while(1) { PORTB = 0xff; // TO TOGGLE PORTB } }
thanks & regards
hassan khan
PORTB =~PORTB;
I have noticed that you are doing nothing in your code.... To toggle the port you should use..
Code:PORTB =~PORTB;
If your circuit is the same as this (with a crystal) it should work..... On a side note.. What speed is your crystal....... If it's 4mhz or below, you need to specify XT crystal setting in your IDE before compilation... If its above, you need to specify HS
do u have any hex file for led at portb?
Here is one, I have tried it with a 4 MHz crystal and a 100K resistor from MCLR to +. It works fine.
Tons... In my signature..... They are based on Nigel's ASM tutorials and use the same boards.... You build The dev board laid out in Nigel's Pic tutorial site and run all my examples on them.
I also did a MPLAB IDE tutorial with basically the same code as you want.... https://www.electro-tech-online.com/threads/eb08.582/