Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

nat 7210 dual addressing problem

HI
thanks, but this is my true problem:
There is a need for read without query
and there is a need to fill a buffer with several messages before the controller reads one....
 
Rona
0 Kudos
Message 11 of 18
(1,754 Views)
Can you require readdressing? If you can require readdressing, you can wait for an ATN interrupt after sending the the LF to arm the interrupt for data requested.

If you can't require readdressing, you will have to poll on NRFD to determine if the host is really requesting data from you. If NRFD goes from asserted->unasserted, then the host is really requesting data and you should start the next message. If it ATN goes from unasserted->Asserted, then the hsot is not requesting any more data and you can stop polling NRFD. You have a potential bigger problem since you are trying to implement multiple devices and presumably the host could read x bytes from one device and then x bytes from the other device and go back and forth until it reads the entire message from both. In this case, you will ALWAYS have to poll for NRFD to indicate that you need to put a data byte into the CDOR register (which may be easier since there is only one way to transmit a byte: be addressed and detect NRFD unasserting).

Good luck!
0 Kudos
Message 12 of 18
(1,750 Views)

thanks...i will try

Roan

0 Kudos
Message 13 of 18
(1,745 Views)

hi

Something i do not undestand...NRFD is controlled by  nat7210 and my SW (as a gbib talker/listener device).

It will not help me to sample it because I change it and it is in the correct state.T

he problem is how to eliminate data sent by the second device to the first device address...

If the work flow is query there isnt any problem. The problem starts at asyncronic communication when I collect data into sw buffer and sent it back answering only a read command. the next read from the second address will get the next byte in the first address buffer...!

0 Kudos
Message 14 of 18
(1,716 Views)
NRFD is controlled by the listener. If the NAT7210 is currently the talker (which was the case you described to me), the controller will be controlling the NRFD line.
0 Kudos
Message 15 of 18
(1,713 Views)

hi

The problem is still here...

The problem is that I need to send data responding to read command only (not query)

I can not use NRFD detection because the controller actually asks for the data, just from the wrong adddress(first byte only)

another thing...does someone knows why I get 6 or 7 interrupts for 5 bytes message read?

 

10x

 

0 Kudos
Message 16 of 18
(1,694 Views)
I just looked at the NAT7210 data sheet and the DO bit is set by (TACS & SGNS & ~nba), which means that the NAT7210 will tell you that the controller is requesting a data byte when you are addressed a talker and ATN is unasserted. This says nothing about whether the NRFD line is unasserted and the host is really requesting data. This is as I described it earlier, I just wanted to make sure.

The problem with this definition is that you will do the following:
Device1 buffer: ABC\n
Device2 buffer: DEF\n
Assume that everytime you are requested to talk, you just repeat the same message:

Host Address Device 1 and read (Generates ADSC interrupt and then a DO interrupt requesting the first byte)
Device 1 places 'A' in CDOR (Generates DO interrupt when sent across the bus)
Device 1 places 'B' in CDOR (Generates DO interrupt when sent across the bus)
Device 1 places 'C' in CDOR (Generates DO interrupt when sent across the bus)
Device 1 places '\n' in CDOR w/EOI (Generates DO interrupt when sent across the bus)
Device 1 places 'A' in CDOR [*I think this is the problem, but Device 1 is addressed as a talker and you get a DO interrupt, so...]
Host Address Device 2 and read (Generates ADSC interrupt and then gets the 'A' and then generates DO interrupt
Device 2 places 'D' in CDOR (Generates DO interrupt when sent across the bus)
Device 2 places 'E' in CDOR (Generates DO interrupt when sent across the bus)
Device 2 places 'F' in CDOR (Generates DO interrupt when sent across the bus)
Device 2 places '\n' in CDOR w/EOI (Generates DO interrupt when sent across the bus)

This is what would happen if you just handle the DO interrupt to send data. However, I have a new, simpler way of handling this that doesn't require polling for NRFD. When you get DO interrupt, you know you are in TACS, so you will also enable an interrupt for ATN. When the controller asserts ATN to send a command byte (required before it can change your addressing from Device 1 to Device 2) you will get the ATN interrupt. If you get an ATN interrupt, than you have not sent that byte across the bus and likely a "wrong" byte is stuck in the CDOR. Therefore, set the auxillary command nbaf, which tells the NAT7210 that the byte that you put in the CDOR is not a valid byte (clears nba). [Make sure you back up your array index so that you don't skip the byte next time Device 1 is a talker.] Then, the next that ATN is unasserted, you will get a new DO interrupt. In the ISR, you do as you normally do (I expect) and check the MJMN bit to determine which device should talk and load the CDOR with that byte.

Regarding the 6 or 7 interrupts for 5 bytes, this depends on which interrupts you have enabled. The 7210 generates an ADSC interrupt [isr2.0] when your addressing state changes from TIDS to TADS and then again from TADS to TACS. Then you will get a DO interrupt indicating that the controller requests a byte. Then, you will get another DO interrupt for each byte that is requested and one more when the last byte is sent, so you can get anywhere from 6 to 8 interrupts depending on your current state and the enabled interrupts.

Message Edited by GPIB Guru on 03-09-2006 07:28 AM

0 Kudos
Message 17 of 18
(1,689 Views)
Hi everyone
thanks for all the help!
the nbuf solution is working so i hope this problem is behind me now:
🙂
Rona

Message Edited by Rona on 03-14-2006 12:34 AM

0 Kudos
Message 18 of 18
(1,643 Views)