PIC programming

Thread Starter

Fresher

Joined Mar 14, 2010
1
Hi
I am new to programming.I have run into trouble.
I am trying to program PIC16F877A using microc and microbrn programmer.
I wrote this code and transferred it into the MCU.Everything went well but when I placed an led between protb pins 1 and 2 nothing happened.Please help me.

void main()
{
TRISB=0;
PORTB=0b10101010;
}
 

t06afre

Joined May 11, 2009
5,934
Hi
I am new to programming.I have run into trouble.
I am trying to program PIC16F877A using microc and microbrn programmer.
I wrote this code and transferred it into the MCU.Everything went well but when I placed an led between protb pins 1 and 2 nothing happened.Please help me.

void main()
{
TRISB=0;
PORTB=0b10101010;
}
Have you set the configuration bits correct. They are mentioned in the "SPECIAL FEATURES OF THE CPU" section in the data sheet. If these bits is not proper set according to your application your MCU will not work as it should. You can set them in MPLAB or your code. Also read my answer in this post http://forum.allaboutcircuits.com/showthread.php?t=32461 about the ansel registers. It will apply to your chip also
 
Top