Hello,
Thank you very much for the replay,
Blaise Gassend <blaise@gassend.com>:
>If your board is acknowledging the byte it is sent, there is no reason
>for the parallel port to hold the byte that it is sending. Have you
>tried not acknowledging?
How I can not acknowledge?
>If you just want to set byte on the port, you could use /dev/parport or
>libieee1284 which would allow you to write the data without worrying
>about the control bits.
I used someones code and wrote simple program useing /dev/parport:
cat port.cpp
/**************************************************************************/
#include <sys/ioctl.h>
#include <linux/ppdev.h>
#include <linux/parport.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <sys/time.h>
#include <string.h>
#include <stdlib.h>
#include <iostream.h>
#define PortName "/dev/parport0"
int main()
{
int desc;
int buffer;
int stat;
unsigned char zz=0,ff=0xff;
desc = open(PortName,O_RDWR);
if(desc < 0)
return -1;
stat = ioctl(desc,PPCLAIM);
if(stat) {
ioctl(desc,PPRELEASE);
close(desc);
return -1;
}
buffer = IEEE1284_MODE_BYTE;
stat = ioctl(desc,PPSETMODE,&buffer);
if(stat) {
ioctl(desc,PPRELEASE);
close(desc);
return -1;
}
for(;;) {
stat = ioctl(desc,PPWDATA,&zz);
if(stat) return stat;
cout << "0x00" << endl;
sleep(1);
stat = ioctl(desc,PPWDATA,&ff);
if(stat) return stat;
cout << "0xff" << endl;
sleep(1);
}
}
/*************************************************************************/
I checked, it works on some machines (generates square on pins - 0.5 Hz, 50%),
but not on this one with main board:
ECS K7S5AL (SIS735),SND,DDR+DIMM,LAN,ATX.
Maybe it is a problem with configuration of parport?
Why it doesn't holt bytes under Linux, but holds under FreeBSD and WinXP?
I would be grateful for some more suggestions,
Regards,
Filip
>Quoted from filip on Fri, Apr 11, 2003 at 11:03:32PM +0200.
>> I want to use /dev/lp0 (lp module) on my PC for controlling
>> external devices.
>> The problem is when I wtire 1 byte to /dev/lp0, paralel port
>> holds this state just for a few ms - if I write to /dev/lp0 0x00
>> pins change to LOW for a moment, and then some of the returns to HIGH
>> and some stay LOW.
>> (I made special plug - so the is no problem with handshake - details on:
>> http://www.hut.fi/Misc/Electronics/circuits/nullprint.html)
>>
>> lsmod
>> lp 8864 0 (unused)
>> parport_pc 18724 1 (autoclean)
>> parport 34208 1 (autoclean) [lp parport_pc]
>>
>> cat /proc/sys/dev/parport/parport0/modes
>> PCSPP,TRISTATE
>>
>> In bios (Setup) I have set SPP mode.
>>
>> The problem is on this PC on RH7.3 and also on Slackware9.0
>> but on FreeBSD everything is OK (on FreeBSD I use /dev/lpt0).
>>
>> It is strange because everything works corect on
>> my old PC (Pentium160).
>>
>> Can you help?
>>
>> Regards,
>> Filip
-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --
This archive was generated by hypermail 2b29 : Fri Apr 11 2003 - 21:02:05 EDT