09-20-2010 10:29 AM
hi
Im developing a GPIB interface for an instrument, using the NAT7210.
Measurement + Automation Exporer 'scan for instruments' is not detecting my instrument
(it does detect other 3rd party instruments I have lying around in the lab)
Im running on Linux in the instrument, and this is what my driver (Sourceforge)
reads and writes from 7210 at start-up.
nec7210_iomem_write_byte 02 to AUXMR
nec7210_iomem_write_byte 00 to IMR1
nec7210_iomem_write_byte 00 to IMR2
nec7210_iomem_write_byte 00 to SPMR
nec7210_iomem_read_byte 00 from CPTR
nec7210_iomem_read_byte 00 from ISR1
nec7210_iomem_read_byte 00 from ISR2
nec7210_iomem_write_byte 70 to AUXMR
nec7210_iomem_write_byte 81 to AUXMR
nec7210_iomem_write_byte c0 to AUXMR
nec7210_iomem_write_byte a1 to AUXMR
nec7210_iomem_write_byte c0 to AUXMR
nec7210_iomem_write_byte 17 to AUXMR
nec7210_iomem_write_byte 16 to AUXMR
nec7210_iomem_write_byte 14 to AUXMR
nec7210_iomem_read_byte 40 from ADSR
nec7210_iomem_read_byte 00 from SPSR
On the GPIB bus itself, Im seeing pulses on REN at the instrument, even with the GPIB cable unplugged, so my
instrument is asserting REN - surely only a System Controller should do that?
With the GPIB cable connected, when I run 'scan for instruments' I see activity on ATN and IFC as well as REN.
When I use ibtest, I see consistently:
nec7210_iomem_read_byte 40 from ADSR
nec7210_iomem_read_byte 00 from SPSR
and not much else.
I dont have any background in GPIB (yet) - any suggestions anybody, as to why my instrument is not being detected?
09-23-2010 05:42 AM
Hi,
You're correct only the System Controller should be controlling REN, if you are seeing this from the slave device then this could be the reason the device is failing to appear on the GPIB bus as you at that point have two System Controllers on the same bus. If you look at Chapter 6-2 here do you have the System Controller capabilities of your chip set disabled at the moment?
Let me know if this helps,
Kind Regards,
09-23-2010 08:24 AM
Hello,
I would also recommend checking out the software considerations chapter in the same manual. It will tell you how to initialize the GPIB and write the primary address. There could be a problem with the NAT7210 having the same primary address as the controller.
Steven T.
09-24-2010 04:02 AM
hi thanks for the answers.
Now I have dug deeper, I think the problem is more fundamental, with the CPU to 7210 communications.
I believe I can read registers correctly -this is what they read right after chip reset :
DIR = 0xFF
ISR1 = 0
ISR2 = 0
SPSR = 0
ADSR = 0x40 (ATN* = 1)
CPTR = 0
ADR0 = 0
ADR1 = 0
Then I did this sequence:
write 0x50 to AUXMR
read from VSR
I get 0x00, when surely I should get 0x80?
This makes me think I am not writing to the NAT7210 correctly, the page-in command 0x50 written to AUXMR probably didnt work?
The question is, how can I confirm this? Is there any simple way of getting confirmation that a write to the chip has succeeded?
There dont seem to be any registers I can write to then read back from.
Basically Im not getting any life out of the 7210 at all, its as if none of the chip write are working.
09-24-2010 05:43 AM
I attached a logic analyser screenshot of a write cycle to the 7210. I am writing 50h to AUXMR.
This write was followed by a read from Register 7 to get the version - it was 0.
The waveforms look ok compared to the datasheet but the datasheet doesnt give much hard info on timings.
My WR pulse is 305ns wide. Is this too short for the NAT7210 running at 8MHz?
Our host processor is running at 200MHz so theres a limit how wide I can make these pulses. Could there be a problem with the big difference in speed of the 2 processors?
Another thing I noticed is that DRQ is asserted. Is this normal? Its as if the 7210 is expecting data to be written to CDOR?
09-24-2010 06:25 AM
sorry I meant register 3 to get the version, not 7! Typo...
09-24-2010 08:23 AM - edited 09-24-2010 08:26 AM
Hi,
Sorry ignore that previous post (This Edit), I was looking at various data sheets and didn't re-check the key, let me take a look into this and get back to you,
Thanks
09-24-2010 08:30 AM
Hello,
The CNT registers are both write and read enabled. You should be able to write values and read the same one's back to test your connections.
Thanks,
Steven T.
09-27-2010 03:58 AM
hi Steven
What are the CNT registers? There arent in my datasheet (NAT7210 Reference Manual)
I have ICR and ICR2 but they are Write-Only.
The only reference manual I can find on the NI website is June 95, plus the errata sheets, is that really the latest?
09-27-2010 08:18 AM
Sorry, but you are actually correct. The CNT registers do not exist on this chip. I was thinking of the TNT4882, which is just another GPIB ASIC.
Thanks,
Steven T.