Author Topic: MHS-5200A Serial Protocol Reverse Engineered  (Read 55710 times)

0 Members and 1 Guest are viewing this topic.

Offline Kintekobo

  • Regular Contributor
  • *
  • Posts: 64
  • Country: gb
  • Avatar by the fabulous 'Space Coyote'
    • A Load of Old Bollox
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #25 on: August 03, 2015, 01:44:13 pm »
I compiled an English manual from Google-translated original Chinese text and other sources of information:
https://github.com/przemekklosowski/mhs52xx/raw/master/MHS5200.pdf

Hi przemek

Thanks for the superb work on the manual. Top class!

I have a couple of things to add if you haven't already found them.

The arbitrary waveform transfer is actually -

:aX0,n2,.........n64<CRLF>
:aX1,n65,n66........n128<CRLF>
.
.
:aXF,n.........n1024<CRLF>

where X is an arbitrary waveform store from 0 to F (Hex). There is an OK<CRLF> returned between each block when transfer is successful.


The Sweep time message is :s5tn from trial and error.

Regards,
Chris
You can call me anything you like. Just don't call me late for lunch.
 

Offline pascal_sweden

  • Super Contributor
  • ***
  • Posts: 1539
  • Country: no
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #26 on: August 03, 2015, 05:49:53 pm »
Would be nice if the protocol for the FeelTech signal generator can also be reverse engineered, or has somebody already confirmed that they are identical?
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #27 on: September 14, 2015, 09:09:28 pm »
Here is some eval of the generator performance.

Regards, Dana.

« Last Edit: September 14, 2015, 09:18:34 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline Howardlong

  • Super Contributor
  • ***
  • Posts: 5313
  • Country: gb
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #28 on: September 14, 2015, 09:23:49 pm »
Here is some eval of the generator performance.

Regards, Dana.

Looking at the ringing, how did you probe it?
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #29 on: September 17, 2015, 05:03:30 pm »
The pics were all probed with 10X probe, 1M, 12 pF. Also a 10X 10M 14.5 pF probe.

When looked at with 50 ohm scope termination, straight short coax, not much changed in terms
of ringing, distortion.

I looked recently at narrow pulse, low duty cycle, at 1 Mhz pulse looks like slew rate limiting
of output amp. At 6 Mhz just 1.5 V, lots ringing severely distorted.

Regards, Dana.
« Last Edit: September 17, 2015, 05:12:45 pm by danadak »
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #30 on: September 17, 2015, 09:21:28 pm »
It is slew-rate limited and heavily downpass filtered.

 This article actually describes two mods that improve the performance somewhat:
http://www.analogzoo.com/2015/08/fixing-the-mhs-5200a/

I have done it (replaced the opamps and did the "cheap" mod on the filters) and it works better, but I still get distortion at maximum amplitude. That is probably due to the insufficient supply voltage, though.

 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #31 on: October 18, 2015, 07:24:06 pm »
I was playing with some HF filters today and thought about trying the sweep function on the generator to check the filter characteristics. Of course, I am aware that with the variable amplitude of the sig gen it would be only very approximate, but that's ok for my needs atm.

However, does anyone know how to synchronize the sweep with a scope? I have tried all sorts of things - like feeding the scope trigger output into the input BNC on the sig gen, probed the TTL outputs on the back to see whether there is a sweep start signal or something but nada.

The other thing I have found seems like a bug - when I set the sweep limits (SET SWEEP FREQ1 and SET SWEEP FREQ2) only the lower limit seems to be respected and the generator always sweeps up 25MHz. Is that normal behavior?
 

Offline briselec

  • Regular Contributor
  • *
  • Posts: 94
  • Country: au
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #32 on: October 24, 2015, 12:48:58 pm »
If you use channel 1 for sweep, set channel 2 to output a square wave with a period equal to the sweep time.  Connect channel 2 to one of the channels on your scope and use that as the trigger.

TTL OUT1 and TTL OUT2 appear to output a square wave at the same frequency as channel 1 and channel 2.

When a channel is generating a signal that doesn't agree with the settings, try turning the unit off and back on.
Usually fixes it. Definitely has some bugs in it.

 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #33 on: October 24, 2015, 05:38:17 pm »
Hmm, didn't think of that. However, isn't that going to drift all over the place? The trigger vs. the sweep start, I mean.

 

Offline briselec

  • Regular Contributor
  • *
  • Posts: 94
  • Country: au
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #34 on: October 25, 2015, 06:17:15 am »
The display of the sweep will drift slightly.  The settings resolutions aren't fine enough to precisely match the 2 channels.




 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #35 on: October 25, 2015, 11:16:00 pm »
Right, makes sense. I guess better than no sync at all.

On the other hand, this device really begs to have its firmware replaced and these silly problems fixed - there is a ton of free I/O available on the connectors to provide a proper sync signal :(
 

Offline Peter Axelsson

  • Newbie
  • Posts: 1
  • Country: se
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #36 on: March 31, 2016, 04:03:39 pm »
Anyone have the serial command to change the display from channel 1 to channel 2?

Best regards
Peter Axelsson
 

Offline EU1

  • Regular Contributor
  • *
  • Posts: 62
  • Country: ua
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #37 on: July 16, 2016, 09:38:07 pm »
Protocol specification in Chinese, I hope it will be helpful:
« Last Edit: July 16, 2016, 09:41:05 pm by EU1 »
 

Offline tomonthelam

  • Newbie
  • Posts: 1
  • Country: us
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #38 on: September 23, 2016, 06:05:05 am »
This is great work...thanks for the effort...

Just getting my feet wet so I though I would fire up old Hyperterminal, point it at the COMM port, and see if I could tickle the 5200A, but no joy.

Any ideas?
 

Offline nickcres13

  • Newbie
  • Posts: 9
  • Country: us
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #39 on: January 10, 2017, 01:43:58 am »
I know im late, but thought I would put in a word about some scripts im developing to further gain access to the MHS5200A device via serial commands. Namely, I have started with a dumb script that asks it for the frequency (on "EXT_IN") once a second and plots it in gnuplot. Links to the github repo and a boring video of me using it below. Let me know what needs fixed!

NOTE: I compile and run on Ubuntu, should work on other Linux distros, as for Windows and hackcoughblechApple there is work to do still obviously...


https://github.com/electricsheeplabs/mhs5200aDataLogger
 
The following users thanked this post: SeanB

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #40 on: January 12, 2017, 02:00:45 pm »
Hello,

I have this same generator too and perhaps this is a completely dumb question, but what is your use case for this? Why are you datalogging the frequency?

Are you trying to characterize the stability of the instrument?


EDIT: Yes, it was a dumb question - on re-reading I have found that you are logging the EXT_IN external input, so using the device as a counter, not generator. D'oh!  :palm:

 

Offline nickcres13

  • Newbie
  • Posts: 9
  • Country: us
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #41 on: January 12, 2017, 06:20:36 pm »
Janoc,

Not to worry! Indeed using as a counter... I think this could be a useful tool for certain measurement tools, such as monitoring a frequency in a lab. I was hoping to use it to monitor the frequency of a crystal oscillator, ore more specifically, a quartz crystal monitor, whose freq changes as mass is deposited on it (and by calibrating, one can measure minute amounts of mass that get deposited on it)...anyhow, let me know if you come up with any cool uses for the script! And also if you would like it to have other functionality. Its easy to send and receive other messages to the device...

Nick
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #42 on: January 13, 2017, 09:02:56 pm »
Yes, I know, I have the same generator on my desk. It is not stellar, but hard to beat for the price.

My have asked the original question because I thought you were logging the frequency of the generator - which isn't of much use when measured/provided by the generator itself. So I thought I am missing something there.

 

Offline nickcres13

  • Newbie
  • Posts: 9
  • Country: us
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #43 on: January 16, 2017, 04:23:33 pm »
Indeed! Yup im using it to monitor the frequency of external sources...though what is very interesting to me (and as other people in this thread have pointed out) is that if you wire the output into the EXT_IN, the value of the input and output don't agree! For example, you set the generator to "sine wave" at 10 Mhz and read that signal on the EXT_IN, and you will see something like 10.000123...so the counter and generator don't agree, even though they are presumably running on the same clock! Not sure why this is, maybe someone who knows more about FPGA/signal generators can comment...
 

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #44 on: January 16, 2017, 08:15:53 pm »
Indeed! Yup im using it to monitor the frequency of external sources...though what is very interesting to me (and as other people in this thread have pointed out) is that if you wire the output into the EXT_IN, the value of the input and output don't agree! For example, you set the generator to "sine wave" at 10 Mhz and read that signal on the EXT_IN, and you will see something like 10.000123...so the counter and generator don't agree, even though they are presumably running on the same clock! Not sure why this is, maybe someone who knows more about FPGA/signal generators can comment...

Really??  :wtf:

I haven't tried that on mine. But it is well possible it is the consequence of some firmware problem - the generator has plenty of jitter so who knows how they have implemented the DDS and how accurate the frequency is. I certainly wouldn't use it for something where accurate frequency generation or measurement mattered.

 

Offline BugCatcher

  • Contributor
  • Posts: 27
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #45 on: January 18, 2017, 10:07:31 am »
please read my old comment:
https://www.eevblog.com/forum/testgear/mhs-5200a-function-generator-teardown-review-reverse-engineering/msg1055618/#msg1055618

btw.     to add another surprise
            if you try to tweak the oscillator for correct frequency ...  the nominal crystal frequency is not 16.000.000Hz!

            you can find my other observations/modifications under
            http://www.analogzoo.com/2016/08/revisiting-the-mhs5200a/#comment-16400

Have Fun
 
The following users thanked this post: nickcres13

Offline janoc

  • Super Contributor
  • ***
  • Posts: 3780
  • Country: de
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #46 on: January 18, 2017, 08:15:49 pm »

Sounds about right.

I remember your blog - I have done the opamp replacement and modded the filter on mine (the older version).
 

Offline JHav

  • Newbie
  • Posts: 1
  • Country: cz
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #47 on: February 15, 2017, 02:36:36 pm »
Hello,

I purchased recently MHS-5200A and developing control SW for it. Some functions are still not working properly (Save/Load M0 - M9). I can catch all codes with serial port analyzer and original SW but the device behaviour is strange...
 

Offline nickcres13

  • Newbie
  • Posts: 9
  • Country: us
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #48 on: February 22, 2017, 11:24:11 am »
JHav,

Looks cool! What language/interface are you developing with? I hope it is Linux compatible, I would love to get a copy of it when you are done (or maybe I could help beta test? haha). Let me know if i can help too, I have mainly C and shell script experience. Best of luck.

Nick
 

Offline technogeeky

  • Frequent Contributor
  • **
  • Posts: 555
  • Country: us
  • Older New "New Player" Player Playa'
Re: MHS-5200A Serial Protocol Reverse Engineered
« Reply #49 on: February 23, 2017, 03:55:54 am »
JHav,

Looks cool! What language/interface are you developing with? I hope it is Linux compatible, I would love to get a copy of it when you are done (or maybe I could help beta test? haha). Let me know if i can help too, I have mainly C and shell script experience. Best of luck.

Nick

If it can be run in Linux (using WINE or whatever), I can make it happen. I will do it ASAP if I get my hands on the software.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf