Great HELP! Thanks a lot! -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Ken Pergola Sent: Wednesday, June 09, 2004 11:28 AM To: PICLIST@MITVMA.MIT.EDU Subject: Re: [EE:] Programming Serial and Parallel Port ToughGuy wrote: > My only problem boils down to whenever I follow a sample, I'm always > puzzled on where the hex was based on. Hi, Those are the "BIOS-aware" memory addresses where the LPT port addresses are stored: 0040:0008 LPT1 0040:000A LPT2 0040:000C LPT3 The COM ports are at: 0040:0000 COM1 0040:0002 COM2 0040:0004 COM3 0040:0006 COM4 You can see this if you invoke debug at the command prompt: 1) Type debug 2) Type d 40:0 C:\>debug -d 40:0 0040:0000 F8 03 F8 02 E8 03 E8 02-BC 03 78 03 78 02 C0 9F ..........x.x... 0040:0010 63 C8 00 80 02 00 00 20-00 00 2C 00 2C 00 64 20 c...... ..,.,.d 0040:0020 20 39 34 05 30 0B 3A 27-30 0B 0D 1C 00 00 00 00 94.0.:'0....... 0040:0030 00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 0040:0040 90 00 C3 00 00 00 00 00-00 03 50 00 00 10 00 00 ..........P..... 0040:0050 00 0C 00 00 00 00 00 00-00 00 00 00 00 00 00 00 ................ 0040:0060 0F 0C 00 D4 03 29 30 03-00 00 C0 FF B8 DD 16 00 .....)0......... 0040:0070 00 00 00 00 00 00 00 00-14 14 14 14 01 01 01 01 ................ - On my computer above, you can see that my "BIOS-aware" I/O port addresses are the following (don't forget about little-endian byte ordering): COM1: 0x3F8 COM2: 0x2F8 COM3: 0x3E8 COM4: 0x2E8 (I have a total of six COM ports on my system, so obviously, using the DEBUG method does not necessarily tell you the whole picture of my hardware.) LPT1: 0x3BC LPT2: 0x378 LPT3: 0x278 However, I can't use the "BIOS-aware" LPT2 and LPT3 addresses queried above under Windows XP Professional with an appropriate I/O driver since they get re-mapped by the OS to upper-level addresses: LPT2: FFE8 - FFEF FFE0 - FFE3 LPT3: FFF0 - FFF7 FFE4 - FFE7 (LPT2 and LPT3 are two parallel ports on my SIIG Duet parallel port PCI card) To use these parallel ports under Windows XP Professional, I use LOGIX4U's INPOUT32.DLL. Translating those re-mapped Windows XP addresses into the LPT register addresses works out to be the following (at least with my hardware): LPT2: Data register: 0xFFE8 Status register: 0xFFE9 Control register: 0xFFEA ECR register: 0xFFE2 LPT3: Data register: 0xFFF0 Status register: 0xFFF1 Control register: 0xFFF2 ECR register: 0xFFE6 It's still very doable to work with parallel ports under Windows XP -- a driver like INPOUT32.DLL is a godsend, and there are numerous others. If you want to use INPOUT32.DLL with Win NT/2000/XP just remember to use LOGIX4U's version (www.LOGIX4U.NET) -- it's a modified version of Jan Axelson's original INPOUT32.DLL -- Jan's was designed for Win 9x only, and therefore will not work with Win NT/2000/XP. Best regards, Ken Pergola -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body --- Incoming mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/2/04 --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/2/04 -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu