home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10459 < prev    next >
Encoding:
Text File  |  1992-11-10  |  2.8 KB  |  68 lines

  1. Newsgroups: comp.os.msdos.programmer
  2. Path: sparky!uunet!interlan.InterLan.COM!rimail.interlan.com!klosp
  3. From: klosp@rimail.interlan.com (Patrick Klos)
  4. Subject: Re: Serial Driver Problem
  5. Message-ID: <klosp.30.721397974@rimail.interlan.com>
  6. Lines: 56
  7. Sender: news@Interlan.com
  8. Organization: Klos Technologies, Inc. (603) 424-0138
  9. References: <1992Nov10.015504.21169@speedy.aero.org>
  10. Date: Tue, 10 Nov 1992 12:19:34 GMT
  11.  
  12. In article <1992Nov10.015504.21169@speedy.aero.org> don@surtsey.aero.org (Don C. Hancock) writes:
  13. >From: don@surtsey.aero.org (Don C. Hancock)
  14. >Subject: Serial Driver Problem
  15. >Date: 10 Nov 92 01:55:04 GMT
  16. >Serial Driver Problem
  17. >
  18. >I hope this is the right place for this.  If not, please
  19. >let me know.
  20. >
  21. >I'm trying to program the serial port to control some equipment.  I
  22. >can't seem to get it (i.e. the port) to generate interrupts (such as
  23. >the data received, or transmitter empty)
  24. >
  25. >What am I doing wrong?
  26. >
  27. >Here's what I've done so far (briefly, sort of).
  28. >
  29. >1.      Replaced vector 0x0c with my interrupt service routine. I'm
  30. >pretty sure this right, because a  geninterrupt(0x0c) gets to my
  31. >routine.
  32. >
  33. >2.      Set up the serial port to interrupt on everything but the modem
  34. >status change by writing 0x07 to the interrupt enable register.
  35. >
  36. >3.      Set 8259 interrupt controller to enable interrupts from IRQ3
  37. >and IRQ4 with outp(0x21, inp(0x21) & 0xe7);
  38. >
  39. >4.      End my interrupt service routine with outp(0x20, 0x20).
  40. >
  41. >When I do a write followed by a read, I get the data I sent.  I've done
  42. >this using the loopback feature (set bit 4 of the modem control
  43. >register) and by wiring pins 2 & 3 together, so the connections are
  44. >right.  I've also done the above for the second serial port, I just
  45. >can't get the hardware to generate interrupts.
  46. >
  47. >Any ideas.  I'll post (or email) code if it'll help me get an answer.
  48. >Please email or post any replies (but email is preferred).
  49. >
  50. >Thanks for any help you can give me.  I'm really troubled by this.  I'm
  51. >sure I'm doing something dumb here.
  52. >
  53. >Don
  54. You forgot one critical element... and now I can't recall it completely 
  55. myself.  Anyway, the Modem Control Register (I think that's what it's 
  56. called) allows you to control 4 signals: Data Terminal Ready (DTR), Request 
  57. To Send (RTS), OUT1 and OUT2.  Now it's coming back to me... the modem 
  58. control register is I/O base+4 (03fcH in your case).  In order for the 
  59. controller to generate an interrupt, you MUST set OUT2 (which is bit 3) to 
  60. one.  I'm sure that will solve your problem!
  61.  
  62. Good luck!
  63. ========================================================================
  64.         Patrick Klos                 Internet: klosp@rimail.interlan.com
  65.         Klos Technologies, Inc.      Compuserve: 71521,145
  66.         (603) 424-0138
  67. ========================All opinions are my own!========================
  68.