Help newbe with 16F87

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?

Reply to
sdeyoreo
Loading thread data ...

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.

Reply to
Tom

DIP package.

Silly me. I'll try it again.

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

Reply to
sdeyoreo

quoted text -

What about the OSC pins ?

Reply to
dk

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.
Reply to
sdeyoreo

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.