Storing Cookies (See : http://ec.europa.eu/ipg/basics/legal/cookies/index_en.htm ) help us to bring you our services at overunity.com . If you use this website and our services you declare yourself okay with using cookies .More Infos here:
https://overunity.com/5553/privacy-policy/
If you do not agree with storing cookies, please LEAVE this website now. From the 25th of May 2018, every existing user has to accept the GDPR agreement at first login. If a user is unwilling to accept the GDPR, he should email us and request to erase his account. Many thanks for your understanding

User Menu

Custom Search

Author Topic: Open Source 3 Channel Frequency Generator  (Read 38875 times)

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #15 on: October 20, 2008, 05:48:10 PM »
Hi ist,

For just PWM it would probably work out cheaper to use some dedicated chip for PWM generation. But if you want the screen for displaying freq and duty then a microcontroller like this can't be beaten.

If you get yourself an Arduino or Freeduino board from www.nuelectronics.com then I would be able to post you source code to generate PWM with it. Trouble is that nuelectronics are currently out of stock on the LCD modules, but they have just released a 4k colour 128x128 pixel screen addon for £20. The screen is a nokia unit and you could display realtime scope image of the generated PWM waves, it could be pretty cool!:

http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=10

nuelectronics are also really good, fast and cheap on international shipping, and they take paypal, I think they have great stuff at great prices!

Best, Yucca.

z.monkey

  • elite_member
  • Hero Member
  • ******
  • Posts: 1660
    • Scientilosopher's Domain
Re: Open Source 3 Channel Frequency Generator
« Reply #16 on: October 20, 2008, 06:28:53 PM »
Howdy Yucca,

So your Arduino/Freeduino boards are prototyping boards?  What kind of processor are you using?  The DS1085 chips are serially programmable and you have an SPI port going from the processor to each DS1085.  I love those tricky little Dallas Semiconductor parts.  I live close to their plant.  So then the signals from the DS1085 go out to some power amplifiers?  What are you using for a power supply, and power amplifiers?  I noticed that you are using C++, ever get into assembly language?

I have a number of products based on Microchip Microcontrollers.  Some of these products are USB slave devices, and when in high speed mode I can get 48 MHz processor clock speeds and 96 MHz USB clock speeds.  I frequently use Hitachi LCD display products when I need to have a visual display.  Mainly I only use text displays, for cost effectiveness.  However Microchip has some new microcontroller products that have enough computational horsepower to run a QVGA GUI.  So I have been thinking about making a new visual platform which is a touchscreen GUI which is microcontroller based.  My product sales haven't been very good this year for the microcontroller based products so any new project will probably be at the hobby level and not a production level device.  I program in assembly language and compiler BASIC.  My BASIC compiler is designed around Microchip's ampasm, so I can use assembly statements in line with BASIC statements, and also write my own macros.

Had you planned on making a system overview drawing?

If you are looking for LCD deals check this place out.  http://store.earthlcd.com/

OK, Mo Later...

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #17 on: October 20, 2008, 08:05:31 PM »
Hi Z.Monkey,

Quote
So your Arduino/Freeduino boards are prototyping boards?  What kind of processor are you using? 
The boards come with 16MHz ATMEGA168 8 bit RISC 32K Mem.

Quote
The DS1085 chips are serially programmable and you have an SPI port going from the processor to each DS1085.  I love those tricky little Dallas Semiconductor parts.  I live close to their plant. 

Yes, I've still got to write the code to program them up. Great parts, only 8 pins but can do so much via the SPI.

Quote
So then the signals from the DS1085 go out to some power amplifiers?  What are you using for a power supply, and power amplifiers?

The unit has a small 5V supply for the MCU. I  will have my variable voltage and current benchtop supply go into the unit, this will then be chopped by the FETs in the unit. My FETs will limit my output freq. to ~25MHz but I might get faster ones in future.

Quote
I noticed that you are using C++, ever get into assembly language?

I've worked with assembly quite a bit, the good thing about C/C++ is that you can embed an assembly routine right into the code if you need fast bits just like what you're doing with ampasm. I used to work with 68000, 68HC11 and Z80 quite a bit and have done pure assembly on those, takes longer as you know but you can get nice optimised fast routines. I've noticed though that modern compilers tend to be alot cleverer with regard to optimising nowadays and I seldom need to use assembly but I still do now and then even when windows programming.

Quote
Had you planned on making a system overview drawing?

Yes, I should do that, when I've finished and settled on how I want it I will make a block diagram using a paint package.

Cheers for the link, some very fancy LCDs on that site :)

