Author Topic: Oscilloscope tester like Hameg HZ60  (Read 19606 times)

0 Members and 1 Guest are viewing this topic.

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #75 on: November 05, 2017, 09:05:07 am »
I pushed the project to Github: https://github.com/cosenmarco/scopetester

The code is not yet complete: It misses the signaling logic for the LED and the battery sensing as well as the auto-shutdown feature.
I would appreciate any type of review.

I simulated so far the code with the MPLAB X simulator and I cannot get it to switch pins RC2 and RC3 to high... Am I missing something?
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Oscilloscope tester like Hameg HZ60
« Reply #76 on: November 05, 2017, 09:26:43 am »
I don't see any initialisation code to disable analog mode for inputs.  Without it analog capable port pins will always read as 0.  You aren't using the comparator or ADC so adding:
Code: [Select]
ANSELA=0;
ANSELB=0;
ANSELC=0;
should do the trick.
For any pin you need to use analog mode on (e.g. battery sensing by potential divider), set the corresponding ANSELx SFR bit to 1. 

Also, to avoid issues with the RMW effect, you should define the output pins as:
Code: [Select]
#define LED_GRN LATAbits.LATA0
#define LED_RED LATAbits.LATA1
//....
#define SHUTDOWN LATCbits.LATC0
//....
#define OUT LATCbits.LATC5
and similarly for any other output pins.
« Last Edit: November 05, 2017, 09:32:39 am by Ian.M »
 
The following users thanked this post: cosenmarco

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 803
  • Country: gb
Re: Oscilloscope tester like Hameg HZ60
« Reply #77 on: November 05, 2017, 06:11:16 pm »
If you, guys, are still researching Steve Swift's MTS529 its schematic is available here.  Steve has been working on a much faster version - up until a few days before he, sadly, passed away.
He named MTS529 after his daughter's initials and birthday...
Leo
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Oscilloscope tester like Hameg HZ60
« Reply #78 on: November 05, 2017, 08:03:13 pm »
I simulated so far the code with the MPLAB X simulator

I only had a quick look...

Did you watch the count of TMR1 in the simulation.

CCP1M<3:0>: ECCP1 Mode Select bits
0010 = Compare mode: toggle output on match


doesn't say anything about reseting TMR1 to 0 for the next timed toggle.
.  That took much longer than I thought it would.
 

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #79 on: November 06, 2017, 02:09:18 pm »
Quote
doesn't say anything about reseting TMR1 to 0 for the next timed toggle.
That's exactly what I figured out yesterday and I guess also why Ian.M used PWM in his code. If I have to reset the Timer1 registers in the ISR routine, then the thing will be too slow to have a correct 1MHz output.
What can I say? No errors, no learning, no fun !!

I'll try PWM out when I get some time.
 

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #80 on: December 05, 2017, 09:11:57 am »
Hi, I updated the code in Github to a version which behaves correctly according to the simulator.
I also started programming and debugging but I cannot get it working: what I get is the following:
1) Programming and verifying goes fine according to pk2cmd using my PICKIT2 on Linux. Remember device is PIC16F1823.
2) After applying VDD at 3.3V I connected the scope probe to the 8MHz quartz and I see a noisy 2Vpp square wave oscillating at ~ 2Hz (not MHz)
3) also pin 12 presents a similar signal all other pins are either at VSS or at VDD

I've tried 3 different devices so far with the same results.  :wtf:
I suspected the compiler (MPLAB IDE with XC8) but opening the .hex in the MPLAB IPE shows the correct config word flags.
Is there a good, free disassembly tool I could use to check the .hex more in deep (preferably linux)?
Any suggestions on how to go further?

 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Oscilloscope tester like Hameg HZ60
« Reply #81 on: December 05, 2017, 12:58:56 pm »
Could it be the scope probe stopping the XTAL, try probing though a 4k to 10k.

Switch to the internal 16MHz HFINTOSC RC oscillator, for now.

Put a 0.5s LED flash as the very first thing in main(), and get that working 1st even if you have to fiddle with I/O values right there.

