PopularFX
Home Help Search Login Register
Welcome,Guest. Please login or register.
2024-03-29, 11:40:29
News: Forum TIP:
The SHOUT BOX deletes messages after 3 hours. It is NOT meant to have lengthy conversations in. Use the Chat feature instead.

Pages: [1]
Author Topic: uC controlled signal generator ?  (Read 20849 times)
Sr. Member
****

Posts: 460
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: 3866


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.
   
Sr. Member
****

Posts: 460
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: 3866


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: 3866


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 2024-03-29, 11:40:29