Shop OBEX P1 Docs P2 Docs Learn Events
Frequency to frequency converter — Parallax Forums

Frequency to frequency converter

Alex41Alex41 Posts: 112
edited 2007-06-21 18:24 in General Discussion
Hello,

I read about the stamp microproccessors on this site with great interest.

I am looking for a frequency to frequency converter. Something to take a frequency input and either output a slower or faster frequency output by a linear or non-linear amount.

Is this possible and where do I look to get started? Sprcifically which product will do this?

The application is modifying the output of a MAP (Manifold Air Pressure)·sensor on a car.
The frequency range is 80 hz to 160 hz. I would either like to speed up or slow down the frequency. Either by just 20hz or maybe change the output by 20%. These are just examples, it would need to be adjustable for fine tuning.

Will these do square wave and/or a sine wave?

Will these products do such a thing?

Thank you in advance for any help,
Alex

Comments

  • pjvpjv Posts: 1,903
    edited 2007-05-30 03:16
    Hi Alex;

    Personally I'm not familiar with the Stamp series, but I can tell you that this can be done with one of the SX processors........ that is, if you program it that way. Possibly SX/B is your answer; again, my experience at that is limited, but with assembler it's a definite YES!

    Cheers,

    Peter (pjv)
  • Tracy AllenTracy Allen Posts: 6,657
    edited 2007-05-30 04:19
    There was recently a thread on a similar topic on the Stamps forum, which then moved to the Propeller forum when it was thought the Stamp was not quite fast enough. And the SX chip could do it too. How hard it is to accomplish will depend on the timing parameters need to be controlled.
    Here are the links:

    http://forums.parallax.com/showthread.php?p=651534
    http://forums.parallax.com/showthread.php?p=651537

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Alex41Alex41 Posts: 112
    edited 2007-05-31 00:30
    Thanks so much for the replies.

    I'll look more into the various processors and what their capabilities are now that I know that this can be done.

    One comment though. I called tech support after I posted on here and the guy on the phone said it could't be done as there is no way in the programming to read an input frequency. Is this true? or was he just talking about the stamp proccessor?

    Thanks again,
    Alex
  • Tracy AllenTracy Allen Posts: 6,657
    edited 2007-05-31 01:58
    The COUNT command on the Stamp is quite good at reading input frequencies.
    COUNT cpin,duration, result
    That counts the number of cycles at the cpin (which can be any of the Stamp's input pins), and does it for a duration that you specify (milliseconds on the BS2 and BS2e--the units of duration are a little different on the other Stamps). At the end of that time, the result holds the count, and count/duration = frequency.

    For your application though there is the difficulty that you probably want your output in a regular beat at practically the same time as the input. The Stamp is single tasking, i.e., while it counts it will not be doing anything else. That was the same difficulty in the link posted, and there are several possible solutions. You will get the most flexibilty from a faster processor that can do two things at once, in fact or de facto, like the Propeller or the SX.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com

    Post Edited (Tracy Allen) : 6/1/2007 1:34:20 AM GMT
  • Alex41Alex41 Posts: 112
    edited 2007-05-31 19:54
    Tracy,

    Thanks so much for your help. Seems like the stamp isn't quite capable enough for my application. In your opinion which would be easier to apply to my project? The Propeller or the SX? Which one is easier to program and set up?

    Will these processors put out different waveforms? At this point I am not sure which is acceptable for my vehicles computer. Further testing will answer that. First I need something that puts out a wave form!!

    Thanks again,
    Alex
  • Tracy AllenTracy Allen Posts: 6,657
    edited 2007-06-01 05:30
    It's hard to know what to recommend--I don't know what kinds of things you consider "easier". wink.gif

    My first instinct would be for the Propeller, because it offers more independent resources for timing, and it would allow for future expansion without disrupting the timing loop. On the other hand, the SX could handle this task in a very straightforward way, at least in assembly language and maybe also in SX/B, and the result would probably be cheaper to produce if you need to make more of them. Difficulty of programming on either processor depends on the details of the timing requirements, and it sounds like you are still looking into that. Never assume that it is going to be easy, unless you can buy it ready made! wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • Alex41Alex41 Posts: 112
    edited 2007-06-03 00:41
    Tracy,

    Yes, easy is a relative term. I do have some programming experience from high school and college. I did buy the STAMP kit at Radio shack the other day and have been playing with it. It doesn't seem hard. -I know - I say that now- The programming terminology refreshes my mind to programming.

    I understand the stamp isn't fast enough for what I need to do, but gets me to understand this stuff better. I can already see the ways this chip can help me out with other tasks.

    On the Parallax site I'm not getting too smart on the differences between the SX and propeller chips. Cost is an issue as I may make more of these.

    I see the propeller chip has a keyboard and screen available. Can I change the programming using this directly? Or do I need to be connected to a PC?

    I assume the stamp, SX, and propeller chips all use different programming language? Or are they common? I mean the programming that I input into an editor? I understand it gets translated into a language the board can use, but as to what I see in the editor is different?

    Thanks so much for your help,
    Alex
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-06-03 15:03
    Alex,

    Currently you cannot develop using the attached peripherals on the Propeller. You still need a Windows 200/XP PC computer. The BASIC Stamps use PBASIC, the SX uses SX Assembly or SX/B and the Propeller uses its own Assembly as well as the higher level SPIN language. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • metron9metron9 Posts: 1,100
    edited 2007-06-05 12:54
    I am trying to get up to speed (no pun intended) understanding MAP sensors. I read a pdf file (attached). The MAP sensor outputs a voltage based on the difference in pressure between the vacuum pressure and intake manifold. So you have a pulse but it may be 0 to 1.1V up to 3.9V or something in that range. Do you need to know the voltage as well as the pulse rate? If the output is only 1.2V at low speeds don't you need a voltage shifter as well to read the pulse as 1.1V is not high enough to transition a pin from 0 to 1.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
    pdf
    261K
    h35.pdf 260.9K
  • Alex41Alex41 Posts: 112
    edited 2007-06-05 13:54
    Metron9,

    so far I have come across 2 different kinds of sensors that sense the amount of air going into an engine. one is the MAP - Manifold Air Pressure sensor and the MAF - Mass Air Flow.
    It appears the MAP was used on earlier modles and the MAF on later models.
    Both also appear to use different signals to the ECU.
    some are based on a different voltage based on the manifold pressure, some have a variable frequency output instead of the voltage.

    Hope this helps,
    Alex
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 05:44
    Alex,
    What type of MAP sensor is it I dont knowof any Frequency type only the Voltage type? What model and make car did it come off of? What you are trying to do is make a MAF translator right?

    The one like for my truck 91' Chevy TBI injected (only a map sensor no MAF) is a·variable 5vdc signal comming from the MAP sensor.
    My 96 buick Riviera has a MAP and·a MAF and the MAP is a 5vdc signal and the MAF is a analog voltage also.

    I did find that their are some Frequency type out their but they wont be any harder to work with. Look at this paper.http://www.egr.msu.edu/autoweb/Class/Fall99/Presentations/maflow1.pdf

    As far as the analog voltage sensors you can use a 8 bit A/D chip to read the 5vdc signal then use a Digital pot to output a 8 bit signal proportional to what you set it.

    Post Edited (bennettdan) : 6/6/2007 6:01:26 AM GMT
  • Alex41Alex41 Posts: 112
    edited 2007-06-06 18:53
    How do you do that conversion with a 8 bit A/D converter. I like to keep things simple and that seems easier than a SX chip and all the programming involved.
    My 1989 Ford had a freq output MAP and later model GM also has a freq MAF.
    You sure you have a MAF and a MAP? Is one possibly the Air temp sensor?
    Thanks,
    Alex
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 21:48
    ALex41,
    You still use a Microprocessor and then use a 8bit A/D (Analog to Digital) converter to convert the 5vdc voltage comming from the MAP sensor to a digital signal with 255 steps which is about .02 volt resolutions per step. Then the Micro uses that data then scales it then outputs a voltage from the digital pot which is also a 8 bit 255 steps. This would only work on a variable voltage sensor like on my 91 Chevy MAP sensor. You could aslo use a 10 or 12 bit A/D converter and digital pot that would give you more resolution.

    I have a MAF and a MAP sensor on my Buick because it is supercharged and it reads the MAP sensor to know the boost pressure.

    As far as using the frequency variable MAF and MAP sensors you can read the frequency then use a Micro to scale the frequency then output the scalled frequency to the cars ECU.

    The SX is a real nice chip and you could use the SX48 protoboard to build your circuit and then you would have the hardware timers to count and send out the frequencys.
    here is the link to the SX48 proto http://www.parallax.com/detail.asp?product_id=45300
    also you will need a 50mhz resonator http://www.parallax.com/detail.asp?product_id=250-05060
    and the SX key to program it. http://www.parallax.com/detail.asp?product_id=552-00007
    But instead of just the SX key alone I would recomend a SX tool kit that comes with the manuals and the Sx key and a few other goodies.http://www.parallax.com/images/prod_jpg/45181.jpg
    But you can download the SX key manual from the parrallax websight for free if you dont want a tool kit. I love working on EFI controls and would be glad to help out where I can.
  • bennettdanbennettdan Posts: 614
    edited 2007-06-06 21:59
    Alex41,
    You could get away with the SX blitz USB programmer http://www.parallax.com/detail.asp?product_id=45170 and the SX48 Prototye board and be about the same price as a Basic Stamp. Then use SX/b to progam it.
  • Alex41Alex41 Posts: 112
    edited 2007-06-12 12:56
    Bennettdan,

    thanks for the help.
    A solution is available for adding and reducing the voltage output of a variable voltage sensor. Let me know if you are interested in this.
    Now I need to figure out how to adjust the frequency output of a sensor. I'll order one of the SX toolkits here shortly. right now I'm going through the lessons of the stamp book.
    I'm slowly learning more about he capabilities in PBasic and have an idea of what I need to do - of course there are always a few things that go haywire in doing just about anything.

    Alex
  • PaulPaul Posts: 263
    edited 2007-06-14 21:13
    Look for a LM331. Its a Voltage to frequency converter. It also does Frequency to voltage!. Buy two. One F to V and the other V to F·about $1 each.

    Paul


    Post Edited (Paul) : 6/14/2007 9:21:07 PM GMT
  • Alex41Alex41 Posts: 112
    edited 2007-06-15 14:52
    Paul,

    ····· Thanks so much for the idea. I did look at the datasheet on the LM331 and it seems the lowest frequency it will do is 10khz. I'm looking for frequencies of about 100Hz. Much slower. I'll do some more research on this though, as it seems like a simple solution. Do you have any experience applying the LM331 chip?

    Alex
  • metron9metron9 Posts: 1,100
    edited 2007-06-15 17:43
    I made a little voltage to frequency converter using a tiny11 details here:

    http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=50491

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • Alex41Alex41 Posts: 112
    edited 2007-06-16 12:52
    metron9,

    the link didn't work for me. Could you doublecheck that for me?
    Thanks,
    Alex
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-06-16 13:01
    It's a valid link (even if it doesn't turn blue in the text.)· You have to copy it and then paste it in the address line up there.
  • Alex41Alex41 Posts: 112
    edited 2007-06-16 13:33
    I did copy and paste it. I'm on my handheld device right now, try it on a pc tomorrow.
    Alex
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2007-06-18 00:51
    Here is a nice appnote that shows how VtoF and FtoV building blocks
    can be used·in designs.
    http://ww1.microchip.com/downloads/en/AppNotes/00795a.pdf

    regards peter
  • Alex41Alex41 Posts: 112
    edited 2007-06-21 18:24
    Thanks to all for the input and ideas.

    I did look at the LM331 datasheet again and it is a bit unclear, but appears it can work down to about 100 Hz. I'll have to try that and see how it works.

    Also have the SX chip now and I'll see what I can come up with to get that to work.

    Thanks again,

    Alex
Sign In or Register to comment.