11 May 23:32
[PIC] CCP1 Glitches in noisy environment (RC Tx)
From: Gordon Williams <g_will <at> cyberus.ca>
Subject: [PIC] CCP1 Glitches in noisy environment (RC Tx)
Newsgroups: gmane.comp.hardware.microcontrollers.pic
Date: 2008-05-11 21:34:03 GMT
Subject: [PIC] CCP1 Glitches in noisy environment (RC Tx)
Newsgroups: gmane.comp.hardware.microcontrollers.pic
Date: 2008-05-11 21:34:03 GMT
Hi All, I'm having problems tracking down the reason of some glitches occurring on the CCP1 output and it is driving me a bit crazy. I'm putting some smarts into a basic RC transmitter. I've replaced the current chip producing the pulse train to the RF section with a daughter board and added a cell phone LCD, some switches and Serial port for input and output. The serial port and LCD (spi) work fine and they don't have any glitches. The 5 ADC readings for the joysticks (4) and battery voltage also work well with only 1 bit of noise on a 10 bit reading (referenced to the power and gnd lines). The PIC that I am using is the 16F886. Its supply is a 78L05 on the main board and I have a 10uf Tant and three 0.1uF on the power lines on the daughter board. The daughter board is single sided with a ground plane pour under the PIC and every else where I could. Because I don't have ADC problems or serial or spi errors that noise must be reasonably constrained, I think. I'm using CCP1 (pin C2) to produce the PPM that goes to the RF section. It is the standard PPM protocol (each channel pulse is 1 to 2 ms wide including the following 0.3 ms pulse, repeated every 20ms). Timer1 runs freely. With a CCP1 interrupt (my only interrupt) I update CCPR1 with the duration until the next transition high or low and the CCP1CON bits to set the next transition in the correct direction. My main program clears a flag and that is all. Most of the time it works perfectly and looks like:(Continue reading)
RSS Feed