Re: [Emc-users] EPP data transfers

2013-02-09 Thread Peter C. Wallace
On Sat, 9 Feb 2013, Klemen Dovrtel wrote:

> Date: Sat, 9 Feb 2013 02:20:37 -0800 (PST)
> From: Klemen Dovrtel 
> To: Peter C. Wallace ,
> "Enhanced Machine Controller (EMC)" 
> Subject: Re: [Emc-users] EPP data transfers
> 
> Now i added the timeout errors checking (code below), but still the same.
>
> I noticed that the address_strobe line is low when i start the pc, and stays 
> low even when i execute my code. But then after I run the hal-hostmot, the 
> address_strobe goes to 1. So it seems that in my code the epp was not set 
> correctly, i dont know why, i have the outb(0x80,extctrl_addr).
>
>

My guess is that you have not setup the parallel port control register 
properly for EPP, EPP mode is somewhat strange in that all the normal 
control register output bits still work the normal way via control register 
writes, so the control register needs to be set in the proper state for EPP 
mode transfers to work. The control register (EPPIdleControl in the code 
below) value needs to be 0x04.

procedure EPPInit(ourport : word);
var dbyte : byte;
begin
   dbyte := port[ourport+$402];
   dbyte := dbyte and $5F;
   dbyte := dbyte or $80;
   port[ourport+$402] := dbyte;  {set EPP mode if not already there }
   DataPort := ourport;
   ContPort := ourport + ContOfs;
   StatPort := ourport + StatOfs;
   EPPDataPort := ourport + EPPDataOfs;
   EPPAddressPort := ourport + EPPAddressOfs;
   port[ContPort] := EPPIdleControl;
   port[StatPort] := EPPTimeout;
end;

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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-09 Thread Klemen Dovrtel
Now i added the  timeout errors checking (code below), but still the same. 

I noticed that the address_strobe line is low when i start the pc, and stays 
low even when i execute my code. But then after I run the hal-hostmot, the 
address_strobe goes to 1. So it seems that in my code the epp was not set 
correctly, i dont know why, i have the outb(0x80,extctrl_addr).



#define STATUS_SELECT   4
#define STATUS_PAPEREND 5
#define STATUS_nACK 6
#define STATUS_nBUSY    7

#define TEST_BIT( x, b )   (((x) & (1<<(b))) != 0 )
#define SET_BIT( x, b )    ((x) |= (1 << (b)))
#define CLEAR_BIT( x, b )    ((x) &= ~(1 << (b)))


typedef struct _Status
{
    unsigned char timeout, error, select, paper_end, ack, busy;
} Status;


/* Checks and returns each bit of the status register */
void read_status(int port_addr, Status *stat)
{
  unsigned char status;

  status = inb(port_addr + STATUS_PORT); // read the status port

  stat->timeout     = TEST_BIT( status, STATUS_TIMEOUT );
  stat->error       = 1 - TEST_BIT( status, STATUS_nERROR );
  stat->select      = TEST_BIT( status, STATUS_SELECT );
  stat->paper_end    = TEST_BIT( status, STATUS_PAPEREND );
  stat->ack         = 1 - TEST_BIT( status, STATUS_nACK );
  stat->busy        = 1 - TEST_BIT( status, STATUS_nBUSY );

 
 
  if ( stat->timeout )  // We clear the timeout bit by writing 1 to bit 0 
(might need to change)
  {
    status = status | STATUS_TIMEOUT; // clears by writing 1
    outb(port_addr+STATUS_PORT, status);
  }
}


/* returns 1 when there was some problem with the last operation */
int check_status(int port_addr)
{
  Status stat;
  read_status(port_addr, &stat); // read status and clear timeout bit
  return (stat.timeout || stat.error || ! stat.select || stat.busy);
}



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(base_addr + CONTROL_PORT, 0x04 ); // reset
    

        check_status(base_addr);

        outb(0x11, base_addr+4);
        check_status(base_addr);
        outb(0x11, base_addr+4);
        check_status(base_addr);
        outb(0x11, base_addr+4);
        check_status(base_addr);
        outb(0x11, base_addr+4);
        check_status(base_addr);

        outb(0x11, base_addr+3);
        check_status(base_addr);
        outb(0x11, base_addr+3);
        check_status(base_addr);
        outb(0x11, base_addr+3);
        check_status(base_addr);
        outb(0x11, base_addr+3);
        check_status(base_addr);        
        
        status = inb(base_addr + STATUS_PORT);
        printf("status byte: 0x%x\n",status); // always returns 0xff ???
    
        

        

    }
  }
  return 0;
}




 From: Peter C. Wallace 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Cc: andy pugh  
Sent: Friday, February 8, 2013 9:23 PM
Subject: Re: [Emc-users] EPP data transfers
 
On Fri, 8 Feb 2013, Klemen Dovrtel wrote:

> Date: Fri, 8 Feb 2013 11:51:09 -0800 (PST)
> From: Klemen Dovrtel 
> To: andy pugh ,
>     "Enhanced Machine Controller (EMC)" 
> 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_a

Re: [Emc-users] EPP data transfers

2013-02-08 Thread Peter C. Wallace

On Fri, 8 Feb 2013, Klemen Dovrtel wrote:


Date: Fri, 8 Feb 2013 11:51:09 -0800 (PST)
From: Klemen Dovrtel 
To: andy pugh ,
"Enhanced Machine Controller (EMC)" 
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 
To: Klemen Dovrtel ; Enhanced Machine Controller (EMC) 

Sent: Thursday, February 7, 2013 3:27 PM
Subject: Re: [Emc-users] EPP data transfers

On 6 February 2013 20:00, Klemen Dovrtel  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
Emc-users@lists.sourceforge.net
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-08 Thread Klemen Dovrtel
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? 


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 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Sent: Thursday, February 7, 2013 3:27 PM
Subject: Re: [Emc-users] EPP data transfers
 
On 6 February 2013 20:00, Klemen Dovrtel  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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-07 Thread Jon Elson
Klemen Dovrtel wrote:
>
> I will continue here... I tested the epp parallel port mode and i can read 
> and write data. Now i also tried to write the address but nothing happens, 
> The strobe signal doesn't change its state.
>
> I also tried to set the wait signal to 0 and monitor the data_strobe (pin14) 
> and address_strobe (pin 17) signal with oscilloscope after i executed a 
> simple code (please see below). If i monitor the address_strobe signal 
> nothing happens, but if i monitor the data_strobe signal, i can see the pause 
> between the two read32() command.
>
>
> // simple code
>  EPP_ADDR(0);
>  EPP_ADDR(1);
>  EPP_ADDR(2);
>  EPP_ADDR(3);
>  datain = read32(); // or write32(dataout)
>  EPP_ADDR(0);
>  EPP_ADDR(1);
>  EPP_ADDR(2);
>  EPP_ADDR(3);
> datain = read32(); // or write32(dataout)
>
> --
> static inline void EPP_ADDR(int w) {
> outb(w, ioaddr+3);
> }
>
> static inline __u32 read32(void) {
> return inl(ioaddr+4);
> }
>
>   
This code looks OK at first glance, but some (not all) EPP implementations
may lock up when a timeout occurs, and not provide any more strobes
until the timeout is cleared by software.  If you are not looping the 
strobes
back to the wait signal, then it will timeout.  You could use a NAND gate
to effectively or the two negative-true strobes together and then
feed that output to the WAIT input.  (I think I have all those polarities
correct.)  This would give a short negative-going pulse of about 600 - 
900 ns
on the strobe.


Jon

