--0-1285054809-1055697146=:91046 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline I found this schematic on the web and this is my exact circuit except the servo signal is connected to pin 3 on portb. Also I have all the unused pins connected to ground. Anyone see anything wrong with the circuit? --- rneel@COX.NET wrote: > I'm certainly no expert, but it looks like a classic > capacitor discharge issue to me. If you have a cap > on this output, it will take time for it to > discharge causing the slow decay in voltage instead > of a nice sharp corner. I can't see your circuit > but do you have a cap connected across the pin you > measured with the scope? > > > > From: Joel Middleton > > Date: 2003/06/15 Sun AM 01:21:50 EDT > > To: PICLIST@MITVMA.MIT.EDU > > Subject: [PIC]: Servo Pulse Problem > > > > I believe I am having a problem with the pulse I > am > > sending to a servo connected directly to portb pin > 3. > > I have tmr0 set to overflow ever .0001 seconds. > The > > variable 'count' is incremented each time tmr0 > > overflows when count reaches 200 it is reset to 0. > > When count is equal to zero I set portb pin 3 and > when > > count equals pw1 I clear the pin. I believe this > > should give me a 1ms pulse every 20ms. This was > not > > working like I thought and I wanted to take a look > at > > the pulse so I downloaded one of those > ocilloscopes > > that runs through a sound card as I did not have > > access to a real one. Well I found out that I am > not > > getting a nice square wave. The rising edge looks > fine > > but the falling edge is a slope. Can anyone tell > me > > how to correct this? I have included my code and > also > > attached an image I captured from the occiloscope. > > Thanks. > > > > > > LIST R=DEC > > > > INCLUDE "p16f84a.inc" > > > > CBLOCK 0x0C > > _w > > _status > > _pclath > > _fsr > > count > > pw1 > > ENDC > > > > __CONFIG _CP_OFF & _WDT_OFF & _XT_OSC & _PWRTE_ON > > > > push macro > > movwf _w ;Save > registers > > movf STATUS, w > > movwf _status > > movf PCLATH, w > > movwf _pclath > > clrf PCLATH > > endm > > > > pull macro > > swapf _pclath, w > > movwf PCLATH > > movf _status, w ;Restore registers > > movwf STATUS > > swapf _w, f > > swapf _w, w > > endm > > > > PAGE > > > > org 0 > > nop > > > > goto Main > > > > org 4 > ;Interrupt > > > > push > > > > Timer0 > > btfss INTCON, T0IF > > goto Iend > > movlw 165 > > movwf TMR0 > > bcf INTCON, T0IF > > incf count > > movlw 200 > > subwf count, W > > btfss STATUS, Z > > goto Step1 > > movlw 0 > > movwf count > > Step1 > > movlw 0 > > subwf count, 0 > > btfsc STATUS, Z > > bsf PORTB, 3 > > movf pw1, W > > subwf count, 0 > > btfsc STATUS, Z > > bcf PORTB, 3 > > Iend > > > > pull > > > > retfie > > > > Main > > > > bsf INTCON, GIE > > bsf INTCON, T0IE > > > > bsf STATUS, RP0 > > bcf OPTION_REG, T0CS > > bsf OPTION_REG, PSA > > bcf STATUS,RP0 ; RAM PAGE 0 > > > > movlw 156 > > movwf TMR0 > > > > clrf PORTB > > > > bsf STATUS, RP0 > > bcf TRISA ^ 0x080, 1 > > bcf TRISA ^ 0x080, 2 > > clrf TRISB > > bcf STATUS, RP0 > > > > clrf PORTA > > clrf PORTB > > clrf count > > > > movlw 10 > > movwf pw1 > > > > Loop > > nop > > goto Loop > > end > > > > > > __________________________________ > > Do you Yahoo!? > > SBC Yahoo! DSL - Now only $29.95 per month! > > http://sbc.yahoo.com > > > > -- > > http://www.piclist.com hint: To leave the PICList > > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > ATTACHMENT part 2 image/pjpeg name=pulse.jpg __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu --0-1285054809-1055697146=:91046 Content-Type: image/gif; name="fig02.gif" Content-Transfer-Encoding: base64 Content-Description: fig02.gif Content-Disposition: inline; filename="fig02.gif" R0lGODlhCAImAecAAAAAAAEBAQICAgMDAwQEBAUFBQYGBgcHBwgICAkJCQoK CgsLCwwMDA0NDQ4ODg8PDxAQEBERERISEhMTExQUFBUVFRYWFhcXFxgYGBkZ GRoaGhsbGxwcHB0dHR4eHh8fHyAgICEhISIiIiMj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at3KtWtFmjynKp2Y1WTZjjrFCjx706vbt3Dj1mxrde3c gVOr2g26Nq3etnxxCv57M/DBq3j/guWbmHFfx4sZIwbMlPDOunTtFoyMV67n z6BlCsa8lHTlvqjpSj6teXDq1TVZwy78WrZszbRzQ8b89fDh26GDCx8ecnTn zMdbk05OVC1g3qqh407ovPn048aVJ0c41LHvu+BV/ncnTr68eYZhsYevjjv7 eOTeCyNOG97qfN7vrWemj1w+W+7fBRjdeQQWaGB3u/UH33RqGZcgffxtJp2C uQ3YmoPfZWfhZku9V991Eqpn4IgkCpeedtCxt5+IKFqoH4j8xbgciwNq6FyI QAko4I0l9ujjVvrxOJuM7dXGIHa2pWafkbol2eRr7QF3pEQvciflj1hm+VOQ IMq3YYPMBQZWio/5NWZs3lVlGGFqVpZgk2+WSRGCZcZHmYZaxhXIQXvm6Wdo /w0X6J8yBWLooQL1WZCihDbq1qDBQepoS4wSVGmlk2aKlKSgcaqpSJciFOqn pJZqap6j8jkQpqe26uqr/sFdemiqrMJq6624/jQrogYxqmituQYr7LAlAftP qMYSq+yyzFKU6rGLQtvstNRW29CzmCZr7bbcUjurqt2GK+64PWZrKLnopius r78+q+678P7pa7SJnhvvveqeoG+WvzKkLb4AE6vvwAT72O9C/was8K0En/BP w+Wu6u/CFC87sEEFk3iwQglX7LGmFyO0r8YSI/zxybCGLPLIBs5rKb0ox1wq ywnRTCC7q7or886N2nyQyjf3ai/MPBf9p88/O2z00kyLhDTGTUct9UZPEwT0 1Fhn3VDVA3Gt9ddfX42x0mCXbbZAYnft9dlsG51xQWm3LXfTDdddYt145633 /t589+3334D/PXe+ed8d+OGIJ6744nsPzjG4wpLdI+OUV2755WtrvWufrHZM quSGg45r3GbXqvPoWJL+qupSny5tycOKHlrnastuq8qyeq6w66/r/jlxvFqq KOutXhx870znPnSisMdeHrK1C8yy6UVvTjvsvn9q+2fQo525qbgL3bSx3Su7 vWcuD//9zNOLmjzR5Qv8PPbRx94+5NXD32uz58vV7rcPW9uodiW8462Eg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