hi,
I am trying to write to a dio port on a dio card on the pci bus. I am not
having any luck. Any input would be greatly appreciated.
I ran the show_pci utility I downloaded from quics. I can detect the
dio card. I get the correct card id and vendor id. The show_pci utility
tells me an address in memory that the card maps to(0xf4002000). Here is a
summary of the code I am using.
volatile unsigned char *addr, *portc;
int fd
fd = shm_open(“Physical”, O_RDWR, 0777);
addr=mmap(0,PAGESIZE,PROT_READ|
PROT_WRITE, MAP_SHARED, fd,
0xf4002000);
portc=addr+2;
/* the port I am trying to write to is at an offset of 0x02 from the
begining of of the memory mapped area */
while(!kbhit()) {
*portc=0x07;
delay(100);
*portc=0x00;
delay(100)
}
My program does the appropriate error checking to make sure that shm_open()
and mmap are working(). I am checking the bits on the port to see if they
change. Is there something I can do to make sure that the value is written
to that memory location? Any comments would be greatly appreciated.
hi,
I am trying to write to a dio port on a dio card on the pci bus. I am not
having any luck. Any input would be greatly appreciated.
I ran the show_pci utility I downloaded from quics. I can detect the
dio card. I get the correct card id and vendor id. The show_pci utility
tells me an address in memory that the card maps to(0xf4002000). Here is a
summary of the code I am using.
Doron <> doron@cfi.ucsb.edu> > wrote:
hi,
I am trying to write to a dio port on a dio card on the pci bus. I am
not
having any luck. Any input would be greatly appreciated.
I ran the show_pci utility I downloaded from quics. I can detect
the
dio card. I get the correct card id and vendor id. The show_pci
utility
tells me an address in memory that the card maps to(0xf4002000). Here
is a
summary of the code I am using.