Author Topic: miniPCIe Parallel Port - Direct access to Databits  (Read 16531 times)

Chris_Muench

  • Member
  • ***
  • Posts: 1
miniPCIe Parallel Port - Direct access to Databits
« on: May 02, 2012, 09:37:53 pm »
I am working on a project that requires to set some GPIO bits under Windows 7 64Bit. The PC I am using has only a miniPCI Express Slot (Zotac Atom board).
The closest I came to a solution was to use a Oxford Chipset based MiniPCIe card, but it does not have the "normal" 0x378 LPT1 port definitions (something above 0xC000).
 
Is there any way to program a miniPCIe card with direct realtime bits like it could be done on older OSes with the standard LTP cards?

I am using the inpoutx64.dll and can access any port address just fine. But using it against the 0xC010 port range of the MiniPCIe card does not do anything. (including setting control bit 5 on control port "0xC012 (base +2)" to zero)

Thanks
Chris

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #1 on: May 03, 2012, 11:36:09 am »
In Windows Device Manager, you could try fiddling with the port address and the options in Port Settings.

Jan

bb

  • Member
  • ***
  • Posts: 3
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #2 on: May 24, 2012, 08:48:31 am »
Hi,

I am having exactly the same problem with exactly the same PCIe/parallel card but with XP 32.
The card is correctly installed and is assigned to LPT3 port with D012 adress.
A footswitch is connected to the parallel port. I would like to read parallel port to know if the footswitch is activated. I am programming with visual c++.
After Input32.dll I also tried dlportIO.dll and the File manager (CreateFile, ReadFile...) of windows API without success.
Do you have any idea if it is still possible to use these tools with an adaptator card?

Thanks for your help.
 


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
« Last Edit: June 27, 2015, 09:43:08 am by Jan Axelson »

bb

  • Member
  • ***
  • Posts: 3
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #4 on: May 24, 2012, 11:05:16 am »
Thank you for your reply.
I have already seen the discussion you pointed.
I used Input32.dll and DlportIO.dll on an onboard parallel port and it worked well. But when I am using the same application on the PCIe/parallel (after changing address etc.) it failed.
I was thinking it was because these dll assume that you can send data directly to the parallel port pins so they "jump" the xp kernel/user protection. But with the PCIe/parallel adaptator i can't have a direct access to the parallel port pins.
So I try using windows API (CreateFile...) without success.
Before trying desperately to make it works I would like to be sure it is possible.
Do you know any code sample that access on board parallel port with win API? because i do not find anything so i conclude that if it doesn't work with on board parallel port it will not work with my parallel card. What do you think?

Many thanks

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #5 on: May 24, 2012, 09:41:23 pm »
What error do you get with CreateFile?

Jan

bb

  • Member
  • ***
  • Posts: 3
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #6 on: May 25, 2012, 04:53:46 am »
I don't have error using CreateFile. But I can't read with ReadFile.
I had a reply on msdn forum http://social.msdn.microsoft.com/Forums/fr-FR/vcgeneral/thread/d19392c9-69f2-417d-a137-0a3e0d57751b that tell me that ReadFile is not supported for LPT port. So I give up using windows API.
I give a last try using CParallelPort class from http://www.naughter.com/parallelport.html and if I can't communicate with my PCI/parallel card I would have to find another way to acquire the footswitch signal.
I will let you know the results.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: miniPCIe Parallel Port - Direct access to Databits
« Reply #7 on: May 25, 2012, 11:00:24 am »
ReadFile might work. You'll need to disable the data outputs by setting control port pin 5 = 1 and set the Status inputs to show printer selected, paper available, no error, not busy. For pin functions, see:

http://www.janaxelson.com/files/ibmlpt.txt

Jan
« Last Edit: June 27, 2015, 09:50:53 am by Jan Axelson »