Help newbe with 16F87

Feb 25, 2008 4 Replies

Can't get it to light a LED. I'm using MPLAB with CC5X compiler and WinPIC programmer with an RCD programmer. Here's the program: Compiles and programs with WinPic ok.



void main( void) { OSCCON= 0x7C; PORTB = 0x00; TRISB = 0x00; //outputs



while (1) { PORTB=1; } }



Here's the configure word from WinPic: Internal RC osc, WDT Disabled: 11 1111 1111 1000 Using an LED and 330 ohm from pin 7 to gnd. Any help?



You didn't say which package you are using, but if you're using the DIP or SOIC package, then pin 7 is RB1 but your program is setting RB0. If you're using the SSOP or QFN package then pin 7 is in fact RB0 so it should work assuming no loose connections or LED connected backwards, etc.

DIP package.

Silly me. I'll try it again.

Do I do anything with MCLR? I only have Vss,Vdd and pin 7 connected.

quoted text -

What about the OSC pins ?

quoted text -

Nothing connecting to them. I thought the config word I used,

11 1111 1111 1000, set it up for internal osc, no? I'll try using the ext RC. Like I said, I'm a newbe to this, though I've been using a BasicStamp and a 8051 with SDCC for a compiler. I've also used a robotic controller using an 18F8722 with MPLAB 7.2, though all the setup used pre-written code.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required