In main.c I couldn't find any obvious errors in Config1, Config2 or the RA4/OSC2 and RA5/OSC1 settings.
« Last Edit: December 05, 2017, 09:29:19 pm by StillTrying »
.  That took much longer than I thought it would.
 
The following users thanked this post: cosenmarco

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #82 on: December 08, 2017, 06:47:29 pm »
It was definitely the Quartz. With the internal oscillator works a treat.
I was using one of those cheapie quartz sold on eBay as a kit with the capacitors. I thought it was going to work out of the box.
I have no clue about the datasheets so it won't be easy to design the oscillator backed by formulas but only by trial and error.
I will play with the caps values and put a trimmer on the output of OSC1 and, as StillTrying suggested, probe through a resistor so that the interference of the probe input capacitance is reduced.
Any other suggestion?
 

Offline Leo Bodnar

  • Frequent Contributor
  • **
  • Posts: 803
  • Country: gb
Re: Oscilloscope tester like Hameg HZ60
« Reply #83 on: December 08, 2017, 06:56:47 pm »
Any other suggestion?
Use XO.
Or at least VSOP.
Leo
 

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #84 on: March 28, 2018, 06:22:51 pm »
After a few encouraging experiments I went ahead and created the PCB design in KiCAD.
Then I ordered the PCB by Elecrow. Here I must say that they were extremely nice and professional and honestly for the money (12€ for 14 PCBs including shipping) I wouldn't have expected the quality of service and the quality of product that I got. Definitely thumbs up :-+
I made a couple of minor mistakes: the indicator led pinout is wrong and the holes for the on/off button are too small ;D
One can see in the pictures that the rise time and fall time are in line with the bandwidth of the scope (HM407-2 40 MHz) and there is no over / undershoot
Unfortunately I have no faster scope. I can send a board to somebody who volunteers to test it to its limits and send me back pictures and data.
« Last Edit: March 28, 2018, 06:38:50 pm by cosenmarco »
 

Offline StillTrying

  • Super Contributor
  • ***
  • Posts: 2850
  • Country: se
  • Country: Broken Britain
Re: Oscilloscope tester like Hameg HZ60
« Reply #85 on: April 02, 2018, 10:36:34 pm »
The edges look very clean @ 40MHz.
I've not tried that 74AC14 anti-ringing method, turning VCC right down to 2V works!
.  That took much longer than I thought it would.
 

Online HighVoltage

  • Super Contributor
  • ***
  • Posts: 5479
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #86 on: April 03, 2018, 12:08:52 pm »
If you want to send to me, I can check it on my 6GHz Keysight 6000x scope.
I can also test the original HAMEG HZ60 at the same time and you have a nice comparison.

Send me a PM, if you are interested.

There are 3 kinds of people in this world, those who can count and those who can not.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Oscilloscope tester like Hameg HZ60
« Reply #87 on: April 03, 2018, 06:06:58 pm »
After you've got some test results, (and put together a documentation package in PDF format), as successful collaborative EEVblog forum projects of general interest aren't that common, it would be nice to send one to Dave for Mailbag.
 

Offline TechieTX

  • Contributor
  • Posts: 41
  • Country: us
Re: Oscilloscope tester like Hameg HZ60
« Reply #88 on: April 03, 2018, 11:21:55 pm »
It was definitely the Quartz. With the internal oscillator works a treat.
I was using one of those cheapie quartz sold on eBay as a kit with the capacitors. I thought it was going to work out of the box.
I have no clue about the datasheets so it won't be easy to design the oscillator backed by formulas but only by trial and error.
I will play with the caps values and put a trimmer on the output of OSC1 and, as StillTrying suggested, probe through a resistor so that the interference of the probe input capacitance is reduced.
Any other suggestion?

I'm still learning the Microchip parts, but with OTHER microcontroller oscillator circuits you want the variable cap on the input of the buffer, not the output.  The playing I've done pretty well nails a 22pf on the output, with variable freq/stability by using around a 5-25pf variable on the input of the buffer.  I haven't found a really good breakdown on what that PIC oscillator section looks like.

A 1meg to 10meg scope probe shouldn't have much effect on the oscillator.

