Communicating with GPIB Instruments
David Horsell (1411) 17 posts |
Hi All, I would like to ask your opinion about the following. Our research group has been using RiscPCs and A7000s for the past 20 years principally to communicate with and read data from a range of GPIB (IEEE 488) based instruments. The program we have been running was written in BASIC and compiled with !ABC and communicated through an Intelligent Interfaces GPIB podule. The module used was IEEE488 written by Andy Ray. The RISC OS version is 3.7. I want to see if a BeagleBoard xM Rev C running RISCOS 5 could be used to do the same job, by modifying what I already have for the Acorns. I have bought a Prologix GPIB-USB controller, which allows me to simply link the GPIB instrument to the USB hub of the beagleboard. My question is how to set about the program/module task in the most efficient way. As far as I can see, I can either rewrite the BASIC code of the programme to talk to this controller, write a new module that effectively interfaces between the programme and the IEEE488 module, or rewrite the IEEE488 module. Whichever way I do it, it will be a slow-burning project as, at the moment of writing, I know only basic BASIC; but with a well defined task I hope to rectify that. If anyone knows of a good resource for learning BASIC, that would also be very helpful. Thanks in advance for any suggestions. |
Theo Markettos (89) 919 posts |
You’ll need to write a USB driver to drive the GPIB-USB controller. There isn’t much standardisation in GPIB controllers… they tend to all do their own thing, and often their own undocumented thing. So this isn’t such an easy job. However, it’s easier than it might be. The Prologix controller is based on an FT245R, which is a pretty simple USB to parallel converter chip. Bytes sent to it appear as 8 bit parallel words on the output, a bit like a parallel printer (but without all the paper status etc pins). So your first task is to write a driver for this, which isn’t completely straightforward but it’s about the simplest USB device you can get. There’s a FT232 serial port driver around somewhere (Thomas Milius?) that might be useful to modify here. But the manual mentions it also has an EEPROM, so it’s not just the FT245R driving the GPIB lines. So you’d need to take the lid off and see what else is inside. Is it a microcontroller (in which case, you need to know what it does with the parallel data)? Is it a simple demultiplexer? For example, the application I use the FT245R in most is the Altera USB blaster (a JTAG programmer for their FPGAs), where it’s connected to a simple parallel-to-serial converter in a CPLD to drive the JTAG lines. Ah, now the manual makes slightly more sense. It appears there’s a microcontroller inside and it accepts its own text commands like ‘++addr 5’. So your program just needs to prefix GPIB traffic with the appropriate strings. That’s a fairly simple text manipulation exercise. So:
|
David Horsell (1411) 17 posts |
Many thanks for your reply and advice, Theo. I have found some work colleagues who might be able to help with the BASIC and C programming so hopefully I will be able to make some progress. If I make any discoveries, I will post them here in case they are useful to anyone else. |