Rikard Bosnjakovic wrote: >Feel free to point me to a place that helps me understand what I'm >supposed to do and why. The datasheet is good as a reference, but >since this is my first playground with a PIC, it tends to get very >complicated very quickly. > > When you use a pin which has multiple functions, like the RA6 and RA7 pins do on your part, you MUST look at the other functions and make sure you have turned them off. This datasheet infers this in at least 2 different places in regards to RA6 and RA7..... On Page 31, in the grey box, note #3... "TRISA<6:7> is overriden by oscillator configuration. When...overriden, the data reads '0' and the...bits are ignored" On Page 96, talking about bit4, 1 and 0 in the configuration registoer "100=INTOSC oscillation: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN", with other bit definitions saying that the RA pin is used for someting else. Generally, when I use a pin, I make sure I understand everything the pin is used for - at least as far as how to disable that function on the pin. In this case, those pins are shared with the clock oscillator circuit, which needs to be switched to a mode where they aren't being used for the clock oscillator. Personally, I would have used a slightly bigger device so I could have dedicated the RB4/RB6/RB7 pins to the ICD functionality, and avoided the need to re-use the OSC. The 16f886 for example is a 28pin device (10 more pins) with a 8mhz adjustable internal clock (double the speed), 8Kwords of flash (4 times the memory), A/D converters, and so on...for $0.71 more - ($2.57 vs $1.86 Qty 1) -forrest -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist