On Fri, 8 Feb 2013, Klemen Dovrtel wrote:
Date: Fri, 8 Feb 2013 11:51:09 -0800 (PST)
From: Klemen Dovrtel <[email protected]>
To: andy pugh <[email protected]>,
"Enhanced Machine Controller (EMC)" <[email protected]>
Subject: Re: [Emc-users] EPP data transfers
Now I tested the hostmod2 halsetup you suggested and i noticed the
address_strobe signal was alive. After that i tested my code again and now
everything worked fine - i can see the address_strobe signal with the
oscilloscope.
So there is a line in your hostmod2 setup code that solves my epp parallel
port problem. Any idea what could that be?
Probably either setting the port into EPP mode is not being done or perhaps
your code is not checking and clearing any possible timeout errors before
you start.
I tried this (see below), but no luck:
int main(int argc, char *argv[])
{
int base_addr, extctrl_addr;
unsigned char status, control;
if (argc==1) { printf("must enter parallel port I/O address\n"); }
if (argc > 1) {
if (1==sscanf(argv[1],"%x",&base_addr)) {
iopl(3) ;//turn on access to all I/O
extctrl_addr = base_addr + 0x402;
outb(0x80,extctrl_addr); // set for EPP mode
printf("wrote 0x80 to 0x%x\n",extctrl_addr);
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
status = inb(base_addr + STATUS_PORT);
printf("status byte: 0x%x\n",status); // always returns 0xff ???
outb(base_addr + CONTROL_PORT, 0x04 ); // reset the peripheral,
status = inb(base_addr + STATUS_PORT);
printf("status byte: 0x%x\n",status); // always returns 0xff ???
// reset
control = inb(base_addr + CONTROL_PORT);
printf("control byte: 0x%x\n",control);
CLEAR_BIT( control, CONTROL_nINIT );
printf("control byte clear: 0x%x\n",control);
outb( base_addr + CONTROL_PORT, control );
SET_BIT( control, CONTROL_nINIT );
printf("control byte set: 0x%x\n",control);
outb( base_addr + CONTROL_PORT, control );
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+4);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
outb(0x11, base_addr+3);
}
}
return 0;
}
________________________________
From: andy pugh <[email protected]>
To: Klemen Dovrtel <[email protected]>; Enhanced Machine Controller (EMC)
<[email protected]>
Sent: Thursday, February 7, 2013 3:27 PM
Subject: Re: [Emc-users] EPP data transfers
On 6 February 2013 20:00, Klemen Dovrtel <[email protected]> wrote:
Any idea what could be wrong? Does anybody have a simple code (executable) that
send the data using address_write/address_read so that i can test my hardware?
Running either the Pico PPMC or Mesa 7i43 drivers from the command
line ought to toggle the pins, though not necessarily in the way you
need.
halrun
loadrt hostmot2
loadrt hm2_7i43 ioaddr=0x378 ioaddr_hi=???? debug_epp=Y
exit
--
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users
Peter Wallace
Mesa Electronics
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users