On Tue, Nov 20, 2001 at 01:45:24PM -0600, Anuj Varshney wrote: > Hello, > > I would like to preface this message by telling you all that I am new to > the PIC, so go easy on me. Before I go through with buying a programmer, I > would like to know if a project I have in mind can be easily completed. > > Basically, I need to measure the pulse-width of a square wave and do > various things based on that value. I have been using a Basic Stamp II for > this purpose, but wanted to use the PIC for its attractive price. One of > the limitations of the STAMP is that the maximum measurable pulse width for > the BS2sx series is 65535*0.8us = 52.4ms. I need the capability to measure > up to about 100ms. Since I know nothing about assembly, I will likely do > this in BASIC through a compiler (PS - if anyone could find the time to > compile about 35 lines of code for me that would be great, I don't want to > buy PICBasic Pro, and the online version doesn't seem to be working for me). > > The question is, would I be able to measure pulse-widths of about 100ms by > simply using a 10MHz clock instead of a 20MHz? And even greater by using a > 4MHz? > > Would either the 16F84 or 16F877 be appropriate for this application, > assuming I don't need the additional I/O pins? A very good post. Smart to actually ask before getting started. I'd like to throw another contender into the ring for the target part: the 16F628. Same form factor as the 16F84, many of the same features as the 16F877 (3 timers, CCP module, hardware USART, low voltage programming, more program, RAM, and data EEPROM memory), and a couple of features of its own (internal RC oscillator, ability to use the MCLR and extra oscillator pins for input). Best of all it's loads cheaper than either of the other two (at least in the US). You should be able to easily build a system using the CCP module and timer1 to capture your pulse lengths. BTW if you do decide to go with a 16F877 or 16F628 they can be programmed in Low Voltage Program mode with simple programmers such as my Trivial LVP programmer. You can find it at http://www.finitesite.com/d3jsys Hope this helps. BAJ -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.