Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Which port pin to use with poor rise/fall time signal

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
stevech



Joined: 23 Feb 2006
Posts: 656

Posted: 24 July 2006, 4:15 AM    Post subject: Which port pin to use with poor rise/fall time signal Reply with quote

On the Mega32 or 644, which port pins would be best to use for a pulsed signal with poor rise and fall times? Goal is to have an edge-triggered port-pin change interrupt.

In the photo, the scope is 1mSec per division. The waveform is used to switch an opto-isolator on/off - this pulse is sent through a 5.1V Zener then to the isolator's LED (via a 220Ohm resistor). The scope vertical is 1V/div. The opto-isolator's transistor's collector connects to some pin on the AVR, with internal pull-up resistor enabled for that pin. Maybe the transfer function of the 4N25 opto-isolator makes this a non-issue.



ScopePulses smaller.JPG
 Description:
 Filesize:  32.95 KB
 Viewed:  6295 Time(s)

ScopePulses smaller.JPG


Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2493
Location: Portland, OR

Posted: 24 July 2006, 5:21 AM    Post subject: Reply with quote

I believe that all of the digital inputs of the newer chips like the mega series have Schmitt trigger inputs. The important characteristic of a Schmitt input is the hysteresis in the transfer curve. This improves the performance of a digital input with signals having a slow rise time, avoiding false switch that can otherwise occur.

If a signal is particularly problematic, you can add a transistor switch or a logic gate (with Schmitt inputs) to square up the signal. In many cases, however, it is not necessary to add external circuitry.
Back to top
stevech



Joined: 23 Feb 2006
Posts: 656

Posted: 24 July 2006, 6:33 AM    Post subject: Reply with quote

dkinzer wrote:


If a signal is particularly problematic, you can add a transistor switch or a logic gate (with Schmitt inputs) to square up the signal. In many cases, however, it is not necessary to add external circuitry.


I'll put the scope on the opto-isolator output - the AVR input pin, and see if it's clean or has oscillations.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group