home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / msdos / programm / 11339 < prev    next >
Encoding:
Text File  |  1992-12-11  |  2.0 KB  |  46 lines

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