Shop OBEX P1 Docs P2 Docs Learn Events
Counter Circuit Needed — Parallax Forums

Counter Circuit Needed

RogerInHawaiiRogerInHawaii Posts: 87
edited 2007-10-23 19:51 in BASIC Stamp
I need a circuit designed which interfaces to the Parallax Stamp circuit board. This circuit will consist of a 16-bit counter which is incremented by a 12 GigaHertz clock. From the Stamp’s standopint it needs to have a control line to zero the counter, one to start and stop the counter, and a means to read the contents of the counter.

Is there anyone who could assist me in this?

- Roger Garrett

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-21 00:58
    The Stamps are really not fast enough to handle this. Even the fastest one takes about 50us to execute an interpreted instruction.

    Have a look at the SX and the Propeller both of which would be fast enough to handle sub-microsecond control functions.
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-21 01:06
    Mike,

    Thanks fo rthe response. I will indeed take a look at the SX and the Propeller boards. But I wasn't thinking of using the clock of the Stamp itself to drive the counter. I was expecting to have an additional clock circuit to drive the 16-bit counter, which would let me have a clock rate tuned specifically tomy application.

    So, I need some help in selecting the right counter (capable of high clock speeds) and in designing the needed circuitry.

    - Roger Garrett
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-21 01:44
    Roger,

    Germane to Mike's comment: 12Ghz / 65536 = 183KHz. This is the rate at which your 16-bit counter would make one complete cycle. That's every 5.5uS. Even if the BASIC Stamp were able to read such a counter, it would have cycled multiple times during a single read instruction. I seriously doubt the reading would have any meaning, except perhaps as a random number. What is it you're trying to do at such speeds?

    -Phil
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-21 02:03
    I wasn't talking about using the Stamp's clock. You had talked about using the Stamp to start and stop the clock. That still requires much more speed and reproducibility than the Stamps can provide.

    Designing a 12GHz counter is a very specialized need with very specialized experience needed. It's really way beyond the scope of these forums. Once you decide on a counter design, that will determine how the counter has to interface to the microcontroller.
  • LilDiLilDi Posts: 229
    edited 2007-10-21 03:37
    Roger,
    This couldn't be a MIR project is it?
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-21 03:55
    LilDi,

    An MIR project? Well, I could answer that if I knew what an MIR project was.


    Phil and Mike,

    I see what you mean. Yes, there would be problems with overrun of the counter. I could explain more precisely what my needs are outside of this forum, if you'd be willing to contact me directly (RogerInHawaii@aol.com) and maybe you could poiint me in the right direction.

    - Roger
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-21 07:02
    Roger,
    I'm happy to make suggestions in the forums. Private discussions are not very useful to others trying to learn and I really have little experience working with stuff in this frequency range.
    Mike
  • metron9metron9 Posts: 1,100
    edited 2007-10-21 18:06
    I would be interested in what you are using that has a 12ghz clock. Since the resolution is only 16 bits why not run a 183khz clock and do the math on the received word. Say you get 15, just multiply by 183,108. Since you dont store the full resolution it doesn't matter if the clock is 12ghz , 6 ghz, 1 ghz or 183khz

    If you need more resolution you could use hardware counters outside the stamp but your start and stop would have to be driven with an external trigger. Unless you use assembler and an chip you can know the time it takes to start and stop the counter so you can subtract the time between it actually starting and stopping. Once the timer is stopped you would read in as many bits of resolution you want from the hardware counters. but i don't have a clue what kinds of components would run at that speed.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-21 18:59
    Interesting project, though. Light travels one inch in 83 pSec (1 / 12GHz). Am I warm? wink.gif

    The start and stop triggers will have to come from your external device (laser pulser and receiver?), and will have to exhibit virtually zero uncertainty in the picosecond range to get the kind of resolution you're after. Given this, it should be no problem for a Stamp to read a stopped clock.

    But, seriously, most sportsman's laser rangefinders that sell for around $200 are accurate to a yard or two. Achieving sub-inch resolution will be an order of magnitude (or two) more difficult — assuming that's even what you're trying to do, of course!

    -Phil
  • LilDiLilDi Posts: 229
    edited 2007-10-21 19:07
    You could make a filter network with an induction coil, capacitor, and a digital resistor. The filter network will output the highest voltage when tuned to the frequency you are testing. Use an ADC to convert that output voltage to a digital word. Use the Stamp to monitor the output voltage digital word and have the Stamp adjust the digital resistor to achieve the highest filter output voltage. The value of the digital resistor register in the Stamp will give you an indirect reading of the frequency you are testing.
    The sample rate is still limited to the speed of the Stamp of course.

    This is assuming your need is to determine the exact frequancy of the signal you are testing. Otherwise... Never mind.
    More details would help.

    Post Edited (LilDi) : 10/21/2007 7:03:52 PM GMT
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-21 19:13
    Yes, I'm trying to take a measurement between two objects to a resolution of about an inch. I've come across some laser rangefinders that have 1.5 mm resolution, so it seems to me there must be some counter chips and clocks that can run at 12 GHz. But I need for my setup to use radio waves, not light. I came across the Stamp and the transmitter/receiver units and it seemed like maybe they would do the trick. Place one Stamp on the target object and have it in "receive mode", so that when it detected an incoming message from the other trnasmitter it simply replies back immediately with another message. The Stamp on the other object would start its counter, send a message via the radio link to the target object, wait for the reply, and stop and read the counter. Of course, it would have to subtract the "processing time", i.e. the time that the target object takes in recognizing the incoming message and sending the reply, in order to determine the actual total radio traversal time, then dvide by two to get the "distance".
    From prior comments on this topic it's clear I'd need a 32-bt counter, since the 16-bit counter would no doubt cycle several times during the full process.

    So, does this sound reasonable?
  • LilDiLilDi Posts: 229
    edited 2007-10-21 19:30
    Roger,
    That would be like trying to measuring the width of a molecule with a yard stick. Before the stamp at either end can even begin to execute a line of MPU micro code, the 12ghz signal will have traveled to the object many hundreds of times.

    I'm not real sure on this, but I think dopler sensors may be able to measure the distance to an object with this high of a frequency.

    Good Luck,
    If you find a solution I'm sure others here would like to here about it. Keep in touch!

    Post Edited (LilDi) : 10/21/2007 7:40:33 PM GMT
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-21 20:12
    Roger,

    No, it doesn't sound remotely reasonable. It's simply impossible for a BASIC Stamp to respond with the picosecond accuracy your app requires. LilDi's simile, "That would be like trying to measuring the width of a molecule with a yard stick," is apt.

    -Phil
  • TechnoRobboTechnoRobbo Posts: 323
    edited 2007-10-21 20:15
    12 GigaHertz Radio waves would be microwaves perhaps you could look for satellite circuitry to do the job.

    I could be wrong but I think those laser rangefinders are actually Interferometers which work with beat frequencies and not frequency counters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Have Fun


    TR
  • BeanBean Posts: 8,129
    edited 2007-10-21 20:50
    Roger,
    · Is there any possiblity of using ultrasonics ? That would make the project much more manageable / practical. And still be able to get 1" resolution.

    · Check out the Parallax Ping sensor http://www.parallax.com/detail.asp?product_id=28015

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My goal is to live forever...Or die trying.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • LilDiLilDi Posts: 229
    edited 2007-10-21 21:23
    Roger,
    Another issue, along with Bean's thinking, Frequencies that high tend to penetrate objects rather than reflect off the surface. That would give you inaccurate readings depending on the density of the object. That's closer to a MIR (micro power inpulse radar) that can see through objects and reflect back an image of the inside or on the other side of an object.
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-22 04:30
    Neither ultrasonic nor laser ranging will work in my application because there generally will not be line-of-site view to the traget object (and I also don't need to know which direction the object is in). I think only a radio transmission approach will work. As for the high frequencies (12 MHz), they only apply to the counter circuitry, not to the radio transmission. Even if the counter circuitry gives off some high frequency RF, I suspect that could easily be shielded if necessary.

    My initial idea was for some kind of transponder on the target object, a simple receiver/transmitter that would operate in receive mode and, when it detected an incoming transmission with a particular encoded value (e.g. to identifiy which transponder was being "queried" for its range) would respond by transmitting back with another encoded value. The device doing the querying would be the one with the counter circuitry; it would zero the counter, start it counting, send out a coded value via its radio transmitter, wait for the return coded transmission, stop the counter, read the value of the counter, subtract the appropriate amount from that value (which is due to "processiong time") to arrive at the total actual transmission time, i.e. how long the radio wave took to get from the transmitter, to the transponder, and back to the receiver, divide by two and get the range between the objects.

    When I came across the Stamp (Propeller/SX) I thought maybe it would simplyify the design and reduce how much cicuitry I had to have designed and built. But maybe not. Maybe I need to go back to mostly specially-built circuitry. So, I guess I need someone who could handle that kind of design.

    Any suggestions?

    - Roger
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-22 06:16
    Roger,

    In any tuned circuit time-of-flight system such as you're proposing, the uncertainty in a wave pulse's time of arrival will be inversely proportional to its carrier frequency. What this implies is that your carrier frequency will have to be several times greater than the 12GHz counter frequency in order to keep the time-of-arrival uncertainty within specs. Also, in non-line-of-sight situations, there will be multi-path issues, wherein the arriving wave pulses can be distorted by having traveled over different routes, due to reflections along the way.

    A system that might hold some promise would use ultrawideband (UWB) transmissions, which consist of coded, picosecond bursts, whose energy is spread over a wide spectrum. (Zigbee is an example of UWB radio.) By syncing to these coded bursts, you may be able to get the accuracy you're after. But I have no idea what devices are available to do this or how it might be implemented. If you Google uwb transponder, you will get a host of links.

    -Phil
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-22 19:31
    Wow, and I thought this was going to be an easy project to implement!

    Thanks to one and all for your comments on this issue. I really appreciate your taking the time to consider my posting and provide feedback.

    Let me explain what it really is that I’m trying to do, and maybe it will prompt some ideas or alternative approaches…

    My brother has over fifty acres of Christmas trees. The grass between the trees needs to be mowed about every three weeks. That’s a tremendous amount of labor, so I was trying to come up with an automated robotic mower that could handle the work for him. I’m a software engineer, and am pretty certain I can come up with a comprehensive approach to the robot control (software) issues.

    The one prime problem is letting the robot know where it is as it traverses the field, maneuvering between the trees. A random walk / bump-and-turn approach isn’t suitable since a random walk (as is so often used with small yard mowing robots) is incredibly inefficient and, although bumping into the trunk of a mature (four-to-five year old) tree would do no harm to the tree, the field also has thousands of seedlings (one-to-two year old trees) which are only a foot or so high and are indistinguishable, to any bump-detection hardware, from the grass and weeds, so it would simply mow right over the seedlings. No optical system exists that could actually “see” and recognize the trees. Indeed, even when my brother is doing the mowing it’s sometimes difficult for him to see the seedlings amongst the weeds and grass.

    So, I figured I needed some form of positioning system, so that I could define the boundaries and also define the position of each and every tree in the field. That might sound like an incredibly labor-intensive job, but it would actually take no more labor than one complete mowing of the field, walking through each row and electronically recording the position of each tree (with a suitable position recording device).

    GPS is the “obvious” first thought. But GPS only has a resolution of about three to four feet. Since the trees are only six feet apart that simply won’t do. I figured I needed some kind of LPS, Local Positioning System, with some form of beacons or otherwise stationary posts from which the robot can determine its position. Laser pointers and sonic approaches won’t work because the line-of-sight to the beacons would generally be obstructed by the trees. (MAYBE the position detector could be mounted on a tall shaft on the robot so that it’s taller than the tallest tree, about ten feet, but I’m concerned that the uneven motion of the robot would cause the shaft to wobble so much that it would make position-determination very difficult and unreliable). Sonic detection would suffer from the same trees-in-the-way problem, as well as the distance to the beacons (several hundred feet).

    So, I thought of radio. I had hoped that radio would be less suseptable to intereference by obstructing trees. But it seems that, in order to get the needed resolution (at most a foot resolution, ideally an inch resolution, but perhaps suitably a half-foot resolution) the radio frequency needs to be in the microwave range. Since microwaves are notoriously obsorbed by water my positioning system would be more likely to cook the Christmas trees than to provide any meaningful position information. Again, I suppose it’s possible to position the detector on a tall shaft on the robot and simply go over-the-heads of the trees.

    Phil notes that uncertainty in a wave pulse’s time of arrival is inversely proportional to the carrier frequency, meaning that the longer the wavelength the more uncertain is the measurement of its arrival, so if I’m trying to determine the robot’s position to within an inch, but the uncertainty is a foot, the measurement cannot be relied upon. I think I’m here but I’m really there, mowing down another seedling. So I’m thinking. Maybe all I need to do is perform a whole slew of measurements at a given position and average them. Well, no. If the uncertainty described a nice uniform Bell curve that might work. But I suspect that the shape of the “uncertainty curve” is significantly dependent upon way too many factors (e.g. the trees between the robot and the beacon) to be of any use.

    Then again, if I have a large number of beacons and take measurements from each one, the uncertainty might get sufficiently low to become a reliable measurement. Maybe?

    Or maybe there’s some incredibly cheap device (an RFID chip) that I could place on each tree trunk that could be detected by the robot ???

    Suggestions are welcome !


    - Roger
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-10-22 20:20
    GPS is regularly used in ag apps where precision navigation is required — down to centimeter accuracy, if you need it. Check out Trimble for an example.

    -Phil
  • BeanBean Posts: 8,129
    edited 2007-10-23 02:16
    I would use a buried wire with a robot that follows the wire (instead of using the wire as boundary).
    It would be coded similar to a "line following robot".

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    My goal is to live forever...Or die trying.
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.hittconsulting.com
    ·
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-23 04:30
    Bean,

    Using a buried wire might be one approach. But for fifty acres of fields laying out the track between rows of trees six feet apart that's an awfully lot of wire and a tremendous amount of labor (and I'm guessing a lot of energy to power the wire). In addition, as the years go by and trees are cut down and new ones planted, the new rows do not necessarily line up with the old rows, meaning pulling up old wire and burying new wire.

    - Roger
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-23 04:36
    I've started looking at microwave transmitters/receivers, and they seem to be around $300 each, kind of high for my budget, since I'll need at least four pairs of them. But I don't really need a full transmission/reception. That is, I don't really need to be transmitting actual data, just a single pulse in the mocrowave range for the "transmitter" and a similar "pulse detector" for the receiving end. Does anyone know of a way to generate/detect simple microwave pulses, or devices that do that?

    - Roger
  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-23 05:13
    Roger,
    What's wrong with the high precision GPS (other than cost maybe?) It sounds like it could give you the accuracy you need and would come ready-made.
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-23 05:57
    Mike,

    Well, I've found a few companies that describe their high performance GPS instruments for agricultural applications. Although they don't lst their prices, their descirptions and intended applications (HUGE farms) give me the impression that they are VERY expensive. My hope was not just for using it at my brother's farm but making something marketable to similar "small" agricultural operations.

    If I can actually find some prices I'll be able to make a better decision on that.

    - Roger
  • Larry SutherlandLarry Sutherland Posts: 77
    edited 2007-10-23 07:48
    Ask the Menehunes...
  • RogerInHawaiiRogerInHawaii Posts: 87
    edited 2007-10-23 18:36
    "Ask the Menehumes" ???

    Please explain.
  • LilDiLilDi Posts: 229
    edited 2007-10-23 19:51
    Like Pixies, Trolls and Leprechauns believed to inhabit the islands.
Sign In or Register to comment.