Article View: comp.os.msdos.programmer
Article #6275Re: Programmed delays when accessing the PIC
From: Jack Morrison
Date: Fri, 11 Dec 1992 20:14
Date: Fri, 11 Dec 1992 20:14
31 lines
2106 bytes
2106 bytes
In article 1625@jet.uk, kr@jet.uk (Kenneth Reed) writes: >A number of code fragments I've seen for programming the interrupt >controller always follow the access to the port with a short delay >(usually 2 "jmp $+2"s). Many microprocessor support devices haven't changed much since the days of 1 MHz 8080's, and the internal registers can require several bus cycles to complete some state changes. Even 8086's can hit them too fast with inline code, so it's standard practice to add a few NOPs. This is something I (and no doubt many others) learned the hard way long ago, and it's become standard practice. >This seems a bit arbitrary to me as the delays will have very >different values when running on a 486 and an 8086 and I was wondering >exactly what delay is actually required. It's not the time that matters, but the number of bus cycles; PCs generally run at the same bus clock (8 MHz) regardless of CPU. >I tried programming the PIC on my 386 without any delays at all and it >all worked fine so, perhaps, this is something required only on >"older" PCs. They may or may not be needed on a given system. If you're writing something for yourself only, feel free to leave them out if it seems to work. If you're doing it for anyone else, it seems a lot safer just to put them in and never wonder if *that* might be why strange things happen on a full moon... --- "How am I typing? Call 1-818-354-7782" jack@robotics.jpl.nasa.gov Jack Morrison/Jet Propulsion Lab/MS107-102 4800 Oak Grove Dr, Pasadena CA 91109
Technical Details
Message-ID:
<1992Dec11.201424.16306@elroy.jpl.nasa.gov>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!forsight!jackReferences:
<1992Dec1.110004.1625@jet.uk>Show Full Headers
Complete Article Headers
Newsgroups: comp.os.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!forsight!jack From: jack@robotics.jpl.nasa.gov (Jack Morrison) Subject: Re: Programmed delays when accessing the PIC Message-ID: <1992Dec11.201424.16306@elroy.jpl.nasa.gov> Sender: news@elroy.jpl.nasa.gov (Usenet) Nntp-Posting-Host: robotics.jpl.nasa.gov Reply-To: jack@robotics.jpl.nasa.gov Organization: Jet Propulsion Laboratory References: <1992Dec1.110004.1625@jet.uk> Date: Fri, 11 Dec 1992 20:14:24 GMT Lines: 32