On Tue, 24 Jun 2003 19:45:32 +0100, Trevor Page wrote:
>Hi list,
<comments below>
{Quote hidden}>I have been assigned the task of designing a piece of test
>instrumentation which must have a GPIB (IEEE-488) interface. Naturally,
>I have decided to use a PIC as the brains of the instrument. It will
>probably be an 18F452 or similar.
>
>I have never had to deal with GPIB before, ever. I've lots of
>electronics and PIC experience in general, and dabbled with various
>serial protocols for various projects, but never GPIB. So, the first
>thing I did was get myself a handbook all about the IEEE-488 standard.
>This book was conveniently found on the bookshelf in the place I work
>and seems to contain everything I could possibly need to get me started
>with the IEE-488 standard itself. So, when it comes to understanding the
>actual protocols involved, I am pretty happy that I have all the info I
>need and I just need some time now to absorb it all.
>
You don't say what version of the spec that you're using. The original
spec (circa 1978) was superceded by two specs IEEE-488.1 and
IEEE-488.2
IEEE-488.1 (titled IEEE Standard Digital Interface for Programmable
Instrumentation) defines only the hardware aspects of GPIB.
I'd recommend that you also take a look at IEEE-488.2 (titled IEEE
Standard Codes, Formats, Protocols, and Common Commands). It defines
all of the standard protocols and interface structures between your
instrument and the bus. It looks nasty at first glance but it's very
thorough and gives you a basic structure to build upon.
{Quote hidden}>Next, I looked into what chips are available to implement GPIB. I have
>learned that there are / were several industry standard devices,
>including the NEC uPD7210. I have also learned that this is now
>obsolete, and fortunately there are a number of suppliers, including
>ComputerBoards, who offer an updated and enhanced 'clone' of this
>device, including the CB7210.2 which conforms to IEE-488.2.
>
>I've concentrated on the 7210 for now (not that I know which one is
>best, but this seems to be the popular one). The datasheets for these
>devices (i.e. the old NEC one and the CB one) are pretty thin. They just
>go over the essential electrical specs, and then provide details on all
>of the internal registers of the chips. And some example application
>diagrams are given, which show how to hook the IC up to various 8-bit
>microprocessors.
>
National Instruments also produces GPIB interface chips. They have
several different versions. I don't have a current pricing comparison
but I have used their chips in the past.
{Quote hidden}>While I am now confident that I can wire one of these chips up to my
>PIC, read / write the internal registers, and generally understand what
>is going on within the low-level protocol side of things, one thing I
>feel I really lack still is some sort of example application of the
>microcontroller software. In other words, the code that talks to the
>GPIB chip, does all it's magic, and churns out high-level commands to
>the core of my program - e.g. turn this on, turn that off, reduce that
>by 3dB, etc. In fact, as a first step, I would just concentrate on
>having a GPIB-enabled PIC that turns LEDs on and off via external
>commands.
>
Good first step.
{Quote hidden}>This is something that I am eventually going to write from scratch
>myself of course, but to get me going, I would really like to know if
>anyone has done something very similar to what I'm doing, and can
>provide me with some example code - written for any micro like the PIC,
>8051, AVR etc, in assembler or C. It's just so that I can get a general
>idea what this task is going to involve. Something to inspire me, and
>also illustrate any particuarly challenging programming aspects would be
>involved.
>
Sorry but all the code that I've written was done for a client so it
isn't mine to share. While I can answer questions and give you some
general direction, the code itself is proprietary.
I don't recall encountering any particularly challenging problems
coding a GPIB instrument for a Z-80. Actually, I had (almost)
unlimited ROM and RAM to use. :=) That may have made my task easier.
>What I'm basically getting at here is that for all I know, handling the
>GPIB stuff on the PIC via the 7210 could be little harder than doing
>RS232... Or it could be almost as hefty as TCPIP. That's the problem. I
>simply have no idea what scale of task it's going to be.
>
>I know that this standard has been around for decades and even existed
>on early CBM machines and things, so surely it cannot be that difficult.
>
You're certainly going to have to write more code than you would for
an RS-232 link. :=) I'd say it probably falls just a bit under the
complexity of a USB device. Using IEEE-488.2 as a guide, your state
machines and data structures are all defined for you. That will ease
your task significantly. It's more a coding task than a full-blown
design effort.
{Quote hidden}>
>I was hoping that the suppliers of any of these 7210 variants would
>supply example microcontroller code, but I have found nothing.
>ComputerBoards do say on their website that they have some 'free' code
>for which I have written and requested, and I await their response. I
>have spent hours Googling around and searching through Google Groups.
>I've found various threads from people doing similar things but haven't
>seen evidence of a working system around a PIC, or any code. A lot of
>the links were dead because these are posts going back into the last
>century :)
>
>If anyone has any advice to offer me or even some information about
>similar projects like that that you've already done, I would appreciate
>it very much indeed.
>
Ziatech (and lots of other companies) used to make GPIB
monitors/analyzers that can make your debugging a lot easier. You can
probably find them on eBay. A simple manual monitor is a very cheap
investment that can save you tons of debug time. My trusty ol' Ziatech
(ZT-488 GPIB Analyzer) has been worth its weight in gold on many an
occasion.
Hope this helps.
Regards, Bob
--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspam
.....mitvma.mit.edu with SET PICList DIGEST in the body