Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

PMC-GPIB Port from X86 vxWorks to PowerPC vxWorks

We recently purchased the NI-488DDK so that we could try to get a
PMC-GPIB
card up and running on a Motorola MVME2432 VME PowerPC computer running
vxWorks.� I have been using the vxWorks example for X386 as a starting
point.
After some fits and starts, with the help of vxWorks support, I have the
code
compiling now for my board.� First I probed the PCI bus:

-> pciDeviceShow 0
Scanning function 0 of each PCI device on bus 0
Using configuration mechanism 1
bus������ device��� function� vendorID� deviceID� class
00000000� 00000000� 00000000� 00001057� 00004803� 00060000
00000000� 0000000b� 00000000� 000010ad� 00000565� 00060100
00000000� 0000000d� 00000000� 000010e3� 00000000� 00068000
00000000� 0000000e� 00000000� 00001011� 00000019� 00020000
00000000� 00000011� 00000000� 00001093� 0000c831� 00078000
value = 0 = 0x0

The PMC-GPIB is the last line with vendor 1093, device c831. I then
compiled
with DEBUG on and tried to load gpib.o and run ib_init():

-> ld
Loading /space/data/users/gravante/pmcgpib/gpib.o \
value = 2496016 = 0x261610
-> ib_init
ib_init:in
ib_init:++++++++
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_init:initialization failed for all buses
ib_init:out
ib_init:--------
value = -1 = 0xffffffff

This did not find anything.� Then I noticed in in nipci_hw.h that the
VENDOR
and DEVICE were set to:

#define PCI_NI_VENDOR_ID������� 0x1093
#define PCI_NI_DEVICE_ID������� 0xc801

This does not match what I am seeing on the PCI bus probe.� So when I
changed
it to:

#define PCI_NI_VENDOR_ID������� 0x1093
#define PCI_NI_DEVICE_ID������� 0xc831

then recompiled, I got the following:

-> ld
Loading /space/data/users/gravante/pmcgpib/gpib.o \
value = 2494200 = 0x260ef8
-> ib_init
ib_init:in
ib_init:++++++++
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:Index: 1 Base0: 0xfd001800 Base1: 0xfd004000
ib_regsInit:in
ib_regsInit:ibo->cdor=0xfd004100
ib_regsInit:ibo->admr=0xfd004108
ib_regsInit:ibo->cfg =0xfd004110
ib_regsInit:out
ib_probe:baseaddr=0x3b84b60
ib_probe:calling hw_probe at 0x5d6fb8
nipci_probe:in
nipci_init_tnt_mite:in
nipci_init_tnt_mite:MITE/base0=0xfd001800 TNT/base1=0xfd004000
nipci_init_tnt_mite:chip sig register=0x12311140
nipci_init_tnt_mite:pbar0=0x1800fd pbar1=0x4000fd
nipci_init_tnt_mite:Writing to MITE's IODWBSR..
nipci_init_tnt_mite:scrom_base_addr=0x4020fd
nipci_init_tnt_mite:Writing to MITE's IOWBSR1..
nipci_init_tnt_mite:Local Register Space...
nipci_init_tnt_mite:LCIMR1: 0x1
nipci_init_tnt_mite:LCIMR2: 0x5695
nipci_init_tnt_mite:LCR1:�� 0xd0d99077
nipci_init_tnt_mite:LCR2:�� 0x1f040000
nipci_init_tnt_mite:STOCR:� 0xe000000
nipci_init_tnt_mite:LRBA:�� 0x0
nipci_init_tnt_mite:IODWBSR:0x4000fd
nipci_init_tnt_mite:IOWBSR1:0x4020fd
nipci_init_tnt_mite:IODWSR: 0xc0
nipci_init_tnt_mite:IOWSR1: 0xc0
nipci_init_tnt_mite:IODWCR: 0x40
nipci_init_tnt_mite:IOWCR1: 0x1000040
nipci_init_tnt_mite:PIDR:�� 0x931031c8
nipci_init_tnt_mite:PSCR:�� 0x6008002
nipci_init_tnt_mite:PCCRIDR:0x1008007
nipci_init_tnt_mite:PLIVR:� 0x8ff0000
nipci_init_tnt_mite:PBAR0:� 0x1800fd
nipci_init_tnt_mite:PBAR1:� 0x4000fd
nipci_init_tnt_mite:PERBAR: 0x0
nipci_init_tnt_mite:PLRIDR: 0x1c010000
nipci_init_tnt_mite:PBAC0R: 0xa8b40000
nipci_init_tnt_mite:PERCR:� 0x8d0000c7
nipci_init_tnt_mite:CSIGR:� 0x12311140
nipci_init_tnt_mite:IOPCR:� 0x32009d00
nipci_init_tnt_mite:out
nitn_presence_check:in
nitn_presence_check:baseaddr=0x3b84b60
nitn_presence_check:enable 7210 mode and reset
nitn_presence_check:test1
nitn_presence_check:FAILURE
nitn_presence_check:adr1=0x0
nitn_presence_check:out
nipci_probe:HW not found
nipci_probe:out
ib_probe:probe failure
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_probe:in
ib_probe:++++++++
ib_probe:out
ib_probe:--------
ib_init:initialization failed for all buses
ib_init:out
ib_init:--------
value = -1 = 0xffffffff
->

It is obviously finding a board now, but it appears that it does not like
what
it sees.� Could the fact that the example code assumes a c801 DEVICE,
rather
than a c831 device be causing problems?� I do not know what the difference
bewteen these two boards is.� If so, are there #defines in the code
somewhere
that I have to change to work with the c831 device?� I do know that the
example
was running on a X386 machine, which is little endian, and I a running on a

PowerPC which is big endian - could this be causing problems?

Follow up:

In looking into the code in more detail, I did notice that the value for
base0/base1 did not match pbar0/bpar1 in the output below. Then I realized

that the two values were identical, but the 4 bytes of the 32 bit word are
swapped. This was a concern I had in my original email - my PowerPC board
is
big endian. The code in nipci_hw.c uses MITEin32(), MITEout32() macros
defined
in ib.c to read and write to the registers. I could change these macros
to
functions that read then byte swap the words, but I am not sure where else
in
the code that big endian/litte endian issues may be present. In some PCI
chips
that I have used, you can set a bit to change the interface from little to
big
endian to match your processor. Is this possible in the GPIB chip on this
PMC
card? If so, none of this code would have to change.

Gary.


...
nipci_init_tnt_mite:MITE/base0=0xfd001800 TNT/base1=0xfd004000
nipci_init_tnt_mite:chip sig register=0x12311140
nipci_init_tnt_mite:pbar0=0x1800fd pbar1=0x4000fd
....


Any help would be appreciated.
0 Kudos
Message 1 of 1
(3,290 Views)