ts-7000
[Top] [All Lists]

[ts-7000] PC104 16-bit confusion...

To:
Subject: [ts-7000] PC104 16-bit confusion...
From: "richw42" <>
Date: Sun, 04 Feb 2007 05:23:35 -0000
I'm trying to understand how to do 16-bit transfers on the TS-7250
PC104 bus, but it doesn't seem to be happpening. Instead, I get two
cycles, apparently 8 bits each. The pair is a little faster, though.

When I run the program below, I see four cycles on each of IOR#,
MEMR#, IOW#, and MEMW#, with somewhat confusing (to me) signals on
BHE#. Here's what I see:

IOR# cycles
1 BHE#=0 A0=0
2 BHE#=0 A0=1
3 BHE#=0 A0=0
4 BHE#=0 A0=1

This is what I would expect, except for there being two cycles for the
16-bit transfer. By the way, A1 is always zero.

MEMR# cyces look about the same, except iirc faster.

IOWE# and MEMW# cycles:
1 BHE#=1 A0=0
2 BHE#=1 A0=1
3 BHE#=1 A0=0
4 BHE#=0 A0=1

This BHE# setting seems to make no sense.

What am I missing?

Here's the source code, with some comments and error checking removed:
(someone may recognize their code as my template)

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>

static volatile unsigned char  *pc104_io8;
static volatile unsigned short *pc104_io16;
static volatile unsigned char  *pc104_mem8;
static volatile unsigned short *pc104_mem16;

/********************************************************************/

int main(int argc, char *argv[])
{
  int size = getpagesize();
  printf("Page Size = %d\n", size);

  int fd = open("/dev/mem", O_RDWR|O_SYNC);

  pc104_io8 =   mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x11E00000);
  pc104_io16 =  mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x21E00000);
  pc104_mem8 =  mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x11a00000);
  pc104_mem16 = mmap(0, size, PROT_READ|PROT_WRITE, MAP_SHARED, fd,
0x21a00000);

  while (1) // Now once a second
  {
    char c;
    short s;
    sleep(1);
    c = *pc104_io8;
    c = *(pc104_io8+1);
    s = *pc104_io16;
    c = *pc104_mem8;
    c = *(pc104_mem8+1);
    s = *pc104_mem16;
    *pc104_io8 = c;
    *(pc104_io8+1) = c;
    *pc104_io16 = s;
    *pc104_mem8 = c;
    *(pc104_mem8+1) = c;
    *pc104_mem16 = s;
  }
}



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU