Shop OBEX P1 Docs P2 Docs Learn Events
frequency gen — Parallax Forums

frequency gen

DunnseptDunnsept Posts: 115
edited 2008-02-12 13:40 in General Discussion
Hi guys!
I've been away far too long and I've gotten out of practice in SX land.
I'm trying to make a square wave generator that I can adjust from about oohhh say 75khz up to about 450khz
is this going to be do-able on the SX? Like I said, I'm having trouble getting back into the thing.
I grabbed one of the examples and just have a toggle RA.1 and my scope shows this at 8.5khz with my SX clock set to 4mhz
I do have the pieces parts to set it to run at 50mhz. Because I just scabbed that code, I dont have anything I can post to start.

in the big picture, I want to sweep that frequency range and at the same time have a current sensor to figure out at which point in that frequency range I get the highest current flow, if that helps or makes any difference.

thanks

paul...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
stand back! I have a slide rule and I know how to use it!

Comments

  • BeanBean Posts: 8,129
    edited 2008-02-11 12:53
    Paul,
    · I'll assume you are using the SX28. I have attached a program that will generate the frequencies.

    · If you are using the SX48 the task is much simpler because you can use one of the hardware timers. Therefore no interrupts to mess up the timing of the foreground program.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com
  • DunnseptDunnsept Posts: 115
    edited 2008-02-11 13:22
    thanks bean!·· been a long time.

    I have a couple sx48 protoboards that I can· use, no problem. I would probably use one any way because I will want to hook up some sort of display so that when it finds the frequency with the highest current, that frequency will be displayed. and the 48 will give me a little more room.·

    graphing the current vs freq on a graphic LCD would be really cool too ;-) but first things first.

    why?·· to help me get these things http://www.youtube.com/watch?v=ku5nZionoRs· tuned. tuning "by hand" is a PITA and the calculators for the frequency can be way off


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    stand back! I have a slide rule and I know how to use it!

    Post Edited (Dunnsept) : 2/11/2008 1:27:06 PM GMT
  • BeanBean Posts: 8,129
    edited 2008-02-11 14:22
    Paul,
    · WOW! Do you sell these ?

    · Here is the code for the SX48. I don't have an SX48 available at the moment to test this code.

    · How do you plan to measure the current ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    www.iElectronicDesigns.com
  • DunnseptDunnsept Posts: 115
    edited 2008-02-11 14:32
    nah.. I'm just getting started building them. I have a new video of it to upload, but forgot the tape.
    for measuring the current, I was looking at one of the maxim high side current-sense ICs. Analog makes some too. both output a voltage proportional to the sensed current.
    the output of this will drive a TI mosfet driver, driving of course, a mosfet. when the input frequency matches the resonant frequency of the coil, current is at it's highest because inductive and capacitive reactance is at a minimum and the coil is seen as (almost) a purely resistive load

    wanted to mention too, congrats bean. looks like SX/B has really come a long way. I hardly recognized it ;-)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    stand back! I have a slide rule and I know how to use it!

    Post Edited (Dunnsept) : 2/11/2008 3:10:03 PM GMT
  • DunnseptDunnsept Posts: 115
    edited 2008-02-12 03:15
    Bean!· you rock.
    put this together on an SX48 protoboard. calculated freq is 74.850
    I hooked it up to my scope, actual freq = 74.943

    thanks.
    now I just have to figure out why my hc4 quits working after it hits 240khz (all I'm displaying is the int part of khz)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    stand back! I have a slide rule and I know how to use it!
  • datacpsdatacps Posts: 139
    edited 2008-02-12 03:26
    DUNNSEPT let me know what chip you are using to sense current I have a project that needs to sense current. The freqout on the SX chips are awesome.
  • DunnseptDunnsept Posts: 115
    edited 2008-02-12 13:40
    I'm looking at the maxim-ic MAX4080 and others in that series. I haven't dug into the datasheets deep enough yet to know exactly which one I want. but likely one in that line

    Paul...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    stand back! I have a slide rule and I know how to use it!
Sign In or Register to comment.