Best, Yucca.

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #18 on: November 23, 2008, 02:42:46 AM »
OK, finally got my Arduino to talk to the DS1085. That was the most difficult peripheral chip I´ve ever worked with! But it´s very sweet with less jitter than I expected, looks nice and stable on scope.

Have tested my FET drivers and they are  good for up to only 21MHz.

The unit will now only be 2 channel:
channel 1 for LF (DC ... 1MHz)
channel 2 for HF (8.2kHz...21MHz)

I´ve also put a thermometer device in that will enable the arduino to monitor the heatsink temperature and then disable output and sound a small audio alarm signal if the sink exceeds a set temp. It should help save FETs.

Now I just need to complete all the other hardware.  When finished I´ll take a few more photos of it.
« Last Edit: November 23, 2008, 03:10:49 AM by Yucca »

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #19 on: December 10, 2008, 11:41:12 PM »
Now that's cool!
I ordered an Arduino Duemilanove some days ago, today I got an email it got shipped. And just NOW I find this thread - I guess my weekend is planned now! :D
Great job Yucca, just what we all need!
When I get my Arduino board, I'll try my best to replicate your PWM circuit. Hope you don't mind a question now and then. :)

Talk to you soon :)

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #20 on: December 11, 2008, 03:17:12 AM »
Thanks europeanhillbilly (Nice handle by the way!)

Fire away with any questions as and when you want.

If you want to just build the low freq version to get started then just buy yourself a LCD shield, quite cheap and fast ship to europe and its pin compatible with the Duemilanove:

http://www.nuelectronics.com/estore/index.php?main_page=product_info&cPath=1&products_id=2

with just that and your arduino board you will get 5V 20mA PWM generator with adjustable freq and duty cycle by loading up the program listed on page one of this thread.

The only hardware work you will need to do is to clip or solder a single lead to one of the port pins and then use that output wire to drive FETs on breadboards etc.

Yucca.

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #21 on: December 11, 2008, 06:43:56 PM »
Great, I'm about to order the LCD keypad shield and a ProtoShield Kit. Thanks!

One killer feature would be to have a shunt connected to the Arduino that measures the amp draw. The Arduino could then figure out the duty cycle to keep the load at that power level.
Any suggestions? :)

What you call LF (is 1Mhz really so low? ;) ) should be enough for the first tests. This may be a stupid question, but the arduino page says the hardware has multiple pins configurable as PWM output. I guess then those pins can only be driven by *one* frequency at a time, is that right?

I'm really looking forward to this, hope you don't mind me being a total newbie with microcontrollers. :/

Greets, ehb

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #22 on: December 12, 2008, 11:04:37 PM »
Great, I'm about to order the LCD keypad shield and a ProtoShield Kit. Thanks!

One killer feature would be to have a shunt connected to the Arduino that measures the amp draw. The Arduino could then figure out the duty cycle to keep the load at that power level.
Any suggestions? :)

What you call LF (is 1Mhz really so low? ;) ) should be enough for the first tests. This may be a stupid question, but the arduino page says the hardware has multiple pins configurable as PWM output. I guess then those pins can only be driven by *one* frequency at a time, is that right?

I'm really looking forward to this, hope you don't mind me being a total newbie with microcontrollers. :/

Greets, ehb

Yes the arduino has a few PWM pins and you can generate I think 3 different freqs, I´m just using one PWM output. Unfortunately the LCD and jogwheel take up the others.

1MHz is fairly quick, but it´s LF. I want HIGHER! I would like to goto GHz in the end, but this I don´t know enough about when it comes to stable(ish) oscillators and amps,.

I will be adding a software gate function to the LF channel this will vork in the ELF to VLF band range. And then you will be able to generate Meyer like waveforms.

