PopularFX
Home Help Search Login Register
Welcome,Guest. Please login or register.
2017-06-27, 13:22:57
News: A feature is available which provides a place all members can chat, either publicly or privately.
There is also a "Shout" feature on each page. Only available to members.

Pages: [1]
Author Topic: uC controlled signal generator ?  (Read 9051 times)
Full Member
***

Posts: 246
Hi

I need a little help from electronic guru experienced with AVR microprocessors. I learned Arduino and then found a way to use also Attiny45/85 chip and I want it to generate square wave. I tried the simplest way ,  setting digital output to HIGH or LOW with a simple delay_us() between. That way I can modify duty cycle and impulse time also. Seems to work fine but for higher frequency above 10khz I see on scope some echo signal . I have a feeling that it's because of time drift of delay_us function not representing exact time in microseconds.
Any way to make a reliable stable sharp square wave using Attiny45 with external 16mhz clock ? Any example ?
   

Group: Administrator
Hero Member
*****

Posts: 3475


Buy me some coffee
I've never used the AVR I'm all Pic micro

Surely it has a PWM dedicated unit you setup? you should be able to set Freq & Duty maybe.
   
Full Member
***

Posts: 246
Ok, so the solution is to use PWM ? If so then well...I have to learn how.  O0 Good to know, please confirm if I guessed
   

Group: Administrator
Hero Member
*****

Posts: 3475


Buy me some coffee
Well first you need to check that it has a built in PWM unit, then you should be able to google how to use it, not all Pic's have them but a lot do.

The trouble with trying to do it in software is that you need to be quiet experienced, i would work out my instruction execution times and calculate my max frequency using the instruction execution time.
Just 1 instruction can slow you down a lot.

So easiest is to use PWM unit
   
Group: Guest
It's a bit more costly, but has flexibility to go in whatever direction is truly needed:

http://open-source-energy.org/?topic=1334.0

I call it my SuperPulseGen.  Uses a Cypress PSoC 5 LP development kit and supports six channels each with phase, frequency and duty cycle control.  Good throughout the kilohertz range.

The good news is that there are now several PSoC 5LP platforms this can be moved to that are far less expensive.
   

Group: Administrator
Hero Member
*****

Posts: 3475


Buy me some coffee
Nice project there Matt

Here's one i designed and built to look into phase delayed pulses.
http://www.overunityresearch.com/index.php?topic=31.msg36381#new
   
Pages: [1]
« previous next »


 

Home Help Search Login Register
Theme © PopularFX | Based on PFX Ideas! | Scripts from iScript4u 2017-06-27, 13:22:57