Simple Square Wave Generator

DETAILS
I needed simple square wave generator with changeable frequency so I came up with that project.

It is so simple because all settings are changed by computer through USB port.

It’s build on ATtiny45, which is small but power-full non-expensive micro controller from Atmel.

CIRCUIT
It’s the simplest possible circuit that I could came up with. I didn’t made a PCB layout because I have it on protoboard for now.

CODE
Both firmware and the host side are written in C and available under GPL license. Code is under development. If you like to help me or you know how to improve it, please send me a mail to dejan [at] dejanlevec [dot] com.

In the archive you can find firmware code, host side code for Mac and executable command line tool for changing speed on SSWG builded for Mac OS Leopard (10.5.6).

Download firmware code and Mac host side code -http://www.dejanlevec.com/code/Microcontrollers/SSWG/SSWG_Mac.zip (version 1)

WINDOWS – HOST SIDE
Version 2:
Download GUI’s source, DLL’s source and firmware’s source and drivers (version 2) -http://www.dejanlevec.com/code/Microcontrollers/SSWG/SSWG2_WIN.zip – everything for using SSWG on Windows XP/Vista/7

Old (version 1):
Download GUI (version 1) (.exe + .dll) – http://www.dejanlevec.com/code/Microcontrollers/SSWG/SSWG.rar
Download GUI source (version 1) (Visual C# 2008, .NET 3.5) -http://www.dejanlevec.com/code/Microcontrollers/SSWG/SSWG_GUI.rar
Download drivers (version 1 & 2) -http://www.dejanlevec.com/code/Microcontrollers/SSWG/SSWG_drivers.rar (libusb – win32)

DLL functions: – void DllInit(); <–connecting to the device (you must run before using SetSpeed and SetMSSpeed) -bool SetSpeed(int speed); <– setting speed in seconds, function won’t return anything -bool SetMSSpeed(int speed); <– setting speed in mili seconds, function won’t return anything -void DllClose(); <– closing connection to the device (you must run it on the end of your program)

When you plug in SSWG, you will need to specify path to the SSWG drivers (32 bit or 64 bit). Then you can change speed by running SSWG GUI (.exe file).

USING THE COMMAND LINE PROGRAM FOR MAC/LINUX (VERSION 1)
For select the frequency in seconds: ./frequency speed 10 – this is for 10 seconds

For select the frequency in mili seconds:
./frequency msspeed 10 – for 10 ms

Get the current frequency:
./frequency status – doesn’t work at this time!

LINKS
http://www.obdev.at/products/avrusb/index.html – AVR USB project from Objective Development on which this project is based.

http://www.atmel.com/ – Atmel web page

http://www.cadsoft.de/freeware.htm – Eagle program for drawing schematics and PCBs working on Mac, Windows, Linux – Non-profit freeware edition available!

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>