--
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-07 Thread Marius Liebenberg
Some ports require external pullups. Is your port connected  a pcb? If 
so try and solder a pullup on that line if you dont have one.
On 2013/02/07 04:00 PM, Klemen Dovrtel wrote:
> I used oscilloscope. I am using the base thread period to execute 
> data/address read/write periodically and I can easily measure/detect the 
> data_strobe signal (pin 14) during data read/write. But if measure the 
> address strobe signal (pin 17), nothing happens.
>
>
> 
>   From: Marius Liebenberg 
> To: Enhanced Machine Controller (EMC) 
> Sent: Thursday, February 7, 2013 2:34 PM
> Subject: Re: [Emc-users] EPP data transfers
>   
> How do you measure the strobe signal? You do realize that it is very
> quick and only happens during data transfer. I.E. Once on every read and
> very write.
>
> On 2013/02/06 08:00 PM, Klemen Dovrtel wrote:
>> Hello everybody,
>>
>> I will continue here... I tested the epp parallel port mode and i can read 
>> and write data. Now i also tried to write the address but nothing happens, 
>> The strobe signal doesn't change its state.
>>
>> I also tried to set the wait signal to 0 and monitor the data_strobe (pin14) 
>> and address_strobe (pin 17) signal with oscilloscope after i executed a 
>> simple code (please see below). If i monitor the address_strobe signal 
>> nothing happens, but if i monitor the data_strobe signal, i can see the 
>> pause between the two read32() command.
>>
>> The parallel port pins i fine (not burned), i can control them using 
>> ptest.hal.
>>
>> 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?
>>
>> Regards
>> Klemen
>>
>>
>> // simple code
>> EPP_ADDR(0);
>> EPP_ADDR(1);
>> EPP_ADDR(2);
>> EPP_ADDR(3);
>> datain êd32(); // or write32(dataout)
>> EPP_ADDR(0);
>> EPP_ADDR(1);
>> EPP_ADDR(2);
>> EPP_ADDR(3);
>> datain êd32(); // or write32(dataout)
>>
>> --
>> static inline void EPP_ADDR(int w) {
>>outb(w, ioaddr+3);
>> }
>>
>> static inline __u32 read32(void) {
>>return inl(ioaddr+4);
>> }
>>
>>
>>
>>
>>
>>
>> 
>> From: Klemen Dovrtel 
>> To: Jon Elson ; Enhanced Machine Controller (EMC) 
>> 
>> Sent: Thursday, January 31, 2013 8:24 AM
>> Subject: Re: [Emc-users] EPP data transfers
>>
>> I tried the pcisetup and this solved the problem for the motherboard 
>> parallel port, now it seems it works fine (i can see the strobe signal 
>> changing). The frequency of transfer id 1B/12us (quite slow). But I could 
>> not set the pci parralel port card to epp mode (I have the NetMos NM9805CV 
>> pci card). I will try some other pci parallel port card. Thank you for your 
>> help :)
>>
>> BTW: how did you compile the pcisetup.c. I tried to compile the code, but i 
>> get the "undefined reference to `outb'" error. I did try to add the -O, -O2 
>> gcc directive as described in man outb, but it did not help. Can you please 
>> show your makefile compiler instructions for this.
>>
>> Best Regards
>> Klemen
>>
>>
>>
>> 
>> From: Jon Elson 
>> To: Klemen Dovrtel ; Enhanced Machine Controller 
>> (EMC) 
>> Sent: Wednesday, January 30, 2013 4:15 AM
>> Subject: Re: [Emc-users] EPP data transfers
>>
>> Klemen Dovrtel wrote:
>>> - HAL file 
>>>
>>> loadrt threads name1ºse-thread period1 0 name2=rvo-thread period2 
>>> 00 # ns
>>>  
>> It will probably be MUCH easier to test this in user mode.  You need
>> root privileges and can open access to the parallel port with the
>> iopl(3) kernel service.  You may also need to use something like my
>> pcisetup program to put the port into EPP mode.  Even though it is set
>> to this mode in the BIOS, it may not actually be in EPP mode on a lot
>> of motherboards.  This program is at
>> http://pico-systems.com/codes/pcisetup
>> You can also find the source code in the same directory.
>> Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
>> I/O register 0x402 higher than the parallel port base register) to
>> enable EPP mode.
>>
>> Jon
>> --
>&g

Re: [Emc-users] EPP data transfers

2013-02-07 Thread andy pugh
On 6 February 2013 20:00, Klemen Dovrtel  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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-07 Thread Klemen Dovrtel
I used oscilloscope. I am using the base thread period to execute data/address 
read/write periodically and I can easily measure/detect the data_strobe signal 
(pin 14) during data read/write. But if measure the address strobe signal (pin 
17), nothing happens.



 From: Marius Liebenberg 
To: Enhanced Machine Controller (EMC)  
Sent: Thursday, February 7, 2013 2:34 PM
Subject: Re: [Emc-users] EPP data transfers
 
How do you measure the strobe signal? You do realize that it is very 
quick and only happens during data transfer. I.E. Once on every read and 
very write.

On 2013/02/06 08:00 PM, Klemen Dovrtel wrote:
> Hello everybody,
>
> I will continue here... I tested the epp parallel port mode and i can read 
> and write data. Now i also tried to write the address but nothing happens, 
> The strobe signal doesn't change its state.
>
> I also tried to set the wait signal to 0 and monitor the data_strobe (pin14) 
> and address_strobe (pin 17) signal with oscilloscope after i executed a 
> simple code (please see below). If i monitor the address_strobe signal 
> nothing happens, but if i monitor the data_strobe signal, i can see the pause 
> between the two read32() command.
>
> The parallel port pins i fine (not burned), i can control them using 
> ptest.hal.
>
> 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?
>
> Regards
> Klemen
>
>
> // simple code
>   EPP_ADDR(0);
>   EPP_ADDR(1);
>   EPP_ADDR(2);
>   EPP_ADDR(3);
>   datain =ead32(); // or write32(dataout)
>   EPP_ADDR(0);
>   EPP_ADDR(1);
>   EPP_ADDR(2);
>   EPP_ADDR(3);
> datain =ead32(); // or write32(dataout)
>
> --
> static inline void EPP_ADDR(int w) {
>      outb(w, ioaddr+3);
> }
>
> static inline __u32 read32(void) {
>      return inl(ioaddr+4);
> }
>
>  
>
>
>
>
> ____________
>   From: Klemen Dovrtel 
> To: Jon Elson ; Enhanced Machine Controller (EMC) 
> 
> Sent: Thursday, January 31, 2013 8:24 AM
> Subject: Re: [Emc-users] EPP data transfers
>  
> I tried the pcisetup and this solved the problem for the motherboard parallel 
> port, now it seems it works fine (i can see the strobe signal changing). The 
> frequency of transfer id 1B/12us (quite slow). But I could not set the pci 
> parralel port card to epp mode (I have the NetMos NM9805CV pci card). I will 
> try some other pci parallel port card. Thank you for your help :)
>
> BTW: how did you compile the pcisetup.c. I tried to compile the code, but i 
> get the "undefined reference to `outb'" error. I did try to add the -O, -O2 
> gcc directive as described in man outb, but it did not help. Can you please 
> show your makefile compiler instructions for this.
>
> Best Regards
> Klemen
>
>
>
> 
> From: Jon Elson 
> To: Klemen Dovrtel ; Enhanced Machine Controller 
> (EMC) 
> Sent: Wednesday, January 30, 2013 4:15 AM
> Subject: Re: [Emc-users] EPP data transfers
>
> Klemen Dovrtel wrote:
>> - HAL file 
>>
>> loadrt threads name1ºse-thread period1 0 name2=servo-thread period2 
>> 00 # ns
>>    
> It will probably be MUCH easier to test this in user mode.  You need
> root privileges and can open access to the parallel port with the
> iopl(3) kernel service.  You may also need to use something like my
> pcisetup program to put the port into EPP mode.  Even though it is set
> to this mode in the BIOS, it may not actually be in EPP mode on a lot
> of motherboards.  This program is at
> http://pico-systems.com/codes/pcisetup
> You can also find the source code in the same directory.
> Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
> I/O register 0x402 higher than the parallel port base register) to
> enable EPP mode.
>
> Jon
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

-- 
Regards / Groete

Marius D. Liebenberg
MasterCut cc
Cel: +27 82 698 3251
Tel: +27 12 743 6064
Fax: +27 86 551 8029
Skype: marius_d.liebenberg
Skype Me^(TM)! 
Get Skype <http://www.skype.com/go/download> and call me for free.




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 130207-0, 2013/02/07

Re: [Emc-users] EPP data transfers

2013-02-07 Thread Marius Liebenberg
How do you measure the strobe signal? You do realize that it is very 
quick and only happens during data transfer. I.E. Once on every read and 
very write.

On 2013/02/06 08:00 PM, Klemen Dovrtel wrote:
> Hello everybody,
>
> I will continue here... I tested the epp parallel port mode and i can read 
> and write data. Now i also tried to write the address but nothing happens, 
> The strobe signal doesn't change its state.
>
> I also tried to set the wait signal to 0 and monitor the data_strobe (pin14) 
> and address_strobe (pin 17) signal with oscilloscope after i executed a 
> simple code (please see below). If i monitor the address_strobe signal 
> nothing happens, but if i monitor the data_strobe signal, i can see the pause 
> between the two read32() command.
>
> The parallel port pins i fine (not burned), i can control them using 
> ptest.hal.
>
> 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?
>
> Regards
> Klemen
>
>
> // simple code
>   EPP_ADDR(0);
>   EPP_ADDR(1);
>   EPP_ADDR(2);
>   EPP_ADDR(3);
>   datain =ead32(); // or write32(dataout)
>   EPP_ADDR(0);
>   EPP_ADDR(1);
>   EPP_ADDR(2);
>   EPP_ADDR(3);
> datain =ead32(); // or write32(dataout)
>
> --
> static inline void EPP_ADDR(int w) {
>  outb(w, ioaddr+3);
> }
>
> static inline __u32 read32(void) {
>  return inl(ioaddr+4);
> }
>
>   
>
>
>
>
> ____________
>   From: Klemen Dovrtel 
> To: Jon Elson ; Enhanced Machine Controller (EMC) 
> 
> Sent: Thursday, January 31, 2013 8:24 AM
> Subject: Re: [Emc-users] EPP data transfers
>   
> I tried the pcisetup and this solved the problem for the motherboard parallel 
> port, now it seems it works fine (i can see the strobe signal changing). The 
> frequency of transfer id 1B/12us (quite slow). But I could not set the pci 
> parralel port card to epp mode (I have the NetMos NM9805CV pci card). I will 
> try some other pci parallel port card. Thank you for your help :)
>
> BTW: how did you compile the pcisetup.c. I tried to compile the code, but i 
> get the "undefined reference to `outb'" error. I did try to add the -O, -O2 
> gcc directive as described in man outb, but it did not help. Can you please 
> show your makefile compiler instructions for this.
>
> Best Regards
> Klemen
>
>
>
> 
> From: Jon Elson 
> To: Klemen Dovrtel ; Enhanced Machine Controller 
> (EMC) 
> Sent: Wednesday, January 30, 2013 4:15 AM
> Subject: Re: [Emc-users] EPP data transfers
>
> Klemen Dovrtel wrote:
>> - HAL file 
>>
>> loadrt threads name1ºse-thread period1 0 name2=servo-thread period2 
>> 00 # ns
>>
> It will probably be MUCH easier to test this in user mode.  You need
> root privileges and can open access to the parallel port with the
> iopl(3) kernel service.  You may also need to use something like my
> pcisetup program to put the port into EPP mode.  Even though it is set
> to this mode in the BIOS, it may not actually be in EPP mode on a lot
> of motherboards.  This program is at
> http://pico-systems.com/codes/pcisetup
> You can also find the source code in the same directory.
> Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
> I/O register 0x402 higher than the parallel port base register) to
> enable EPP mode.
>
> Jon
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_jan
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

-- 
Regards / Groete

Marius D. Liebenberg
MasterCut cc
Cel: +27 82 698 3251
Tel: +27 12 743 6064
Fax: +27 86 551 8029
Skype: marius_d.liebenberg
Skype Me^(TM)! 
Get Skype <http://www.skype.com/go/download> and call me for free.




---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 130207-0, 2013/02/07
Tested on: 2013/02/07 03:34:06 PM
avast! - copyright (c) 1988-2013 AVAST Software.
http://www.avast.com


--
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-06 Thread Klemen Dovrtel
Hello everybody,

I will continue here... I tested the epp parallel port mode and i can read and 
write data. Now i also tried to write the address but nothing happens, The 
strobe signal doesn't change its state.

I also tried to set the wait signal to 0 and monitor the data_strobe (pin14) 
and address_strobe (pin 17) signal with oscilloscope after i executed a simple 
code (please see below). If i monitor the address_strobe signal nothing 
happens, but if i monitor the data_strobe signal, i can see the pause between 
the two read32() command.

The parallel port pins i fine (not burned), i can control them using ptest.hal.

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?

Regards
Klemen


// simple code
 EPP_ADDR(0);
 EPP_ADDR(1);
 EPP_ADDR(2);
 EPP_ADDR(3);
 datain = read32(); // or write32(dataout)
 EPP_ADDR(0);
 EPP_ADDR(1);
 EPP_ADDR(2);
 EPP_ADDR(3);
datain = read32(); // or write32(dataout)

--
static inline void EPP_ADDR(int w) {
    outb(w, ioaddr+3);
}

static inline __u32 read32(void) {
    return inl(ioaddr+4);
}

 





 From: Klemen Dovrtel 
To: Jon Elson ; Enhanced Machine Controller (EMC) 
 
Sent: Thursday, January 31, 2013 8:24 AM
Subject: Re: [Emc-users] EPP data transfers
 
I tried the pcisetup and this solved the problem for the motherboard parallel 
port, now it seems it works fine (i can see the strobe signal changing). The 
frequency of transfer id 1B/12us (quite slow). But I could not set the pci 
parralel port card to epp mode (I have the NetMos NM9805CV pci card). I will 
try some other pci parallel port card. Thank you for your help :)

BTW: how did you compile the pcisetup.c. I tried to compile the code, but i get 
the "undefined reference to `outb'" error. I did try to add the -O, -O2 gcc 
directive as described in man outb, but it did not help. Can you please show 
your makefile compiler instructions for this.

Best Regards
Klemen




From: Jon Elson 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Sent: Wednesday, January 30, 2013 4:15 AM
Subject: Re: [Emc-users] EPP data transfers

Klemen Dovrtel wrote:
>
> - HAL file 
>
> loadrt threads name1=base-thread period1=200 name2=servo-thread 
> period2=2000 # ns
>  
It will probably be MUCH easier to test this in user mode.  You need
root privileges and can open access to the parallel port with the
iopl(3) kernel service.  You may also need to use something like my
pcisetup program to put the port into EPP mode.  Even though it is set
to this mode in the BIOS, it may not actually be in EPP mode on a lot
of motherboards.  This program is at
http://pico-systems.com/codes/pcisetup
You can also find the source code in the same directory.
Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
I/O register 0x402 higher than the parallel port base register) to
enable EPP mode.

Jon
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users
--
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
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-01 Thread Klemen Dovrtel
Hello John,
I edit the code and compiled it as described on your blog and now it works fine 
:) Thank you!
Regards, Klemen





 From: John Stewart 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Cc: Jon Elson  
Sent: Friday, February 1, 2013 5:14 PM
Subject: Re: [Emc-users] EPP data transfers
 
Klemen;

On 2013-01-31, at 2:24 AM, Klemen Dovrtel wrote:
> 
> BTW: how did you compile the pcisetup.c. I tried to compile the code, but i 
> get the "undefined reference to `outb'" error. I did try to add the -O, -O2 
> gcc directive as described in man outb, but it did not help. Can you please 
> show your makefile compiler instructions for this.
> 
> Best Regards
> Klemen

I, also, needed the results of the picsetup.c. 

I put instructions, including a modified file from Jon Elson on a page of my 
(not great, but its a start) blog:

cnc-for-model-engineers.blogspot.com - look for the post "Intel Motherboards 
and the parallel port".

*please* tell me if the instructions are ok for you; if not, we'll correct 
them. This should also go on the wiki, unless it's already on there somewhere, 
and I missed it…

John A. Stewart
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-02-01 Thread John Stewart
Klemen;

On 2013-01-31, at 2:24 AM, Klemen Dovrtel wrote:
> 
> BTW: how did you compile the pcisetup.c. I tried to compile the code, but i 
> get the "undefined reference to `outb'" error. I did try to add the -O, -O2 
> gcc directive as described in man outb, but it did not help. Can you please 
> show your makefile compiler instructions for this.
> 
> Best Regards
> Klemen

I, also, needed the results of the picsetup.c. 

I put instructions, including a modified file from Jon Elson on a page of my 
(not great, but its a start) blog:

cnc-for-model-engineers.blogspot.com - look for the post "Intel Motherboards 
and the parallel port".

*please* tell me if the instructions are ok for you; if not, we'll correct 
them. This should also go on the wiki, unless it's already on there somewhere, 
and I missed it…

John A. Stewart


--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-30 Thread Klemen Dovrtel
I tried the pcisetup and this solved the problem for the motherboard parallel 
port, now it seems it works fine (i can see the strobe signal changing). The 
frequency of transfer id 1B/12us (quite slow). But I could not set the pci 
parralel port card to epp mode (I have the NetMos NM9805CV pci card). I will 
try some other pci parallel port card. Thank you for your help :)

BTW: how did you compile the pcisetup.c. I tried to compile the code, but i get 
the "undefined reference to `outb'" error. I did try to add the -O, -O2 gcc 
directive as described in man outb, but it did not help. Can you please show 
your makefile compiler instructions for this.

Best Regards
Klemen




 From: Jon Elson 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Sent: Wednesday, January 30, 2013 4:15 AM
Subject: Re: [Emc-users] EPP data transfers
 
Klemen Dovrtel wrote:
>
> - HAL file 
>
> loadrt threads name1=base-thread period1=200 name2=servo-thread 
> period2=2000 # ns
>  
It will probably be MUCH easier to test this in user mode.  You need
root privileges and can open access to the parallel port with the
iopl(3) kernel service.  You may also need to use something like my
pcisetup program to put the port into EPP mode.  Even though it is set
to this mode in the BIOS, it may not actually be in EPP mode on a lot
of motherboards.  This program is at
http://pico-systems.com/codes/pcisetup
You can also find the source code in the same directory.
Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
I/O register 0x402 higher than the parallel port base register) to
enable EPP mode.

Jon
--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Jon Elson
Lars Andersson wrote:
> In cases like this, is there a good, simple way to know if the parallel 
> port is EPP capable or not? The HW documentation might sometimes be wrong.
>   
It is quite a mess!  There are some motherboards that have defective 
BIOS code
that reports the ports are NOT EPP-capable, when they in fact are.  
There are
some old NETMOS chips that claim EPP capability, but the logic is 
pathologically
broken.

Jon

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Jon Elson
Klemen Dovrtel wrote:
>
> - HAL file 
>
> loadrt threads name1=base-thread period1=200 name2=servo-thread 
> period2=2000 # ns
>   
It will probably be MUCH easier to test this in user mode.  You need
root privileges and can open access to the parallel port with the
iopl(3) kernel service.  You may also need to use something like my
pcisetup program to put the port into EPP mode.  Even though it is set
to this mode in the BIOS, it may not actually be in EPP mode on a lot
of motherboards.  This program is at
http://pico-systems.com/codes/pcisetup
You can also find the source code in the same directory.
Most of the LinuxCNC drivers for EPP devices do this (writing 0x80 to the
I/O register 0x402 higher than the parallel port base register) to
enable EPP mode.

Jon

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_jan
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Peter C. Wallace
On Tue, 29 Jan 2013, Lars Andersson wrote:

> Date: Tue, 29 Jan 2013 22:30:46 +0100
> From: Lars Andersson 
> Reply-To: "Enhanced Machine Controller (EMC)"
> 
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] EPP data transfers
> 
> In cases like this, is there a good, simple way to know if the parallel
> port is EPP capable or not? The HW documentation might sometimes be wrong.



Most are but if they are not on the motherboard they must be programmed to be 
in EPP mode. Even some Motherboard ports (Intel D525 is an example) screw up 
the port initialization so driver code must set the port into EPP mode, even 
if the BIOS parallel port settings are for EPP mode.

Also note that the common NetMOS PCI parallel port cards (using 9805 and 9815 
chips) have a hardware bug with EPP mode so are not suitable parallel ports 
when EPP mode is required.


>
>> I did start the threads.
>>
>>
>>
>> 
>> From: andy pugh 
>> To: Klemen Dovrtel ; Enhanced Machine Controller 
>> (EMC) 
>> Cc: Jon Elson 
>> Sent: Tuesday, January 29, 2013 7:44 PM
>> Subject: Re: [Emc-users] EPP data transfers
>>
>> On 29 January 2013 20:30, Klemen Dovrtel  wrote:
>>
>>> loadrt threads name1=base-thread period1=200 name2=servo-thread 
>>> period2=2000 # ns
>>>
>>> loadrt eppfpga
>>> addf
>>>eppfpga.write  base-thread
>> start
>>
>> (You need to start the threads)
>>
>
>
> --
> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
> MVPs and experts. ON SALE this month only -- learn more at:
> http://p.sf.net/sfu/learnnow-d2d
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> 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.


--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Lars Andersson
In cases like this, is there a good, simple way to know if the parallel 
port is EPP capable or not? The HW documentation might sometimes be wrong.

> I did start the threads.
>
>
>
> 
> From: andy pugh 
> To: Klemen Dovrtel ; Enhanced Machine Controller 
> (EMC) 
> Cc: Jon Elson 
> Sent: Tuesday, January 29, 2013 7:44 PM
> Subject: Re: [Emc-users] EPP data transfers
>
> On 29 January 2013 20:30, Klemen Dovrtel  wrote:
>
>> loadrt threads name1=base-thread period1=200 name2=servo-thread 
>> period2=2000 # ns
>>
>> loadrt eppfpga
>> addf
>>eppfpga.write  base-thread
> start
>
> (You need to start the threads)
>


--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Klemen Dovrtel
I did start the threads.




From: andy pugh 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Cc: Jon Elson  
Sent: Tuesday, January 29, 2013 7:44 PM
Subject: Re: [Emc-users] EPP data transfers

On 29 January 2013 20:30, Klemen Dovrtel  wrote:

> loadrt threads name1=base-thread period1=200 name2=servo-thread 
> period2=2000 # ns
>
> loadrt eppfpga
> addf
>  eppfpga.write          base-thread

start

(You need to start the threads)

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread andy pugh
On 29 January 2013 20:30, Klemen Dovrtel  wrote:

> loadrt threads name1=base-thread period1=200 name2=servo-thread 
> period2=2000 # ns
>
> loadrt eppfpga
> addf
>  eppfpga.write  base-thread

start

(You need to start the threads)

-- 
atp
If you can't fix it, you don't own it.
http://www.ifixit.com/Manifesto

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


Re: [Emc-users] EPP data transfers

2013-01-29 Thread Klemen Dovrtel
I see, thank you for your reply,

Now i found the pluto-p .comp and .h source code and i modified it to test the 
simple EPP write command. I set the parallel port Wait (11) line to LOW and 
monitor the Write line using oscilloscope. Nothing happened. The pin value 
stayed still. I am using the D525MW and i tested the communication on the 
motherboard parrnell port and also on the additional pci parallel port card. 
The result was the same - nothing happed. I also tried to change the epp_wide 
mode - same result. Any idea what could be wrong or how can i test the hardware 
is fine?


- HAL file 

loadrt threads name1=base-thread period1=200 name2=servo-thread 
period2=2000 # ns

loadrt eppfpga
addf
 eppfpga.write      base-thread



- eppfpga.com -


component eppfpga;

description """some discription""";

pin in bit testin[2];
pin out bit testout[2];

option singleton;
option extra_setup;
option extra_cleanup;
option data internal;

function write; // "Write all the outputs

modparam dummy ioaddr = 0x1030;// 0x0378
modparam dummy ioaddr_hi = 0; //Used to set EPP mode. 0: ioaddr + 0x400. -1: no 
secondary address.
modparam
 dummy epp_wide = 1; //Set to zero to disable the "wide EPP mode".  
"Wide" mode allows a 16- and 32-bit EPP transfers, which can reduce the 
time spent in the read and write functions.  However, this may not work 
on all EPP parallel ports.
modparam dummy watchdog = 1; // hardware watchdog
 enable. 6ms

modparam int test_encoder = 0;

license "GPL";

include "pluto_common.h";
;;


typedef struct {
    int64_t last_index[4];
    int64_t last_count[4];
    int64_t reset_count[4];
} internal;



FUNCTION(write) {
    if(communication_error) return;

    EPP_ADDR(0);
    write32( 0x00110011);
    write32( 0x11001100);

}

EXTRA_SETUP() { return 0; }

EXTRA_CLEANUP() {}



 pluto_common.h---
#ifdef SIM
#include 
#include 
#else
#include 
#endif

#include "hal_parport.h"

int ioaddr = 0x378;
int ioaddr_hi = 0;
int epp_wide = 0;
int watchdog = 1;
struct hal_parport_t portdata;

RTAPI_MP_INT(ioaddr, "Address of parallel port where pluto-p is attached");
RTAPI_MP_INT(ioaddr_hi,"Secondary address of parallel port (0 to use 
ioaddr+0x400)");
RTAPI_MP_INT(epp_wide, "Use 16- and 32-bit EPP transfers with hardware
 EPP");
RTAPI_MP_INT(watchdog,"Enable hardware watchdog to tristate outputs if EMC 
crashes");

#ifndef llabs // linux/kernel.h may provide labs for realtime systems
static int64_t llabs(int64_t l) { if(l < 0) return -l; return l; }
#endif

static inline int64_t extend(int64_t old, int newlow, int nbits) {
    int64_t mask = (1< maxdelta)
    return candidate2;
    else
    return candidate1;
}

static inline void EPP_DIR_WRITE(void) { }
static inline void EPP_DIR_READ(void) { }
static inline void EPP_ADDR(int w) {
    outb(w, ioaddr+3);
}

static inline void EPP_WRITE(int w) {
    outb(w, ioaddr+4);
}

static inline int EPP_READ(void) {
    return inb(ioaddr+4);
}


static inline __u32 read32(void) {
    unsigned char a, b, c, d;

    if(epp_wide)
    return inl(ioaddr+4);

    a = EPP_READ();
    b = EPP_READ();
    c = EPP_READ();
    d = EPP_READ();

    return a + (b<<8) + (c<<16) + (d<<24);
}

static inline void write32(long w)
 {
    if(epp_wide) {
    outl(w, ioaddr+4);
    return;
    }

    EPP_WRITE(w);
    EPP_WRITE(w >> 8);
    EPP_WRITE(w >> 16);
    EPP_WRITE(w >> 24);
}






____________
 From: Jon Elson 
To: Klemen Dovrtel ; Enhanced Machine Controller 
(EMC)  
Sent: Tuesday, January 29, 2013 6:45 PM
Subject: Re: [Emc-users] EPP data transfers
 
Klemen Dovrtel wrote:
> Hello everybody,
>
> I am studying EPP data transfers via parallel port and i could not find the 
> answer to my simple question: Is it possible to transfer several bytes of 
> data in single base-period? How many bytes can be transferred?
>
>  
Umm, you question is not very specific.  If you are inquiring about the 
hal_parport
driver, it doesn't use EPP.  I use EPP mode in the driver for my 
parallel port
connected devices, and they transfer many bytes, often 20-75 per board,
every servo period.  I don't see why it couldn't alos be done in the
base thread, but if that is running at a fast rate, you have to be very
concerned with the complete thread time.  With a fast PCI parallel port
plug-in card, a complete EPP transfer can be done in as little as about
600 ns, with an on-motherboard ISA-interfaced multi-IO chip, it may
take as long as 1.2 us.  More than a few transfers might be too slow
for your thread.

How many has to be determined by your thread dispatch rate, the speed
of the parallel port, and the realtime jitter, to give enough margin so
you never overrun th

Re: [Emc-users] EPP data transfers

2013-01-29 Thread Jon Elson
Klemen Dovrtel wrote:
> Hello everybody,
>
> I am studying EPP data transfers via parallel port and i could not find the 
> answer to my simple question: Is it possible to transfer several bytes of 
> data in single base-period? How many bytes can be transferred?
>
>   
Umm, you question is not very specific.  If you are inquiring about the 
hal_parport
driver, it doesn't use EPP.  I use EPP mode in the driver for my 
parallel port
connected devices, and they transfer many bytes, often 20-75 per board,
every servo period.  I don't see why it couldn't alos be done in the
base thread, but if that is running at a fast rate, you have to be very
concerned with the complete thread time.  With a fast PCI parallel port
plug-in card, a complete EPP transfer can be done in as little as about
600 ns, with an on-motherboard ISA-interfaced multi-IO chip, it may
take as long as 1.2 us.  More than a few transfers might be too slow
for your thread.

How many has to be determined by your thread dispatch rate, the speed
of the parallel port, and the realtime jitter, to give enough margin so
you never overrun the period.

Jon

--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


[Emc-users] EPP data transfers

2013-01-29 Thread Klemen Dovrtel
Hello everybody,

I am studying EPP data transfers via parallel port and i could not find the 
answer to my simple question: Is it possible to transfer several bytes of data 
in single base-period? How many bytes can be transferred?

Best Regards
Klemen
--
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users