You say it works in the simulator. Can you explain what you mean by "works". May be less obvious than it appe= ars. LED on correct pin ? (has happened :-)). LED between pin and where? Resistor in series with pin? LED which ?polarity. If pin to ground then LED Anode towards pin, cathode towards ground. If pin to Vdd, LED Cathode towards pin, LED anode towards VDD. Series resistor wise. Say 270 ohm to 1k range to start. _______ The following "proves" your hardware. Desocket PIC if socketed. Power up circuit. 1. IF there is a resistor in series with the LED (as there should be). Connect PIC pin location connected to LED to ground with a wire - observe. Connect PIC pin location connected to LED to Vdd with a wire - observe. LED should light during one of those states and extinguish for other. If not, reverse LED polarity and retry. 2. If there is NO series LED resistor. Repeat as in 1. above BUT use a 270 ohm to 1000 ohm range resistor instead of a wire place of the wire. If no LED lights then hardware is wrong. Fix this, then fix software if needed. 3. If PIC is NOT socketed then 1. above will still work and PROBABLY won't damah\ge PIC. 4. 2. above may work but R may need to be say 100 ohms - keep it short time wise :-). 5. If LD was inserted backwards if\t MAY have died. 6. LED po\polarity check. Connect from Vdd via eg 1000 ohms via LED to ground. LED Anode must be towards Vdd to work. Russell On 30 May 2010 03:41, Xiao Xu wrote: > Alright, here's my entire program, I added TRISA in: > I'm currently running a 16F684 on a PICKit 1, and I'm trying to get 1 of = the > lED to light up. But unfortunately it refuses to. > > #include > > __CONFIG(INTIO & WDTDIS & PWRTEN & MCLRDIS & UNPROTECT \ > > =A0& UNPROTECT & BORDIS); > > >> void init() > > { > > PORTA =3D 0; > > =A0 CMCON0 =3D 7; > > =A0 ANSEL =3D 0; > > =A0 TRISA4 =3D 0; > > =A0 TRISA5 =3D 0; > > } > > main() > > { > > =A0 init(); > > =A0 while(1) > > =A0 { > > =A0 =A0 =A0 for (int i =3D 0; i < 255; i++) > > =A0 =A0 =A0 =A0 =A0 for (int j =3D 0; j < 129; j++); > > >> =A0 =A0 =A0 =A0RA4 =3D 1; > > >> =A0 =A0 =A0 =A0for (int i =3D 0; i < 255; i++) > > =A0 =A0 =A0 =A0 =A0 for (int j =3D 0; j < 129; j++); > > >> =A0 =A0 =A0 =A0RA4 =3D 0; > > =A0 } > > } > > > - Xiao Xu > > > > On Sat, May 29, 2010 at 9:32 AM, Olin Lathrop > wrote: >> Wouter van Ooijen wrote: >>>> PORTD |=3D 1<<0; >>> >>> But *do google for "read modify write problem"*. The above line might >>> *fail* on a PIC (with all compilers). >> >> The above line will turn on the intended bit. =A0The failure is that it > might >> alter other bits. >> >> >> ******************************************************************** >> Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products >> (978) 742-9014. =A0Gold level PIC consultants since 2000. >> -- >> http://www.piclist.com PIC/SX FAQ & list archive >> View/change your membership options at >> http://mailman.mit.edu/mailman/listinfo/piclist >> > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- = http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist