Bob is right. Its a perfect match for a PIC application. I've experienced Windows peculiarities in using RS232 w/ Windows, too; Windows doesn't necessarily process tasks in order of their arrival, and strange results can follow. Make the PIC send packeted results, and interpret when the entire packet is known to have been received. --Bob At 09:20 AM 8/13/2003 -0400, you wrote: >This application is well within the capability of even a relatively low-end >PIC. > >Simply use the built-in A/D to convert the input. It can easily sample at >exactly (within 50 parts per million!) 50 Hz. > >Take the converted values and send them to the PC via a serial port. > >Bob Ammerman >RAm Systems > > > > >----- Original Message ----- >From: "Hulatt, Jon" >To: >Sent: Wednesday, August 13, 2003 9:04 AM >Subject: [PIC] Real time operation? > > > > Hi All, > > > > I've been reading the list for a couple of weeks now, although I've not > > actually used a pic before. > > > > I'm a programmer really, but have a fair degree of electronics experience. > > > > I am doing some consultancy for a company at the moment. They have a need >to > > measure displacement of a vehicle suspension, at bang on 50Hz. They have >so > > far set up an elaborate system which moves a PC mouse, and tried to create > > windows software to read the mouse position 50 times per second. However, > > they've been having great difficulty in reading at that frequency, and in > > particular, reading without a fair degree of variance over the frequency. > > > > I have been hired to help them out. The main problem they're having is the > > way windows works. It's not a Real Time Operating system, and the internal > > clock pulse of the NT kernal has a period of 7.5ms, which makes it really > > hard to do anything in real time at a frequency whose period is not a > > multiple of that. > > > > I had considered that a solution to the problem might be to use a PIC. To > > replace the mouse as the displacement sensor with a simple rheostat >device, > > through an op amp and into an ADC on a PIC. The pic could then send the > > sampled data down a serial port, to the PC, for storage and processing. > > > > My question to you is whether the PIC is suitable for this Real-time > > operation? Am I likely to be able to get a PIC to sample at 50Hz with a 1% > > error margin of frequency? Or should I be looking elsewhere for solutions? > > > > Thanks > > > > Jon > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > >-- >http://www.piclist.com#nomail Going offline? Don't AutoReply us! >email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -------------- Bob Axtell PIC Hardware & Firmware Dev Tucson, AZ 1-512-219-2363 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body