EDIT: and you'll need to add your KiCad cache.lib library for that project to the github, Marco.  Opening your schematic with a vanilla KiCad install gets the screenshot below.  The PCB loads fine, it's only the schematic that's wonky due to the missing symbols.
« Last Edit: April 04, 2018, 12:24:52 am by TechieTX »
"No matter where you go, there you are." ~BB
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 16660
  • Country: us
  • DavidH
Re: Oscilloscope tester like Hameg HZ60
« Reply #89 on: April 04, 2018, 12:29:39 am »
A 1meg to 10meg scope probe shouldn't have much effect on the oscillator.

A x10 high impedance passive oscilloscope probe usually has about 10 to 15 picofarads of tip capacitance.  A x1 probe will have about 5 times that.

What I have done in the past where this was a problem is to add a JFET source follower to buffer the signal to the oscilloscope probe tip.  This can reduce the probe capacitance to a fraction of a picofarad.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12879
Re: Oscilloscope tester like Hameg HZ60
« Reply #90 on: April 04, 2018, 06:06:27 am »
Put a 'gimmick' capacitor in the 1pF to 2pF range in series with the tip of your x10 probe and probe with the other lead of the gimmick cap to the osc out pin.   That trades off an order of magnitude less signal level for an order of magnitude less loading.    Above 10KHz, the 10Meg input resistance shunting the typically 15pF tip capacitance of the x10 probe is negligible, so with the scope AC coupled, you can even rough calibrate the assembly to approx x100 on a low impedance known signal source by trimming the gimmick cap.

Avoid probing the osc in pin as that's usually higher impedance and more sensitive to loading.  Also use a minimum length sprung ground connection to minimise noise injection.

If the oscillator is so sensitive that it is significantly disturbed (other than a little frequency pulling) by the couple of extra pF introduced by touching it with the gimmick cap, its too close to the edge for a real-world application as a little board contamination or even temperature variation could also kill it, so its time to redesign with a tighter layout and a bit more drive margin.
« Last Edit: April 04, 2018, 06:09:16 am by Ian.M »
 

Offline cosenmarcoTopic starter

  • Regular Contributor
  • *
  • Posts: 59
  • Country: de
Re: Oscilloscope tester like Hameg HZ60
« Reply #91 on: April 05, 2018, 11:09:09 am »
Ian.M
Quote
After you've got some test results, (and put together a documentation package in PDF format), as successful collaborative EEVblog forum projects of general interest aren't that common, it would be nice to send one to Dave for Mailbag.
Absolutely. I need to solve a few small issues, maybe spin a Rev2 with additional trimmers and package it nicely so that it doesn't seem crap  ;)
I also would like to try to fit the 4 batteries (AAA) within the PCB area: should be possible but not with the battery holders available on e-bay because they are too big. I would need something as small as metal clips maybe directly soldered on the PCB... Ideas?
The size is dictated by some boxes I currently have available. Maybe I can redesign using a larger box but I like the form factor and portability it has nowadays.

By the way, for the batteroo fans, the output voltage starts decreasing when the battery voltage goes below ~3.6V. The LED turns red at ~3.8V. This means 0.95V per cell and a usage of I think more than 90% of the capacity.

TechieTX
Quote
I'm still learning the Microchip parts, but with OTHER microcontroller oscillator circuits you want the variable cap on the input of the buffer, not the output.
I didn't have the issue with the clock not starting up anymore and that's basically why I wend forward with the PCB. Adding trimming to fine tune the frequency is an attractive feature but this project is oriented at calibrating analog scopes with relatively low bandwidth (the output can max 1MHz) so I don't know if we have real need for fine tuning the frequency.

Quote
and you'll need to add your KiCad cache.lib library for that project to the github, Marco.  Opening your schematic with a vanilla KiCad install gets the screenshot below.
Interestingly enough I had the very same issue ;D I think it was due to moving the project from a MacOS based PC to my normal Linux based (the laptop was broken at the time when I started). I removed the offending libraries from the project and now should show up fine. Let me know if there's still issues and I'll try to fix them.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf