On Sat, 2004-10-02 at 17:46, Adam Woodworth wrote: > Hi Brent, > > Thanks for your response! Actually, I've been programming in C for years, > and I tried putting the code in a loop earlier and still nothing happens > to the LED. So I'm still clueless as to what the problem is. Then you've either got a wiring mistake, a power problem, a programming problem, a reset problem or a config fuse problem. Which PIC are you using? Which programmer? What are your fuse settings? > I even tried setting PORTB = 0 instead of 255 in case 0 meant high and 1 > meant low (which seems to be the case with gpasm). Huh? "high" and "low" aren't defined in gpasm AFAIK, a 0 is a 0, a 1 is a 1, a 1 on a port pin will cause it to go to Vh, what did you observe to make you think differently?? > But would this program really require an endless loop? If you want it to behave in an expected way... yes. > I'm still not too > familiar with PICs, but I would assume that the compiler would generate > code that would have an instruction to terminate the program, so that the > PIC wouldn't go off into never never land. Nope, the compiler won't do anything more then you ask it to. > I was expecting the code to > run, change the state of PORTB, and exit cleanly and the PIC would be > sitting "idle". Define "exit cleanly" in the context of a PIC? I think you are confusing things here with a PC. When a program "ends" on a PC control returns to that which called the program, which is your OS. But even when control is with the OS, there is still an infinite loop running, your CPU never actually stops doing things (except when going into suspend and things like that). On a PIC you have NO OS, there is no such thing as your program "exiting", your program is the only thing the PIC knows, it is the PIC's universe. > Am I wrong? Unfortunately yes, although wrong is a little harsh. I just think you haven't completely wrapped your head around what a PIC is. This is why I NEVER recommend people start out with a PIC using C, it ends up confusing people more then if they just went ASM first and then moved to C. Just wait until you hit your first compiler bug, if you know nothing of PIC ASM and it's "interesting" architecture you WILL be lost. > Thanks! > Adam ----------------------------- Herbert's PIC Stuff: http://repatch.dyndns.org:8383/pic_stuff/ _______________________________________________ http://www.piclist.com View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist