Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

nat 7210 dual addressing problem

hi
I am working on embedded gpib device.
Our implementation is using the nat 7210 in dual primary addressing mode.
With the last byte of my messages I send EOI to the CIC.
My device can be only talker or listener.
My problem  is that if I swirch between the 2 adresses using read and there is data in the second device address buffer my first byte is received from the previous device and then I get the rest of the message from the correct address.
For example if I get 1245 the 1 belongs to the previous address.
Reading continuesly from the same address is OK.
The byte that was transfered will be missing from the next address and so on.
It seems that the first interrupt is using the old address.
Does any one can think of a reason?
 
Thanks
Rona
 
0 Kudos
Message 1 of 18
(4,581 Views)

There's no concept of a "buffer" in the 7210...You just read from the CDOR a byte at a time.  Unless you're doing DMA, in which case you would see the data in memory all at once.  So I'm confused by your use fo the term "buffer".  Are you using DMA?  Or is this some internal software buffer?

You should be able to tell pretty easily which PAD has been addressed as a listener by examining the MJMN bit in the ADSR prior to reading each byte.  Are you doing this?  When?

Scott B.
GPIB Software

0 Kudos
Message 2 of 18
(4,565 Views)

hi

Maybe I did not explain my self good enough.

The buffers are SW buffers and we made 2 buffers one for "Minor" primary and one for "Major" primary.

When we receive interrupt from the NAT7210 we first look at the MJMN  bit to determine which address we need to serve.

When the messages are coming from the same address everything works OK . but when we do a read from the "Minor" and the next read is from the "Major" the first byte is sent from the "Minor" buffer and then we receive the rest of the "Major" buffer as we expected. the problem is the first byte that comes from the wrong address (buffer).

It is like the NAT7210 changes the MJMN bit only after the first interrupt.

 

0 Kudos
Message 3 of 18
(4,561 Views)
Is it possible that there is a byte loaded into the CDOR, but that byte is not transferred because the bus is readdressed?

For example, one of the addresses has the following data to send "ABCD". It sends "AB" and then loads "C" into the CDOR but does not send it because the controller has asserted attention. The controller readdresses the bus. The other address has the following data to send "WXYZ". "C" is still in the CDOR so it sends "C" and then "WXYZ", so the listener receives "CWXYZ".

Is it possible that the NAT7210 is being readdressed while it still has data to send from one of its addresses?
0 Kudos
Message 4 of 18
(4,556 Views)

I see what Collin is saying, but I think I confused the matter by talking about the CDOR.  In fact, we're talking about the CDIR, right?  Because this is when the NAT is receiving data from the GPIB?

I think this is what you're doing, please correct me if I'm wrong:

-You setup dual addressing at, say, PAD 4 and PAD 5.
-Your controller begins to write "ABCD" to PAD 4
-You do a read of the MJMN bit and see that it's the Major addressed as a listener.  You read the CDIR and get A, B, C, D.
-Your controller now writes EFGH to PAD 5.
-You read MJMN, see that the Minor address is listening, and read the CDIR 4 times to see E, F, G, H.

At what point are things messing up and going awry?

Scott B.
GPIB Software

0 Kudos
Message 5 of 18
(4,542 Views)

hi

the problem is from the device to the controller so CDOR is the right term

Rona

0 Kudos
Message 6 of 18
(4,524 Views)