Robert B. wrote: >I've been getting some really strange behavior out of a 16F873A. The chip >is in a wirewrap socket soldered to a piece of perfboard, with a 5v 7805 >power supply, a 100uF decoupling capacitor, ICSP wires, a 20mhz ceramic >resonator wired directly to the clock pins and ground (it has built in >caps), and a resonant piezzo buzzer attached to one pin through a 550 ohm >resistor. All connections are either made with soldered (not actually >wrapped, just point to point) 30 ga wire-wrap wire or direct soldering. The >only programmed fuses are the power up timer, and HS oscillator (no wdt). >The programmed code sets up the I/O pins, then has something like this >(AUDIBLE is the output for the resonant piezo buzzer): > >main(){ >while(1){ > output_high(AUDIBLE); > delay_ms(500); > output_low(AUDIBLE); > delay_ms(500); >} > >} > >There is no other code. > >The bleeping works fine, but the chip resets itself after about 20us, >resulting in a quickly pulsed set of bleeps instead of the 1/2 second on, >1/2 second off. Its as if the chip is not booting properly. > >In frustration I unhooked my scope from the power supply ground and turned >it off, ready for bed. Then the damn thing worked fine! So I hooked up the >scope again to see what was going on, and it didn't work again. Whenever >the scope probe's clip is attached to the ground the circuit seems to >resonate out of control, rebooting quickly. The circuit also displays >erratic behavior when my body is physically close to the ceramic resonator. >Another note is that when the scope is hooked to ground and I place my >finger also on the ground, the circuit boots and runs properly. > >So can anyone fathom why it's being so picky? I've never had this problem >before, and I really need to be able to use my scope to debug the coming >code. > >On my scope there is a connection marked for ground, but it is not attached >to anything. The probes are basic 60MHz 1/10x scope probes, but the problem >occurs on both the 1 and 10x settings. > > >Please help me figure this out.. it's killing me! > > You need to have a bypass capacitor (100n) between Vdd and Vcc at the PIC pins for a start. Do you also have a cap on the input side of the 7805? David... -- ___________________________________________ David Duffy Audio Visual Devices P/L U8, 9-11 Trade St, Cleveland 4163 Australia Ph: +61 7 38210362 Fax: +61 7 38210281 New Web: www.audiovisualdevices.com.au ___________________________________________ -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body