> By the way, Microchip's USB firmware is using MPLAB C18. So there > will not be anything like "clr TRISA". > > And they are doing the following for the bootloader example > (in file io_cfg.h). > #define mInitAllLEDs() LATD &= 0xF0; TRISD &= 0xF0; > > This is indeed questionable. It is correct to set RD0/1/2/3 > to output since they are for LED output. RD4/5/6/7 are not > used so maybe it is better to set them as output and output 0 > if you do not have something connected to them in the final > circuits. Take note this is only the bootloader. The > use application hardware/software should take care of this. > > Regards, > Xiaofan Xiaofan, I will tell you what happened, btw the touching issue is solved now, but I don't understand why. Apparently it was pin38 which was causing this. Now I connected it to gnd and the touching problem is gone. Interestingly, if I connect it to 5v instead of gnd, the bootloader doesn't start AT ALL. As you have seen yourself in io_cfg.h there is no mention of pin38 (on the schematic it is S3, the bootloader shares some hardware with the demonstartion board, but the bootloader never uses S3) so I have no idea why this is happening. Any ideas? b.t.w. I would like to thank everyone here, I really didn't ask well, but now I believe everyone should understand. thanks. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist