Find the answer to your Linux question:
Results 1 to 3 of 3
Hi. I'm fairly new to linux and am trying to get direct access to my parallel port. I am using a program called Avrdude that downloads compiled programs to microcontrollers ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2004
    Location
    Port Moody, BC, Canada
    Posts
    5

    Trouble getting direct access to parallel port


    Hi.

    I'm fairly new to linux and am trying to get direct access to my parallel port. I am using a program called Avrdude that downloads compiled programs to microcontrollers over a special cable. The hardware works -- I have successfully used a Windows port of Avrdude.

    I am running Mandrake 10 on a Sony VAIO PCG-FR130 laptop.

    I have tried various things to no avail. I seem to be not using the parallel port correctly. I have tried it with various /dev/ devices, but I really don't know which, if any, are actually configured for my parallel port. [I did check BIOS. The parallel port is enabled in ECP mode, Base I/O addr is 378 (hex?), using IRQ 7 and DMA 3. I could change it from 'Enabled' to 'Auto', but I don't think that would help.]

    It seems the simplest way to show whats going on is to show several invocations of the program and the error messages it generates:

    $ avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex
    avrdude: can't open device "/dev/parport0": No such file or directory
    avrdude: failed to open parallel port "/dev/parport0"

    OK, I will tell it to try /dev/lp0 with the -P flag:

    $ avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/lp0
    avrdude: can't open device "/dev/lp0": Permission denied
    avrdude: failed to open parallel port "/dev/lp0"

    Permission denied sounds promising. So, I become the superuser and try again...

    # avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/lp0
    avrdude: can't claim device "/dev/lp0": Invalid argument

    Don't know what to make of that. I'll try a couple of other devices, just to be sure.

    # avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/printers/0
    avrdude: can't claim device "/dev/printers/0": Invalid argument

    [I think /dev/lp0 is a link to /dev/printers/0.]

    # avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/lp1
    avrdude: can't open device "/dev/lp1": No such file or directory
    avrdude: failed to open parallel port "/dev/lp1"

    Just for good measure, I'll try /dev/printers/0 as myself.

    $ avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/printers/0
    avrdude: can't open device "/dev/printers/0": Permission denied
    avrdude: failed to open parallel port "/dev/printers/0"

    $ avrdude -p atmega8 -c sp12 -U flash:w:LEDs.hex -P /dev/parport0
    avrdude: can't open device "/dev/parport0": No such file or directory
    avrdude: failed to open parallel port "/dev/parport0"


    Well, I don't know what else to try. Any help would be appreciated.

    Thanks,
    Armagon

  2. #2
    Just Joined!
    Join Date
    Sep 2004
    Location
    Port Moody, BC, Canada
    Posts
    5
    Well, it took a lot of searching, but I finally found a couple of useful tidbits of information.

    All I had to do was execute this command, as root:

    mknod /dev/parport0 c 99 0
    That created the parallel port device. I could then upload code with avrdude as root. I found that I didn't have permissions as myself, so, as root, did this:

    chmod a+rw /dev/parport0
    which gives all users write access to the device.

    I'm so glad it worked. The two links I found are:
    http://sourceforge.net/mailarchive/f...&forum_id=5896
    and http://pikdev.free.fr/installation.html .

    Armagon

  3. #3
    Just Joined!
    Join Date
    Apr 2005
    Posts
    5
    How can I get run this under Cygwin?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •