On Tue, Nov 09, 2004 at 11:13:26PM -0600, Barton Hodges wrote: > > Hey everyone, thank you for all the assistance with the RS232 problem > I wrote about earlier. The RS232 problem was determined to be a > timing issue, and I was experiencing erratic behavior in a simple LED > flashing routine. The LED would blink erratically unless I placed my > hand near the development board, or grounded it. > > The problem turned out to be the that the default settings in WinPIC > for the 16F87 chip has the "Low Voltage Prog" bit enabled. Since I am > quite a newbie at this, I incorrectly assumed that the defaults chosen > for the device would be proper in all circumstances. > > >From the data sheet: > > "While in Low-Voltage ICSP mode (LVP = 1), the RB3 pin can no longer > be used as a general purpose I/O pin. When using Low-Voltage ICSP > Programming (LVP) and the pull-ups on PORTB are enabled, bit 3 in the > TRISB register must be cleared to disable the pull-up on RB3 and > ensure the proper operation of the device. RB3 should not be allowed > to float if LVP is enabled. An external pull-down device should be > used to default the device to normal operating mode. If RB3 floats > high, the PIC16F87/88 device will enter Programming mode. LVP mode is > enabled by default on all devices shipped from Microchip. It can be > disabled by clearing the LVP bit in the CONFIG register. Disabling > LVP will provide maximum compatibility to other PIC16CXXX devices." > > After reading this, I placed a resistor between RB3 and ground, and it > solved the problem when the LVP bit is enabled. The problem is also > solved when the LVP bit is disabled. That's how it works. One last thing: Whenever you program a LVP capable part, the LVP pin should be grounded even when you are HVP. The erasure process causes the parts to briefly be in LVP mode and could cause it to lock up. BAJ _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist