On Fri, 2011-01-28 at 11:18 -0600, Jon Elson wrote:
> Mark Wendt wrote:
> > Really makes one wonder how any of this stuff works at all.  You gotta 
> > love it.  A standard with no real standards...  ;-)
> >   
> Yes, completely appalling, and I have to keep hopping to make my boards 
> work with a wide variety of par port chips.  What a nightmare!  I think 
> I finally have all of my boards set up so that if they don't work with 
> any particular parallel port, I can pretty honestly say "It's not MY 
> fault!"  It is totally amazing to me that these chips can't even follow 
> the LOOSE standard laid out in those docs, which just kind of show this 
> signal comes before that one.
> 
> Jon

I'm beginning to think that maybe the most popular chip, maybe Moschip
9815, should be considered the standard, then make it work on that. The
Lava and Siig cards may be better, but the Moschips are easy to find and
cheap.

BTW, the attached has been fun to look at parallel port registers.
(Caution, can cause harm to your PC if you plug in the wrong address)

-- 
Kirk Wallace
http://www.wallacecompany.com/machine_shop/
http://www.wallacecompany.com/E45/index.html
California, USA
/*
 * example.c: very simple example of port I/O (example-2b.c)
 *
 * Based on http://www.faqs.org/docs/Linux-mini/IO-Port-Programming.html
 *
 * Compile with `gcc -O2 -o example example.c',
 * and run as root with `./example'.
 * ( sudo gcc -O2 -o example-2b example-2b.c )
 */

#include <stdio.h>
#include <unistd.h>
//#include <asm/io.h>    /* My computer didn't io.h in asm */
#include <sys/io.h>      /* but I found it here */
#include <stdlib.h>      /* added to stop an "exit not defined" warning */

#define BASEPORT 0xA000  /* This address comes from "lspci -v", change this to match the current location, usually the first and third address on the list */
#define EXTENDED 0xA400  /* usually the second and fourth, this address was from a MOSCHIP MCS9815 */

int main()
{
  /* Get access to the ports */
  if (iopl(3)) {perror("iopl"); exit(1);}
  
  /* Set the data signals (D0-7) of the port to all low (0) */
//  outb(0, BASEPORT);
  
  /* Sleep for a while (100 ms) */
//  usleep(100000);
  
  /* Read and display all registers */
  printf("DPR: %d\n", inb(BASEPORT + 0));
  printf("DSR: %d\n", inb(BASEPORT + 1));
  printf("DCR: %d\n", inb(BASEPORT + 2));
  printf("EPPA: %d\n", inb(BASEPORT + 3));
  printf("EPPD: %d\n\n", inb(BASEPORT + 4));

  printf("CFA: %d\n", inb(EXTENDED + 0));
  printf("CFB: %d\n", inb(EXTENDED + 1));
  printf("ECR: %d\n\n", inb(EXTENDED + 2));

//  outb(53, EXTENDED + 2);
//  usleep(1000);
//  printf("ECR: %d\n", inb(EXTENDED + 2));

  /* We don't need the ports anymore */
  if (iopl(0)) {perror("iopl"); exit(1);}

  exit(0);
}

/* end of example-2b.c */

------------------------------------------------------------------------------
Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)!
Finally, a world-class log management solution at an even better price-free!
Download using promo code Free_Logger_4_Dev2Dev. Offer expires 
February 28th, so secure your free ArcSight Logger TODAY! 
http://p.sf.net/sfu/arcsight-sfd2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to