Author Topic: AR488 Arduino-based GPIB adapter  (Read 269051 times)

0 Members and 8 Guests are viewing this topic.

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #625 on: January 29, 2021, 06:38:55 pm »
in my (working) Arduino some of the pins numbers are different:
your   mine
11----16
12----14
13----15
the rest are the same
I think you have to modify some pin definition in the sources....



Ouch... that is an interesting one..  Let me go and check that..  Thank you!

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #626 on: January 29, 2021, 07:00:39 pm »
This is what I found in AR488_Layouts.h :

/**************************************/
/***** UNO/NANO LAYOUT DEFINITION *****/
/***** vvvvvvvvvvvvvvvvvvvvvvvvvv *****/
#if defined(AR488_UNO) || defined(AR488_NANO)


/***** NOTE: UNO/NANO pinout last updated 21/09/2019 *****/
#define DIO1  A0  /* GPIB 1  : PORTC bit 0 */
#define DIO2  A1  /* GPIB 2  : PORTC bit 1 */
#define DIO3  A2  /* GPIB 3  : PORTC bit 2 */
#define DIO4  A3  /* GPIB 4  : PORTC bit 3 */
#define DIO5  A4  /* GPIB 13 : PORTC bit 4 */
#define DIO6  A5  /* GPIB 14 : PORTC bit 5 */
#define DIO7   4  /* GPIB 15 : PORTD bit 4 */
#define DIO8   5  /* GPIB 16 : PORTD bit 5 */

#define IFC    8  /* GPIB 9  : PORTB bit 0 */
#define NDAC   9  /* GPIB 8  : PORTB bit 1 */
#define NRFD  10  /* GPIB 7  : PORTB bit 2 */
#define DAV   11  /* GPIB 6  : PORTB bit 3 */
#define EOI   12  /* GPIB 5  : PORTB bit 4 */

#define SRQ    2  /* GPIB 10 : PORTD bit 2 */
#define REN    3  /* GPIB 17 : PORTD bit 3 */
#define ATN    7  /* GPIB 11 : PORTD bit 7 */


Which does not seem to map either your or my Arduino:
- for your pin nrs I see no corresponding #defines
- for mine I lack pin 13

I also added a picture of the bottom of my Arduino PCBs.  Note that A4, A5, A6 and A7 are unpopulated. A4 and A5 are listed in the AR488_Layouts.h file

So... Looks like this particular Arduino board variant is not suitable for the AR488. :-//

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #627 on: January 29, 2021, 07:10:11 pm »
The Arduino's I ordered this afternoon match the pin nrs you have on yours  ;D 

Might even be the same board.


 

Offline eliocor

  • Supporter
  • ****
  • Posts: 522
  • Country: it
    • rhodiatoce
Re: AR488 Arduino-based GPIB adapter
« Reply #628 on: January 29, 2021, 07:57:15 pm »
Try the following:
1) download the latest source code from https://github.com/Twilight-Logic/AR488
2) modify the AR488_Config.h as:
3) on line 26 remove the comment in front of: #define AR488_CUSTOM
4) change lines lines 218÷235 from:
Code: [Select]
#define DIO1  A0  /* GPIB 1  */
#define DIO2  A1  /* GPIB 2  */
#define DIO3  A2  /* GPIB 3  */
#define DIO4  A3  /* GPIB 4  */
#define DIO5  A4  /* GPIB 13 */
#define DIO6  A5  /* GPIB 14 */
#define DIO7  4   /* GPIB 15 */
#define DIO8  5   /* GPIB 16 */

#define IFC   8   /* GPIB 9  */
#define NDAC  9   /* GPIB 8  */
#define NRFD  10  /* GPIB 7  */
#define DAV   11  /* GPIB 6  */
#define EOI   12  /* GPIB 5  */

#define SRQ   2   /* GPIB 10 */
#define REN   3   /* GPIB 17 */
#define ATN   7   /* GPIB 11 */
to:
Code: [Select]
#define DIO1  3   /* GPIB 1  : PORTD bit 0   data pins assigned for minimum shifting */
#define DIO2  13  /* GPIB 2  : PORTB bit 1 */
#define DIO3  12  /* GPIB 3  : PORTB bit 2 */
#define DIO4  11  /* GPIB 4  : PORTB bit 3 */
#define DIO5  8   /* GPIB 13 : PORTB bit 4 */
#define DIO6  9   /* GPIB 14 : PORTB bit 5 */
#define DIO7  10  /* GPIB 15 : PORTB bit 6 */
#define DIO8  6   /* GPIB 16 : PORTD bit 7 */

#define IFC   4   /* GPIB 9  : PORTD bit 4 */
#define NDAC  A3  /* GPIB 8  : PORTF bit 4   fast control pins assigned to same port */
#define NRFD  A2  /* GPIB 7  : PORTF bit 5 */
#define DAV   A1  /* GPIB 6  : PORTF bit 6 */
#define EOI   A0  /* GPIB 5  : PORTF bit 7 */
#define REN   5   /* GPIB 17 : PORTC bit 6 */
#define SRQ   7   /* GPIB 10 : PORTE bit 6 */
#define ATN   2   /* GPIB 11 : PORTD bit 1 */
5) recompile
6) program
7) test

just to simply things, attached you will find the file already modified for you.
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #629 on: January 30, 2021, 12:03:36 pm »
hi! Thank you for the adapted .h file.  I just tried it on both of my 5V Arduino's but unfortunately no GPIB communications :-(  No "annunciator" like RMT on the display of my HP3478A

Serial communications are working, as before. 

Wilko

Try the following:
1) download the latest source code from https://github.com/Twilight-Logic/AR488

[snip]

just to simply things, attached you will find the file already modified for you.
 

Offline eliocor

  • Supporter
  • ****
  • Posts: 522
  • Country: it
    • rhodiatoce
Re: AR488 Arduino-based GPIB adapter
« Reply #630 on: January 30, 2021, 12:23:44 pm »
maybe there is another way....
What kind of board have you selected in the "Arduino.exe" SDK?
See it in the [Tools/Board] menu or in the lower right of the Arduino.exe window.
« Last Edit: January 30, 2021, 12:38:01 pm by eliocor »
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #631 on: January 30, 2021, 12:59:15 pm »
Found a problem:  pins for DIO3 and DIO4 were swapped with respect to the Arduino I have in use.

So the .h snippet below corrects that:

/*******************************/
/***** AR488 CUSTOM LAYOUT *****/
/***** vvvvvvvvvvvvvvvvvvv *****/
#ifdef AR488_CUSTOM

#define DIO1  3   /* GPIB 1  : PORTD bit 0   data pins assigned for minimum shifting */
#define DIO2  13  /* GPIB 2  : PORTB bit 1 */
#define DIO3  11  /* GPIB 3  : PORTB bit 2 */
#define DIO4  12  /* GPIB 4  : PORTB bit 3 */


At least I get "annunciators" TLK and RMT active on the HP3478A LCD  :D The HP3478A utility unfortunately still does not work.  I will first program the second one.. not all that confident about these  Arduino's I found here in my "used parts" bin.

But.. progress at least!

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #632 on: January 30, 2021, 01:12:15 pm »
YES!

2nd Arduino programmed with the fixed .h seems to work now!

Thanks/mille grazie to eliocor!

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #633 on: January 30, 2021, 03:45:09 pm »
 :palm: Conclusion: I have an  interesting collection of more or less duff Arduino's..  Just trashed a bunch that do not seem to respond to anything, or let themselves be programmed but that is about it etc..  |O

But in any case I have one working AR488 now.  So I am a happy camper!

Wilko
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1168
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #634 on: January 30, 2021, 03:51:58 pm »
Your board looks identical to the one I used for a PCB layout. If you select the 32U4 layout it should work correctly. However, the pin numbers will not be the same as the Uno version - I relocated them to allow the code to work more efficiently (less bit-re-mangling, more whole-word writes).

So it's fine to rearrange the pins that are moved as you have done, but for a little more speed or to use my PCB layout, use the 32U4 option.



 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #635 on: January 30, 2021, 06:28:26 pm »
Apart from the pin number differences already observed (11-13 vs 14-16), although the boards shown by wkb and eliocor are similar in appearance, they are rather different. Firstly note that they have two different processors. The board shown by wkb has a 328p whereas the board shown by elicor has a 32u4. That's the reason for the different pin numbers.

wkb, could you please confirm which board you purchased and based on the information provided here, I will add the layout for it to the next release.

artag's board was originally designed for the Micro Pro with 32u4 MCU on board. The 328p board shown appears to be a Nano variant without a micro-USB header. I was a bit concerned that the additional RST pin shown on the far side of GND pin that is next to pin 2 might be grounded. Its hard to tell from the picture, but I suspect it is probably mis-labelled and actually is a second GND pin, same as on the 32u4 board. Since your second board runs with the adjusted layout, that doesn't seem to be a problem anyway.
« Last Edit: January 30, 2021, 06:31:37 pm by WaveyDipole »
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #636 on: January 30, 2021, 06:56:45 pm »
hello Wavey,

I have attached some pictures of the working unit that are hopefully somewhat crispier. The silkscreen quality is not very stellar unfortunately. Hope this assists you somewhat?

I have these Arduino's in my possesion for a couple of years now,  no idea where they came from
other than "China". Sorry for a less than clueful answer.

Wilko

 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #637 on: January 30, 2021, 06:58:02 pm »
blasted upload limit..  :box:

Please let me know if I can provide you with additional information.

Thanks for your work on making this possible!

Wilko
« Last Edit: January 30, 2021, 06:59:52 pm by wkb »
 

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #638 on: January 30, 2021, 08:20:21 pm »
Was hoping you might have had a link to an eBay item number or something, but I think I have identified it as a "Pro Mini":

https://www.ebay.co.uk/itm/Arduino-Pro-Mini-compatible-5V-16MHz-ATMega328-pin-headers-UK-SELLER/254327628308

I see that both 3v3 and 5v variants do exist although the eBay photos seem identical. On the other hand, your photos show slightly different boards. The 3v3 variant seems to have an 8MHz clock whereas the 5v one has a 16MHz clock so there is likely to be some performance difference although both seem to have the same pinout. The name of this board is similar but subtly different to the "Micro Pro" which is a 32u4 based board, but is understandably and easily confused. Still, it seems to me that it would be worth having a documented and supported layout for it, especially as it appears to fit directly onto Artag's adapter board.

Since I don't have such a board to hand, could I ask you to test it for me once the update is ready :-)

Regards.
« Last Edit: January 30, 2021, 08:23:27 pm by WaveyDipole »
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #639 on: January 30, 2021, 08:57:43 pm »
Alas, no URL from eBay or similar. My bet would be Banggood or Aliexpress, not eBay.

The problem of 5V versus 3.3V is familiar. I have fed them 7V on their RAW voltage input and measured the Vcc they output.

More than happy to test if for you of course!  I currently have one working speciment, the Funduino one I posted pictures of.
 

Offline artag

  • Super Contributor
  • ***
  • Posts: 1168
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #640 on: January 30, 2021, 09:13:09 pm »
The only pinout difference between the pro mini and the pro micro is that there's a reset pin on the mini pro thaht's ground on the micro pro.

However, while that means either will fit my PCB, there may still be some pin mapping differences.

And the mini pro has TTL serial instead of USB, so it needs an external FTDI adapter or similar.
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #641 on: February 03, 2021, 10:50:13 am »
However, while that means either will fit my PCB, there may still be some pin mapping differences.

And the mini pro has TTL serial instead of USB, so it needs an external FTDI adapter or similar.

The only pinout difference between the pro mini and the pro micro is that there's a reset pin on the mini pro thaht's ground on the micro pro.

However, while that means either will fit my PCB, there may still be some pin mapping differences.

And the mini pro has TTL serial instead of USB, so it needs an external FTDI adapter or similar.

Yes, I run the AR488 with an FTDI cable, works fine.

To make EZGPIB work I had to jumper the CTS - RTS wires.  In the meantime I have patched the EZGPIB.EXE to eliminate the CTS check. So, something like a CP2102 cable should now also work. Have not verified that yet.

I dug up my 2 dusty IEEE488 0.5m cables (genuine HP, only the best  8) ). After connecting my two HP8642a generators I could make both of them work using a single AR488. I suppose this is better not tried with a 20m long bus but  a short one the Arduino drives without issues.

Wilko
 

Offline kutte

  • Contributor
  • Posts: 35
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #642 on: February 04, 2021, 04:41:02 pm »
my pro mini is accepted by EZGPIB withn an USB Prolific adapter cable tx/rx/gnd/vcc only.

@WKB
could you please provide your pin mapping so that the pro mini works with an PCB for pro micro in detail?
thank you Kutte
 

Offline Echo88

  • Frequent Contributor
  • **
  • Posts: 835
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #643 on: February 04, 2021, 06:37:14 pm »
I want to build a relay scanner thats capable of accepting front panel buttons and commands via a GPIB-port to make the relays switch.
So far i only found open source USB-GPIB-Controllers, which arent capable of the Device Mode as far as i understand.
AR488 seems to be capable of said mode, but im unsure how to actually use this very big library to do what i want.
Can someone guide me a bit on how to do what i mentioned with the library?
Is AR488 capable of using GPIB-addresses in Device Mode, which would allow the usage of more than one DIY-scanner on the same GPIB-Bus when they all have different adresses?

Thanks.
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #644 on: February 04, 2021, 08:56:19 pm »
my pro mini is accepted by EZGPIB withn an USB Prolific adapter cable tx/rx/gnd/vcc only.

@WKB
could you please provide your pin mapping so that the pro mini works with an PCB for pro micro in detail?
thank you Kutte

Yes I can..  8)


/*******************************/
/***** AR488 CUSTOM LAYOUT *****/
/***** vvvvvvvvvvvvvvvvvvv *****/
#ifdef AR488_CUSTOM

#define DIO1  3   /* GPIB 1  : PORTD bit 0   data pins assigned for minimum shifting */
#define DIO2  13  /* GPIB 2  : PORTB bit 1 */
#define DIO3  11  /* GPIB 3  : PORTB bit 2 */
#define DIO4  12  /* GPIB 4  : PORTB bit 3 */
#define DIO5  8   /* GPIB 13 : PORTB bit 4 */
#define DIO6  9   /* GPIB 14 : PORTB bit 5 */
#define DIO7  10  /* GPIB 15 : PORTB bit 6 */
#define DIO8  6   /* GPIB 16 : PORTD bit 7 */

#define IFC   4   /* GPIB 9  : PORTD bit 4 */
#define NDAC  A3  /* GPIB 8  : PORTF bit 4   fast control pins assigned to same port */
#define NRFD  A2  /* GPIB 7  : PORTF bit 5 */
#define DAV   A1  /* GPIB 6  : PORTF bit 6 */
#define EOI   A0  /* GPIB 5  : PORTF bit 7 */
#define REN   5   /* GPIB 17 : PORTC bit 6 */
#define SRQ   7   /* GPIB 10 : PORTE bit 6 */
#define ATN   2   /* GPIB 11 : PORTD bit 1 */

#endif
/***** ^^^^^^^^^^^^^^^^^^^ *****/
/***** AR488 CUSTOM LAYOUT *****/
/*******************************/


 
The following users thanked this post: kutte

Offline WaveyDipoleTopic starter

  • Frequent Contributor
  • **
  • Posts: 851
  • Country: gb
Re: AR488 Arduino-based GPIB adapter
« Reply #645 on: February 05, 2021, 09:28:37 pm »
I want to build a relay scanner thats capable of accepting front panel buttons and commands via a GPIB-port to make the relays switch.
So far i only found open source USB-GPIB-Controllers, which arent capable of the Device Mode as far as i understand.
AR488 seems to be capable of said mode, but im unsure how to actually use this very big library to do what i want.
Can someone guide me a bit on how to do what i mentioned with the library?
Is AR488 capable of using GPIB-addresses in Device Mode, which would allow the usage of more than one DIY-scanner on the same GPIB-Bus when they all have different adresses?

Thanks.

Yes. In controller mode the ++addr command sets the controller address, but in device mode it sets the device address so you could assign a different GPIB address to each device. Using ++savecfg stores the configuration in EEPROM. Alternatively you could enable Macro mode and store the ++mode 0 and ++addr x commands in the startup macro. Your relay scanner would presumably need to be capable of communicating via UART/USB for configuration purposes and to to receive its commands. There isn't as yet a hardware (dip-switch style) means of setting the address although such a thing would not be impossible to add. I would need to know more about the design of your relay scanner design to comment further.
 

Offline Echo88

  • Frequent Contributor
  • **
  • Posts: 835
  • Country: de
Re: AR488 Arduino-based GPIB adapter
« Reply #646 on: February 07, 2021, 10:32:45 pm »
I was planning on building a relay scanner like this one: http://www.dataproof.com/media/d0465722b2aecc8bffff8241ffffe907.pdf
So for example 32 relays switched by suitable relay drivers, switchable via frontpanel-buttons or GPIB-commands.
Frontpanel-Buttons should be lockable and the Remote-LED/Local-Button should work.

If id use two Arduinos: The first runs the AR488 with the mentioned macro (++mode 0&++ addr X) and the second configures the first µC and then takes the serial commands (coming from the first µC, translated from GPIB) and switches the relays?

 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #647 on: February 09, 2021, 11:23:28 am »
Boat from China has arrived: fresh Arduino's  :)

Silkscreen on these is of better quality, see attached picture.  Testing to commence tonight (I hope).

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #648 on: February 09, 2021, 06:38:39 pm »
OK, just programmed one and it seems to work just fine with EZGPIB and my HP3478a. Using the custom pinout I posted a couple of postings back.

Wilko

Boat from China has arrived: fresh Arduino's  :)

Silkscreen on these is of better quality, see attached picture.  Testing to commence tonight (I hope).

Wilko
 

Offline wkb

  • Frequent Contributor
  • **
  • Posts: 928
  • Country: nl
Re: AR488 Arduino-based GPIB adapter
« Reply #649 on: February 12, 2021, 02:03:59 pm »
The only pinout difference between the pro mini and the pro micro is that there's a reset pin on the mini pro thaht's ground on the micro pro.

However, whiley that means either will fit my PCB, there may still be some pin mapping differences.

And the mini pro has TTL serial instead of USB, so it needs an external FTDI adapter or similar.

Fresh Arduinos have arrived from China. Yet another variant(??). Definitely more pin mapping differences than just the extra Reset pin.

The silkscreen says "Arduino Pro Micro", it identifies as a Arduino Leonardo in device manager under windoze.

See attached picture. Note that the 3 pins to the right of pin 10 have different numbering compared to the Pro Mini picture I posted earlier.

Selecting model "Arduino Leonardo" does not lead to a working AR488 however. Compiles fine, talks to EZPGPIB, does not work other than that.

So...what I think I need is this adapted pin mapping:

/*******************************/
/***** AR488 CUSTOM LAYOUT *****/
/***** vvvvvvvvvvvvvvvvvvv *****/
#ifdef AR488_CUSTOM

#define DIO1  3   /* GPIB 1  : PORTD bit 0   data pins assigned for minimum shifting */
#define DIO2  15  /* GPIB 2  : PORTB bit 1 */
#define DIO3  16  /* GPIB 3  : PORTB bit 2 */
#define DIO4  14  /* GPIB 4  : PORTB bit 3 */
#define DIO5  8   /* GPIB 13 : PORTB bit 4 */
#define DIO6  9   /* GPIB 14 : PORTB bit 5 */
#define DIO7  10  /* GPIB 15 : PORTB bit 6 */
#define DIO8  6   /* GPIB 16 : PORTD bit 7 */

#define IFC   4   /* GPIB 9  : PORTD bit 4 */
#define NDAC  A3  /* GPIB 8  : PORTF bit 4   fast control pins assigned to same port */
#define NRFD  A2  /* GPIB 7  : PORTF bit 5 */
#define DAV   A1  /* GPIB 6  : PORTF bit 6 */
#define EOI   A0  /* GPIB 5  : PORTF bit 7 */
#define REN   5   /* GPIB 17 : PORTC bit 6 */
#define SRQ   7   /* GPIB 10 : PORTE bit 6 */
#define ATN   2   /* GPIB 11 : PORTD bit 1 */

#endif


Unfortunately selecting a custom layout by #define AR488_CUSTOM results in a compile error for the serial port  ::)

Like so:
215:46: error: cannot convert 'Serial_*' to 'HardwareSerial*' in initialization

   HardwareSerial *arSerial = &(AR_SERIAL_PORT);



So.. basically I am confused? The

Wilko
(wandering in a maze full of Arduinos, #define's and #ifdefs, all alike)

« Last Edit: February 12, 2021, 02:12:05 pm by wkb »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf