Author Topic: HP 3456A DIY serial read out  (Read 2123 times)

0 Members and 1 Guest are viewing this topic.

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1143
  • Country: au
HP 3456A DIY serial read out
« on: November 29, 2013, 10:11:39 am »
With my 3456A now working, I was very keen to get the readings out of it and into the tablet app.  So I had a play around with the GPIB port last night.

Turns out to be very easy in Talk Only mode.

If anyone's interested in doing it, just grab a uC, attach the first 7 data lines, DAV and NDAC lines and the code's below.

Now to see if I can get my hands on the proper connector...

Code: [Select]
const int DAV =  10; // Data Valid
const int NDAC  =  11; // Not data accepted

byte data;

void setup() {
  Serial.begin(115200);
  pinMode(DAV, INPUT); 
  pinMode(NDAC, INPUT);
  digitalWrite(NDAC, LOW);
  pinMode(2, INPUT); //D0
  pinMode(3, INPUT); //D1
  pinMode(4, INPUT); //D2
  pinMode(5, INPUT); //D3
  pinMode(6, INPUT); //D4
  pinMode(7, INPUT); //D5
  pinMode(8, INPUT); //D6
}

void loop()
{
  pinMode(NDAC , OUTPUT);
  if(digitalRead(DAV) == LOW){   
    data = 0;
    if(digitalRead(2) == LOW)
      data |= (1<<0);
    if(digitalRead(3) == LOW)
      data |= (1<<1);
    if(digitalRead(4) == LOW)
      data |= (1<<2);
    if(digitalRead(5) == LOW)
      data |= (1<<3);
    if(digitalRead(6) == LOW)
      data |= (1<<4);
    if(digitalRead(7) == LOW)
      data |= (1<<5);
    if(digitalRead(8) == LOW)
      data |= (1<<6);
    Serial.write(data);
    pinMode(NDAC , INPUT);   

  }
}
 

Offline george graves

  • Super Contributor
  • ***
  • Posts: 1259
  • Country: us
Re: HP 3456A DIY serial read out
« Reply #1 on: November 29, 2013, 10:24:04 am »
subscribed!

Offline Harvs

  • Super Contributor
  • ***
  • Posts: 1143
  • Country: au
Re: HP 3456A DIY serial read out
« Reply #2 on: November 29, 2013, 01:44:27 pm »
subscribed!

Do you have one of these meters?

Just thinking I could get a board made through itead with the proper connector and a USB + Bluetooth interface.  The connector is $5.50 from digikey, plus all the other parts, it'd probably cost around $20.  Would anyone else be interested?
 

Offline macboy

  • Super Contributor
  • ***
  • Posts: 1916
  • Country: ca
Re: HP 3456A DIY serial read out
« Reply #3 on: November 30, 2013, 02:03:11 am »
I like the trick of emulating an open-collector I/O by switching the pin between input and output(0). That's something not everyone thinks to do.
The only thing I would add is that you should ensure that all inputs are TTL level compatible (2.0 V and up is High). With CMOS level inputs, it may not work well.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf