Easy programming for the DSO Quad

So I can send data with simple printf() but no read? Thats enough for data log but not control.



I took the sample voltmeter code and created a large number display to use like a DVM. The code is not pretty but I was amazed at how much more accurate readings are in pawn compared to the normal or alternative software.



I wonder what could be done with pawn if it was the main app. Use all the slots for pawn.


Kind of. Not yet Pawn bindings for the function. But maybe I’ll find time to add it soon :slight_smile:

Yeah after being calibrated it should be quite accurate. Maybe one day I’ll bother porting the calibration stuff to main firmware. It’s not complex, I don’t understand how the main firmware calibration manages to suck so bad.

Flash is no-longer restricting, but the RAM size is. Pawn as a language is not very powerful, if there will be a more powerful version of DSO Quad one day I’d like to run Lua or Squirrel on it.



And because Pawn is interpreted, it’ll always be limited to the simpler stuff. I couldn’t imagine writing a complete oscilloscope app in pawn; it would simply be too slow.


That would be great. Let me know if you need beta tester.


The one thing I noticed is that I must calibrate on battery power. If I calibrate while powered by USB it is off. Maybe gabonator1 could use the same method for calibration in the alternate firmware.


What else could pawn do on the DSO?

I have decided to use pawn on the DSO to make a capacitor checker. Simple RC circuit timer. Use waveout to power and wave-in to measure voltage drop over time. I think it may also be possible to measure the internal resistance of the cap too.

Good to know! I haven’t noticed that, but it makes sense as the 3.6V supply voltage is not regulated. It may be that the battery charge level also affects it a bit. But it shouldn’t be very large effect because it is only the opamp supply voltage and not any reference voltage.

Nice! Perhaps the 51 ohm internal resistor on the waveout is enough, so you don’t need separate resistor for the RC timer?

I wonder if it could be used to improve accuracy more. Compare current voltage against that of when it was calibrated. Would need to test at various voltages to check for linearity but I think it could be an improvement to your already good calibration system.

I doubt 51 ohms would work across a wide enough range but it will need to be considered in the calculations.

Indeed. Or maybe we are lucky and the behaviour is somehow predictable between units; then it could just be compensated without calibrating each device separately.

Based on rough calculations, it would have some chance of working for capacitances 100nF and higher.



Not sure if ESR measurement will be possible without external FET; theoretically one could pull the waveout low, but the difference in voltage will be very small. The AC mode at 50mV range could work here.

Entirely possible. Only way to know it to test.

I don’t see it. 51 ohm, and 100nf cap with a 2.5v source has a rise time of 0.0164ms to reach 2.4v. That will require a very fast counter.

I was thinking along the lines of something like this.

May not be possible but I thought it would be worth a look.

You have hardware that is able to capture 1180 samples in that time. So I was thinking something like this:


  1. Set waveout to output square wave @ 10Hz.


  2. Set wavein to capture @ 72MHz in free-running mode (DC 500mV) and start the capture synchronously. This means the capture will start when waveout starts a new period.



    The result will be a decaying waveform like this: <LINK_TEXT text=“http://en.wikipedia.org/wiki/File:Serie … oltage.svg”>http://en.wikipedia.org/wiki/File:Series_RC_capacitor_voltage.svg</LINK_TEXT>



    Then you could fit the exponential function to the captured data and compute the capacitance from that.



    You will have to adjust the sample rate for higher capacitances though. Because the usable sample buffer is only about 3500 samples, it will only store 50 microseconds @ 72MHz.

I was just going to do a simple RC circuit. Your method will work and not require external parts. I will switch gears and duplicate with my test equipment first and then reproduce in pawn.


Since we have a lot to FPGA logic to spare, the FPGA could even catch the preset point in your project with something like this
[code]
– Start some counter somewhere

sig_preset_reached <= ‘1’ when ADC_sample > PRESET else ‘0’;

preset_capture: process(sig_preset_reached)
begin
if rising_edge(sig_preset_reached) then
– stop counter and output count
end process;
[/code]
The first part (combinatorial) can easily run in less than a ns, and the counter can be connected to the main sampling clock.

Today I got an error when loading pawn.



redscreen hardfault



SP:2000bcf0 PC:080442ac LR:08045063

SCB HFSR:40000000 CFSR:00008200 BFAR:74ab4c00



There are also R0 to R12 listings as well as Callers.



I have tried reloading older versions of everything and it still does it. I also loaded jpa’s flashtst.hex into app4 to see if it might have a problem in that slot but it worked fine. When I loaded pawn again it still does the hardfault.



Any help would be appreciated.



My gut tells me its because I loaded the logo file. I have not found a way to erase and start clean.

That PC address is in the AlterBIOS memory. Try reloading AlterBIOS.



(I’m not sure if I should combine the alterbios image to Pawn image, so that they are both in the same .HEX file)

That was it. Not sure what happened but its working again.



I was making headway on calibration last night. Trying to add supply voltage differences. Is it possible to get CPU temp in pawn?

Nope, and even if it was the CPU temp sensor requires calibration itself also.

I don’t care if its accurate. Monitoring drift over time could help.

True; but it would only be a second-hand estimate for the ADC / analog stage temperature. Because the data is all digital from the ADC onwards.

Let me back up and explain why I was asking about monitoring temp drift over time. I noticed drift when using the DSO with standard or alternative firmware when measuring RMS. This is about the same time I lost access to pawn. There is several volts drift after minutes.



I just checked the volt meter readout with pawn and it is rock steady. I also checked the Vref on the ADC.



Now I assume there is a bug in the RMS calculations.

There is new release 0.08 that fixes a bug with FFT causing hardfaults.



http://koti.kapsi.fi/~jpa/dsoquad/#QuadPawn

Thank you for the update.



Note that the application still identify itself as V0.07 in the about window