Which port pin to use with poor rise/fall time signal

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
Post Reply
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Which port pin to use with poor rise/fall time signal

Post by stevech »

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.
Attachments
ScopePulses smaller.JPG
ScopePulses smaller.JPG (32.95 KiB) Viewed 6774 times
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Post by dkinzer »

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.
- Don Kinzer
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

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.
Post Reply