I am thinking about current sensing at the moment, a shunt would certainly be a good way of measuring RMS amps via one of the ADC pins. Will have to smooth output with a parallel RC circuit prrior to sampling because the sample rate is quite slow.

Microcontrollers are easy with the Arduino, Just need to know a little C or C++. The free dev environment is really simple to setup, just plug the board into USB and go!

What are you going to use it for first, HHO?

Yucca.

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #23 on: December 12, 2008, 11:22:14 PM »
I was just re-reading your posts and the code here :)
HHO will most likely be my first use, yes.
Although I would also like to test PWM with a plasma electrolysis cell. Not sure what parts I'd need for switching 300VDC though.

I need to crawl before I walk, so my first use would be dimming an LED :D

I got the Duemilanove in my hands right now, sweet small piece of hardware. I haven't coded in C yet, only 'stupid people' stuff like ruby, php and some ecma script. Will need to wrap my head around it, but should be managable. Haven't done alot with electronics yet either, so yeah, I'm a bloody beginner.

I'd be really thankful if you'd manage to find a way for measuring the amps. Have you heard of the "HHO VMU"?
http://www.xo1ox.net/hho/shop/item.asp?itemid=33
Seems to be a good product, but open source is always a better way :) Reading up on some arduino libraries, OBD monitoring could well be on the feature wishlist for 2010 or so ;)

I haven't ordered an LCD shield yet, will do right now. Do arduinos tend to be easily breakable? Then I'd order a second one, just in case.. (now that I need to order in GB anyways)

Cheers and thanks for your efforts, ehb

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #24 on: December 12, 2008, 11:49:53 PM »
Yes I´ve seen the VMU, it is indeed a sweet little unit.

I also have another project on my bench at the moment called HHOBox.

http://www.HHOBOX.com

It´s still in devmode but preliminary specs are:

DC...1MHz
PWM
Gating
1 channel RMS Amps
FET Heatsink Temp
CELL Temp
EFFIE up to four sensors
Audio alerts

Yucca.

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #25 on: December 13, 2008, 12:01:12 AM »
ehb,

IRF 730s go up to 400v, each FET can handle about 5amp, you can parallel them for more current.
http://www.datasheetcatalog.org/datasheet/fairchild/IRF730.pdf

Arduinos are as tuff as any PCB I think, but the stackable shields will fall apart if shaken too much, nothing a few rubber bands won´t stop though ;D

Yucca.

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #26 on: December 30, 2008, 09:01:47 PM »
Hey Yucca and all others interested,

I received my LCD shield today, hooray! Looks cool, esp. for that price (man the british pound is down) :D
So now I wanted to go ahead and load up your source code, and realized you've taken it down. Humm :)
It would be nice if you could post the source code in .txt form here, or maybe use http://pastebin.com/
I'd be grateful, I'd love to break some fets soon :)

Greets, ehb

Yucca

  • Hero Member
  • *****
  • Posts: 884
Re: Open Source 3 Channel Frequency Generator
« Reply #27 on: December 31, 2008, 01:18:58 AM »
Hi EHB,

I've attached it to this post as a .txt file, just copy and paste into your Arduino.exe programmer/editor and compile.

You will have to add the LCD4Bit_mod library to the project.

I've just read that nuelectronics have changed the LCD board since I purchased mine and they use a pin that I have used for the piezo, so you may have to mod the pin assignment for the piezo in the code. It should work ok though as long as you have the modified library from nuelectronics.

Let me know how it goes. :)

Yucca.

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #28 on: December 31, 2008, 02:17:15 AM »
You're da man!  ;D
I'll try it asap, first sleep.

Thanks alot! :D

europeanhillbilly

  • Newbie
  • *
  • Posts: 25
Re: Open Source 3 Channel Frequency Generator
« Reply #29 on: December 31, 2008, 06:35:52 PM »
It works like a charme, at least the LCD says so :)
Great work man.
Only problems I had were with the includes of io.h and interrupt.h. Arduino0012 software reports: "23: error: interrupt.h: No such file or directory".
Prefixing the filenames with avr/ fixed this problem though.

Now I've gotta figure out how to attach a jog wheel and lateron the mosfets.
I'll get an oscope tomorrow, so I can check the output frequencies.

Really cool stuff, now go out and celebrate new year :)