Pages: [1]   Go Down
Author Topic: Is sequential pulsing possible??  (Read 859 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi,
 First i'd like to say i'm new to Arduino and micro controllers. I'd like to know if its possible to pulse channels sequentially with digital write? I would like full control over duty cycle and frequency. I played around with the fade sketch but the frequency is not high enough in that mode. I'm looking to pulse 3 channels sequentially, from 10-50khz and i will be using these pulses to drive mosfets, through a mosfet driver of course. Any help would great. I've tried searching around for this info but can't find the info i'm looking for.
By the way the board I have right now is the Uno. 
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 210
Posts: 13036
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Granularity?  Accuracy?  How tolerant of glitches is your application?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm looking to create as sharp a pulse as possible. Fast on, fast off. Duty cycle as low as possible.
Logged

nr Bundaberg, Australia
Online Online
Tesla Member
***
Karma: 129
Posts: 8601
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

A tight loop toggling a single pin using direct port manipulation can get about 500kHz IIRC.

So you have 10:1 theoretical advantage but if you need to do three pins + clever control stuff as well it might be a struggle.

Quote
I'm looking to create as sharp a pulse as possible
Not exactly an engineering term, but the rise and fall times of a digital pin will I'm sure be fast enough.

You still need to answer Coding Badly's questions. For example if 1:256 is good enough granularity for the duty cycle some form of table lookup may be the way to go.

Quote
Duty cycle as low as possible.
Does this mean that the duty cycle is not variable, just a constant-width pulse?
______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 137
Posts: 6789
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You can get about 100kHz with digitalWrite() (or could, at one point.  Core code is subject to change.)
There is extensive discussion about how fast, why, and alternatives in this old thread:
http://arduino.cc/forum/index.php/topic,4324.0.html

You should easily be able to get pulses under one microsecond wide using direct port manipulation.
Logged

Pages: [1]   Go Up
Jump to: