PDA

View Full Version : Newbie with LAB X1 timming problem



schlaray
- 3rd November 2006, 17:49
How would I duplicate a retriggerable one-shot multivibrator with PicBasic Pro software. I would like the time period to be variable(programmable T1). The trigger input would be the output from an A/D converter.

Dave
- 3rd November 2006, 20:28
schlaray, Do you mean you want the one shot period to be a function of the a/d reading or do you want the one shot to be triggered by some value being exceeded by the a/d?

Dave Purola,
N8NTA

schlaray
- 3rd November 2006, 22:40
The one-shot will be triggered by a high value out of the A/D converter

mister_e
- 3rd November 2006, 23:48
Start:
ADCIN 0, ByteA
If ByteA>Something then
Pulsout...
endif
GOTO Start

schlaray
- 5th November 2006, 01:21
I thank everyone for their interest. The period T1 will vary from 0 to 4 hours. The output of this one-shot will energize a delay operate timer whose period will also be 0 to 4 hours. Using the built in timers in the 16F877A seems to be a complicated task. When is it advantagious to use a seperate RTC to access time periods?

BobK
- 5th November 2006, 17:38
Hi schlaray,

Why don't you look at using one of the 12F series PICs as they are small. I'm assumming here that all you are looking for is creating a one shot timer. You could create a clock using the internal timers and have a serial display showing how much time has elapsed. You have 6 I/O pins to work with on the 12F series. Look at data sheets for one with an A/D input then go from there. I think one with 1K of memory should do the trick for you. Search this forum for Paul Borgmier's "Easy Clock" programs to see just how easy it is to create a clock with a serial display. I think what you're asking to do should be relatively simple to make. You could use one button to set the time period to whatever time you wantand the same with how long of a pulse you want to have. Setup a small menu program to select these times then have your display show you are "waiting for an activation". See how an imagination can run wild. That's what I like about this stuff. It gets the creative juices flowing, even on a Sunday!

Have fun!

BobK

Chuck Helebuyck has produced some articles in Nuts and Volts Magazine this year that show you how easy it is to use timers and interupts. There also some great sample programs on the MELabs website.

BobK
- 6th November 2006, 01:19
Hi schlaray,

I got to thinking about your project again. Darrel Taylor had a great program called "Elapsed Timer" posted on this forum some time ago. Your ADC reading could trigger the timer and you just monitor the count until it reaches the point you want to stop at and do what you need to do.

BobK

schlaray
- 7th November 2006, 00:30
Once again I thank everyone for their input. With the information I have received it is time for me to get to work and apply some of it. As my project advances, I will return to ask additional questions.