pic microcontroller discussion list <> wrote on Thursday, July 10, 2003 1:33 PM: > Yeah, I will need you all to sign an NDA for my blinking LED code. So can I use it in my projects, licence free? Wow, thanks :-) :-) > I'm using the CCS compiler. The code looks like this: > > Output_low(PIN_A1); > Delay_ms(200); > Output_high(PIN_A1); That's very interesting, but does it produce any assembler :-) There is probably a .LST file or even .ASM file created, which will show what it is actually doing from startup. As it's a C compiler, I would expect that the above 3 lines will use quite a few resources to blink the LED, not a string of nop's! Does pin A1 have any other function on the chip you are using (eg comparator input etc). I'm sure you mentioned which PIC it was, could you remind me? What registers need to be set to disable the other functions? Can you check the assembler to verify that they are set correctly? Are the above instructions the first three instructions in main(), or do you have additional startup code (I don't use CCS, does it handle tristates etc for you, if it doesn't, then I wouldn't expect the above code to work, pins are set as inputs on boot) Are the PICs socketed? Can you swap them over to see if the fault follows the PIC or the board? Do you have a 'scope? Can you look at the MCLR waveform on the actual pin (not on the solder blob or the PCB) on reset to see what it is doing? Have you tried to remake the solder joints around the MCLR resistor which you think might be suspect? If you don't have a 'scope, a) try to get one, b) Check with a multimeter what voltage is on the actual pin (again, not the pad or the solder, there might be a subtle dry joint!) when reset is asserted and released. You could also have a visual check around MCLR to inspect solder joints. A few pointers to be going on with, these are all standard debug thoughts that you can store away for next time, even if they don't find the problem this time! Once you've tried them, let us know what the result was, and we'll go one from there. As you mentioned that you have 2 boards, one working and one not, try to test both of them and compare what happens. Nigel -- Nigel Orr, Design Engineer nigel@axoninstruments.co.uk Axon Instruments Ltd., Wardes Road,Inverurie,Aberdeenshire,UK,AB51 3TT Tel:+44 1467 622332 Fax:+44 1467 625235 http://www.axoninstruments.co.uk