EEVblog Electronics Community Forum

Products => Test Equipment => Topic started by: Valentin on April 18, 2020, 03:15:22 pm

Title: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Valentin on April 18, 2020, 03:15:22 pm
Hello dear people! I was roaming around aliexpress, like one does, looking for cheap equipment and I stumbled across this thing for ~$140 which is really cheap when considering what it's specs state(which I don't really believe after looking at the mini scope's review), looks very new tho and I haven't been able to find any videos or even posts of it anywhere.
So I was wondering I'd come on here and ask you wonderful people if it might be worth buying, or if maybe someone has their hands on this thing. I don't have a scope in my lab yet and I was wondering what I should buy.
I was looking at analog scopes but prices here are absolutely outrageous(150 euros for a used 1 channel 10mhz analog scope, give me a break...), I found some better ones like a 25MHz 2 channel Phillips for 100eu, but for that price, I'd rather use a Chinese USB o-scope with 60Mhz bandwidth, but even then I'd rather use a propper bench scope, so this scope might be something of value.

Here's the listing:
https://www.aliexpress.com/item/4000861098295.html?spm=a2g0o.productlist.0.0.22127b3doVRRR4&algo_pvid=edb11322-95b9-46ac-9a63-b8edb27f3c5b&algo_expid=edb11322-95b9-46ac-9a63-b8edb27f3c5b-13&btsid=0ab6fb8315872218024854861e5a0e&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ (https://www.aliexpress.com/item/4000861098295.html?spm=a2g0o.productlist.0.0.22127b3doVRRR4&algo_pvid=edb11322-95b9-46ac-9a63-b8edb27f3c5b&algo_expid=edb11322-95b9-46ac-9a63-b8edb27f3c5b-13&btsid=0ab6fb8315872218024854861e5a0e&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: StillTrying on April 18, 2020, 03:39:02 pm
I can't find the exact FNIRSI-1013D 100MHz tablet oscilloscope, your link doesn't work.
Dave's looked at the yellow FNIRSI-5012H 100MHz bandwidth 500MS/s. :popcorn:

https://www.youtube.com/watch?v=SIH48bIUU00 (https://www.youtube.com/watch?v=SIH48bIUU00)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Valentin on April 18, 2020, 04:10:09 pm
Quote
Dave's looked at the yellow FNIRSI-5012H 100MHz bandwidth 500MS/s.
Yes, I know he looked at that, that's what I mentioned in parenthesies.

Quote
your link doesn't work.
Weird. I clicked it and it worked, let me link another one. This one should also be from the official firnis store on ali:
https://www.aliexpress.com/item/4000934486311.html?spm=a2g0o.productlist.0.0.82921270tT6riy&algo_pvid=f6723bf1-94cf-4142-a575-b7c768967cb7&algo_expid=f6723bf1-94cf-4142-a575-b7c768967cb7-1&btsid=0ab6fb8815872260505105676ec577&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ (https://www.aliexpress.com/item/4000934486311.html?spm=a2g0o.productlist.0.0.82921270tT6riy&algo_pvid=f6723bf1-94cf-4142-a575-b7c768967cb7&algo_expid=f6723bf1-94cf-4142-a575-b7c768967cb7-1&btsid=0ab6fb8815872260505105676ec577&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
And another one from another firnis store(?):
https://www.aliexpress.com/item/4000904121391.html?spm=a2g0o.productlist.0.0.82921270tT6riy&algo_pvid=f6723bf1-94cf-4142-a575-b7c768967cb7&algo_expid=f6723bf1-94cf-4142-a575-b7c768967cb7-2&btsid=0ab6fb8815872260505105676ec577&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_ (https://www.aliexpress.com/item/4000904121391.html?spm=a2g0o.productlist.0.0.82921270tT6riy&algo_pvid=f6723bf1-94cf-4142-a575-b7c768967cb7&algo_expid=f6723bf1-94cf-4142-a575-b7c768967cb7-2&btsid=0ab6fb8815872260505105676ec577&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Valentin on April 18, 2020, 04:17:07 pm
Heres what the listing says: *chinglish spam warning*
[spoiler]
Key features:
1:Intelligent anti-burn,1X Can withstand up to 400V withstand voltage
2:100MHz analog bandwidth @ 1GSa/s sampling rate(1X = 5MHz,10X = 100MHz)
3:Fully fit 7 inch 800 * 480 resolution color TFT LCD display with bright colors and high contrast
4:Capacitive touch screen, the same as the touch mode of modern mobile ipad, is not a resistive touch screen with ancient nail operation
5:High measurement voltage range, 1X can measure 0 ~ 40 V, 10X can measure 0 ~ 400V,100X can measure 0 ~ 4000V
6:Up to 12 parameters measurement:VPP,VP,Vmax,Vmin,Vavg,Vrms,Frequent,Duty+,Duty-,Time+,Time-,Period
7:Cursor measurement function, it is convenient to manually measure the period and frequency and voltage
8:Complete triggering function (single, normal, automatic)
9:At any time, the waveform display (pause function) is frozen
10:Equipped with high efficiency One-button AUTO
11:One-button waveform storage and screenshot
12:Built-in 1GB storage space, can store up to 1000 screenshots + 1000 sets of waveform data
13:Powerful waveform picture manager supports thumbnail browsing, viewing, detailed viewing, page turning, deletion and waveform zooming in, zooming out, moving, etc.
14:Equipped with a USB interface, which can be connected to a computer to share its screenshots with the computer, which is convenient for secondary analysis
15:Lissajous figures graphic display function can be used to determine the amplitude, frequency, and phase contrast of two groups of signals
16:FFT display function, can analyze the spectral characteristics of the signal
17:Built in 6000mAh rechargeable lithium battery,Fully charged for 4 hours of continuous use at the highest screen brightness
18:Memory compression technology, waveform refresh screen does not flicker
19:Screen brightness adjustment
20:Background grid brightness adjustment
21:Ultra thin, easy to carry
 
Specifications:
1:Analog band width: 100MHz * 2
2:Number of channels:2 channels
3:Maximum real time sampling rate: 1GSa/s
4:Vertical sensitivity: 50 mV/div ~ 500 V/div
5:Horizontal time base range: 50S/div ~ 10nS/div
6:Maximum test voltage: 40 V (1X probe), 400 V (10X probe)
7:Storage depth: 240Kbit
8:Input resistance: 1M
9:ADC precision: 8bits
10:Coupling mode: AC/DC
11:Trigger mode: Single, Normal, Auto
12:Trigger edge: Rising edge/Falling edge
13:External trigger voltage 0 – 40 V
14:Display: 7 inch - 800*480
15:Operating: Capacitive touch screen + gesture
16:Extension ports:USB picture export
17:Power supply: 6000 mAh lithium battery
18:Size: 184mm x 124mm x 50mm
19:Total weight:650g
 
Package includes:
1 x FNIRSI-1013D oscilloscope host
2 x Matching 100MHz probe(1X and 10X)
1 x 5V2A Charger(Include USB data line)
1 x User manual (English)
[/spoiler]

And here are some images, there's a whole bunch more on the listing, wasn't bothered to screenshot them all:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: fkfaraz on May 05, 2020, 02:49:36 pm
also interested in this tablet o'scope. does any body got hand on this o'scope???
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: PKTKS on May 05, 2020, 03:31:48 pm
also interested in this tablet o'scope. does any body got hand on this o'scope???

Not seeing before.  Seems a new model.

It would be nice if that  BW is really 100MHz
unlike the others which more likely are 20MHz or so

Price would fit if 100MHz  otherwise just a crap
But a mobile bat operated 100MHz w/TFT touch ?

That is nice
Paul

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on May 05, 2020, 05:44:34 pm
I saw that, couldnt help myself and ordered one, I will let you know when I get it. I have to know if the XY mode is as good as the one video I saw or if its bullshit, I MUST KNOW....   :-DD

Regards
Nik
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 05, 2020, 07:10:42 pm
The main hardware is probably the same garbage as the little one. If you want a tablet oscope don't waste your money and get a micsig.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on May 05, 2020, 07:16:51 pm
The main hardware is probably the same garbage as the little one. If you want a tablet oscope don't waste your money and get a micsig.

Find out soon enough!  >:D

MicSig is the much better choice if you need a portable scope. I just want to see if its the same old or whether they have actually progressed to something better, there is no pull apart/reviews on it I could find.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 05, 2020, 07:30:25 pm
I expect a better mcu for handling the display and... Nothing else.

Maybe it'd be a decent platform for your own tablet project.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: fkfaraz on May 06, 2020, 07:04:43 pm
yeah definitely Micsig is better then this tab o'scope. But micsig is like a bench o'scope specially the sto1104c (with knobs On) looks like a fully featured bench o'scope. while this one could be used in field even if works reasonably around 20Mhz-ish. ::)

@wolfy007 let us know ur opinion when u get it..

Finger crossed :box: :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cdev on May 06, 2020, 07:17:20 pm
Looks pretty nice for the price.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on May 06, 2020, 08:25:08 pm
Frontend look similar to the FNIRSI-5012H but they added a FPGA.

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985500;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985504;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985508;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985512;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985516;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985520;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985524;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: afm on May 09, 2020, 10:40:49 pm
Reads 100 Mhz, or not?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stefanh on May 12, 2020, 12:30:06 am
Can you confirm the bandwidth?  Price is very appealing for a small portable 2 channel scope.

Looks like a few copycat / rebadged versions are making an appearance.
https://au.banggood.com/DANIU-ADS1013D-2-Channels-100MHz-Band-Width-1GSa-or-s-Sampling-Rate-Oscilloscope-with-7-Inch-Color-TFT-LCD-Touch-Screen-p-1641865.html?cur_warehouse=CN

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: hgjdwx on May 12, 2020, 02:05:46 am
This is the key:
4:Vertical sensitivity: 50 mV/div ~ 500 V/div
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ResistorRob on May 12, 2020, 09:16:37 pm
Original Poster's link worked for me.

If they had a 4 channel version of this it would be the perfect cheap automotive scope. I don't have the need for anything mobile, but being battery operated would be awesome because then I would be isolated from mains. Even if it operates at half it's claimed bandwidth it would be worth it (to me).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cdev on May 12, 2020, 11:13:01 pm
Watch out for ESD even so!

I'd be afraid to use such an obviously all solid state scope to measure spark plug timing, but I suppose there must be some way of doing it safeely. tapping off a logic level signal before it goes to the high voltage?


You know, since your use is so specialized, I bet there is a way to do that for much less money. But of course it wouldn't look as cool as a tablet scope. If they can pull this off and its a decent product they deserve some kind of award. It would be such a great thing for experimenters.

They need a better name. "FNIRSI" how does one pronounce that?


Original Poster's link worked for me.

If they had a 4 channel version of this it would be the perfect cheap automotive scope. I don't have the need for anything mobile, but being battery operated would be awesome because then I would be isolated from mains. Even if it operates at half it's claimed bandwidth it would be worth it (to me).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1847123212 on May 13, 2020, 12:19:36 am
allwinner F1C100S for main controller,it looks interesting :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nctnico on May 13, 2020, 06:03:49 am
Original Poster's link worked for me.

If they had a 4 channel version of this it would be the perfect cheap automotive scope. I don't have the need for anything mobile, but being battery operated would be awesome because then I would be isolated from mains. Even if it operates at half it's claimed bandwidth it would be worth it (to me).
Don't mistake an oscilloscope like this with an oscilloscope suitable to use with mains! This oscilloscope has no protection against touching live parts at all so it is not suitable to use as a floating oscilloscope. You'll need to use a CAT rated differential probe anyway to probe anything connected to mains.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Rhenium on May 18, 2020, 07:18:43 am
Hi!

Did anyone check if it was capable of 100Mhz? Or where its limit is?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: StillTrying on May 18, 2020, 02:12:24 pm
4:Vertical sensitivity: 50 mV/div ~ 500 V/div

The link now works for me but I still can't figure it's maximum/Div sensitivity. 50mV/Div makes me think they don't use any amplification on the inputs, which would make the high BW a bit easier.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on May 18, 2020, 02:15:34 pm
Found this video about it ;) Has a nice touch screen interface but not intensity graded or DPO so update rate is probably minimal. But still not a bad bit of kit for the money.

https://www.youtube.com/watch?v=EToBC3_FtOs (https://www.youtube.com/watch?v=EToBC3_FtOs)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on May 18, 2020, 02:31:32 pm
Mine hasnt come in yet with all this disrupted mail stuff, so I cant test anything yet, hopefully Kosmic will have further updates soon.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on May 18, 2020, 04:05:44 pm
Mine hasnt come in yet with all this disrupted mail stuff, so I cant test anything yet, hopefully Kosmic will have further updates soon.

Sorry for the confusion, I didn't order one. Found those disassembly pictures on some Russian website.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on May 18, 2020, 04:13:43 pm
Hi!

Did anyone check if it was capable of 100Mhz? Or where its limit is?

Considering that the FNIRSI-5012H is not 500MS/s sampling rate and 100Mhz bandwidth. I would be really surprise if this one is 1GSa/s and 100Mhz. The frontend will probably have the same variable impedance (depending on the range) problem but the FPGA will certainly help with sampling rate.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 23, 2020, 05:59:17 pm
I notice that this unit is sold under three names:  Daniu,  Fnirsi, Elikliv.

Daniu is sold at Banggood for $148.  Fnirsi is sold at Ali Express for $138. Elikliv on Amazon for $190.  But new customers at Banggood get a $20 first time discount (I think - I haven't tried it yet  - could be a come on - or maybe only for items $5,000 or more :palm:.)

Does anyone know the difference between these three brands?  Probably no difference, right?  Does someone else make them besides the names on them?

Would this unit be:  1) Overkill  2) About right, or 3) Inadequate for a noob as an electronics teaching/learning tool, working through a Make: Electronics book and kit or planning to explore Arduino in the near future.  I'm already using a couple of DMMs.

I'm thinking that even 1/2 the value of the specs. on this unit would still be decent for my purposes.  The touch screen interface seems to be more intuitive than most.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 24, 2020, 05:29:01 am
Hi all.

I got one of these to test out.  Results so far are OK-ish – i.e. it does work.

It comes with quite two decent-looking older HP type probe copies.  I have not checked these as yet.


I have an oscilloscope calibrator here at work, so give some suggestions as to what I should verify and I will try to get it sorted.

This unit also came without a front bezel, from the 'Official FNIRSI' store on AliExpress.  Make of that what you will, but it suggests some form of re-work without proper QC to me...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 24, 2020, 09:46:08 am
Hi all.

I got one of these to test out.  Results so far are OK-ish – i.e. it does work.

Cool. I don't expect it to be perfect at this price point but is there anything you'd say was a deal breaker? How's the touch screen? Good update rate? How easy it is to set horizontal/vertical scale? Does it crash and need rebooting?

Are you "This is OK...", or "What a pile of garbage!"?

  • My unit is way out on vertical accuracy, yielding around 212 mVpp for a 200 mVpp 1 kHz square wave.  Specification is 2%, which seems optimistic, but 6% high is fairly poor.

That wouldn't worry me at all. "About 200mV" is fine.

(and yeah, 2% is never going to happen with an 8-bit ADC on a device like this)

  • No way to store or restore setups, and fairly limited measurement options.

Sooooo annoying if it doesn't power on to a known state (preferably the same as power-off).

  • I am not sure if it is set to a sinc mode or not – no setting for this.

It will be obvious if it doesn't have it: Zoom in on a rising edge and look for Gibbs phenomenon, ie. a sinc will show ringing before the signal starts to rise.

  • Waveform capture is two horizontal screens wide, so you can shift the window that much.  No hold-off or other such niceties.

Not ideal, but not a deal breaker.

I have an oscilloscope calibrator here at work, so give some suggestions as to what I should verify and I will try to get it sorted.

The main thing at this price point is being able to see wiggly lines on screen properly and not have any deal-breaking fails/annoyances.

I'd go to the extremes of horizontal scale and see how badly it aliases high/low frequencies. See if you can get it to display correct-looking waves with completely wrong frequencies.

How good is the FFT? I have a cheapo device with an awesome FFT (much better than the FFT on low end Rigols/Siglents).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on May 24, 2020, 02:41:03 pm
One of the problem of the FNIRSI-5012H was software triggering + slow sampling rate. Hopefully this is now fixed with the newly added FPGA ? in any case I would make sure to test triggering on slow or non repetitive waveforms.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 25, 2020, 09:14:18 am
Cool. I don't expect it to be perfect at this price point but is there anything you'd say was a deal breaker?

Nothing like that, for the cost.  It is 'feature poor', compared to a 'real' 'scope, but for the price...

Quote
How's the touch screen? Good update rate? How easy it is to set horizontal/vertical scale? Does it crash and need rebooting?

Good update rate, seems responsive.  No crashes yet, but the AUTO SET function can be a bit hit or miss.  (But it is fast, so just tap it more times.)

Quote
Are you "This is OK...", or "What a pile of garbage!"?

So far, it seems usable.

The biggest issue may be that 50 mV/div lowest amplitude setting.

Quote
That wouldn't worry me at all. "About 200mV" is fine.

(and yeah, 2% is never going to happen with an 8-bit ADC on a device like this)

Sure.  If you know how inaccurate it is, then it's less of a problem.

Quote
Sooooo annoying if it doesn't power on to a known state (preferably the same as power-off).

Sorry: it does power-up as last set.  No way to store another setup, though.

Quote
It will be obvious if it doesn't have it: Zoom in on a rising edge and look for Gibbs phenomenon, ie. a sinc will show ringing before the signal starts to rise.

Probably not, then.  (See attachments.)

Quote
The main thing at this price point is being able to see wiggly lines on screen properly and not have any deal-breaking fails/annoyances.

I'd go to the extremes of horizontal scale and see how badly it aliases high/low frequencies. See if you can get it to display correct-looking waves with completely wrong frequencies.

How good is the FFT? I have a cheapo device with an awesome FFT (much better than the FFT on low end Rigols/Siglents).

FFT included in attachments.  It seems viable for simple requirements.  Update rate is fast.

Attachments:

Pic 1: 200 mVpp @ 1 kHz (centred)
Pic 2: 200 mVpp @ 100 kHz (centred)
Pic 3: 3 Vpp @ 50 kHz sine (centred) – horizontal jitter roughly ± 0.1 div
Pic 4: 3 Vpp @ 50 kHz sine (centred) – trigger shifted low
Pic 5: 3 Vpp @ 50 kHz sine (centred) – trigger shifted high
Pic 6 & 7: 3 Vpp @ 50 MHz sine (centred) – amplitude ~2.3<->2.5 Vpp
Pic 8: 3 Vpp @ 10 MHz sine (centred) – stable amplitude (becomes significantly unstable around 20 MHz)
Pic 9: 3 Vpp @ 10 Hz sine (centred) – roll mode (automatic - cannot be selected)
Pic 10: 3 Vpp @ 50 kHz sine (centred) – aliased signal (AUTO SET not used, but shows aliasing is possible)
Pic 11: 200 mVpp @ 1 kHz (centred) – FFT
Pic 12-14: 20 Vpp @ 1 kHz (centred) – FFT, shifting horizontal scale

Notes on pictures and waveforms saved.

This is fast and seems to work well – but does not show the FFT in the thumbnail.  (No idea why not.)  There is no way to organise them; last saved is at top left.


Edit: forgot to add CH impedance characteristics as follows:

CH1: 1.015-1.016 MOhm // 30.0-30.1 pF
CH2: 1.012-1.013 MOhm // 30.5 pF.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 25, 2020, 11:32:59 am
FFT included in attachments.  It seems viable for simple requirements.  Update rate is fast.

Definitely something weird in the FFT.

[attachimg=1]

Attachments:

Pic 1: 200 mVpp @ 1 kHz (centred)
Pic 2: 200 mVpp @ 100 kHz (centred)
Pic 3: 3 Vpp @ 50 kHz sine (centred) – horizontal jitter roughly ± 0.1 div
Pic 4: 3 Vpp @ 50 kHz sine (centred) – trigger shifted low
Pic 5: 3 Vpp @ 50 kHz sine (centred) – trigger shifted high
Pic 6 & 7: 3 Vpp @ 50 MHz sine (centred) – amplitude ~2.3<->2.5 Vpp
Pic 8: 3 Vpp @ 10 MHz sine (centred) – stable amplitude (becomes significantly unstable around 20 MHz)
Pic 9: 3 Vpp @ 10 Hz sine (centred) – roll mode (automatic - cannot be selected)
Pic 10: 3 Vpp @ 50 kHz sine (centred) – aliased signal (AUTO SET not used, but shows aliasing is possible)
Pic 11: 200 mVpp @ 1 kHz (centred) – FFT
Pic 12-14: 20 Vpp @ 1 kHz (centred) – FFT, shifting horizontal scale

Thanks for all those.

How do you adjust the horizontal/vertical? Does it use gestures like pinch-zoom, etc.?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 25, 2020, 12:50:36 pm
What are your thoughts about ease of use of the interface, especially compared to traditional knob and button layouts?  Simpler?  Confusing?  More or fewer steps to accomplish intent?  How useful is the manual for experienced?  For noobs? 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on May 25, 2020, 01:35:23 pm
Would it be possible to test it with higher frequency square waves, e.g. 10-100MHz?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 25, 2020, 02:20:00 pm
Definitely something weird in the FFT.

Yeah.  I suspect it’s working on the (full?) bitmap.  Not sure how useful it is.  I noticed it looks like it overlaps / interleaves when the signal becomes less ‘noisey’, so I tried to capture that behaviour.

Quote
How do you adjust the horizontal/vertical? Does it use gestures like pinch-zoom, etc.?

Horizontal (which took me a while to figure out) is just tapping left or right side on the display.  Vertical is by the CTRL item; opens a menu with V+ / V- items for each channel.

Functional enough, if a bit clunky.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 25, 2020, 02:25:42 pm
What are your thoughts about ease of use of the interface, especially compared to traditional knob and button layouts?  Simpler?  Confusing?

For people used to tapping phone screens, probably just as easy to use.  Cost is likely lower for capacitive touch screens now.  The screen is quite responsive.  Edit: seems to be single point / single touch only — no pinch type behaviour.  (I believe this is cheaper.)

Quote
More or fewer steps to accomplish intent?

It’s very basic.  Think of it as the equivalent of a simple, 3.5 digit multimeter.  The ease of capturing screenshots and waveforms is a positive.  Battery life of four hours seems feasible, too.

Quote
How useful is the manual for experienced?  For noobs?

Utterly hopeless.  But this is a pretty basic instrument, so I’m not sure if a decent manual would add much.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 25, 2020, 02:38:34 pm
Would it be possible to test it with higher frequency square waves, e.g. 10-100MHz?

The Wavetek calibrator tops out at 100 kHz for amplitude-controlled square waves.  I was more focused on the vertical (in)accuracy, as the timebase seemed reasonably accurate up until the trace became unusable (jitter / trigger issues render the trace ineffective by around 50 MHz).

I can check the higher frequencies with a nominal square wave using the timebase function later today.

It looks like the effective bandwidth is way less than 100 MHz, but I can check using the supplied probes as the manual appears to claim that you need to use the 10x probe setting to achieve the claimed bandwidth.

Jitter starts getting significant past 10 MHz for sine waves, so the triggering is a bit dubious.  You have the option of a set 50% trigger (in a settings menu) or can manually move the trigger point.  It certainly isn’t as stable as a decent ‘scope, but would be fine for gross estimations of signal presence and approximate shape.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 25, 2020, 03:57:24 pm
the manual appears to claim that you need to use the 10x probe setting to achieve the claimed bandwidth.

That's true on all 'scopes.

https://www.youtube.com/watch?v=OiAmER1OJh4 (https://www.youtube.com/watch?v=OiAmER1OJh4)

Jitter starts getting significant past 10 MHz for sine waves, so the triggering is a bit dubious.

This is much more worrying. 10Mhz is in the "Arduino range".

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 25, 2020, 04:29:47 pm
I just watched the video on this page, I think it gives a pretty good idea of what it does and how it does it.

https://www.aliexpress.com/item/4000861098295.html (https://www.aliexpress.com/item/4000861098295.html)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 26, 2020, 12:49:33 am
the manual appears to claim that you need to use the 10x probe setting to achieve the claimed bandwidth.
That's true on all 'scopes.

Not with an oscilloscope calibrator.  Or at least I have not found this to ever be the case.

The bandwidth is determined using direct connection from an Active Head.  (Usually 3 Vpp @ 50 kHz as reference level, so I did that here, but didn't bother to adjust for an accurate 3 Vpp reference indication because this isn't really a 'performance' instrument, so meh...)

So this instrument seems a bit odd, if it only functions correctly with the probe.

Quote
Jitter starts getting significant past 10 MHz for sine waves, so the triggering is a bit dubious.
This is much more worrying. 10Mhz is in the "Arduino range".

There isn't a lot in the front end.  A gradual deterioration in stability seems to occur, somewhere past 10 MHz for a sine wave.  Because this starts at 50 mV/div, perhaps it would perform better with a higher amplitude than 3 Vpp.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on May 26, 2020, 01:01:11 am
the manual appears to claim that you need to use the 10x probe setting to achieve the claimed bandwidth.
That's true on all 'scopes.

Not with an oscilloscope calibrator.  Or at least I have not found this to ever be the case.

The bandwidth is determined using direct connection from an Active Head.  (Usually 3 Vpp @ 50 kHz as reference level, so I did that here, but didn't bother to adjust for an accurate 3 Vpp reference indication because this isn't really a 'performance' instrument, so meh...)

So this instrument seems a bit odd, if it only functions correctly with the probe.

Jitter starts getting significant past 10 MHz for sine waves, so the triggering is a bit dubious.
This is much more worrying. 10Mhz is in the "Arduino range".
There isn't a lot in the front end.  A gradual deterioration in stability seems to occur, somewhere past 10 MHz for a sine wave.  Because this starts at 50 mV/div, perhaps it would perform better with a higher amplitude than 3 Vpp.
So its amplitude rolloff is not consistent through the V/div ranges and BNC cable connection produces different results ?  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 01:11:13 am
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 26, 2020, 02:25:48 am
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.
Is the Hantek linked below a less enough of a "toy" to be worth $70 more?
https://www.amazon.com/Hantek-DSO5072P-Digital-Oscilloscope-Bandwidth/dp/B00RJPXB6Y/ref=sxin_12_ac_m_pm?ac_md=5-1-QmV0d2VlbiAkMTAwIGFuZCAkNDAw-ac_d_pm&cv_ct_cx=oscilloscope&dchild=1&keywords=oscilloscope&pd_rd_i=B00RJPXB6Y&pd_rd_r=a2fcc83f-174f-4d8b-8b42-a9c39cadd7d8&pd_rd_w=Z1GDp&pd_rd_wg=4wViO&pf_rd_p=14719209-e059-46b3-be1a-859d16f01f7e&pf_rd_r=ZQK2WZNQ2XPTRBDYA52V&psc=1&qid=1590459641&sprefix=oscillo&sr=1-2-3f74d940-526b-436f-a83d-f486577edf4d (https://www.amazon.com/Hantek-DSO5072P-Digital-Oscilloscope-Bandwidth/dp/B00RJPXB6Y/ref=sxin_12_ac_m_pm?ac_md=5-1-QmV0d2VlbiAkMTAwIGFuZCAkNDAw-ac_d_pm&cv_ct_cx=oscilloscope&dchild=1&keywords=oscilloscope&pd_rd_i=B00RJPXB6Y&pd_rd_r=a2fcc83f-174f-4d8b-8b42-a9c39cadd7d8&pd_rd_w=Z1GDp&pd_rd_wg=4wViO&pf_rd_p=14719209-e059-46b3-be1a-859d16f01f7e&pf_rd_r=ZQK2WZNQ2XPTRBDYA52V&psc=1&qid=1590459641&sprefix=oscillo&sr=1-2-3f74d940-526b-436f-a83d-f486577edf4d)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 02:29:22 am
Yes, that's not a toy. It's a real oscilloscope and while its specs aren't very good at least they're honest and I'm reasonably certain it can do whatever they claim.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 26, 2020, 07:49:46 am
Some more results.

15_c.png through 25_c.png are a 1 Vpp sine wave at settings from 20 ns/div (50 Mhz) through to 10 ns/div (100 MHz) in -1 ns/div steps.  Notice that the 100 Mhz trace has essentially died.  But...

26_c.png and 27_c.png are an 11 ns/div then 10 ns/div trace.  This was done by slowly ramping from 20 ns/div down to 11 ns/div, then 10.9 ns/div down to 10.0 ns/div.  So, a stable 100 MHz trace – if you can slide onto it gently...   :-+

28_c.png and 29_c.png are part of a PAL TV signal check at white and mid-grey levels respectively.  It shows the cursors in use.  There is a "move fast" / "move slow" setting (right of the s/div) that alters the sensitivity of dragging movements.  "move fast" is too fast, while "move slow" is frustratingly slow.   :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 26, 2020, 07:59:03 am
So its amplitude rolloff is not consistent through the V/div ranges and BNC cable connection produces different results ?  :-//

It appears to be a weird hybrid / fast logger design to me, repurposed through software to give 'scope-like functionality.

My positive takes are: it is cheap, claimed to handle 400 Vpeak directly (yeah... I could check, but...), responsive UI, makes taking screen / waveform captures easy (but limited options if you want to do anything on the device), and it does yield a sensible(ish) trace up to 50 MHz+.

Negative: not really a handheld 'scope, IMO.

I think it is more of a "basic 'scope" / pretty inaccurate DMM hybrid.  (And I suspect it's really a data logger.)


Should you buy it?

Well, will it do what you would want it for?  Should be useful to quickly probe something before cranking up the real 'scope, as an alternative to the cheaper not-quite 'scopes, or for certain 'niche' uses.  I intend on adding it to my gear for the Airsoft club, where it could be handy to check for battery/motor type faults where a DMM doesn't tell you enough.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on May 26, 2020, 08:10:31 am
So its amplitude rolloff is not consistent through the V/div ranges and BNC cable connection produces different results ?  :-//

It appears to be a weird hybrid / fast logger design to me, repurposed through software to give 'scope-like functionality.

My positive takes are: it is cheap, claimed to handle 400 Vpeak directly (yeah... I could check, but...), responsive UI, makes taking screen / waveform captures easy (but limited options if you want to do anything on the device), and it does yield a sensible(ish) trace up to 50 MHz+.

Negative: not really a handheld 'scope, IMO.

I think it is more of a "basic 'scope" / pretty inaccurate DMM hybrid.  (And I suspect it's really a data logger.)


Should you buy it?

Well, will it do what you would want it for?  Should be useful to quickly probe something before cranking up the real 'scope, as an alternative to the cheaper not-quite 'scopes, or for certain 'niche' uses.  I intend on adding it to my gear for the Airsoft club, where it could be handy to check for battery/motor type faults where a DMM doesn't tell you enough.
Cool, thanks for your checks and the GUI looks not too bad but shame it's not a real 100 MHz scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 26, 2020, 12:49:04 pm
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.

Anybody could have told you that just from the price, no need to read the thread or get snobbish over it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 26, 2020, 03:24:42 pm
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.

Anybody could have told you that just from the price, no need to read the thread or get snobbish over it.

From some of these comments it appears there is little "modulation" of opinion.  If it isn't a scope that is on target with the specs or they haven't mastered the use of yet or it isn't an instrument that they would feel comfortable using, it's a "toy."  I see the word "toy"  (or "shit" from Dave to emphasize his frustration with something) thrown around quite often. 

It would be more helpful to describe what the "scope" would be good or not so good at doing along with the extent to which it misses its stated specs. I might have missed the definition of "toy", which apparently is "Any device which misses its stated spec or behaves in a manner in which the operator does not expect or doesn't meet his own specialized need."

Every measuring/diagnostic device has its best uses and limitations and requires significant user familiarity with its best useage, quirks and anomalies.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 26, 2020, 03:56:56 pm
Every measuring/diagnostic device has its best uses and limitations and requires significant user familiarity with its best useage, quirks and anomalies.

No arguments there.

Compared to what's gone before, this seems like a big step towards being a contender for being a "real" 'scope. The touch screen is a good feature and seems intuitive enough, I'd have no problem buying one if I needed something cheap/portable and I knew I was going to work at frequencies I knew it could handle.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 05:48:37 pm
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.

Anybody could have told you that just from the price, no need to read the thread or get snobbish over it.

Yea. Multiple people bought one because they thought it'd be the same thing as the last one. I think multiple people thought it was going to be something more because of the form factor change. If you'd read the thread you'd see that I had. It's also not me getting snobbish I'm summarizing for people who don't know better. They see all the screenshots and won't know what to make of it. Especially with the guy performing all the tests being way too happy with a fairly expensive toy scope. Maybe someone will do like ataradov did with the smaller one and write new firmware for it but until then I'd rather people with limited budgets not waste that money.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 26, 2020, 06:19:19 pm
....until then I'd rather people with limited budgets not waste that money.

I can definitely think of a few usage cases for it.

Especially with the guy performing all the tests being way too happy with a fairly expensive toy scope.

And so can he.

I'd rather people with limited budgets not waste that money

It might be very good value for money in the right circumstances.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nctnico on May 26, 2020, 06:37:10 pm
Sounds like it's still a toy scope, not a serious instrument, and the bandwidth is still a lie. As expected.

Anybody could have told you that just from the price, no need to read the thread or get snobbish over it.

Yea. Multiple people bought one because they thought it'd be the same thing as the last one. I think multiple people thought it was going to be something more because of the form factor change. If you'd read the thread you'd see that I had. It's also not me getting snobbish I'm summarizing for people who don't know better. They see all the screenshots and won't know what to make of it. Especially with the guy performing all the tests being way too happy with a fairly expensive toy scope. Maybe someone will do like ataradov did with the smaller one and write new firmware for it but until then I'd rather people with limited budgets not waste that money.
At this price level you can't really go wrong. Worst case you end up with a portable scope you can use on the road. Someone else made the suggestion for the 60% more expensive Hantek but at that point you better save more money and buy a real (entry level) oscilloscope. But I agree this FNIRSI-1013D portable scope's price is at the tipping point where you have to consider spending around $450 on a real entry level oscilloscope or spend $130 and get by for a couple of years.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 06:42:54 pm
It sounds like the "trigger" is as unstable as their first smaller version. If that's the case I'd recommend a meter with plotting(sometimes called oscilloscope) capabilities over this. You get something that can do what this thing can do but you'd also get a meter. Alternatively if you really want something that sort of works I'd recommend finding the smaller cheaper one and using ataradovs firmware.

EDIT: Are you saying the hantek is worth less than this thing you'd seemingly recommend to anybody? My comments were for people who don't know better not for people who know they might be able to use this. It can't even measure reliably though so I can't imagine I'd ever use this even if I had one although I do have multiple handheld battery powered scopes too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 26, 2020, 06:53:57 pm
Yup.  It goes sort of like this...

$40 scope = "toy".  Need a real scope.

$140 Frinsi scope = "toy".  Nope.  Need a "real" scope.

$210 Hantek scope = "toy".  Nope.  Need a "real" scope.

$400 Siglent scope = "nope, not good enough, need a "real" scope.

I look at it this way:  Different scopes for different folks.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 06:55:53 pm
I look at it this way:  Different scopes for different folks.

Beginners usually don't have enough knowledge to determine what would be useful but a stable trigger and working measurements are usually a baseline.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 26, 2020, 07:00:44 pm
I look at it this way:  Different scopes for different folks.

Beginners usually don't have enough knowledge to determine what would be useful but a stable trigger and working measurements are usually a baseline.
Not everyone has the same need for the same degree of stability required for their diverse applications.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 07:12:45 pm
Got it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 26, 2020, 07:42:33 pm
working measurements are usually a baseline.

I guess my Rigol is broken by design then. It only has about 5% accuracy according to the specification.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 26, 2020, 07:44:25 pm
Meeting specs isn't broken.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 27, 2020, 07:43:25 am
Especially with the guy performing all the tests being way too happy with a fairly expensive toy scope.

It works within limitations, and certainly doesn't meet the amplitude specifications.  Perhaps that can be adjusted, perhaps not.  I have (predictably) not received a reply from FNIRSI.  It should suffice for my intended usage.

I see a lot of instruments at various price levels.  Some 'professional' appearing, expensive, stuff is not very good.  Some cheap stuff is very good.  Often you are paying for support (or lack thereof) and testing to meet safety specifications.

This thing would probably be fine connected up to a high-energy circuit (e.g. mains supply) – or it might explode in your face.  If you want to do that safely, you're going to have to cough up a lot more money for a 'proper' scopemeter.  If you just want to measure a non-'high potential to explode in your face' circuit quickly, this will work OK.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 27, 2020, 08:01:59 am
A few more captures using the 'X-Y' mode.  Using my super-duper FeelElec FY6800.  (Special usage to please maginnovision.  :D  Now who can tell which 'toy' is at fault?  :-DD)

30_c.png – 10 kHz @ 5 Vpp on each channel, 90° phase offset between channels.  Note the offset along the y-axis - I don't know why it is doing this.
31_c.png – same, but shifted to centre by adding an offset (note the Vavg for CH1 is now +600 mV).
32_c.png and 33_c.png – testing where the limits are.  So it's one full screen height in both x and y - no off-screen capacity.
34_c.png and 35_c.png – changed inputs: CH1 is 30 kHz, CH2 is 24 kHz, with phase offset 75°.

I can't think of any other useful tests.  This is a fairly basic instrument, so I'm not sure what else to do.  If anyone has any ideas let me know.


Also, FYI:

The screen captures are natively '.bmp' format at 800 000 bytes each.  So not super-efficient storage size, but quick to process (about two seconds).  My unit has a 'Sandisk' branded 1 GB micro-SD card in it.  Real?  Probably not.

Waveform captures are 15 000 bytes.  Take slightly longer than a screen capture - maybe 2.5 seconds.  Why 15 000 bytes?  Don't know.  Perhaps that's the full memory for data points?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 27, 2020, 08:22:57 am
Quote
(Special usage to please maginnovision.  :D  Now who can tell which 'toy' is at fault?  :-DD)

I don't have any problems with the FY6800. I think you're confusing me with someone who hates cheap shit, or chinese shit? I don't care what something costs or where it comes from when it does the job it's supposed to do. As far as I can tell there is nothing about this that is a substantial upgrade over their last iteration which was bad enough a forum member wrote his own firmware for it. It had plenty of issues and this one seems to as well. Apparently I can't even get people to agree on a baseline so I recommend everyone go out and buy one. It'll be my new newbie scope recommendation since everyone is saying I'm just a negative nancy.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 27, 2020, 08:36:46 am
As far as I can tell there is nothing about this that is a substantial upgrade over their last iteration which was bad enough a forum member wrote his own firmware for it. It had plenty of issues and this one seems to as well.

If you can write new firmware for this, then that’s a positive really.

Is it open-source?

Quote
Apparently I can't even get people to agree on a baseline so I recommend everyone go out and buy one. It'll be my new newbie scope recommendation since everyone is saying I'm just a negative nancy.

OK.  You can be the ‘anti-Dave’.  :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: maginnovision on May 27, 2020, 09:13:35 am
Ataradov did release the source. I don't know if this particular scope it is possible though since there is no information on the hardware. The company who makes this doesn't release the source code as far as I know.

I'm not sure what an anti-dave is but you can call me whatever you like.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: all_repair on May 27, 2020, 10:47:06 am
Can take a look at DSO1511, single channel with FPGA inside for processing.  From the demo, software is more refine.  I already have a FNIRSI-5012H, so I can wait and wait.  For me, aAt the moment FNIRSI-5012H with the original software is fulfilling my simple need.  All those buttons are simple to use.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 12:19:19 pm
I just received  my ADS1013D from Banggood for which I paid 118 € including shipping ( DHL).
This is probably the same as the  FNIRSI

I just unpacked it, tested its rise time with the excellent pulse generator from Leo Bodnar
https://www.eevblog.com/forum/projects/yet-another-fast-edge-pulse-generator/msg1251589/#msg1251589 (https://www.eevblog.com/forum/projects/yet-another-fast-edge-pulse-generator/msg1251589/#msg1251589)

The performances are not as advertised. They say <3 ns on the back.
I measure more like 12 ns ( see pict attached). So if you think of the bandwidth as 0.35/rt, it gives a bandwidth of  30 Mhz instead of the 100 Mhz as advertised.
But apart from that (which I expected)  I consider it as a very valuable piece of equipment, and a real oscilloscope with  a huge advantage over
my previous oscilloscopes  ( I have many anchor boats and a recent  rigol 1054Z)

- No power chord. Works on internal, rechargeable battery.
- totally isolated
- No Fan : no noise ( this is also the case of my TDS220 which I use often because of that and because  of its light weight).
- fast and responsive  touch screen with a straightforward interface.
- large memory. Easy to retrieve the screen shots by USB connector.

- It is provided  with two x1 x10  full size probes ( I should test them on another scope).

So at  1/3 of the price of the Rigol1054z, I would definitely recommend it to a beginner, and to everyone who wants a battery powered scope. Within  the known limitations of the bandwidth to 25-30 Mhz.

I should also say that the included manual is small but informative and readable.

I am very happy with this purchase. 

A big advantage over many more sophisticated scopes :  from switching ON to signal on the screen :  < 4s.  Hard to beat !

Added : It seems  to freeze when you use the USB connection.
 Yes, definitively, it does not like to be hooked by the USB cable. Many bad behaviours in this case.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 01:24:49 pm
Here are the  pictures of the internal views . They confirm what Kosmic has posted.


Only the board color seems to have changed.

The nice thing is that the internal memory is provided by  a 1 Gb  SD card. I have changed it with a 32 Gb card  and it works like a charm.

As the pictures are only 800 k. This is practically infinite memory. Waves can also be stored and retreived.

The missing part is a file manager, but this is already very nice, as accessing the sd card is easy ( 5 screws ) .
Incidently, there is space for a larger battery, so we can think that a hack could be done  to increase the

On time  of the device.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 27, 2020, 01:51:10 pm
I'm currently working on a musical synthesizer and I'd buy one right now if that FFT was just a teeny bit better.

From the few videos and screenshots I've seen so far it has a couple of artefacts that worry me.

[attachimg=1]

eg. Why do the height of the peaks on the square wave in that image alternate tall/short? Are the tall ones harmonics and the short ones aliases? I don't know the source of the signal in that video and the horizontal axis has no scale.

Can the measurement cursors be used on the FFT? Is there any control of the FFT horizontal scale or does it simply follow the horizontal timebase? :-//

I'd love to have one to play with for a couple of hours.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 03:56:48 pm
eg. Why do the height of the peaks on the square wave in that image alternate tall/short? Are the tall ones harmonics and the short ones aliases? I don't know the source of the signal in that video and the horizontal axis has no scale.

Can the measurement cursors be used on the FFT? Is there any control of the FFT horizontal scale or does it simply follow the horizontal timebase? :-//

I'd love to have one to play with for a couple of hours.

There is not much action on the scale of the FFT.  The scale changes with the time division setting but nothing is written. Either you assume that  your main frequency is the largest peak, or you provide a sine wave  in the other channel for reference.

I dont see  as much alternate high low peaks as  there is in the picture you found;

Here there is a small alternation of high and low peak, but this is due to the FFT. If the frequency matches exactly one of the main frequency of the FFT, you have a high isolated peak. If you are further from one of the  FFT  harmonics, yoiu have a smaller, but broader peak.  This si seen below, but nothing surprising, and nothing that
reflects a priori a bad behavior of the scope.
[attachimg=2]


[attachimg=3]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 27, 2020, 04:41:48 pm
Fugus said "I can definitely think of a few usage cases for it."

Which brings me to something that would be helpful to noobs like me and hopefully others.  I did see the extensive table that lists scopes ranging in price from a few dollars to thousands - must be several hundred listed.

I would like to see a pared down, simplified list in the BELOW $400 scope range that has at least the following genralized categories, with BOLD text being really good to know:

* Make/model
* Year produced
* Price range, e.g $20 to $60; $60 to $150; $150-$250; $250 and above   (The $20 to $60 range may be good for random exploration, without need for accuracy.  The $60 to $150 range may provide reasonable accuracy for limited uses.  The $150 to $250 range, etc. etc.
* Screen size/pixels
* # channels
* Band width, claimed
* Band width, useful and reliable (It appears that scopes generally less than $200 have "useful and reliable bandwidth" about one third of stated spec.)
* Trigger action:  Poor, fair, good, excellent or whatever other categories might be helpful
* User interface/ease of use:  Poor, fair, good, excellent
* Particularly useful features or characteristics; or grossly lacking features that unexpectedly limit functionality in the price range.
* Examples of best uses:
* Examples of what they do not do well or at all:

So, what are the "best uses" for this FNISI-1013D?  I'm mainly into audio and using tools for observing and learning electronic and audio characteristics (e.g. frequency, distortion, etc.).  If I don't need to spend an extra $100 for a "real scope" I'd rather not.

If this needs to be moved to the "noob" section, let me know and I'll have it moved.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 27, 2020, 05:15:14 pm
Here there is a small alternation of high and low peak, but this is due to the FFT. If the frequency matches exactly one of the main frequency of the FFT, you have a high isolated peak. If you are further from one of the  FFT  harmonics, yoiu have a smaller, but broader peak.

So the peak is shorter because it's "smeared" across two pixels...

Does the horizontal scale of the FFT change when you change the timebase of the 'scope? It would be good to zoom in on the first few harmonics.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nctnico on May 27, 2020, 05:42:40 pm
@gfmucci:

I put tools & equipment in three different categories:
1) Useful although limited but cheap enough to throw away.
2) Relatively cheap and supposedly fully featured but flawed
3) Expensive but working as it should.

I avoid the tools & equipment in category 2. They cost a reasonable amount of money but the flaws are like an itch that never goes away. Having to 'make do' and use workarounds takes the fun away from the project.

I put the oscilloscope this thread is about in category 1 but the price is at the high end of the range.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 06:13:23 pm
@nctnico

There is also the category of tools

 4) Cheap, not full featured, but fulfill your needs.

I believe  ADS1013D is in this category. You dont need to throw it away. It has a form factor that is difficult to beat. Up to now, cheap wireless oscillo
have not been suitable for general workshop use.  I dont think its the same for this one, and I really think it opens a new game.
Its like the ANENG AN8008 multimeters. For most uses, you dont need more.

This is really  something to buy for one who is starting in electronics, even if he does not know what is an oscilloscope. When he will get more knowledgeable, he will
buy a better scope, but will keep the use of this one, as most probably his better scope will not be wireless.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 06:18:11 pm
So the peak is shorter because it's "smeared" across two pixels...
In some sense, yes. But it is already in the mathematical FFT of the signal, not only in the display.

Quote
Does the horizontal scale of the FFT change when you change the timebase of the 'scope? It would be good to zoom in on the first few harmonics.

You can act on the vertical and horizontal scale, but in a limited way.

Vertically, you can change the scale by acting on the vertical scale of the signal, but the spectrum is crop on the top.
Horizontally, you can change the scale by acting on the time scale, but  from what I have seen, you cannot scroll horizontally the spectrum. You will
have access only to the beginning part ( which is what you asked for).


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 27, 2020, 07:34:28 pm
I just received  my ADS1013D from Banggood.

I consider it as a very valuable piece of equipment, and a real oscilloscope with  a huge advantage over
my previous oscilloscopes
[bold added]  ( I have many anchor boats and a recent  rigol 1054Z)

Certainly not on par with your Rigol 1054Z, right? https://www.tequipment.net/Rigol/DS1054Z/Digital-Oscilloscopes/ (https://www.tequipment.net/Rigol/DS1054Z/Digital-Oscilloscopes/)

What will be the circumstances/types of testing with your new ADS1013D that you would not use the Rigol for?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 27, 2020, 07:40:13 pm
You will have access only to the beginning part ( which is what you asked for).

That's OK for me. In fact it's good that the origin (ie. 0Hz) stays fixed at the left side of the screen.

The other big thing that bothers me is the lack of vertical scale and no visible noise floor. I'd like to have some idea of signal:noise ratio.

Certainly not on par with your Rigol 1054Z, right?
What will be the circumstances/types of testing with your new ADS1013D that you would not use the Rigol for?
 (https://www.tequipment.net/Rigol/DS1054Z/Digital-Oscilloscopes/)

a) The FFT on the Rigol is awful. I don't particularly care because I have another gadget for that but FFT is the Rigol's Achilles Heel.
b) I was thinking of using this for recording videos. A 'scope with a  7" screen that lies flat on the bench seems ideal for use with an overhead camera but the Rigol shape/size simply doesn't work, especially with the mains plug sticking out of the back.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nctnico on May 27, 2020, 08:53:22 pm
@nctnico

There is also the category of tools

 4) Cheap, not full featured, but fulfill your needs.
That IS category 1.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 09:31:19 pm
Certainly not on par with your Rigol 1054Z, right? https://www.tequipment.net/Rigol/DS1054Z/Digital-Oscilloscopes/ (https://www.tequipment.net/Rigol/DS1054Z/Digital-Oscilloscopes/)
No, the Rigol is far superior in performance from what I have measured

rising time in Rigol is about 4 ns ( real 100 Mhz) vs  about 12 ns for the ADS1013D.

Quote
What will be the circumstances/types of testing with your new ADS1013D that you would not use the Rigol for?

I have a dozen of scopes.  Most of them are anchor boats that I have repaired. The most powerfull in term of bandwidth is a TDS 460 
with a rising time of  1.3 ns  ( Bandwidth of 350 Mhz).

The ones I use the most often are now the Rigol1054 because of all his features and 4 channels, but also the TDS220 black and white with only two channels, but which
has no fan and thus makes no noise. This is important for me. In fact, now I use more the TDS220 than the Rigol.

The circumstances I would use rather the ADS1013 is any time  I will test something  outside from my bench.

I had to test the signal of an alarm system, on the top of a ladder. This is certainly where the ADS1013 would be welcome.

Same for anything in the car.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 27, 2020, 09:34:04 pm
@nctnico

There is also the category of tools

 4) Cheap, not full featured, but fulfills your needs.
That IS category 1.

In this case, we agree.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gfmucci on May 28, 2020, 03:06:47 pm
Well, after considerable consternating and other assorted deliberations, I went with the Hantek 5072P.  http://www.hantek.com/en/productdetail_97.html (http://www.hantek.com/en/productdetail_97.html)

Why?

1. Traditional user interface.  Better to relate to the numerous teaching videos for a noob.  And old people prefer knobs, which is what I am - an old person, (not a knob.)  This noob likes knobs.  Kind of catchy.

2. Changing functions on the touch screen blanks out what is being measured, or so it appears on the videos and photos. Not so with the knobby interface.

3. The Hantek is more likely to achieve its bandwidth spec, and other specs, which may be ~double the touchscreen bunch.

4.  If I croak before my wife does, the traditional knobby layout is likely to be easier to sell - or it will at least be easier to identify what the device is.

5.  I don't anticipate any need for portability.  It stays on the bench.

6.  I reviewed the Hantek's 72 page manual which seems quite helpful. Haven't seen the Frinsi or equiv. manual online.

As an aside, Ali Express sells this for less than Amazon, but their shipping cost is $50+, which makes it $35 >Amazon.

If the touchscreen O-scope is a "semi-accurate, semi-"toy" useful for some things" device, then the Hantek is a "low end, utilitarian, slightly more accurate, useful for a few more things" device.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 28, 2020, 04:01:13 pm
Well, after considerable consternating and other assorted deliberations, I went with the Hantek 5072P.  http://www.hantek.com/en/productdetail_97.html (http://www.hantek.com/en/productdetail_97.html)

Sure. It's horses for courses.

My own interest in this "toy" is more because of form factor and portability than its measuring ability.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 29, 2020, 08:07:43 am
My own interest in this "toy" is more because of form factor and portability than its measuring ability.

The FFT function seems very dubious to me.  I am not sure how they're deriving it, but the weird 'foldback' artefacts it produced (shown in my screen-grabs) are spurious.

If that's important to you, then this is probably not suitable.  More testing would be required to figure out what it is doing, and the limitations.

I haven't got a clean enough known signal source to really test the FFT function.  Nothing in the lab is sufficient, and my 'FeelElec' is not the most accurate of instruments.  (It has interesting aliasing issues which appear to be timebase related.  Assuming that my Siglent 'scope isn't the culprit, which I feel safe on.)

Also, no response from FNIRSI concerning this device and my query about adjustment.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 29, 2020, 01:23:50 pm
The FFT function seems very dubious to me.  I am not sure how they're deriving it, but the weird 'foldback' artefacts it produced (shown in my screen-grabs) are spurious.

If that's important to you, then this is probably not suitable.  More testing would be required to figure out what it is doing, and the limitations.

Yes, I'm going to pass on this.  I'll wait for the next generation or save up for an Analog Discovery 2 instead.

My ancient DSO Quad has a tiny screen but the FFT is an order of magnitude better (actually quite awesome because of high update rate, labelling of peaks, etc).

FFT is the green overlay, it's showing the cyan trace which has four harmonics in it:

[attachimg=1]




Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on May 29, 2020, 05:41:28 pm
Yes, this looks better that the FFT of the ADS1013D.

There is no labels on the ADS1013D, and the scales are difficult to adjust. It can only be used marginally.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on May 31, 2020, 05:16:15 am
There is no labels on the ADS1013D, and the scales are difficult to adjust. It can only be used marginally.

It's a 'basic' instrument.

The built-in 'Measurements' appear to be correct, and the cursors work, but it's all quite limited.

A modern 'real' oscilloscope (Siglent and Rigol are probably fine low-cost options) is a better bet if you want a more flexible instrument.  Siglent make hand-held 'scopes, too, if that is a requirement.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 31, 2020, 05:28:55 am
It's a 'basic' instrument.

Yes, we get that. I was more interested in the form factor + price.

A modern 'real' oscilloscope (Siglent and Rigol are probably fine low-cost options) is a better bet if you want a more flexible instrument.

The FFT on both of those is horrible. Within its bandwidth limits I dare say my "toy" DSO Quad is better.

Siglent make hand-held 'scopes, too, if that is a requirement.

If I was after a "real" scope in this form factor I'd be looking at a Micsig.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on May 31, 2020, 05:36:29 am
A modern 'real' oscilloscope (Siglent and Rigol are probably fine low-cost options) is a better bet if you want a more flexible instrument.

The FFT on both of those is horrible.
Yes we all know the low cost Rigol FFT is poor but an equivalent Siglent X-E ?
Nope, that's how a cheap DSO FFT should be, a proper implementation of a cheap spectrum analyser.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 31, 2020, 05:56:46 am
Yes we all know the low cost Rigol FFT is poor but an equivalent Siglent X-E ?

I'm just looking at the horrible FFT, awful laggy controls and slow update rate shown in this video (skip to 4:00):

https://www.youtube.com/watch?v=Jf0TgfzYQXE (https://www.youtube.com/watch?v=Jf0TgfzYQXE)

It doesn't look like much of a step up from the Rigol to me.  :-//



eg. At 4:30 he's showing a single sine wave, shouldn't the 'scope be showing a horizontal noise floor with a single vertical spike?

[attachimg=1]

My DSO Quad can manage it:

[attachimg=2]

It updates the FFT at 30 fps, too, not the 1 fps of the Siglent.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on May 31, 2020, 08:06:02 am
Yes we all know the low cost Rigol FFT is poor but an equivalent Siglent X-E ?

I'm just looking at the horrible FFT, awful laggy controls and slow update rate shown in this video:

https://www.youtube.com/watch?v=Jf0TgfzYQXE (https://www.youtube.com/watch?v=Jf0TgfzYQXE)

(skip to 4:00)

It doesn't look like much of a step up from the Rigol to me.  :-//


eg. At 4:30 he's showing a single sine wave, shouldn't the 'scope be showing a horizontal noise floor with a single vertical spike?

(Attachment Link)

My DSO Quad can manage it. It updates the FFT overlay at 30 fps, too, not the 1 fps of the Siglent.

(Attachment Link)
::)
You know better than to judge an instrument from a 2 year old video, really !  :=\
One glance at the UI and I know it's operating with very old FW and after watching the whole video it's obvious how much better the results would be with the features that have since been added.

So you bought a DSO Quad to supplement the FFT that your Rigol can't do ?  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 31, 2020, 08:14:15 am
One glance at the UI and I know it's operating with very old FW and after watching the whole video it's obvious how much better the results would be with the features that have since been added.

Video? Screenshots? I'm having trouble finding any. Let's see the new frame rates, etc.

Let's see if they've managed to get it up to the level of a DSO Quad.

So you bought a DSO Quad to supplement the FFT that your Rigol can't do ?  :-DD

No, I had the DSO Quad for a couple of years before I got my Rigol.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on May 31, 2020, 08:28:18 am
One glance at the UI and I know it's operating with very old FW and after watching the whole video it's obvious how much better the results would be with the features that have since been added.

Video? Screenshots? I'm having trouble finding any. Let's see the new frame rates, etc.

Let's see if they've managed to get it up to the level of a DSO Quad.
From 6.45. Also with old firmware but from a guy that knows how to drive Siglent X-E FFT.  :phew:
That this is the 4ch X-E makes no difference, SDS1202X-E FFT is exactly the same.

https://youtu.be/Cwbwq-AKbPc?t=405
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on May 31, 2020, 12:06:42 pm
From 6.45. Also with old firmware but from a guy that knows how to drive Siglent X-E FFT.  :phew:

OK, so with the latest firmware a good "driver" can achieve a similar update rate to a DSO Quad by reducing the memory depth to 2.8kpts and the FFT to 2048 points. Got it.

[attachimg=1]

Even so, he couldn't sort out the sloping noise floor or the weird cone shaped "peaks".

Maybe you should start slipping DSO Quads into the boxes of all your Siglents as a perk for your customers.  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on June 02, 2020, 06:37:17 am
OK, so with the latest firmware a good "driver" can achieve a similar update rate to a DSO Quad by reducing the memory depth to 2.8kpts and the FFT to 2048 points. Got it.

(Attachment Link)

Even so, he couldn't sort out the sloping noise floor or the weird cone shaped "peaks".

This may be an accurate evaluation of the applied signal.  Unless it is a 'perfect' sinewave being presented at the 'scope front end (or close enough to pass, in this case), you should expect some aberrations.  I can check my 1202X-E with a good quality signal from the calibrator here, if you really want an FFT from a 'known' signal.

I have to take some gear in from home tomorrow, anyway.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 02, 2020, 07:59:19 am
Even so, he couldn't sort out the sloping noise floor or the weird cone shaped "peaks".

This may be an accurate evaluation of the applied signal.

Maybe, but it's not the only place I've seen it, eg. Here's a comparison with a Picoscope:

Picoscope:
(https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/?action=dlattach;attach=758640;image)

Siglent shows the same signal with cone shaped peaks and sloping noise floor:
(https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/?action=dlattach;attach=758652;image)

Images taken from this thread: https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/ (https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on June 02, 2020, 08:41:14 am
Going by those this one must be broken  :P

(https://www.eevblog.com/forum/beginners/is-this-oscilloscope-perhaps-the-best-for-the-beginner/?action=dlattach;attach=957182)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on June 02, 2020, 09:03:57 am
Images taken from this thread: https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/ (https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/)

Did you not notice that there is another example two posts down, with a correct FFT display?

Poor configuration will produce aliasing, so that may be why the post you linked to yields that.

I will try a comparison of my 1013D and 1202X-E tomorrow, if I get the time.  It would be interesting to try to make sense out of what the 1013D is doing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on June 02, 2020, 09:36:53 am
 :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 02, 2020, 09:59:58 am
Going by those this one must be broken  :P

Or just zoomed out a lot and half the first peak cropped off to hide it...
[attachimg=1]


PS: What's the frame rate with that many points?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 02, 2020, 10:10:25 am
I've just been looking at the classic FFT comparison video:

https://www.youtube.com/watch?v=07VkEUUd0eo (https://www.youtube.com/watch?v=07VkEUUd0eo)

Most of the others seem to do something similar to the Siglent with the peaks in that video, although that could be from the source signal. Dave put a distortion in it.

None of the others seem to have a slope in the noise floor though.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on June 02, 2020, 12:26:29 pm
Even so, he couldn't sort out the sloping noise floor or the weird cone shaped "peaks".

This may be an accurate evaluation of the applied signal.

Maybe, but it's not the only place I've seen it, eg. Here's a comparison with a Picoscope:

Picoscope:
(https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/?action=dlattach;attach=758640;image)

Siglent shows the same signal with cone shaped peaks and sloping noise floor:
(https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/?action=dlattach;attach=758652;image)

Images taken from this thread: https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/ (https://www.eevblog.com/forum/testgear/siglent-sds1104x-e-fft-frequency-centering/)

FFT Resolution Bandwidth is too low, try increasing capture time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nctnico on June 02, 2020, 12:41:39 pm
FFT Resolution Bandwidth is too low, try increasing capture time.
I agree. I'd assume this is a setting somewhere that limits the FFT length; the length of the capture is more than enough.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on June 03, 2020, 05:31:45 am
Or just zoomed out a lot and half the first peak cropped off to hide it...

Well then, from your post above, half the PicoScope first peak must be 'cropped off' to hide something...

 ???
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 03, 2020, 05:34:21 am
Or just zoomed out a lot and half the first peak cropped off to hide it...

Well then, from your post above, half the PicoScope first peak must be 'cropped off' to hide something...

 ???

The Picoscope goes down to zero so there's nothing to hide (unless there's some negative frequencies in there...)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on June 05, 2020, 09:54:26 pm
Here's a small review:
https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=auto&sp=nmt4&tl=en&u=https://mysku.ru/blog/aliexpress/79977.html&usg=ALkJrhguojbK4BKwyJE3pVHHq8nsoxRH-w (https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=auto&sp=nmt4&tl=en&u=https://mysku.ru/blog/aliexpress/79977.html&usg=ALkJrhguojbK4BKwyJE3pVHHq8nsoxRH-w)

And you can find the manual here: http://www.fnirsi.cn/support (http://www.fnirsi.cn/support)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 13, 2020, 08:07:21 pm
I am amazed by this product. I don't have one, and I will probably not buy one right now. But look at current alternatives (Mini DS203 and DS213). From what I can see in the videos, the touch screen interface is very intuitive and very fast. No comparison to pressing buttons or turning knobs to navigate through menus. In fact, I wonder whether one could not simply build a professional scope (like a Siglent 1202X) with a larger screen and an extended version of such a user interface. Fine tuning could be implemented with sliders that are displayed on demand. Coarse adjustments would continue to be simple touch gestures. This 1013d seems to lack two finger gestures. Using those could yield additional improvement of the touch interface.

The reason I'm not buying the 1013d is that I am thinking about buying a Siglent 1202X-E. It's available though German shops and I will have a more mature product, higher bandwidth, etc.
Another drawback of the 1013d is the battery and the power via USB. Given the rating (5V 2A), it will be hard to find a proper charger. Also, I do not trust the USB charger than comes with it. Better would have been USB PD via USB-C. Then I could have used a notebook USB-C charger or a USB-C PD power bank. 4 hours of usage on battery after charging it for 4 hours is great. Also, having it connected to the power 24/7 while it's standing on my desk seems like a bad idea. The battery will probably suffer, and, as I said, i don't trust the charger. Does it have a mini or micro USB plug?

If you are in Europe and you want to order it anyway: you will find units with shipping from Italy or Spain if you search for "nano1013d" on Aliexpress.



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 13, 2020, 09:14:03 pm
The reason I'm not buying the 1013d is that I am thinking about buying a Siglent 1202X-E. It's available though German shops and I will have a more mature product, higher bandwidth, etc.

Have you seen the Micsig tablets?

Same form factor and touchscreen as a 1013D, more powerful than a Siglent.

https://micsig.aliexpress.com/store/group/Tablet-Oscilloscope/1293611_509734614.html

OK, a bit more expensive than the Siglent but if that's what you're after then it's worth saving up a little bit more.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on June 14, 2020, 05:14:44 am
In fact, I wonder whether one could not simply build a professional scope (like a Siglent 1202X) with a larger screen and an extended version of such a user interface. Fine tuning could be implemented with sliders that are displayed on demand. Coarse adjustments would continue to be simple touch gestures. This 1013d seems to lack two finger gestures. Using those could yield additional improvement of the touch interface.

It only has single-point response.  While you could add a lot more in software to something like this, the front end is pretty basic.  50 mV/div minimum to 5 V/div maximum ranging, for example (and my unit certainly doesn't meet the claimed specification).

Quote
The reason I'm not buying the 1013d is that I am thinking about buying a Siglent 1202X-E. It's available though German shops and I will have a more mature product, higher bandwidth, etc.

I have one, and it seems to be a solid, reliable, 'scope (now).  The 1104X-E is worth looking at, too – four-channel, and a bit more competent (nominal bandwidth is lower, but it's likely 'hackable' to 200 MHz easily enough).

Quote
Another drawback of the 1013d is the battery and the power via USB.

It's more of an advantage, really.

Quote
Given the rating (5V 2A), it will be hard to find a proper charger. Also, I do not trust the USB charger than comes with it. Better would have been USB PD via USB-C. Then I could have used a notebook USB-C charger or a USB-C PD power bank. 4 hours of usage on battery after charging it for 4 hours is great. Also, having it connected to the power 24/7 while it's standing on my desk seems like a bad idea. The battery will probably suffer, and, as I said, i don't trust the charger. Does it have a mini or micro USB plug?

Any USB charger will work.  It doesn't have to be 2 A rated.  Even leaving it plugged into a PC USB port charges it.

It uses micro USB, so 2 A is optimistic anyway.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on June 14, 2020, 05:18:44 am
Same form factor and touchscreen as a 1013D, more powerful than a Siglent.

I'm not sure about that.  What do they offer over the cheap Siglent bench 'scopes?

I would assume that they're better than Siglent's hand-held 'scope offerings – but I'm not really sure about that, either.

Quote
OK, a bit more expensive than the Siglent but if that's what you're after then it's worth saving up a little bit more.

A good bit more expensive.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 14, 2020, 07:02:19 am
Quote
OK, a bit more expensive than the Siglent but if that's what you're after then it's worth saving up a little bit more.

A good bit more expensive.

No more than the difference between a Siglent and a Rigol.

Siglent owners have no problem telling Rigol owners that the difference is worth every penny, so...  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rlohmann on June 15, 2020, 10:48:41 am
Hi @AlcidePiR2

I'm still waiting for my unit ... so I'm actually reading and searching for information.

Looking at the pictures, it appears to me that the shielding of the input BNC connectors are actually not grounded.  ???
Could you measure the resistance between the two BNC shieldings?

Btw, looks like your PCB has a slightly different routing.
The FNIRSI units seem to have a more obvious runtime alignment (meander traces) between ADC and FPGA. 

I found in a russian forum the assumption AD9288 are used as ADCs ...  so, the x1013 would have max 200Ms/sec sample rate (in best case).  :o
Maybe probing the ADC-clock (with a second scope) might help to answer that question...

Unfortunately both PCBs does not have the potential 9th and 10th bit traces routed.
Would have been a nice option to replace the 8bit ADCs (AD9288) with a 10bit ADC (AD9218) to somewhat compensate the min 50mV/dev. ;)
Especially while using x10 coupling for higher bandwidth which leads to min 500mV/dev I guess.

One comment/request on the 10MHz measurement you posted to check the rise time. Looks like you did the measurements with x1 coupling, correct?
Could you redo the measurement with x10 coupling? ... guess that will increase the bandwidth and could reduce the rise time.
... never mind, I've just checked the link to puls generator you used ... :D
   
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on June 15, 2020, 05:25:03 pm
Could you measure the resistance between the two BNC shieldings?

I bet it's ~= 0 Ohms...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 15, 2020, 07:00:56 pm
Looking at the pictures, it appears to me that the shielding of the input BNC connectors are actually not grounded.  ???

They must be connected to something, or the 'scope won't work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rlohmann on June 15, 2020, 07:28:10 pm
You are probably right, looking at the PCB backside.  :)

   https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985516;image (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=985516;image)

I got confused with the isolation on the top side and the trace going away from there.

   https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=997413;image (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=997413;image)

Guess the trace is going to the differential inputs pins of the ADCs and tied together to GND for noise reduction.
 

 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 16, 2020, 03:12:01 am
Could somebody follow which versions have the blue PCB and which versions have the green PCB?
Clearly, the blue ones seem to have issues which were resolved in the green revision with proper length matching.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on June 16, 2020, 11:39:41 am
Could you measure the resistance between the two BNC shieldings?

I bet it's ~= 0 Ohms...

Yes it is.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on June 16, 2020, 01:38:27 pm
Could you measure the resistance between the two BNC shieldings?

I bet it's ~= 0 Ohms...

Yes it is.

Yup zero Ohms
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 28, 2020, 11:02:24 pm
So, have you received your 1013d yet? And what's your verdict?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on June 30, 2020, 10:47:07 am
So, have you received your 1013d yet? And what's your verdict?

Quick overview, same as what others have seen;

Three of us at work bought them, none of them can be regarded 100MHz scopes. Even using HP 500MHz @10:1 probes (just to make sure its not an issues with the supplied probes), the highest frequency you will see is about 85MHz with a sine input before its starts showing nonsense (signal starts looking like its modulated/unstable), and its attenuated quite a bit.

At my most optimistic I would say its a 40MHz scope. I looked inside, it has a blue circuit board.

But I do like the form factor a lot, it uses far less volume than even the Micsig and actually fits in my small electronics tool box with tools, multimeter, and a hand held signal gen yet has a nice screen size. So if you just need a low cost simple visual signal probe, its fine. If you need a more serious portable tool, with more features (a 4ch version), superior software, stated bandwidth and better triggering, save up for the Micsig and a separate carry bag for it.

What I found interesting while testing was XY mode. If you just put up some simple lissajous figures (circle, spiral etc) its looks fantastic without trying. But try one of those boards that puts up a clock or one I made to put up a spinning graphic (aka w2aew > https://www.youtube.com/watch?v=344oEu9vo7w (https://www.youtube.com/watch?v=344oEu9vo7w) ), it cant render it correctly, almost as if its doing something funky in software.

When I get time I will post some photos.

But I collect all sorts of scopes so I couldnt help buying one, I accept my TEA....  ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 30, 2020, 12:18:07 pm
Can you clarify something for me? What does 50mV/div mean? As far as I know "division" refer to one line in the grid. But that doesn't tell me anything about the resolution within one division.

What I would like to know is the vertical resolution per ADC increment with a 10X probe (by how much does the voltage increase if the ADC output increases by 1). Or, equivalently, by how much does the voltage increment over the whole 8bit ADC range (0 to 255). Can anybody tell?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 30, 2020, 02:00:04 pm
Quick overview, same as what others have seen;

Three of us at work bought them, none of them can be regarded 100MHz scopes. Even using HP 500MHz @10:1 probes (just to make sure its not an issues with the supplied probes), the highest frequency you will see is about 85MHz with a sine input before its starts showing nonsense (signal starts looking like its modulated/unstable), and its attenuated quite a bit.

At my most optimistic I would say its a 40MHz scope.

Edit: Post remove due to Aliexpress confusion over the numbers. Many sellers say it's 100MS/sec (https://www.aliexpress.com/item/4001123682082.html) but it's not.

One question: How shiny are the screens on these? The screens on Micsigs look awfully shiny in videos. I hate that.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on June 30, 2020, 02:46:53 pm
Quick overview, same as what others have seen;

Three of us at work bought them, none of them can be regarded 100MHz scopes. Even using HP 500MHz @10:1 probes (just to make sure its not an issues with the supplied probes), the highest frequency you will see is about 85MHz with a sine input before its starts showing nonsense (signal starts looking like its modulated/unstable), and its attenuated quite a bit.

At my most optimistic I would say its a 40MHz scope.

That makes perfect sense for a 100Mhz sample rate. Nyquist will be at 50Mhz and that's your maximum frquency, but Nyquist is a very theoretical thing and requires an infinitely wide filter to get the original signal back.

On any practical device you'll start to get artifacts that look like AM as you approach Nyquist, this is due to the samples moving in and out of phase with the peaks and zero crossings in the signal.

The highest frequency you can hope to see correctly will be approx Nyquist/1.25 which just happens to be 40MHz. Bingo! Math, it works.  :popcorn:

I'm still mulling over whether to get one of these. OTOH it might be better to sell my Rigol DS1054Z and put the money towards a Micsig.

One question: How shiny are the screens on these? The screens on Micsigs look awfully shiny in videos. I hate that.

Except its supposed to be 1Gsa/s scope not 100Msa/s, cheap front end holds it back....

As for the screen, its shiny, as shiny as the Micsig for all intents and purposes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 30, 2020, 02:51:34 pm
I would claim that the scope cannot display a 85MHz sine wave, if the sampling frequency is 100MSa/s. You need at least 2 samples per period of the sine wave. I conclude that this a 200MSa/s scope. But of course, results start degrading much earlier than samplefreq/2. Hence, the results starts becoming unreasonable above 40MHz (which would mean 5 samples per sine wave).

Anyhow, a Mini DS213 has a 100MSa/s samplerate, the price is higher, the display is smaller, and it has no touch screen. So maybe the 1013d is a reasonable choice for its price point?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 30, 2020, 03:31:26 pm
I would claim that the scope cannot display a 85MHz sine wave, if the sampling frequency is 100MSa/s. You need at least 2 samples per period of the sine wave. I conclude that this a 200MSa/s scope. But of course, results start degrading much earlier than samplefreq/2. Hence, the results starts becoming unreasonable above 40MHz (which would mean 5 samples per sine wave).

Anyhow, a Mini DS213 has a 100MSa/s samplerate, the price is higher, the display is smaller, and it has no touch screen. So maybe the 1013d is a reasonable choice for its price point?

Wait, I'm confused...

Many sellers say: "100MS/s"

eg. https://www.aliexpress.com/item/4001123682082.html (https://www.aliexpress.com/item/4001123682082.html)

But the official store says: "100M bandwidth 1GS sampling rate"

https://www.aliexpress.com/item/4000934486311.html (https://www.aliexpress.com/item/4000934486311.html)

I imagine the official store is correct, in which case there's something that doesn't add up.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on June 30, 2020, 03:34:58 pm
As for the screen, its shiny, as shiny as the Micsig for all intents and purposes.

OK, thanks.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 30, 2020, 03:38:49 pm
As far as I was aware, the claimed (fake) specs were always 100MHz bandwidth at 1GSa/s. That's why people like wolfy007 would even try frequencies like 85MHz. If it was 100MSa/s, you would probably expect things to go wrong above 20MHz.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on June 30, 2020, 04:00:41 pm
100MHz, 100MSa/s:
[attachimg=1]
(http://www.sglabs.it/public/SgLabs_Tektronix_2232_1.JPG)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on June 30, 2020, 07:16:20 pm
The Tektronix is a combo analog + digital scope , made in the period of transition from analog to digital .  Used in analog mode ( like an old scope ) has 100MHz bandwidth , but if you want the digital stuff like measurements on screen  , cursors , storage is just 100MS/sec so much lower usable bandwidth
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on June 30, 2020, 07:41:59 pm
What CDaniel said: the given bandwidth is the spec of the analog part, which is responsible for putting the lines on the screen. This has nothing to do with the problems that digitial scopes face, when they have to reconstruct a sine wave based on a digital discrete-time signal, i.e., a sequence of digital samples.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on June 30, 2020, 08:08:32 pm
But when I hear 100MHz/100MSa/s the 2232 automatically comes to my mind :-)

The analog bandwidth is a must, but the MSa/s for repetitive signals isn't... back then, that's what the "repetitive store mode" was for. Non repetitive and one shots are a different beast of course.

The 2232 has been my favourite scope for more than 20 years, I still like it, I still use it sometimes. Memory depth: 1k/4k samples :-) It's got the best user interface of any scope I've ever seen. Wanna save a waveform? Press store and the memory number. Want to recall a saved waveform? Simply press the memory number 1..4 and voilá. A pleasure to use, no infinite menus and submenus, each function has a dedicated button. CRT + awesome vector graphics. I love it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on June 30, 2020, 08:30:03 pm
In a complete digital scope even if you have the input amplifier analog bandwidth you won't see it on screen  if the ADC sample rate is low ...
In my opinion this cheap chineese scopes are just toys usable for beginers , better buy an used portable old Fluke , like model 97 which have an extra powerfull meter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 01, 2020, 11:36:31 am
1013D doesn't have 1GSa/s!!!
But the way, I made that screenshots of internal parts on the first page...
name of ADC IC is erased, but by pinout can see that this is AD9288-100MSa/s
(also frequency on ENC(A,B) pins is 100MHz).
so the real rate is 200MSa/s on each channel!!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on July 01, 2020, 11:53:11 am
1013D doesn't have 1GSa/s!!!
Yes, we know that already.

But the way, I made that screenshots of internal parts on the first page...
name of ADC IC is erased, but by pinout can see that this is AD9288-100MSa/s
(also frequency on ENC(A,B) pins is 100MHz).
so the real rate is 200MSa/s on each channel!!!
I don't understand. You say 100MSa/s, then 100MHz, and then you conclude with 200Ma/s per channel! That doesn't workout. Do you mean 200MSa/s for both channels (meaning 100MSa/s per channel)?

As far as I understand ENCA/B defined the sample rate of the ADC. How can the scope reconstruct and show a sine wave of up to 85MHz with only 100MSa/s per channel? That's a mathematical impossibility.

If you measured ENCA/B, that rules our the possibility that they "overclock" the ADCs. Is there a variant of the AD9288 that samples on both edges of ENCA/B?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rf-loop on July 01, 2020, 12:42:31 pm
1013D doesn't have 1GSa/s!!!
Yes, we know that already.

But the way, I made that screenshots of internal parts on the first page...
name of ADC IC is erased, but by pinout can see that this is AD9288-100MSa/s
(also frequency on ENC(A,B) pins is 100MHz).
so the real rate is 200MSa/s on each channel!!!
I don't understand. You say 100MSa/s, then 100MHz, and then you conclude with 200Ma/s per channel! That doesn't workout. Do you mean 200MSa/s for both channels (meaning 100MSa/s per channel)?

As far as I understand ENCA/B defined the sample rate of the ADC. How can the scope reconstruct and show a sine wave of up to 85MHz with only 100MSa/s per channel? That's a mathematical impossibility.

If you measured ENCA/B, that rules our the possibility that they "overclock" the ADCs. Is there a variant of the AD9288 that samples on both edges of ENCA/B?

Have you ever seen AD9288 data sheet and understood it.  This is old ADC what have used in tens on different manufacturers low end scopes even models what have 1Gsa/s sampling speed and years these have handled and discussed here in forum repeatedly. Of course less today due to fact that most manufacturers use more modern circuits today. One famous model was Rigol1000E models, also Siglent, also hantek and many others. Most of them put 5 ADC inside scope for get 1Gsa/s (interleaved).
Now I have seen OP fist images and explanation. There can see 2 pcs ADC chips. One for each channel. So, IF they are AD9288 or clones,  it can give 200Msa/s both channels simultaneously.  Just because inside one ADC IC there is 2pcs 100Msa/s ADC. And these can connect for interleaving.  Some of these chips are manufaturer graded to slower clock, example for 40MHz just because all chips are not best ones. All tey can work with 100MHz clock but all do not meet all analog conversion specs with this speed so manufacturer have classified these chips for different speed class. In history it was just fun when Rigol use these 40M classified chips as 100M and remove all labels from chips.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on July 01, 2020, 12:55:08 pm
interleaving
That makes sense. So it's two 100MSa/s ADCs interleaved for both channels giving us 200MSa/s.
So that explains why things go really bad above 85 MHz.

So following the 1:5 rule, the 1013d is a 40MHz scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rf-loop on July 01, 2020, 02:00:45 pm
interleaving
That makes sense. So it's two 100MSa/s ADCs interleaved for both channels giving us 200MSa/s.
So that explains why things go really bad above 85 MHz.

So following the 1:5 rule, the 1013d is a 40MHz scope.

Roughly saying yes if we talk about "single shot" usable BW. If there is available way or other implemented repetitive  acquisition mode it change this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: martinot on July 02, 2020, 02:58:57 pm
The reason I'm not buying the 1013d is that I am thinking about buying a Siglent 1202X-E. It's available though German shops and I will have a more mature product, higher bandwidth, etc.

Have you seen the Micsig tablets?

Same form factor and touchscreen as a 1013D, more powerful than a Siglent.

https://micsig.aliexpress.com/store/group/Tablet-Oscilloscope/1293611_509734614.html (https://micsig.aliexpress.com/store/group/Tablet-Oscilloscope/1293611_509734614.html)

OK, a bit more expensive than the Siglent but if that's what you're after then it's worth saving up a little bit more.

This Micsig looks to be a perfect scope for portability, but still better value than the classic "cheap" desktop scopes by the other Chinse brands (Rigol, Siglent, Owon, etc.).

Thinking about to get this one with button/knobs on the side:

https://www.batronix.com/shop/oscilloscopes/Micsig-STO1104C.html (https://www.batronix.com/shop/oscilloscopes/Micsig-STO1104C.html)
https://www.batronix.com/files/Micsig/STO1000/STO1000C-data-sheet.pdf (https://www.batronix.com/files/Micsig/STO1000/STO1000C-data-sheet.pdf)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: EEVblog on July 04, 2020, 06:47:51 am
I have one.
Same lame interleaved sampling AD9288 100MS/s ADC, one per channel. So 200MS/s if using bi-phase clock.

(https://live.staticflickr.com/65535/50074405786_e4241c1dcd_c.jpg) (https://flic.kr/p/2jhUqgU)FNIRSI 1013D Portable Tablet Oscilloscope PCB (https://flic.kr/p/2jhUqgU) by Dave Jones (https://www.flickr.com/photos/eevblog/), on Flickr
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 04, 2020, 11:38:48 am
I have one.

I'm still on the fence.

Same lame interleaved sampling AD9288 100MS/s ADC

That perfectly fits the observation that the signal goes to hell above 40MHz but it's a MASSIVE lie by the manufacturers.

A new low for testgear number exaggeration/inflation?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: EEVblog on July 04, 2020, 11:44:56 am
Same lame interleaved sampling AD9288 100MS/s ADC
That perfectly fits the observation that the signal goes to hell above 40MHz but it's a MASSIVE lie by the manufacturers.
A new low for testgear number exaggeration/inflation?

Yep. It's 200MS/s actually as both ADC's in the one chip are clocked out of phase, same signal goes into both ADC channels.
I'd call it 20MHz and be done with it.
Still a dual channel 20MHz 7" touch screen portable tablet scope for $140 isn't bad.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 04, 2020, 12:00:37 pm
Yep. It's 200MS/s actually as both ADC's in the one chip are clocked out of phase, same signal goes into both ADC channels.

Is it one chip per channel (the two unmarked chips at bottom right)?

If so that's "400MSamples/sec" - nothing to be ashamed of but I don't see anybody advertising that number. They all have numbers that start with a "1".

Still a dual channel 20MHz 7" touch screen portable tablet scope for $140 isn't bad.

Yep.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on July 04, 2020, 01:39:20 pm
Yep. It's 200MS/s actually as both ADC's in the one chip are clocked out of phase, same signal goes into both ADC channels.
Is it one chip per channel (the two unmarked chips at bottom right)?

If so that's "400MSamples/sec" - nothing to be ashamed of but I don't see anybody advertising that number. They all have numbers that start with a "1".
It's still 200MSa/s as explained above. Multiplying by two just because you have two channels doesn't make any sense. Yes, some scopes have 1GSa/s when using one channel and only 500MSa/s when using two channels, but this scope has 200MSa/s regardless of how many channels you use. At least that's what I understood so far. And the "marketing" is off by a factor of 5, which is pretty big lie that's totally unnecessary.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: EEVblog on July 04, 2020, 01:58:20 pm
Yep. It's 200MS/s actually as both ADC's in the one chip are clocked out of phase, same signal goes into both ADC channels.
Is it one chip per channel (the two unmarked chips at bottom right)?
If so that's "400MSamples/sec" - nothing to be ashamed of but I don't see anybody advertising that number. They all have numbers that start with a "1".

Yes, one dual ADC per channel. As far as I see, no way to combine 4 ADC's for one channel.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 04, 2020, 02:56:42 pm
Yes, one dual ADC per channel. As far as I see, no way to combine 4 ADC's for one channel.

And not much point if the front end isn't up to the job.

(or maybe the front end is up to the job and it's the firmware that's going to hell, I assume this will be covered in the video  :)  )
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 04, 2020, 03:14:51 pm
If to click save without SD card then firmware complete hangs...
Without a battery, the MCU should go into boot mode (this is implemented in the circuit), but it does not seem to work.
There is no way to update the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: skoehler on July 04, 2020, 03:28:33 pm
Without a battery, the MCU should go into boot mode (this is implemented in the circuit), but it does not seem to work.

What do you mean by "without a battery" ? Does it mean, that you disconnect the battery and power this device via USB only?

There is no way to update the firmware.
If true, that would be sad.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 04, 2020, 05:17:37 pm
What do you mean by "without a battery" ? Does it mean, that you disconnect the battery and power this device via USB only?
Yes, it is...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: AlcidePiR2 on July 06, 2020, 04:09:08 pm
Still a dual channel 20MHz 7" touch screen portable tablet scope for $140 isn't bad.

I agree. The main limitation I think  is not the 20 Mhz bandwidth, but the 50 mV  sensitivity.

Besides,   one can understand that they can find many ways to measure the bandwidth, but  I find that their most outrageous claim is the  < 3ns  rise time
while I measured 12 ns  at least, using Leo Bodnar  tool.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 06, 2020, 05:52:56 pm
Without a battery, the MCU should go into boot mode (this is implemented in the circuit), but it does not seem to work.
There is no way to update the firmware.

Well, actually the firmware is stored ouside of the SOC in the SPI flash, so it can be updated, just not without opening the device up...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 07, 2020, 06:40:38 am
Seriously , updates for a thing that was made like a toy with big hardware limitations ...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 07, 2020, 11:43:11 am
Seriously , updates for a thing that was made like a toy with big hardware limitations ...

Sure, why not?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 15, 2020, 10:24:21 pm
I ordered one from amazon last evening--after reading through this entire thread--and as one poster said, $150 for a 2-channel 20 Mhz (maybe 40?) 7" touchscreen tablet scope isn't too bad. In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.

After my experiences with the FNIRSI-5012H I did not expect it would/could meet the 100 MHz and 1Gs/s specs--too bad they have to just outright lie about these things, they'd get a lot more respect if they published the real specs.

I hope it triggers reasonably well on aperiodic bursts (which modern automobile control systems produce mostly), that was my deal breaker with the 5012, will get this one going back to Amazon as well.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 15, 2020, 10:57:07 pm
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 15, 2020, 11:21:11 pm
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 16, 2020, 01:07:19 am
Don't know if anyone is interested, however in digging around the web early this morning I did find a PDF file of the 1013-D User Manual (http://www.paladinmicro.com/TestEquipment/FNIRSI-1013D English manual.pdf) (47.5 MB)--for what it's worth...

I love the "Solemn reminder" section, lead me to wonder if the fellow above who tested the rise time used the 10X mode?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 16, 2020, 01:22:54 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly. I just bought one of these scopes and whilst it's not perfect I do find that I use it when the other scopes are tied up. Because it is portable and easy on the battery it is a great portable scope I can throw in the car anytime. Much cheaper than buying a battery for the TDS3000 ;) Hopefully they will offer some firmware upgrades and allow the auto triggering level detection to be switched on or off. Like Dave said it is essentially,limited to 20MHz but that is fine with me for a general purpose portable scope for measuring audio and power stuff ;)

cheers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 16, 2020, 01:33:29 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly. I just bought one of these scopes and whilst it's not perfect I do find that I use it when the other scopes are tied up. Because it is portable and easy on the battery it is a great portable scope I can throw in the car anytime. Much cheaper than buying a battery for the TDS3000 ;) Hopefully they will offer some firmware upgrades and allow the auto triggering level detection to be switched on or off. Like Dave said it is essentially,limited to 20MHz but that is fine with me for a general purpose portable scope for measuring audio and power stuff ;)

cheers

Not at all; it would be sending back an oscilloscope claimed (by the vendor via Amazon) to have a 100 MHz bandwidth, 1 Gs/s sample rate and <3 ns risetime:

(http://www.paladinmicro.com/TestEquipment/FNIRSI-Claims-00.jpg)

that does not...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 16, 2020, 01:51:16 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly.
Nope, 500mV/div max sensitivity using a 10x probe is just inadequate for many requirements.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 16, 2020, 02:06:45 am
Nope, 500mV/div max sensitivity using a 10x probe is just inadequate for many requirements.

However for the remainder it is not, for example it would be entirely adequate for displaying the primary waveform of a contemporary "coil-on-plug" automotive ignition system:

this is the "triple-strike" firing pattern used on many modern cars at idle and lowish RPMs to ensure a clean burn
(http://www.paladinmicro.com/images/OwonHDS_3-Strike-Ign.png)

Or the PWM signal at an idle air control:

(http://www.paladinmicro.com/images/OwonHDS_IAC01.png)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on July 17, 2020, 10:02:50 am
I just bought one too  :palm:

Even with all the lies, bugs and limitations, I find the concept to be excellent.
I sometimes need to "see something" in hard to reach places or when I am not in the lab.
When we just need to see if the clock signal is here or if we have our RS422 pairs at the right place, no need for the big 5000€ scope balanced on the crimping pliers.

The fact that we can increase the battery capacity is great, the big 7" screen is also great, no fan. I hesitated with a handled oscilloscope but I find them very expensive.
If I like the concept, I think it will lead me to buy a Micsig tablet oscilloscope but the small form factor of this little Fnirsi is very very nice.

If they make their code open source, they can sell millions, I think.
It need a small silicone protection and a more expensive 50 € model with real 500 MSa/s
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 10:22:00 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly. I just bought one of these scopes and whilst it's not perfect I do find that I use it when the other scopes are tied up. Because it is portable and easy on the battery it is a great portable scope I can throw in the car anytime. Much cheaper than buying a battery for the TDS3000 ;) Hopefully they will offer some firmware upgrades and allow the auto triggering level detection to be switched on or off. Like Dave said it is essentially,limited to 20MHz but that is fine with me for a general purpose portable scope for measuring audio and power stuff ;)

cheers

Not at all; it would be sending back an oscilloscope claimed (by the vendor via Amazon) to have a 100 MHz bandwidth, 1 Gs/s sample rate and <3 ns risetime:

(http://www.paladinmicro.com/TestEquipment/FNIRSI-Claims-00.jpg)

that does not...

OK from here on and based on Dave's review you can assume it is a 20 MHz scope. Still a very useful portable battery operated dual channel scope for $140 IMHO ;)

cheers
david

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 17, 2020, 10:24:30 am
If they make their code open source...

If only...

It need a small silicone protection and a more expensive 50 € model with real 500 MSa/s

I'm thinking the next generation of these could be awesome.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 10:29:32 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly.
Nope, 500mV/div max sensitivity using a 10x probe is just inadequate for many requirements.

OK what has siglent got to offer with battery operated, dual channel, 7 inch 800x480 full color touch sensitive display etc ?? And not some iddy biddy 3 inch QVGA BS either !!

What you got ??

cheers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 10:32:01 am
If they make their code open source...

If only...

It need a small silicone protection and a more expensive 50 € model with real 500 MSa/s

I'm thinking the next generation of these could be awesome.

If the improvement over the original bar of soap scope is anything to go by then the next model could be a very serious proposition and this company whoever they may be could become a serious contender in the portable scope market ;)

cheers
david
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 10:38:30 am
I just bought one too  :palm:

Even with all the lies, bugs and limitations, I find the concept to be excellent.
I sometimes need to "see something" in hard to reach places or when I am not in the lab.
When we just need to see if the clock signal is here or if we have our RS422 pairs at the right place, no need for the big 5000€ scope balanced on the crimping pliers.

The fact that we can increase the battery capacity is great, the big 7" screen is also great, no fan. I hesitated with a handled oscilloscope but I find them very expensive.
If I like the concept, I think it will lead me to buy a Micsig tablet oscilloscope but the small form factor of this little Fnirsi is very very nice.

If they make their code open source, they can sell millions, I think.
It need a small silicone protection and a more expensive 50 € model with real 500 MSa/s

Also what a lot of others have overlooked with this scope is that because it is battery operated you can float the measurements above ground although I wouldn't recommend this when measuring mains equipment for safety reasons !!

cheers
david
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 17, 2020, 10:49:29 am
If the improvement over the original bar of soap scope is anything to go by then the next model could be a very serious proposition and this company whoever they may be could become a serious contender in the portable scope market ;)

The only reason I haven't bought one of these is that if I sell my Rigol DS1054Z and add $140 to the result (the cost of one of these) I'm in Micsig territory. A Micsig would make a lot more sense.

Plus Micsigs have a 4-channel option and I want 4-channel capability somewhere.

(OTOH I've got an Analog Discovery 2 on order so the 4-channel requirement might disappear when that arrives)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 17, 2020, 11:14:02 am
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly.
Nope, 500mV/div max sensitivity using a 10x probe is just inadequate for many requirements.

OK what has siglent got to offer with battery operated, dual channel, 7 inch 800x480 full color touch sensitive display etc ?? And not some iddy biddy 3 inch QVGA BS either !!

What you got ??

cheers
5.7" display and BW's to 200 MHz and some with 1000V CAT II isolation between channels, all 5 mV sensitivity AND a datasheet that can be trusted !

Nothing flash at all but they work as per their spec.

And you don't think 50 mV max sensitivity is piss poor ?  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 17, 2020, 11:50:07 am
OK what has siglent got to offer with battery operated, dual channel, 7 inch 800x480 full color touch sensitive display etc ??
5.7" display and BW's to 200 MHz and some with 1000V CAT II isolation between channels, all 5 mV sensitivity AND a datasheet that can be trusted !

Just not battery operated or with 7 inch touch display.

Do you even bother reading the posts before replying?  :palm:

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on July 17, 2020, 12:04:57 pm
Siglent SHS800 are battery powered.
This is the first model I looked at when I wanted a portable oscilloscope. But it is too big to be operated by hand, and too expensive as a "small portable bench scope".
The Micsig seems very interesting but too advanced for what I wanted to do.
There is also the Hantek 2C72 but the FNIRSI does just the right thing, 2 channels, large screen and large battery.

This thing cannot and should not be compared to the Siglent or Micsig offer.
And cannot and should not be used as a real scope or to replace a real oscilloscope.
It's just a cheap portable tool that allows you to take measurements very usefull in certain situations.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 12:21:35 pm
In looking at the signals I deal with (hobbyist electronics and automotive stuff) the 50 mv/div sensitivity is not really an issue.
It's marginal though when using a 10x probe as we do for most stuff.

That is so...

We shall see, the good news is that if it is not a useful tool for any reason (even if the novelty wears off and it's no longer "fun") it can go back to Amazon within 30 days--for the simple and indisputable fact that it does not meet the published specs....

That's like sending a 100MHz scope back to Amazon because it can't measure 500MHz properly.
Nope, 500mV/div max sensitivity using a 10x probe is just inadequate for many requirements.

OK what has siglent got to offer with battery operated, dual channel, 7 inch 800x480 full color touch sensitive display etc ?? And not some iddy biddy 3 inch QVGA BS either !!

What you got ??

cheers
5.7" display and BW's to 200 MHz and some with 1000V CAT II isolation between channels, all 5 mV sensitivity AND a datasheet that can be trusted !

Nothing flash at all but they work as per their spec.

And you don't think 50 mV max sensitivity is piss poor ?  :-//

How much ??

cheers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 12:29:35 pm
Siglent SHS800 are battery powered.
This is the first model I looked at when I wanted a portable oscilloscope. But it is too big to be operated by hand, and too expensive as a "small portable bench scope".
The Micsig seems very interesting but too advanced for what I wanted to do.
There is also the Hantek 2C72 but the FNIRSI does just the right thing, 2 channels, large screen and large battery.

This thing cannot and should not be compared to the Siglent or Micsig offer.
And cannot and should not be used as a real scope or to replace a real oscilloscope.
It's just a cheap portable tool that allows you to take measurements very usefull in certain situations.

Yes and it's a hell of lot better than having no scope at all !!

For some time I have been looking for a Tek THS7xx scope at a reasonable price. Only monochrome and QVA but have proper isolation between channels but only 30k record depth :( The Tek THS3000 are way to exe but offer 4 channels and full color but still QVGA and 30k record depth. Or the Keysight U1620 which has 2M point record depth going for around $1000 USD if you are lucky to get all of the accessories. However this scope will do me for a while ;) Hopefully we should see some firmware upgrades if people would stop bagging the crap out of it all of the time and instead offer some constructive criticism :(

cheers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 12:32:23 pm
If the improvement over the original bar of soap scope is anything to go by then the next model could be a very serious proposition and this company whoever they may be could become a serious contender in the portable scope market ;)

The only reason I haven't bought one of these is that if I sell my Rigol DS1054Z and add $140 to the result (the cost of one of these) I'm in Micsig territory. A Micsig would make a lot more sense.

Plus Micsigs have a 4-channel option and I want 4-channel capability somewhere.

(OTOH I've got an Analog Discovery 2 on order so the 4-channel requirement might disappear when that arrives)

I have a 1054z tied up doing I2C decoding so this scope becomes useful for the other measurements when I don't want to boot up the Tek TDS7054 all of the time !

cheers
david
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 17, 2020, 12:37:46 pm
I have a 1054z tied up doing I2C decoding so this scope becomes useful for the other measurements when I don't want to boot up the Tek TDS7054 all of the time !

I'm hoping the AD2 can take over the decoding duties.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on July 17, 2020, 01:03:02 pm
Yes it does and in real time  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 17, 2020, 01:23:32 pm
Hey, I just worked out how to turn off the auto triggering level. It's in the system menu  |O This scope just got a lot better  :-+

cheers
david
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 17, 2020, 01:29:52 pm
Got mine yesterday evening, haven't "played with it" a lot yet (it is for certain a toy) of course. However I can confirm the following (in no special order):

So all that said, and as what I will likely use it for (automotive, motorcycles, etc.) does not require an X10 probe or 100 MHz bandwidth, I think I will keep it. It's portability alone makes it a worthwhile tool. I's too bad the makers feel they need to lie about it's specs.

Did I mention it is as cute as a bug's ear?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 17, 2020, 10:39:31 pm
Got mine yesterday evening, haven't "played with it" a lot yet (it is for certain a toy) of course. However I can confirm the following (in no special order):

  • It is as cute as a bug's ear;
  • The capacitive touch screen UI is quite nice, responsive and nicely configured;
  • It triggers properly on aperiodic bursts usin 5 bursts of a 1 MHz pulse at a 100 kHz repetition rate.
  • It does not have a usable bandwidth of anywhere near 100 MHz;
  • In X10 mode and mucking about with the probe's compensation I found I could create an incredibly non-linear "peaky as hell' response that might perhaps pass a 100 MHz signal--this may be how the rice-burners that market it justify their "100 MHz" and "< 3ns" claims;
  • It is as cute as a bug's ear;
  • In X10 mode the vertical input characteristics are different at each sensitivity setting--making X10 mode even more useless;
  • The FFT math function does nothing but provide a vertically constrained, fixed position, non-calibrated, non-adjustable, clipped off at the top picture of the waveform's spectral content--it is more annoying than useful;
  • The battery seems quite capable of meeting the 4 hour runtime claim;
  • The user manual is horrid, tiny, incomplete and obviously written by someone with an only partial command of the English language;
  • It is as cute as a bug's ear;
  • The -3 dB bandwidth in X1 mode (using just a 50 Ω BNC patch cable) is 20 MHz;
  • I have no way of measuring the sample rate, however I seriously doubt it is 1 Gs/s;
  • Within it's real capabilities the display is very nice;
  • It runs well when charging via the supplied wall wart, however when connected to the USB charging station also powering my function generator or my desktop computer it goes haywire--some ground loop issue I suspect;
  • It is as cute as a bug's ear;
  • Mine is branded Yeapook, though in the Amazon ad copy it was shown as being FNIRSI;
So all that said, and as what I will likely use it for (automotive, motorcycles, etc.) does not require an X10 probe or 100 MHz bandwidth, I think I will keep it. It's portability alone makes it a worthwhile tool. I's too bad the makers feel they need to lie about it's specs.

Did I mention it is as cute as a bug's ear?

Would you mind dumping the winbond SPI flash and posting it here? It would definitely help with reverse engineering it! I've ordered one but it's coming on a human-powered boat from China...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 17, 2020, 10:48:44 pm

Would you mind dumping the winbond SPI flash and posting it here? It would definitely help with reverse engineering it! I've ordered one but it's coming on a human-powered boat from China...

I would be pleased to;  how do I go about doing so? What do I need?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 12:27:35 am
I just bought one too  :palm:

Even with all the lies, bugs and limitations, I find the concept to be excellent.
I sometimes need to "see something" in hard to reach places or when I am not in the lab.
When we just need to see if the clock signal is here or if we have our RS422 pairs at the right place, no need for the big 5000€ scope balanced on the crimping pliers.

The fact that we can increase the battery capacity is great, the big 7" screen is also great, no fan. I hesitated with a handled oscilloscope but I find them very expensive.
If I like the concept, I think it will lead me to buy a Micsig tablet oscilloscope but the small form factor of this little Fnirsi is very very nice.

If they make their code open source, they can sell millions, I think.
It need a small silicone protection and a more expensive 50 € model with real 500 MSa/s

That's pretty much the way I look at it, I have a $360 Hantek 1062B with an actual 60 MHz bandwidth, 1 Gs/s sample rate, 2 mv/div sensitivity, and a real configurable and adjustable FFT function.

It is approximately the same size but has just a 5.7" 640 x 480 display, a cooling fan, and weighs 1.2 kg vs. 707 g for the little guy. It also requires 12 VDC to charge vs. the little fella's nearly ubiquitous 5 VDC requirement.

The Hantek is cute (it would be better with a larger touchscreen):

(http://www.paladinmicro.com/TestEquipment/Hantek1062B.jpg)

But not as "cute as a bug's ear":

(http://www.paladinmicro.com/TestEquipment/Yeapook1013D.jpg)



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 12:33:37 am

Would you mind dumping the winbond SPI flash and posting it here? It would definitely help with reverse engineering it! I've ordered one but it's coming on a human-powered boat from China...

I would be pleased to;  how do I go about doing so? What do I need?

Awesome! You'll need a CH341A (preferred) or a Raspberry Pi (any model) or, as a last resource, a blue pill board.

If you don't own any of those devices you could order the CH341A on eBay (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518 (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518)), but in that case I think it's not worth it as I'd probably get my device before you get the programmer. However, if the open-source firmware comes along nicely and you want to flash it, you'll need one of those devices too, so it's not wasted money ;)

In case you own a CH341A, you will need to connect it to the SPI memory and dump it using the provided software.
In case of using a Raspberry Pi, a software called "flashrom" can be used to use the GPIO as the interface to the SPI chip. (https://www.flashrom.org/RaspberryPi (https://www.flashrom.org/RaspberryPi))
With the blue pill board it's more tricky to do.

In all cases, the CPU will need to be held in a reset state in order to free the SPI bus for the programmer to use it. The only other way is physically de soldering the SPI chip from the board.

PD: To hold the CPU in reset, pin 70 needs to be shorted to GND. There's a convenient pad attached to it (https://prnt.sc/tjxfnl (https://prnt.sc/tjxfnl)).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 01:22:43 am

Would you mind dumping the winbond SPI flash and posting it here? It would definitely help with reverse engineering it! I've ordered one but it's coming on a human-powered boat from China...

I would be pleased to;  how do I go about doing so? What do I need?

Awesome! You'll need a CH341A (preferred) or a Raspberry Pi (any model) or, as a last resource, a blue pill board.

If you don't own any of those devices you could order the CH341A on eBay (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518 (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518)), but in that case I think it's not worth it as I'd probably get my device before you get the programmer. However, if the open-source firmware comes along nicely and you want to flash it, you'll need one of those devices too, so it's not wasted money ;)

In case you own a CH341A, you will need to connect it to the SPI memory and dump it using the provided software.
In case of using a Raspberry Pi, a software called "flashrom" can be used to use the GPIO as the interface to the SPI chip. (https://www.flashrom.org/RaspberryPi (https://www.flashrom.org/RaspberryPi))
With the blue pill board it's more tricky to do.

In all cases, the CPU will need to be held in a reset state in order to free the SPI bus for the programmer to use it. The only other way is physically de soldering the SPI chip from the board.

PD: To hold the CPU in reset, pin 70 needs to be shorted to GND. There's a convenient pad attached to it (https://prnt.sc/tjxfnl (https://prnt.sc/tjxfnl)).

I do not buy from China via eBay, having been stung too many times after waiting weeks on end. I do see what looks like the same device on Amazon for $8.88 w/ Prime shipping (https://www.amazon.com/Gikfun-Programmer-CH341A-Burner-EEPROM/dp/B01I1EU9LG/ref=sr_1_5?dchild=1&keywords=USB+Programmer+CH341A&qid=1595034129&sr=8-5)

Amazon does not vet it's vendors as well as they could/should, eBay is worse!

I have a CP2102 based USB to TTL interface I have used to update firmware on a JYETech DSO112A. I wonder if that could work, however to be honest as my Parkinson's has advanced over the last year I have become less confident about mucking about on SMD boards with a soldering iron, I would hate to brick my new $160 toy (SWMBO would kill me)...

I will do some research any see if it's something I feel comfortable jumping in to...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 01:35:37 am

Would you mind dumping the winbond SPI flash and posting it here? It would definitely help with reverse engineering it! I've ordered one but it's coming on a human-powered boat from China...

I would be pleased to;  how do I go about doing so? What do I need?

Awesome! You'll need a CH341A (preferred) or a Raspberry Pi (any model) or, as a last resource, a blue pill board.

If you don't own any of those devices you could order the CH341A on eBay (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518 (https://www.ebay.com/itm/JW-USB-Programmer-CH341A-Burner-Chip-Writer-SOP-Clip-Adapter-EEPROM-BIOS-FLAS/233635841518)), but in that case I think it's not worth it as I'd probably get my device before you get the programmer. However, if the open-source firmware comes along nicely and you want to flash it, you'll need one of those devices too, so it's not wasted money ;)

In case you own a CH341A, you will need to connect it to the SPI memory and dump it using the provided software.
In case of using a Raspberry Pi, a software called "flashrom" can be used to use the GPIO as the interface to the SPI chip. (https://www.flashrom.org/RaspberryPi (https://www.flashrom.org/RaspberryPi))
With the blue pill board it's more tricky to do.

In all cases, the CPU will need to be held in a reset state in order to free the SPI bus for the programmer to use it. The only other way is physically de soldering the SPI chip from the board.

PD: To hold the CPU in reset, pin 70 needs to be shorted to GND. There's a convenient pad attached to it (https://prnt.sc/tjxfnl (https://prnt.sc/tjxfnl)).

I do not buy from China via eBay, having been stung too many times after waiting weeks on end. I do see what looks like the same device on Amazon for $8.88 w/ Prime shipping (https://www.amazon.com/Gikfun-Programmer-CH341A-Burner-EEPROM/dp/B01I1EU9LG/ref=sr_1_5?dchild=1&keywords=USB+Programmer+CH341A&qid=1595034129&sr=8-5)

Amazon does not vet it's vendors as well as they could/should, eBay is worse!

I have a CP2102 based USB to TTL interface I have used to update firmware on a JYETech DSO112A. I wonder if that could work, however to be honest as my Parkinson's has advanced over the last year I have become less confident about mucking about on SMD boards with a soldering iron, I would hate to brick my new $160 toy (SWMBO would kill me)...

I will do some research any see if it's something I feel comfortable jumping in to...

The one in Amazon is the same, but it does not come with the clip connector which is useful in these situations.

That said, there's no smd soldering involved! FNIRSI were kind enough to give us access to all the pins required with standard 2.54mm pin headers (https://prnt.sc/tjxzwj (https://prnt.sc/tjxzwj)). However, I completely understand that you don't want to risk it and kill your brand new oscilloscope :P

That's okay, I'll do it myself when I receive mine, and post full pinouts for every (unpopulated) header in the board, for future reference.

Thanks for the interest!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 02:00:48 am

The one in Amazon is the same, but it does not come with the clip connector which is useful in these situations.

That said, there's no smd soldering involved! FNIRSI were kind enough to give us access to all the pins required with standard 2.54mm pin headers (https://prnt.sc/tjxzwj (https://prnt.sc/tjxzwj)). However, I completely understand that you don't want to risk it and kill your brand new oscilloscope :P

That's okay, I'll do it myself when I receive mine, and post full pinouts for every (unpopulated) header in the board, for future reference.

Thanks for the interest!

I just ordered one from Amazon, with the clip connector and some other physical interface devices ($13.58, this one (https://www.amazon.com/AiTrip-EEPROM-Programmer-CH341A-Adapter/dp/B07VNVVXW6/ref=sr_1_24?dchild=1&keywords=USB+Programmer+CH341A&qid=1595037248&refinements=p_85%3A2470955011&rnid=2470954011&rps=1&s=electronics&sr=1-24)). Supposed to be here Monday (evening is when we get deliveries out here "in the county").

I'll see what I can figure out then...


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 02:24:38 am
I just ordered one from Amazon, with the clip connector and some other physical interface devices ($13.58, this one (https://www.amazon.com/AiTrip-EEPROM-Programmer-CH341A-Adapter/dp/B07VNVVXW6/ref=sr_1_24?dchild=1&keywords=USB+Programmer+CH341A&qid=1595037248&refinements=p_85%3A2470955011&rnid=2470954011&rps=1&s=electronics&sr=1-24)). Supposed to be here Monday (evening is when we get deliveries out here "in the county").

I'll see what I can figure out then...

Awesome! I'm sure you'll find it useful in other situations too (SPI Flash chips are very common!).

The only thing you will need to solder is a jumper from the pin 70 header to GND, to keep the CPU in reset mode.
(https://i.imgur.com/WpBmtvn.png)

This is the driver + software for the programmer for Windows. I tested it on my machine with Windows 10 x64. https://drive.google.com/file/d/1pPrfsr2i2ZM_NXGNXCCLFuscdtjxWvYx/view?usp=sharing (https://drive.google.com/file/d/1pPrfsr2i2ZM_NXGNXCCLFuscdtjxWvYx/view?usp=sharing) (I don't recommend to download this software from other sources as some of them are viruses... It took some time to find this working, clean version).
You need to install the driver first, and then run the software. I've included various versions (as they support different chips). Try the latest one, and if it does not work keep trying the other ones until you find one that works. Worst thing that can happen is that the software won't be able to read the chip.

Those are the only steps that are required to read the chip (DO NOT PRESS THE "Auto", "Blank", "Write" OR "Erase" BUTTONS AS THAT WILL ERASE THE CHIP!):
(https://i.imgur.com/Qrknvmj.png)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 18, 2020, 02:43:40 am
The only thing you will need to solder is a jumper from the pin 70 header to GND, to keep the CPU in reset mode.

Looks like there's a GND hole without solder mask 2.54 millimeters to the left right of that.


That said, there's no smd soldering involved! FNIRSI were kind enough to give us access to all the pins required with standard 2.54mm pin headers (https://prnt.sc/tjxzwj (https://prnt.sc/tjxzwj)).

Indeed. This thing was born to be hacked.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 08:16:07 am

Looks like there's a GND hole without solder mask 2.54 millimeters to the left of that.


That would be cool, I'll just slap a two-pin header strip in there and put a jumper on it...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 12:55:53 pm
The only thing you will need to solder is a jumper from the pin 70 header to GND, to keep the CPU in reset mode.

Looks like there's a GND hole without solder mask 2.54 millimeters to the left right of that.

From the looks of it, that's not GND... This is a (low-res) picture of the underside:
(https://i.imgur.com/PtFr5C2.png)

Also, @cliffyk, could you take some clear pictures of the LCD ribbon cable and the Touchscreen IC chip? We need to identify them to write their drivers in the Linux Kernel. The pictures on page 1 of the topic does not show them clearly.

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 18, 2020, 01:02:42 pm
From the looks of it, that's not GND... This is a (low-res) picture of the underside:

Seems hard to believe that they'd bring out that pin then put another hole 2.54mm away from it, no solder mask on either hole, but that's not what you're supposed to use.  :-//

[attachimg=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 18, 2020, 01:13:42 pm
[...] Also, @cliffyk, could you take some clear pictures of the LCD ribbon cable and the Touchscreen IC chip? We need to identify them to write their drivers in the Linux Kernel. [...]

There's lots of useful info here: http://nano.lichee.pro/ (http://nano.lichee.pro/) (chinese, use the google translate extension)

Seeing how quick it boots, I'd think it isn't booting uboot then linux, but maybe, perhaps xboot? + rt-thread, and also the simple UI may as well be littlevGL. (follow the links at the url above).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 01:24:11 pm
[...] Also, @cliffyk, could you take some clear pictures of the LCD ribbon cable and the Touchscreen IC chip? We need to identify them to write their drivers in the Linux Kernel. [...]

[...] Seeing how quick it boots, I'd think it isn't booting uboot then linux, but maybe, perhaps xboot? + rt-thread, and also the simple UI may as well be littlevGL. [...]

Yeah! I thought about that too (but Linux can be made to boot that fast too, if you try hard enough). However, I'd like to use Linux in the new firmware as it's easier to use overall, and also allows us to use other UIs, like Qt. I still have to see if Qt will run in this little chip. If not, then GTK or LVGL would be my other choices.

There's a guy that has created a bare minimum buildroot configuration for this specific chip, which I'm planning to use as a base.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 18, 2020, 02:27:47 pm
It's not going to be easy, first you've got to be sure you can reverse engineer the interface with the fpga, because without that you're not going anywhere.

P.D. the lichee nano (an F1C100S with a Linux) is $6 at seeedstudio.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 02:34:11 pm
It's not going to be easy, first you've got to be sure you can reverse engineer the interface with the fpga, because without that you're not going anywhere.

Yeah, I'll have to either reverse engineer the interface with the FPGA, or program the FPGA myself (which is my plan!). I'll of course back up all the SPI memories to be able to restore the scope to factory defaults. The main reason of buying this scope was to write full open-source code for it.

P.D. the lichee nano (an F1C100S with a Linux) is $6 at seeedstudio.

I know, very cheap! I have a Lichee Pi Zero which is quite similar, but a bit more powerful.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 18, 2020, 02:37:29 pm
I know, very cheap! I have a Lichee Pi Zero which is quite similar, but a bit more powerful.

But that's an S3 (V3s?), right?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 02:58:31 pm
I know, very cheap! I have a Lichee Pi Zero which is quite similar, but a bit more powerful.

But that's an S3 (V3s?), right?

Exactly, it's an S3 with integrated DDR2 memory. It's true that the V3s is a Cortex-A7, while the F1C00S is ARM926EJ-S, so binaries are not compatible. However, building for both is quite similar.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 18, 2020, 05:28:46 pm

Yeah, I'll have to either reverse engineer the interface with the FPGA, or program the FPGA myself (which is my plan!). I'll of course back up all the SPI memories to be able to restore the scope to factory defaults. The main reason of buying this scope was to write full open-source code for it.


I'm very interested to see how this goes.  I started work on open source for an Instek GDS-2000E but then killed the scope in an accident.  I'm trying to get a price on replacing the main board.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 06:36:56 pm

Yeah, I'll have to either reverse engineer the interface with the FPGA, or program the FPGA myself (which is my plan!). I'll of course back up all the SPI memories to be able to restore the scope to factory defaults. The main reason of buying this scope was to write full open-source code for it.


I'm very interested to see how this goes.  I started work on open source for an Instek GDS-2000E but then killed the scope in an accident.  I'm trying to get a price on replacing the main board.

Have Fun!
Reg

Oh, that's an expensive accident...  :-\ In case of the FNIRSI-1013D, it's practically unkillable (unless you overvolt it, or short something you don't have to). I'm not that good with FPGAs yet, so any help will be appreciated (by me and by all the community, I'm sure) :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 18, 2020, 07:14:32 pm
I had leads on a header so I could probe the signals without shorting the pins, but then stood the scope up and one of the leads hit the SMPS.  Ouch!

I got insanely lucky and got it new for $255 from Amazon during an old stock clearance.  So I was diligently working on reverse engineering the header, software update process, etc.

My initial goal was simply to crack the UI open so I could fix a bunch of bugs.  But I'd also set up to develop FPGA IP for the Zynq on a Zybo Z-7 board.  Goal was to develop open source FW for Zynq based DSOs.  They have to be very similar so over the course of a couple of years one ought to be able to completely replace the OEM FW on any Zynq based DSO.  Almost certainly not exactly the same, but no worse than dealing with different MMUs used with different CPUs.

If I get a replacement main board for the GDS-2072E I'll use the dead board to reverse engineer the ADC and Zynq wiring.

Has anyone investigated the USB port to see if one can get access via that?  I just learned about these recently.  I've watched a couple of reviews by Dave and another chap, but not read through all the posts here.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 18, 2020, 07:55:08 pm
Has anyone investigated the USB port to see if one can get access via that?  I just learned about these recently.  I've watched a couple of reviews by Dave and another chap, but not read through all the posts here.

The USB port is handled by the Allwinner SOC, and it can work in both host and peripheral mode. I don't know if there's a way to upgrade the firmware directly by copying a file to the USB disk it creates when connected to a computer. If we get our hands on a dump of the firmware we could find it out.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 18, 2020, 08:09:44 pm
I'll send $20 US via PayPal to the first person to post a FW dump.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 18, 2020, 08:27:48 pm
Hi,

Ordered a fnirsi too, should arrive on monday (amazon).
The only reason is to measure the update rate of my scope.
After this, maybe it could be useful for something else.
Can try to read out the winbond chip too, as I got a tl866 here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 09:52:46 pm
Here are some results of my testing bandwidth in X1 mode using alligator clips:

10kHz reference (5.04 Vpp):
(http://www.paladinmicro.com/TestEquipment/Yeapook/10kHz-00.jpg)

1 MHz (4.99 Vpp -0.087 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/1MHz-00.jpg)

10 MHz (5.39 Vpp +0.58 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/10MHz-00.jpg)

20 MHz (4.99 Vpp -0.087 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/20MHz-00.jpg)

30 MHz (4.36 Vpp -1.26 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/30MHz-00.jpg)

34 MHz (3.47 Vpp -3.24 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/34MHz-00.jpg)

So, there it is -3 dB @ 33 to 34 MHz with alligator clips! Not too shabby,,,

Note that the square-wave on CH2 (X1 mode via a 50 Ω patch cable) turned to crap at > 10 MHz, which actually validates the 30+ MHz bandwidth...



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 18, 2020, 10:50:18 pm
If you can go higher please plot values for a sine wave as I did today in the Rigol DS1202Z-E thread.

https://www.eevblog.com/forum/testgear/rigol-ds1202z-e-entry-level-scope-(200mhz-2-channel)/msg3143092/#msg3143092 (https://www.eevblog.com/forum/testgear/rigol-ds1202z-e-entry-level-scope-(200mhz-2-channel)/msg3143092/#msg3143092)

That will give a much better idea of the usable BW.  For a lot of uses such as HF RF work they seem to be pretty viable even with the attenuation and aliasing at higher frequencies.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 18, 2020, 11:19:01 pm
If you can go higher please plot values for a sine wave as I did today in the Rigol DS1202Z-E thread.

https://www.eevblog.com/forum/testgear/rigol-ds1202z-e-entry-level-scope-(200mhz-2-channel)/msg3143092/#msg3143092 (https://www.eevblog.com/forum/testgear/rigol-ds1202z-e-entry-level-scope-(200mhz-2-channel)/msg3143092/#msg3143092)

That will give a much better idea of the usable BW.  For a lot of uses such as HF RF work they seem to be pretty viable even with the attenuation and aliasing at higher frequencies.

Have Fun!
Reg

My current signal sources (other than my pirate FM station) max out at 60 MHz. Pushing the ADS1013D beyond the 34 MHz I posted just revealed further and relatively linear attenuation (which I view as "a good thing"). It's response does run up (peak) a bit between 10 and 20 MHz, but < 1.0 dB max--comes back down ∼ 22 MHz.

Although, and as I posted in a bulleted list earlier, when using the X10 mode and the supplied HF probe I could "adjust" the probe compensation to create all sorts of peaky responses using pretty solid 25 MHz square-waves. These peaky responses varied with each vertical sensitivity setting making them just useless abnormalities. I think in general the X10 mode in this device is worthless...

 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 19, 2020, 06:00:58 am
Hey, I just worked out how to turn off the auto triggering level. It's in the system menu  |O This scope just got a lot better  :-+

The menu system is weird.  It's also where you set / unset the FFT function.  A somewhat bizarre FFT, too...

Did you figure out the fast/slow setting near the top that changes responsiveness to the (single-point) screen movement?  The single-tap on the left or right on screen to alter the time-base.  (I could not figure this out for ages... gah!)

It has very basic functionality and works adequately within those limitations.  The vertical accuracy on mine is way off, though, so you should check that against something else if you intend on believing what it claims.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 19, 2020, 06:48:42 am
34 MHz (3.47 Vpp -3.24 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/34MHz-00.jpg)

So, there it is -3 dB @ 33 to 34 MHz with alligator clips! Not too shabby,,,

Note that the square-wave on CH2 (X1 mode via a 50 Ω patch cable) turned to crap at > 10 MHz, which actually validates the 30+ MHz bandwidth...

My results seemed a little better: this is 3 Vpp at 50 kHz and 50 MHz, ~2.3 dB down.  I was using a calibrator with active heads directly attached to this instrument, though.

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=996729)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=996737)

Cabling can cause lots of degradation, and alligator clips is not ideal for high frequency.

Edit: can't math properly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 08:09:46 am
Hey, I just worked out how to turn off the auto triggering level. It's in the system menu  |O This scope just got a lot better  :-+

The menu system is weird.  It's also where you set / unset the FFT function.  A somewhat bizarre FFT, too...

Did you figure out the fast/slow setting near the top that changes responsiveness to the (single-point) screen movement?  The single-tap on the left or right on screen to alter the time-base.  (I could not figure this out for ages... gah!)

It has very basic functionality and works adequately within those limitations.  The vertical accuracy on mine is way off, though, so you should check that against something else if you intend on believing what it claims.

My first 'scope was a Bell & Howell Model 34 recurrent sweep monstrosity I got for Christmas when I was 10 or 11 (1956 or '57; I wanted so badly to "see" electricity and my parents indulged me). It came from a local junk/pawn shop, and maybe cost $5--likely pawned by someone who got a VA "TV Repair" grant.

Because of that harrowing experience and years of experience with analog 'scopes I have never considered vertical accuracy to be worth a damn and rarely consider it as other than a rough indicator of what's going on.

It is not possible for an  8-bit digital scope to have especially good vertical accuracy anyway--I have access to a Lecroy Waverunner 204 Xi. it's vertical accuracy spec is  ±1.5% (Of full scale); same as my WaveJet 322...

The digital readouts displaying hundredths of a volt are total eyewash...





Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 08:12:26 am

My results seemed a little better: this is 3 Vpp at 50 kHz and 50 MHz, ~2.3 dB down.  I was using a calibrator with active heads directly Cabling can cause lots of degradation, and alligator clips is not ideal for high frequency.


Yeah, I was deliberately presenting it with a worst-case scenario...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 08:44:53 am
Something I just ran across, there is no triggered sweep at slower than 10 ms/division--that could be a deal breaker for me.

According to the manual it's not supposed to go into "scroll mode" 'til 100 ms/div, but at 20 ms/div the trigger position and level indicators go away and it devolves into some recurrent sweep sort of mode...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 09:27:30 am
I'll send $20 US via PayPal to the first person to post a FW dump.

There you go, a FW dump:

[attachurl=1]

Paypal: me@my.com
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 09:49:26 am
(http://www.paladinmicro.com/TestEquipment/Yeapook/10MHz-00.jpg)

Ohh, so the "3ns rise time" looks more like "30ns rise time", LOL. What a waste. It's a pity because @200MSps that could look much much better with a decent front end. Maybe the software of this one is the least of the problems.

Can anybody post a "dots" display mode of that WF, so we can count the dots?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 19, 2020, 11:10:10 am
Ohh, so the "3ns rise time" looks more like "30ns rise time", LOL. What a waste. It's a pity because @200MSps that could look much much better with a decent front end. Maybe the software of this one is the least of the problems.

That's what we're figuring out.

So far it seems like the capacitance in a 1x probe compensates for the front end and makes it a workable 30MHz 'scope (low pass filter).

The nest step would be to work out the ideal capacitance (for max bandwidth), add a capacitor internally, go back to using 10x probes.

This fix would mean you can place a lot more trust in what's on-screen. If it's 30Mhz then 30Mhz it is. There's nothing wrong with that at this price and with 200MSamples/sec you get a decent bandwidth:sample rate ratio.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rf-loop on July 19, 2020, 11:42:42 am
(http://www.paladinmicro.com/TestEquipment/Yeapook/10MHz-00.jpg)

Ohh, so the "3ns rise time" looks more like "30ns rise time", LOL. What a waste. It's a pity because @200MSps that could look much much better with a decent front end. Maybe the software of this one is the least of the problems.

Can anybody post a "dots" display mode of that WF, so we can count the dots?

With my old but experienced eyes risetime looks more like 17ns than 30ns.
with 200MSa/s it have in this image 10 samples per div, 3.4sample in 10-90% rise time.



Roughly we can say what is needed realtime single shot sampling speed for measure rising time in signal under measure (rtum). (when analog BW is "enough").
Result is MSa/s
5000/rtum for quite accurate risetime measurements
3500/rtum for medium quality measurements
1750/rtum for only poor accuracy measurement or "looking around for fun"
1250/rtum very poor accuracy, useless for measurements

Old demonstrations for some tiny teaching purposes
(https://siglent.fi/pic/SDS1000X/c90-trise-1250-25ns-50MSa-t.png)
1.25s for edge rising time (10 - 90%)

(https://siglent.fi/pic/SDS1000X/c91-trise-1750-35ns-50MSa-t.png)
1.75s for edge rising time

(https://siglent.fi/pic/SDS1000X/c92-trise-3500-70ns-50MSa-t.png)
3.5s for edge risetime(still there can see 10 and 90% points have some time jitter for risetime measurements purposes

No image for 5s for edge. There is no sampling interval based errors when mesurement are specified for 10 and 90%.

(https://siglent.fi/pic/SDS1000X/KuvaD-RisingEdge-640--250-1GSa--3ns-at.png)
just for thinking.

------------------------------------
Personally I can not understand at all why so small amount of noise and ranting is about this "1GSa/s  100MHz" total hoax - fraud. Totally shameful outrageous scam if it is just as in Dave's video and HW is like displayed and if it is true what ADC there is. Also some tests support the assumption that there is max 200MSa/s.
Here in China I can see it selling in many places, example Jingdong, also Tmall/Taobao and all these claim they have quite tight rules for scams.  How long they can continue this hoax. Everywhere they advertise it 100MHz oscilloscope with 1GSa/s samplerate.  Why peoples accept it. Example here in China is quite strong customer protection system IF customers know how to use it. But looks more like "who knows...who cares".  This kind of business peoples do not think anything but what is money coming today to pocket and after soon they hide and escape and start some other hoax. Why they do not sell chickens. There is less numerical specifications what can easy check and test. Only need take the stones out from stomach before weighing and tell final price.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 12:17:17 pm
Would you mind dumping the winbond SPI flash and posting it here?
attached...

You'll need a CH341A (preferred)...
This is totally shit programmer...
I bought EZP2019+... Each reading get different result...
After that order SP16-B (www.sofi-tech.com (http://www.sofi-tech.com)) this one read stable.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 12:54:40 pm
Here are the horizontal and vertical settings from the FW image:

Vertical settings:

5V/div
2.5V/div
500mV/div
200mV/div
100mV/div
50mV/div
25V/div
10V/div
2V/div
1V/div
500V/div
250V/div
100V/div
50V/div
20V/div

Horizontal settings:

50S/div
20S/div
10S/div
5S/div
2S/div
1S/div
500mS/div
200mS/div
100mS/div
50mS/div
20mS/div
10mS/div
5mS/div
2mS/div
1mS/div
500uS/div
200uS/div
100uS/div
50uS/div
20uS/div
10uS/div
5uS/div
2uS/div
1uS/div
500nS/div
250nS/div
100nS/div
50nS/div
25nS/div
10nS/div

Apparently 4 rebranders:

UTX-1013.bin
FSI-1013.bin
YPK-1013.bin
DAN-1013.bin

It appears to be an AD9288:

AD9288
AD9288_1
AD9288_2
AD9288_1_2

I'm guessing that the last is a reference to merging all 4 channels into one. So there may be variants which implement that.

Does anyone have a disassembler for the chip?  If the compiler doesn't do a lot of optimization then it might be possible to write C code from reading the disassembly and incrementally start reverse engineering source code for it.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 01:18:40 pm
It appears to be an AD9288:
Yep, I said it before...

I'm guessing that the last is a reference to merging all 4 channels into one. So there may be variants which implement that.
They don't have hardware support to merge all 4 channels into one...

Does anyone have a disassembler for the chip?
IDA Pro, Ghidra... it is ARM9 core
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 02:01:02 pm
(http://www.paladinmicro.com/TestEquipment/Yeapook/10MHz-00.jpg)

Ohh, so the "3ns rise time" looks more like "30ns rise time", LOL. What a waste. It's a pity because @200MSps that could look much much better with a decent front end. Maybe the software of this one is the least of the problems.

Can anybody post a "dots" display mode of that WF, so we can count the dots?

It does not have a "raw point" display mode, only interpolated x/sin(x) "vector" mode....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 19, 2020, 02:02:47 pm
Personally I can not understand at all why so small amount of noise and ranting is about this "1GSa/s  100MHz" total hoax - fraud. Totally shameful outrageous scam if it is just as in Dave's video and HW is like displayed and if it is true what ADC there is.

Are you in a position to do anything about it?

We're busy hacking it into something useful.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 19, 2020, 02:04:03 pm
Does anyone have a disassembler for the chip?
IDA Pro, Ghidra... it is ARM9 core

The main chip is this:

https://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf

ARM9 with built-in display controller.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 02:31:01 pm
Code: [Select]
0030ba0: f001 bde8 0000 a0e3 0082 bde8 1cd0 8de2  ................
0030bb0: f001 bde8 0100 a0e3 0082 bde8 0060 7380  .............`s.
0030bc0: 01ff ff00 01ff ff80 7377 6974 6368 2069  ........switch i
0030bd0: 6e74 6f20 6869 6768 2073 7065 6564 206d  nto high speed m
0030be0: 6f64 6520 2121 210d 0a00 0000 04e0 2de5  ode !!!.......-.
0030bf0: 8bdf 4de2 0120 a0e3 ac10 8fe2 0d00 a0e1  ..M.. ..........

Any idea what's that?

Code: [Select]
004d330: e13f a0e3 b0c0 d0e1 9b00 5ce3 1900 009a  .?........\.....
004d340: 0110 81e2 0c20 82e0 0118 c1e3 1800 00ea  ..... ..........
004d350: ccaf 1880 506c 6561 7365 2069 6e73 6572  ....Please inser
004d360: 7420 7465 7374 2063 6c69 7020 616e 6420  t test clip and
004d370: 7072 6573 7320 4f4b 2074 6f20 636f 6e74  press OK to cont
004d380: 696e 7565 2021 0000 9ced 1880 5901 0000  inue !......Y...
004d390: 4f4b 0000 7227 1980 58cd 1980 02b8 1a80  OK..r'..X.......
004d3a0: cdcc 0000 72cf 1a80 0180 8be2 0ca0 8ae0  ....r...........
004d3b0: 01b8 c8e3 0130 53e2 0200 80e2 dcff ff1a  .....0S.........

And this?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 02:36:12 pm
Who assured that the FW is only the SPI mem contents?

It only has a bootloader, a small app and a bitmap...   ::)

I only opened it with a hex-editor but I think something is missing...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 02:41:17 pm
attached...

Thanks! It looks like it's not Linux in this case. But can be easily ported!

This is totally shit programmer...

It works fine for me! I used it in different situations, bios flash, firmware dump, etc and never had any problems :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 02:43:10 pm
I realized that Dave thought it was an AD9288, but the chips had been sanded off.  My point was confirmation from the binary image.

Does anyone recognize the filesystem?  It doesn't appear to be UBI which is the only flash filesystem I have any familiarity with, and that is *very* little.

There's a string "F1C100S  XiaoTaoQi  Disk 1.0 " but a search with google didn't turn anything up other than a translation to "Rascal Disk 1.0".

There are these strings:

/pic_system.sys
/piclist.sys
/wave_system.sys
/wavelist.sys
eGON.BMP
eGON.EXE

If we can mount the filesystem we should be able to start disassembling the code and making variable maps to identify major sections of the code.

Have Fun!
Reg

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 02:44:14 pm
Who assured that the FW is only the SPI mem contents?

The F1C100s has no internal memory, only RAM, so it must be in flash. Normally they run Linux, but in this case they must be using something else (somebody suggested XBoot paired with other software). It makes sense as the flash chip is only 2MB, Linux won't fit in there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 02:48:09 pm
I realized that Dave thought it was an AD9288, but the chips had been sanded off.  My point was confirmation from the binary image.

Does anyone recognize the filesystem?  It doesn't appear to be UBI which is the only flash filesystem I have any familiarity with, and that is *very* little.


I've tried Binwalk and it's not recognizing anything from the binary... We'll have to do some more research...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 02:52:00 pm
"F1C100S  XiaoTaoQi  Disk 1.0" inside.

https://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf (https://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf)

There is a big part that looks obfuscated (starting around offset 0x184C80).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 02:53:07 pm
Does it come with an SDCard or is the SD slot empty?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 02:55:27 pm
Does it come with an SDCard or is the SD slot empty?

It comes with a 2GB SDCard I think.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 02:59:06 pm
"F1C100S  XiaoTaoQi  Disk 1.0" inside.

I was just thinking. This could be part of the USB descriptor table. When you plug it in to a PC, it shows up as a USB drive. Anyone with the scope can check it on device manager.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 02:59:41 pm
pic_system.sys appears to be a touchscreen library by a company call JuTouch.  The server doesn't seem to be accessible, but google had this cached:

Comprehensive system support. Supporting wide variety of operating systems (Linux, Windows, IOS, and Android). pic_system. About JuTouch

Haven't found anything else that looks likely for the other stuff.  It's obviously not a quantum computer nor a video game.  piclist.sys did produce a hit on a Chinese Python library but google translate just briefly showed it in Chinese and then blanked the screen.  I think it's an OCR library though.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:00:34 pm
The F1C100s has no internal memory, only RAM, so it must be in flash. Normally they run Linux, but in this case they must be using something else (somebody suggested XBoot paired with other software). It makes sense as the flash chip is only 2MB, Linux won't fit in there.

So it's a F1C100 proc with all the FW in the SPI mem.

There is no filesystem, outside the SD Card. There is only an app launched by the secondary bootloader (SPL block).

They simplified also by not having to deal with FW upgrades...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 03:00:58 pm
Does it come with an SDCard or is the SD slot empty?
It comes with a 2GB SDCard I think.

Might as well be booting from there, then, no?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 03:02:43 pm
Personally I can not understand at all why so small amount of noise and ranting is about this "1GSa/s  100MHz" total hoax - fraud. Totally shameful outrageous scam if it is just as in Dave's video and HW is like displayed and if it is true what ADC there is.

Are you in a position to do anything about it?

We're busy hacking it into something useful.

I have written scathing reviews on Amazon, for both the product and the vendors of this and the "bar of soap" ADS 5012 model, however they do not seem to care. Yeapook is a brand name of Shenzhen Yipu Commercial and Trading Co., Ltd however I have not been able to determine if they are indeed the manufacturer of this device. The only contact info I have found is their snail-mail address.

As far as I can determine there is no online support for the product. I have contacted the vendor fom whom i purchased it (Ccfoud-US via Amazon) but have had no response. It was however a "fulfilled by Amazon"item so it can go back if I find it to not meet even my modest needs.

We'll see...

I have also determined that there is no triggered operation at sweeps slower than 10 ms/div. The scroll mode does work at 100ms/div and slower but it is just a non-triggered unsynchronized repetitive left to right sweep that would be of little to no use capturing aperiodic single-shot events unless you were to continuously monitor it and manually stop the capture when you "got one; and IF the event does not occur during the "retrace" period.

To be fair, my Hantek DSO1062B also does not have triggered operation in "scroll mode". The Lecroy WJ 322 does. but that's a $2000 instrument.

It is still "as cute as a bug's ear", but it may be going back...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 03:03:58 pm
"F1C100S  XiaoTaoQi  Disk 1.0" inside.

https://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf (https://linux-sunxi.org/images/b/ba/F1C100s_Datasheet_V1.0.pdf)

There is a big part that looks obfuscated (starting around offset 0x184C80).

I did not find the string in the datasheet.  The apparently obfuscated part may be the FPGA bitstream.  However, there is a string "Encrypt" in the image.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 03:05:02 pm
Does it come with an SDCard or is the SD slot empty?

It comes with a 2GB SDCard I think.

Mine came with a SanDisk 1 GB card...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 03:06:15 pm
It comes with a 2GB SDCard I think.

Might as well be booting from there, then, no?

I still don't have the scope with me, but I did read somewhere that the SDCard only contained the screenshots and saved data.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 03:08:32 pm
The F1C200s is the same as F1C100s, but with double the RAM. All the registers are the same, so this user manual applies to our chip too:
https://www.thirtythreeforty.net/posts/2020/02/trying-the-allwinner-f1c200s/Allwinner_F1C200s_User_Manual_V1.1.pdf (https://www.thirtythreeforty.net/posts/2020/02/trying-the-allwinner-f1c200s/Allwinner_F1C200s_User_Manual_V1.1.pdf)

It contains all the CPU and Peripherals registers and descriptions about them. Might be useful to use with Ghidra.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:09:43 pm
I did not find the string in the datasheet.  The apparently obfuscated part may be the FPGA bitstream.  However, there is a string "Encrypt" in the image.

Reg, the string is in the FW. Some guys call "encrypt" to simple obfuscation methods. The pattern that I refer to doesn't seem to be a "standard" encryption output. But...

Yes, I also noticed that there is no "clear" FPGA block in the FW.

Does the scope have any FPGA? Which?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:11:04 pm
The F1C200s is the same as F1C100s, but with double the RAM. All the registers are the same, so this user manual applies to our chip too:
https://www.thirtythreeforty.net/posts/2020/02/trying-the-allwinner-f1c200s/Allwinner_F1C200s_User_Manual_V1.1.pdf (https://www.thirtythreeforty.net/posts/2020/02/trying-the-allwinner-f1c200s/Allwinner_F1C200s_User_Manual_V1.1.pdf)

It contains all the CPU and Peripherals registers and descriptions about them. Might be useful to use with Ghidra.

https://linux-sunxi.org/F1C100s (https://linux-sunxi.org/F1C100s)

http://www.allwinnertech.com/index.php?c=product&a=index&id=73 (http://www.allwinnertech.com/index.php?c=product&a=index&id=73)

Allwinner's in-house operating system Melis 2.00

This (https://github.com/steward-fu/miyoo) guy managed to insert linux OS on a machine running Melis OS (and with a Allwinner F1C500S chip).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 03:13:01 pm
Does it come with an SDCard or is the SD slot empty?

It comes with a 2GB SDCard I think.

Mine came with a SanDisk 1 GB card...

Does it boot w/o the card? Can you have a look and tell us what's in the card? Ideally, partitions, filesystem types, and start blocks too :-)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:14:14 pm
Does it boot w/o the card? Can you have a look and tell us what's in the card?

It has to. The card is extra.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 03:16:15 pm
The FPGA is an Altera part, but I don't recall the version from Dave's video.

I found this in the image at two different locations.  Does anyone recognize the byte pattern?

rhb@Hipster:/export/home/rhb/Downloads/fnirsi$ head bb bbb
==> bb <==
0060000 006  \0  \0 352   e   G   O   N   .   E   X   E  \0  \0  \0  \0
0060020  \0   t  \0  \0   E   X   E   C  \0  \0  \0  \0  \0  \0  \0  \0
0060040 333 360   ! 343   X   П  ** 345 327 360   ! 343   T   П  ** 345
0060060 322 360   ! 343   P   П  ** 345 321 360   ! 343   L   П  ** 345
0060100 337 360   ! 343   H   П  ** 345 323 360   ! 343   D   П  ** 345
0060120 020 017 021 356 002  \n 300 343 020 017 001 356   8  \0 237 345
0060140 020   / 021 356 002   * 022 342  \0 020 240 003   , 020 237 025

==> bbb <==
0470000 006  \0  \0 352   e   G   O   N   .   E   X   E  \0  \0  \0  \0
0470020  \0   2 031  \0   E   X   E   C  \0  \0  \0  \0  \0  \0  \0  \0
0470040 333 360   ! 343   X   П  ** 345 327 360   ! 343   T   П  ** 345
0470060 322 360   ! 343   P   П  ** 345 321 360   ! 343   L   П  ** 345
0470100 337 360   ! 343   H   П  ** 345 323 360   ! 343   D   П  ** 345
0470120 020 017 021 356 002  \n 300 343 020 017 001 356   8  \0 237 345
0470140 020   / 021 356 002   * 022 342  \0 020 240 003   , 020 237 025

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:19:08 pm
It has 4 blocks:

00000000 - SPL (secondary bootloader)
00006000 - 1st executable (OS part that deals with the SD card)
00013000 - bitmap
00027000 - 2nd executable (main app)

My best guesses ATM.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 03:36:17 pm
It has 4 blocks:

00000000 - SPL (secondary bootloader)
00006000 - 1st executable (OS part that deals with the SD card)
00013000 - bitmap
00027000 - 2nd executable (main app)

My best guesses ATM.

ATM?  I shudder to think what google will return for that.  Can you explain?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 03:37:08 pm
Function at 0x00042830 seems to be an init/hardware check function. It calls a function related to the FPGA, which if it fails, prints "FPGA Failed" through the serial port or some sort of log file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 03:38:41 pm
It has 4 blocks:

00000000 - SPL (secondary bootloader)
00006000 - 1st executable (OS part that deals with the SD card)
00013000 - bitmap
00027000 - 2nd executable (main app)

My best guesses ATM.

ATM?  I shudder to think what google will return for that.  Can you explain?

ATM = At The Moment ;P
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 03:38:52 pm
...I think something is missing...
Something what? there is no another flash... that is a full dump of SPI flash...

Does anyone recognize the filesystem?
this is a plain binary file... not filesystem...
at start executing standard initialization... stack pointers for different modes... initializing ram.. etc

There is a big part that looks obfuscated (starting around offset 0x184C80).
it is not obfuscated... it is some table... note values coming in ascending order.
it looks more as a map, unicode characters conversion table.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:43:15 pm
it is not obfuscated... it is some table... note values coming in ascending order.
it looks more as a map, unicode characters conversion table.

No way, it looks obfuscated. There are very few "clear" strings...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 03:44:56 pm
Can someone post a disassembly?  I should be able to identify all the function and variable addresses with a bit of awk.  That will also tell us if the "obfuscated" section is a bitstream.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 03:48:51 pm
Can someone post a disassembly?

I'm away from my dev station...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 03:53:52 pm
Does it come with an SDCard or is the SD slot empty?
Yep, 1GB... I've tried 32GB (FAT32) working!
without card if you try to save anything, device will hang...

...I did read somewhere that the SDCard only contained the screenshots and saved data.
Yep, only for screenshots and saved data.

Does it boot w/o the card? Can you have a look and tell us what's in the card? Ideally, partitions, filesystem types, and start blocks too :-)
Yep, working without SD... but hangs if you try to save.

No way, it looks obfuscated. There are very few "clear" strings...
My 20 years of experience in reverse engineering tells me that this is a table, not a code. But I will know for sure only when I reach that place.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 03:55:23 pm
When someone can post a disassembly I'll make tables of the caller:callee relationships among the functions and map the global variable addresses.  If we can get documentation for the JuTouch library we should have a pretty good grip on it.

https://www.jutouch.com/ (https://www.jutouch.com/)

They say to contact sales for the driver software.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 03:57:40 pm
If we can get documentation for the JuTouch library we should have a pretty good grip on it.

I think it's easier for somebody to just open the device up and tell us the which chip is the touchscreen using, then just writing the driver for it (which for sure is already available in GitHub)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 04:00:28 pm
The JuTouch library will give important hints about what the rest of the code does.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 04:03:54 pm
My 20 years of experience in reverse engineering tells me that this is a table, not a code. But I will know for sure only when I reach that place.

My 5 minutes look at that part shows an incrementing pattern (with contiguous 0x400 bytes size blocks). That doesn't look like a unicode characters conversion table. I could be wrong...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 19, 2020, 04:09:21 pm
It is still "as cute as a bug's ear", but it may be going back...

Imagine all the fun you'll miss out on.  :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 04:14:54 pm
My 5 minutes look at that part shows an incrementing pattern (with contiguous 0x400 bytes size blocks). That doesn't look like a unicode characters conversion table. I could be wrong...
Maybe we talk about different places?
Because I don't see any 0x400 bytes size blocks... In that case I will asume that this is a memory mapping table...
But this is what I see
(https://i.ibb.co/jbnd0y1/20200720000935.png) (https://ibb.co/jbnd0y1)
PS: This is a Little Endian...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 04:20:16 pm
That section is broken up in  chunks of various sizes delimited by zeros.  This is strongly suggestive of a bitstream for the FPGA. If that's the case there will be a bit of assembly code that sits in  loop incrementing a pointer through that section reading and then writing the contents to the FPGA load address.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 04:43:34 pm
But the fpga has another spi flash chip.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 05:04:22 pm
But the fpga has another spi flash chip.

I think that's an I2C EEPROM, judging by the two pull-up resistors on two of the pins.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 19, 2020, 05:25:23 pm
It comes with a 2GB SDCard I think.

Might as well be booting from there, then, no?

I still don't have the scope with me, but I did read somewhere that the SDCard only contained the screenshots and saved data.

As originally designed and configured that is correct...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 05:31:12 pm
If that's the case there will be a bit of assembly code that sits in  loop incrementing a pointer through that section reading and then writing the contents to the FPGA load address.

That is almost certainly wrong.  The Zynq at least has it's own facility for loading the bitstream from flash.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 05:34:44 pm
But the fpga has another spi flash chip.

I think that's an I2C EEPROM, judging by the two pull-up resistors on two of the pins.

Well, maybe, but my point is/was, isn't that the eeprom that contains the fpga bitstream? And if so, it's not going to be in the other eeprom too, right?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 05:37:56 pm
This is strongly suggestive of a bitstream for the FPGA.
FPGA has another standalone chip... as wrote @GeorgeOfTheJungle

But the fpga has another spi flash chip.
IC which you mark is I2C, name is erased...
and the IC a little bit left, is also SPI 25P16VP, and connectors on left (6pin top, and 4pin bottom is to program them)
Both of them connected to FPGA only...

By the way
Touch IC is GOODIX GT915
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 05:42:47 pm

Well, maybe, but my point is/was, isn't that the eeprom that contains the fpga bitstream? And if so, it's not going to be in the other eeprom too, right?

Oh, the FPGA bitstream is definitely in the other SPI NOR located to the left of this misterious EEPROM. The Allwinner CPU does not send it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 19, 2020, 05:47:41 pm
But the fpga has another spi flash chip.
IC which you mark is I2C, name is erased...
and the IC a little bit left, is also SPI 25P16VP, and connectors on left (6pin top, and 4pin bottom is to program them)

Where will my glasses be?  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 06:24:59 pm
Here is the dump of ST 25P16VP... (this is FPGA stream data and connected to dedicated FPGA pins)
I don't think that it is useful for anyone, just let it be for history...
I2C I guess for store settings.
https://mega.nz/file/MGY3FI5b#wURGvOJB9Zb6dqilI2w5TRbJWrP3fHHG5muqNXtb-r4
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 19, 2020, 06:31:59 pm
That is almost certainly wrong.  The Zynq at least has it's own facility for loading the bitstream from flash.

Yes but that would mean two flash chips.

(ie. more expensive)

But the fpga has another spi flash chip.

I think that's an I2C EEPROM, judging by the two pull-up resistors on two of the pins.

I2C EEPROM would be used for storing calibration, atc.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 07:16:53 pm
Here is the input channel...
screenshot from here (made by St_dsk )
https://mysku.ru/blog/aliexpress/80036.html
quality of picture is not good  :(
(https://i.ibb.co/mHXFkXR/bddbbe.jpg) (https://ibb.co/mHXFkXR)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 07:24:49 pm
Well, I got Ghidra 9.1.2 to run, but it does not grok ARM V9.  So where to from here?

Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 07:56:08 pm
Here is the dump of ST 25P16VP... (this is FPGA stream data and connected to dedicated FPGA pins)
I don't think that it is useful for anyone, just let it be for history...
I2C I guess for store settings.

Also for history, here is the parsing of this dump (.RBF file) header:

Code: [Select]
WARNING: the .RBF file has the bytes bit-reversed!  Reversing...
FPGA - RBF/RPD (Raw Binary File) - Filesize: 16 777 216 bits (00200000 bytes)
00000000 - Start of File  (Type 1)

         [00000048                      00000021]
Bit 7  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 6  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 5  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 4  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 3  - 1111111111111111111111111110111010000000       FFFFFFEE80
Bit 2  - 0000011100110011001011111000000000111111       07332F803F
Bit 1  - 1100000000000111100011000000010111111111       C0078C05FF
Bit 0  - 0000000000010101000100010110110111111111       0015116DFF
Bits 0080 - EPCS/EPCQ ID check: Enabled
Bits 005F - Stream size: 943 711 bits  (0001CCCC bytes)  Compression Bit ON  (+1)       Size NOT OK
Bits 0056 - 0000 0000 : 0x56-0x5D
Bits 004C - Programming Mode: Active Serial (AS x1)
Bits 003B - IDCode (Version+Part Number only): 0x020F1  (-> 0x024F1)
Bits 0008 - Usercode: 0015116D
00000049 - Header CRC-16_MODBUS: 0033  [00000021-00000048]        CRC OK
0000004B - Data Framesize: 207  [0000004B-000000F1]
000000F2 - 4-byte words: 1260  [000000F2-000014A1]
00000000 - Stream Size (Uncompressed): 15 610 872 bits
000014A2 - CRC Framesize: 207+0     # Data Frames: 1727  [000014A2-00059D4F]
Start address: 00000000
00059D50 - Post-device bitstream pad bytes (0xFF): 1583407  [00059D50-001DC67E]
File Checksum: 1E469589

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 08:29:30 pm
Blocks:  (UPDATE)

Offset:      Size:
00000000 00003400 - SPL (secondary bootloader)
00006000 00007400 - 1st executable (OS part that deals with the SD card)  (?)
00013000 0000E600 - bitmap
00027000 00193200 - 2nd executable (main app)  (?)
 
(the 1st 32 bytes of each block are its header) In the header, at offset 0x10, there is the size of the block (including header).

SPL has a Load Address = 0x00000000
The executables have a Load Address = 0x80000000


A teaser function in the attached file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ace1903 on July 19, 2020, 08:32:42 pm
@ rhb
ARM V9 != ARM9

ARM9 is old architecture and it should be supported in Ghidra.
The latest architecture from ARM when I checked a couple of years ago was ARM v8.
Not sure if v9 is released yet.
Also note that ARM9 is also older than Cortex A9.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 09:04:49 pm
What's the architecture I should select?  ARM's nomenclature has driven me crazy for years and I'm the kind of person who bought processor manuals for new chips e.g. R2000, i860, 68000.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 09:07:04 pm
Here is a LOT of interesting stuff for those that want to develop something:

http://dl.linux-sunxi.org/ (http://dl.linux-sunxi.org/)
http://dl.linux-sunxi.org/allwinner/ (http://dl.linux-sunxi.org/allwinner/)
http://dl.linux-sunxi.org/SDK/ (http://dl.linux-sunxi.org/SDK/)

F1C100 processor (http://dl.linux-sunxi.org/F1C100/Allwinner_F1C100_datasheet_20110331.pdf)

http://dl.linux-sunxi.org/SDK/A80/A80_SDK_20140728_stripped/lichee/linux-3.4/drivers/usb/sunxi_usb/udc/sunxi_udc.c (http://dl.linux-sunxi.org/SDK/A80/A80_SDK_20140728_stripped/lichee/linux-3.4/drivers/usb/sunxi_usb/udc/sunxi_udc.c) - Similar to some functions in the scope
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 09:09:06 pm
What's the architecture I should select?

ARM Little endian with the load addresses that I've previously indicated, after stripping the 32 byte headers!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 09:22:11 pm
What's the architecture I should select?

ARM Little endian with the load addresses that I've previously indicated, after stripping the 32 byte headers!

Not clear what you mean by "stripping the 32 byte headers".  Could you give a novice a more detailed description?

Once I can decompile the whole thing I should be able to discover quite a lot.  I haven't attacked a completely undocumented code in 30 years, but that was how I was introduced to C & Unix.  A 5000 line C code which didn't work correctly on a little endian machine.  It had 2 comments both of which read

/* handling special cases */

thanks,
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 09:45:27 pm
Well, I got Ghidra 9.1.2 to run, but it does not grok ARM V9.  So where to from here?

Reg

ARM V4T little endian
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 19, 2020, 09:46:57 pm
What's the architecture I should select?

ARM Little endian with the load addresses that I've previously indicated, after stripping the 32 byte headers!

Not clear what you mean by "stripping the 32 byte headers".  Could you give a novice a more detailed description?

Once I can decompile the whole thing I should be able to discover quite a lot.  I haven't attacked a completely undocumented code in 30 years, but that was how I was introduced to C & Unix.  A 5000 line C code which didn't work correctly on a little endian machine.  It had 2 comments both of which read

/* handling special cases */

thanks,
Reg

Read and process this msg (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3145054/#msg3145054).

Attached is the start of the 2nd executable loaded as I explained before (as seen in IDA Pro).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 10:08:20 pm
I selected "ARM v4t little endian" and Ghidra is thinking about it.  Probably wrong, but I just fed it the entire file. I can always go back and do it over in pieces.

From the look of it Ghidra may already do the stuff I was going to do.  But we'll see.  It's about time I learned more about this.  It makes for considerable incentive to get a sacrificial GDS-2072E either by means of a new board or buying another along with a Siglent SDS-1104X. The fact that NSA created Ghidra greatly increases my enthusiasm for this.  IDA Pro is a bit pricey for my purposes at least for now.  And I'd really rather focus on analog front end design.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 10:13:55 pm
ARM V4T little endian
actually
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ)
https://steward-fu.github.io/website/mcu/lichee-nano/flash_image.htm
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 10:18:11 pm
Thanks!

I'd *really* like to crack this to the point we can write open source FW for it.  I'd expect it to sell like mad if we can do that.  Which might actually persuade Rigol, Siglent et al to open source their FW or better yet, use a common set of base open source FW and just compete on HW design.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 19, 2020, 10:22:41 pm
(the 1st 32 bytes of each block are its header) In the header, at offset 0x10, there is the size of the block (including header).

SPL has a Load Address = 0x00000000
The executables have a Load Address = 0x80000000


A teaser function in the attached file.
addon
In the header, at offset 0x10, there is the size of the block (including header), aligned to 0x200 (size = (size + 0x1FF) & 0xFFFFFE00)
In the header, at offset 0x0C, there is the SUM32 checksum (sum of all words) of the block (including header), but previously set checksum to 0x5F0A6C39
(mksunxi.exe align the size and calc checksum)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 19, 2020, 10:22:56 pm
ARM V4T little endian
actually
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ)
https://steward-fu.github.io/website/mcu/lichee-nano/flash_image.htm

Lol you're right! It actualy worked with ARMv4T in ghidra for me lol
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 19, 2020, 10:39:51 pm
ARM V4T little endian
actually
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ)
https://steward-fu.github.io/website/mcu/lichee-nano/flash_image.htm

Would you please elaborate on the link?    How does this relate to the 1013D?  From what I found I probably want to get a couple but it's not clear what to get as I found lots of very different hits.

Ghidra finished, but I'm *way* in over my head. LoL!

Can someone point me to some basic instructions suitable for someone who knows nothing about Ghidra, a lot generally about HW, but nothing at all about this HW and only  very little about the ARM.  After studying a dozen or more CPUs (e.g Burroughs 5000) going back 50 years it becomes a bit of a blur.  On top of which I've not been into a machine at this level since the VIC20 and C64.

Thanks,
Reg
Title: Heard back from FNIRSI re: "100 MHz"
Post by: cliffyk on July 20, 2020, 06:28:27 am
Well,

FNIRSI responded to my WTF "100 Mhz???" snot-gram (actually I was quite polite): 

(http://www.paladinmicro.com/TestEquipment/Yeapook/FNIRSIResponse-00.jpg)

So, it turns out that 100 Mhz is the "maximum theoretical value"  and if you actually want a 100 Mhz bandwidth you should "buy other better oscilloscope, such as TEKTRONIX..."

Kind of like what I told my wife when we first met, "my đick is 'theoretically' 9 inches"...
Title: Re: Heard back from FNIRSI re: "100 MHz"
Post by: Fungus on July 20, 2020, 06:53:08 am
So, it turns out that 100 Mhz is the "maximum theoretical value"  and if you actually want a 100 Mhz bandwidth you should "buy other better oscilloscope, such as TEKTRONIX..."

It's the Nyquist limit of a 200Mhz sample rate and we know it's 200Mhz.  :-+

What about their claim of 1GHz sampling? I'd love to see how they spin that.
Title: Re: Heard back from FNIRSI re: "100 MHz"
Post by: cliffyk on July 20, 2020, 07:04:20 am
So, it turns out that 100 Mhz is the "maximum theoretical value"  and if you actually want a 100 Mhz bandwidth you should "buy other better oscilloscope, such as TEKTRONIX..."

It's the Nyquist limit of a 200Mhz sample rate and we know it's 200Mhz.  :-+

What about their claim of 1GHz sampling? I'd love to see how they spin that.

I hadn't considered that perspective--they know damned well the front-end cannot pass 100 Mhz! 

But hot damn, that makes my 1 Gs/s 60 MHz Hantek DSO1062B a 500 Mhz machine!

In my snot-gram I had questioned the sample rate and  <3 ns rise time claims as well, they ignored both...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 07:20:42 am
I suspect that with the exception of a handful of geeks who need not be named outright (no offense guys), 99.44% of the buyers of this "instrument" have no real need for a 100MHz 'scope, have no access to signals of near that frequency anyway, and will never know the claim is a complete bucket of hogwash...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 07:26:04 am
I don't get why everybody is so angry about it at this price point.

In my country we have a saying about people who start looking the teeth when you're trying to give them a free horse.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: MosherIV on July 20, 2020, 07:49:16 am
False advertising!

In engineering specifications are everything!
If something is specified to be 100MHz and1G samples - it had better be!

Realistically, based on the price most sensible engineers would know this is an obvious scam.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 20, 2020, 07:54:56 am
There are other sayings about being cheap and buy crappy stuff ...
If is known that this is a 20MHz scope or so , many people wouldn't buy it , cheap as it is  ;D

The display , parts and manufacturing are very cheap from tablet/phone industry , no surprise they can afford to make it . Of course the know-how and time to make a scope right are not that cheap
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 07:55:06 am
I don't get why everybody is so angry about it at this price point.

In my country we have a saying about people who start looking the teeth when you're trying to give them a free horse.

I have no "anger" over this, nor have I seen anymore than "bemusement" by most of the posters here.  i knew going in it was a "too-good-to-be-true" device; but I am annoyed by the blatant deception and total disregard for the customer. Sort of like if I went to pick up the free horse and was told "Well, it's not EXACTLY 'free'".

It takes a lot to get me angry--no one wants to see me like that.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 08:02:44 am
False advertising!

In engineering specifications are everything!
If something is specified to be 100MHz and1G samples - it had better be!

That's just a cultural expectation, not a physical law.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 08:15:30 am
False advertising!

In engineering specifications are everything!
If something is specified to be 100MHz and1G samples - it had better be!

That's just a cultural expectation, not a physical law.

I was raised to believe that a man's word was his bond. I once, many years back, spent $16.4 million (of my employer's money) with a "handshake" contract--but that was back when men had decency and honor; long lost characteristics I fear.

"Cultural expectation" sounds like a way of self-justifying sniveling out of a deal...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 08:36:40 am
I was raised to believe that a man's word was his bond.

That has NEVER been true.

But getting back to the point: How do we get the most from these things?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 20, 2020, 08:47:11 am
I was raised to believe that a man's word was his bond.
That has NEVER been true.

Perhaps not in your circles...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 09:00:44 am
Perhaps not in your circles...

You've never seen anti-hairloss products, diet products, abdominal training devices in yours?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 20, 2020, 09:17:10 am
The F1C100s Lychee Nano board is now a sipeed product (or so it seems), and FYI there's a sipeed group at telegram: https://t.me/sipeed (https://t.me/sipeed)

Also:
https://github.com/Lichee-Pi (https://github.com/Lichee-Pi)
https://github.com/Lichee-Pi/Lichee-Nano-Doc-us-english (https://github.com/Lichee-Pi/Lichee-Nano-Doc-us-english)
https://github.com/Lichee-Pi/linux (https://github.com/Lichee-Pi/linux)
https://dl.sipeed.com/LICHEE/Nano/Document (https://dl.sipeed.com/LICHEE/Nano/Document)
https://www.programmersought.com/article/5946691191/ (https://www.programmersought.com/article/5946691191/)
https://www.cnx-software.com/2018/08/17/licheepi-nano-cheap-sd-card-sized-linux-board/ (https://www.cnx-software.com/2018/08/17/licheepi-nano-cheap-sd-card-sized-linux-board/)

(https://www.cnx-software.com/wp-content/uploads/2018/08/LicheePi-Nano-Board-Large.jpg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 11:43:03 am
The preceding seems like a lot of senseless argument about something we all knew long before.  Lets get on with open sourcing the FW.

FWIW My "200 MHz"  Rigol DS1202Z-E has a 300 MHz -3 dB point and is quite usable to almost 1 GHz on a sine wave.

[attachimg=1]

This was done with an HP 8648C set at 0 dBm output into a 50 ohm thru termination.  The horizontal line is -3 dB.  The scope is severely aliased of course which will lead to incorrect results for an FFT.  I'm still trying to devise a good time domain test for aliasing effects other than the standard sine wave appears to be lower frequency than it actually is. The modulation options for the 8648C are somewhat limited.

The 100 MHz trigger instability is a consequence of sampling the sine wave consistently at less than peak value.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 01:42:42 pm
Despite my simply feeding Ghidra the flash image and specifying the wrong architecture, it seems to have worked.

However, learning to use Ghidra looks pretty daunting and I don't think I have the time to do anything serious.  All the stuff I know to do and then some is already implemented in Ghidra.  Unfortunately I don't yet know how to access what I want.

For example, 0xb34e() has an infinite loop following a series of function calls suggesting that it is the main loop when the DSO is running.  However, I can't figure out how to walk back up the call tree from there.

I'm certainly impressed by Ghidra.  I had not known of it before, so it's been a very valuable education.  I can see lots of uses for it, but I think I need to start by analyzing a less complex program.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 02:30:13 pm
Did anyone check if it was capable of 100Mhz?

Yes.

Or where its limit is?

More like 20-30MHz
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 02:31:07 pm
Has anybody measured the bandwidth in 1x mode?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 03:37:10 pm
The lack of a variable gain amplifier limits them pretty significantly.  The Rigol had to change ranges quite a few times for the plot I posted.

My DSO testing has found that all of the ones I've tested alias because the filter is before the variable gain amplifier.  While undesirable in certain circumstances, it does mean they are usable to 3-4x they -3 dB point for tasks like troubleshooting an RF system.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 03:47:54 pm
I was raised to believe that a man's word was his bond.
That has NEVER been true.

Perhaps not in your circles...

Bingo!

I was going to respond "Never been in a firefight, have you?". When you tell a brother you "have his back", YOU HAVE HIS GODDAMN BACK!

You'll need him to do the same for you someday...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 20, 2020, 03:50:29 pm
Hi,

Mine did arrived - Ordered as fnirsi, it comes a "yeapook"... ;)
First look, cute toy, responsive touchscreen...

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 03:56:41 pm
I was going to respond "Never been in a firefight, have you?". When you tell a brother you "have his back", YOU HAVE HIS GODDAMN BACK!

I don't think it's a bad thing to have been raised with the phrase "Caveat Emptor" burned into the psyche.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 04:06:33 pm
Has anybody measured the bandwidth in 1x mode?

Didn't read the entire thread did you?

Here're my results, a couple others checked it as well:

Here are some results of my testing bandwidth in X1 mode using alligator clips:

10kHz reference (5.04 Vpp):
(http://www.paladinmicro.com/TestEquipment/Yeapook/10kHz-00.jpg)

1 MHz (4.99 Vpp -0.087 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/1MHz-00.jpg)

10 MHz (5.39 Vpp +0.58 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/10MHz-00.jpg)

20 MHz (4.99 Vpp -0.087 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/20MHz-00.jpg)

30 MHz (4.36 Vpp -1.26 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/30MHz-00.jpg)

34 MHz (3.47 Vpp -3.24 dB)
(http://www.paladinmicro.com/TestEquipment/Yeapook/34MHz-00.jpg)

So, there it is -3 dB @ 33 to 34 MHz with alligator clips! Not too shabby,,,

Note that the square-wave on CH2 (X1 mode via a 50 Ω patch cable) turned to crap at > 10 MHz, which actually validates the 30+ MHz bandwidth...

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 04:09:26 pm
I was going to respond "Never been in a firefight, have you?". When you tell a brother you "have his back", YOU HAVE HIS GODDAMN BACK!

I don't think it's a bad thing to have been raised with the phrase "Caveat Emptor" burned into the psyche.

Oh, we had that one too.

if you read the entire thread you will find that I and others have been generally please with the value of the unit--nonetheless it is grossly misrepresented..
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 20, 2020, 04:13:18 pm
For example, 0xb34e() has an infinite loop following a series of function calls suggesting that it is the main loop when the DSO is running.  However, I can't figure out how to walk back up the call tree from there.

I'm certainly impressed by Ghidra.  I had not known of it before, so it's been a very valuable education.  I can see lots of uses for it, but I think I need to start by analyzing a less complex program.

As Morpheus would say: Welcome to the real world.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 04:22:42 pm
Hi,

Mine did arrived - Ordered as fnirsi, it comes a "yeapook"... ;)
First look, cute toy, responsive touchscreen...

I have found the UI will get sluggish in "Normal" trigger mode in the absence of, or with a maladjusted trigger--switching to "Auto" mode frees it all up.

Check out the "Save Wave"/"View Waveform"  functions. When viewing a saved wave ("wave", not "pic") you can alter gain and time base, and scroll up/down/sideways, to view the entire capture. Measured parameters, cursors anf the FFT function (such as it is) work as well. I wish my Lecroy allowed that. 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 20, 2020, 04:24:17 pm
Here're my results, a couple others checked it as well:

Fed in a sinewave with 1Vrms, starting at 1Mhz. Got -3dB (0.707Vrms) at appx 37 Mhz.
Interesting :

Where at frequencies about 10Mhz or more the waveform looks stable, at 1Mhz it´s somekind of "restless" .
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 04:34:21 pm
Here're my results, a couple others checked it as well:

Fed in a sinewave with 1Vrms, starting at 1Mhz. Got -3dB (0.707Vrms) at appx 37 Mhz.
Interesting :

Where at frequencies about 10Mhz or more the waveform looks stable, at 1Mhz it´s somekind of "restless" .

Mine tracks and synchs well from the 10 kHz reference I started with, out to the 34 MHz -3dB point I found... But, that's the sort on inconsistency we have all come to expect in this stuff. If they used top notch quality components they could of course not afford the sell it for $165 delivered here in the U.S.

All in all I find I am enjoying it. Did I mention it's as cute as a bug's ear?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 04:35:21 pm
For example, 0xb34e() has an infinite loop following a series of function calls suggesting that it is the main loop when the DSO is running.  However, I can't figure out how to walk back up the call tree from there.

I'm certainly impressed by Ghidra.  I had not known of it before, so it's been a very valuable education.  I can see lots of uses for it, but I think I need to start by analyzing a less complex program.

As Morpheus would say: Welcome to the real world.

The real world is a rather large place.  No one lives long enough to visit all of it.

It would be very interesting to know the origins of this.  The obvious presence in the FW of features not supported by the HW suggests someone developed a base design and FW to sell to manufacturers who in turn set the price point by leaving out HW.

The lack of a variable gain amplifier to provide mV ranges is more of a barrier to my getting one than the 30 MHz BW.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 04:38:28 pm
The trigger jitter at 1 MHz may be caused by failing to interpolate the trigger point and retime the sampling  Easily fixable once we have control of the FW it's running.

Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 04:40:06 pm
It would be very interesting to know the origins of this.  The obvious presence in the FW of features not supported by the HW suggests someone developed a base design and FW to sell to manufacturers who in turn set the price point by leaving out HW.

Maybe management said "We want a 1GSample/100Mhz 'scope!" and engineering did the best they could.

The would certainly explain the discrepancy between the ADC sample rate and the analog bandwidth - they were aiming higher when they chose the ADC but it didn't work out in production.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 20, 2020, 04:55:57 pm
Be serious , this is not a company as it should be , just some guys wanting to make easy money lying  ...  ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 05:03:41 pm
Be serious , this is not a company as it should be , just some guys wanting to make easy money lying  ...  ;D

In the west we call those people "managers and salesmen".

There's laws that make it make it difficult to sell products with definite numbers on them though so they mostly stick to homeopathic, gluten-free hairloss remedies that help you sleep and tighten up your abs while you use them. ie. Nothing that can be disproved in a court of law.

(either that or investment-grade "collectables" on the shopping channel that can only go up in value in the future...)

Edit: And then there's the Batteroo brothers.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pascal_sweden on July 20, 2020, 05:07:42 pm
It would be nice if the software of this device was open sourced. Then one could actually make something useful out of it :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 20, 2020, 05:26:47 pm
Some further impressions...
Took the screenshot function, works perfect.
Data transmission to pc was really simple - Connect it to the pc, voilá.
Interesting : You should better disconnect your source from the channels when connect it to the pc, otherwise the waveforms changed to a negative DC voltage on the screen - Isolation problem I guess.
But after playing a bit around:
Cute, really cute toy... :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 05:58:28 pm
Be serious , this is not a company as it should be , just some guys wanting to make easy money lying  ...  ;D

The datasheet of  Keysight MSOX3104T states rise time as 0.35/BW *except* for the 1 GHz model.  For that it's 0.45/BW.

That's a $20K MSRP scope.

Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 20, 2020, 06:21:41 pm
Be serious , this is not a company as it should be , just some guys wanting to make easy money lying  ...  ;D

In the west we call those people "managers and salesmen".

There's laws that make it make it difficult to sell products with definite numbers on them though so they mostly stick to homeopathic, gluten-free hairloss remedies that help you sleep and tighten up your abs while you use them. ie. Nothing that can be disproved in a court of law.

(either that or investment-grade "collectables" on the shopping channel that can only go up in value in the future...)

Edit: And then there's the Batteroo brothers.

"Franklin Mint" comes to mind...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 07:05:44 pm
"Franklin Mint" comes to mind...

Yeah, that's the one.

At least FNIRSI is giving you something in return for your money.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 20, 2020, 07:13:51 pm
Has anybody measured the bandwidth in 1x mode?

Didn't read the entire thread did you?

Wait a minute...

That measurement was with "alligator clips". I was interested in the bandwidth with the 1x probes. The 1x probes will have some capacitance that will lower the bandwidth.

If we have to use crocodile clips to get the most from this thing then there should be a way to get better results by adding a small amount of capacitance and limiting the bandwidth to something the system can handle.

(ie. not exploding into a mess of aliasing when you go over 50MHz).


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 20, 2020, 07:53:12 pm
Hi,

Done the meausure with the probe switching to 1x.
BW decreases to 17.8Mhz
Martin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 20, 2020, 08:20:23 pm
Cute, really cute toy... :D

Have you used it with your Siglent board?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 20, 2020, 08:21:43 pm
Damn, good idea!

Tomorrow I´ll do it with the stb-3 .

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 20, 2020, 10:22:44 pm
I reran Ghidra specifying "ARM v5te little endian".  It generated an error message for an "aggressive one time" operation which I did not get when I used "ARM v4te little endian".  Without experienced guidance I
 have no idea what to make of it.

The noise level has gotten pretty high. I'm really not interested in Franklin Mint and such, so I think it's time to wander off.

If anyone actually does something please send me a heads up via PM.

Have Fun!
Reg

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 02:56:40 am
That measurement was with "alligator clips". I was interested in the bandwidth with the 1x probes. The 1x probes will have some capacitance that will lower the bandwidth.

If we have to use crocodile clips to get the most from this thing then there should be a way to get better results by adding a small amount of capacitance and limiting the bandwidth to something the system can handle.


The alligator clips represent the type of "probe" I am likely to employ in my use of this tool, as my primary use will be in troubleshooting contemporary electronic engine control system sensors and control devices in automobiles, motorcycles and almost any modern ICE powered equipment (even lawn mowers). Alligator clips, back-probe needles, and insulation piercing clips such as these:

(http://www.paladinmicro.com/TestEquipment/Yeapook/PiercingClips-00.JPG)

On such machinery, and other than at board level within the "black box" engine and power-train control modules, there are mo pretty little test points to which one could connect a formal X1 or X10 oscilloscope probe--the best one can do is attempt to find something shiny to clip onto and when that fails you grab the proper color wire and punch a hole through the insulation (a spray of carburetor cleaner to degrease and a small drop of silicone sealer will plug it up when you're done).

For the most part the signal voltages are "highish", at 5 or 12 V typically; and signal frequencies max out at 1 to maybe 5 kHz. Consider that even with a 10 cylinder  4-stroke/cycle engine running 10,000 RPM (an unlikely find); spark, fueling, and monitor events occur only 50,000 times/minute; just 833 events per second.

Other uses such as monitoring voltage drops, start-up current draws and the like occur over multiples of minutes. Here are some traces i've captured over the years:

Testing an ignition coil (primary waveform at 0.054" and 15 mm plug gaps):
(http://www.paladinmicro.com/images/COPTest20101120-01.png)

2003 Mustang GT triple-strike plug firing at idle (reduces NOx emissions):
(http://www.paladinmicro.com/images/COPMultiStrike02.gif)

1998 Mercedes SL500 IR keyless entry receiver output of keyfob "unlock" command:
(http://www.paladinmicro.com/images/MTSPacket02.png)

1998 SL500 RF keyless entry receiver output, lock and unlock:
(http://www.paladinmicro.com//SL500/images/1998StockKeyless-01.jpg)

Only Mercedes knows why they felt both IR and RF controls were needed--they are incapable of doing anything normally, like lug bolts requiring an alignment tool to mount a wheel, instead of studs and nuts. Worst car I ever owned, gobs of fun to drive, just don't think too much about what plastic thing is going to deteriorate next,

2003 Mustang GT narrowband oxygen sensor output at 2000 RPM:
(http://www.paladinmicro.com/images/OwonHDS_O2-2K01.png)

Suzuki Burgman 400 headlamp startup current w/a cheap Asian 5-pin DIN relay (captured using a MasTech clamp-on DC current probe):
(http://www.paladinmicro.com/images/Burgman/9006Cheap-ON-01.png)

Same with a quality NTE relay having reverse EMF protection:
(http://www.paladinmicro.com//images/Burgman/9006NTE-ON-01.png)

Burgman 400 ignition ON current:
(http://www.paladinmicro.com/images/Burgman/K3400-CurrentDraw-01.jpg)

2009 Tacoma throttle position sensor, from closed to WOT:
(http://www.paladinmicro.com/images/ForumPosts/TPSWJ312Trace-01.png)

2009 Tacoma, on-board 120 VAC inverter (so-called "modified sine wave" w/a 60W load):
(http://www.paladinmicro.com/Tacoma/images/Tacoma400-60W.PNG)

My point is that there is a whole bunch of useful work one can do with an oscilloscope that does not involve single digit mV levels and MHz frequencies.

I think this silly little puppy may be just the ticket for much of that sort of work.

Did I mention it's as cute as a bugs ear?

--------------------------------------------
Not related to any of the above, but nonetheless a novel use of an oscilloscope in automotive diagnosis/repair, here's an analysis of an audio file I asked a fellow who was questioning the accuracy of his mustang Cobra's tachometer to send me. The FFT analysis revealed a predominate frequency (a loud exhaust note) of 154 Hz.

154 /4 [exhaust pulses per revolution for a V8] * 60 =  2310 RPM, just what his tach was reporting:
(http://www.paladinmicro.com/images/4R70W-373-03.png)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 21, 2020, 03:02:12 am
Cliff, can you select units of Amps in the channel input menu ?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 03:13:03 am
Cliff, can you select units of Amps in the channel input menu ?

With my Lecroys you can select A as he unit label and scale the value display, but not with this little fella. However I'm pretty good at math and "make believe"...

 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 21, 2020, 04:04:50 am
Cliff, can you select units of Amps in the channel input menu ?

With my Lecroy's you can select A as he unit and scale the display, but not with this little fella. However I'm pretty good at math and "make believe"...
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

Another FAIL for FNIRSI.  ::)

Thanks for checking.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 21, 2020, 08:12:13 am
Hi,

Done the meausure with the probe switching to 1x.
BW decreases to 17.8Mhz
Martin

 :-+

Not perfect but also not the disaster promised in the manual.

[attachimg=1]

Theoretically we could gain an extra 15Mhz in 1x mode by making a custom probe with just the right amount of capacitance, but... you'd only need that when you want 50mV/division.

The overlap in the Venn diagram isn't big enough to not bother, IMHO. People who want that would probably be using a real oscilloscope anyway.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 21, 2020, 08:22:58 am
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

But the amount of menu-diving required simply isn't worth it.

Another FAIL for FNIRSI.  ::)

Yeah, total fail. They totally should have added a whole extra menu just for that.  Not. :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 08:43:53 am
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

But the amount of menu-diving required simply isn't worth it.


And all that does is change the label for use with a current probe--without a current probe an oscilloscope has no idea how much current a conductor is carrying.

Another FAIL for FNIRSI.  ::)

Yeah, total fail. They totally should have added a whole extra menu just for that.  :palm:

:palm: + 100, i'm with you on the face plant; And as I said above I'm pretty good at make believe...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 21, 2020, 08:52:52 am
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

But the amount of menu-diving required simply isn't worth it.

Another FAIL for FNIRSI.  ::)

Yeah, total fail. They totally should have added a whole extra menu just for that.  Not. :palm:
We need ask ourselves who might buy this $120 tablet instead of a proper DSO or for that matter a working CRO ?
At least an order of magnitude sensitivity better is available in all other scopes and totally without the apparent sensitivity to 10x probes.  :o
Yes older instruments do have their limitations too but not so for the most basic of measurements like these.

A buyers expectations of getting a somewhat capable instrument would not be met and for once on this forum I'd recommend the purchase of a CRO so not to be so disappointed. Yes I said that !  :palm:

Yet member bd139 picked up a mint condition TDS210 DSO yesterday for the same price as the topic of this thread of which I strongly suggest will be a much better investment.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 08:53:51 am
Hi,

Done the meausure with the probe switching to 1x.
BW decreases to 17.8Mhz
Martin

 :-+

Not perfect but also not the disaster promised in the manual.

(Attachment Link)

Theoretically we could gain an extra 15Mhz in 1x mode by making a custom probe with just the right amount of capacitance, but... you'd only need that when you want 50mV/division.

The overlap in the Venn diagram isn't big enough to not bother, IMHO. People who want that would probably be using a real oscilloscope anyway.

That first statement in the manual's red-flagged  "Solemn reminder" section ("The bandwidth of the 1x probe file is 5 MHz,...") may be so with regard to the supplied probe in 1X mode, however I got out to 34 MHz at -3 dB, with alligator clips on the end of 16" of 50 Ω cable. In the morning I'm going to see what I can get with 3 ft of 18 ga. zip cord...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 21, 2020, 09:01:21 am
That first statement in the manual's red-flagged  "Solemn reminder" section ("The bandwidth of the 1x probe file is 5 MHz,...") may be so with regard to the supplied probe in 1X mode, however I got out to 34 MHz at -3 dB, with alligator clips on the end of 16" of 50 Ω cable.

It's all about capacitance.

You can get the same bandwidth by switching the probe to 10x mode, you just lose the 50mV range.

(because the x10 probe has a 10:1 voltage divider hidden inside it).

There'll be a compromise in between the two, which is what you're doing with your clips, but I suspect most people won't bother. It's nice to know it's there but the difference in bandwidth isn't huge (you're not getting the promised 100Mhz or anywhere close)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 21, 2020, 09:11:30 am
Theoretically we could gain an extra 15Mhz in 1x mode by making a custom probe ...

I'm beginning to think the nickname of this puppy is "theoretically".  :-DD

Warning: I'm not bashing. I must do a comparison between my DSO138 and a MXR...  ::)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 09:36:50 am
That first statement in the manual's red-flagged  "Solemn reminder" section ("The bandwidth of the 1x probe file is 5 MHz,...") may be so with regard to the supplied probe in 1X mode, however I got out to 34 MHz at -3 dB, with alligator clips on the end of 16" of 50 Ω cable.

It's all about capacitance.

You can get the same bandwidth by switching the probe to 10x mode, you just lose the 50mV range.

(because the x10 probe has a 10:1 voltage divider hidden inside it).

There'll be a compromise in between the two, which is what you're doing with your clips, but I suspect most people won't bother. It's nice to know it's there but the difference in bandwidth isn't huge (you're not getting the promised 100Mhz or anywhere close)

I fully understand the theory of HF passive probes probes, however I just tested the supplied probe in x1 mode.

Here's a dose of empirical reality: 18.6 MHz @ -3 dB.

1 Mhz 1.01 Vrms:
(http://www.paladinmicro.com/TestEquipment/Yeapook/1.bmp)

18.6 Mhz 0.707 Vrms (-3 dB):
(http://www.paladinmicro.com/TestEquipment/Yeapook/2.bmp)
 
I don't think they ever tested the instrument, just threw together some specs based on theoretical capabilities.

I still like it, for my intended use it will do just what i need though i do wish it had triggered sweep at 20 ms/div and slower.

Have I mentioned that it's a cute as a bug's ear?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 21, 2020, 09:57:24 am
This is another good example of compromise between € and capabilities.

Doing such a scope with a multimedia chip is another example of ingenuity and its developers surely did their best. Once again, I don't think it can be improved much more.

The specs that are presented by the vendor are executives/marketing "wishful thinking".

Once people here correctly characterize the performance envelope of this scope, I think it should be perfectly usable in non-demanding tasks by a great number of users.

Maybe its time for C-brands...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 21, 2020, 10:16:07 am
Doing such a scope with a multimedia chip is another example of ingenuity and its developers surely did their best. Once again, I don't think it can be improved much more.

I wonder why did they put a front end so slow when the digitizer runs @ 200MSa/s? It's not a good fit. Perhaps the guy was better at digital than analog? It happened to Woz all the time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 21, 2020, 10:38:58 am
I wonder why did they put a front end so slow when the digitizer runs @ 200MSa/s? It's not a good fit. Perhaps the guy was better at digital than analog? It happened to Woz all time.

There goes the neighborhood... you up the proc, you up the price. It's a fine balance. You have to put the limit somewhere.

Edit: What I meant is: you up the front end, and you'll be here asking for more sampling power...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 21, 2020, 10:41:01 am
There goes the neighborhood... you up the proc, you up the price. It's a fine balance. You have to put the limit somewhere.

Do you think it would have been so much more expensive?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 21, 2020, 10:46:49 am
Do you think it would have been so much more expensive?

I think so. When we are at this scale of "upscaling/modding", any small change in any part of the chain might force big € increments in the rest of the chain / total redesign. But, of course, IMHO.

I can easily imagine those meetings where this kind of things are discussed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 21, 2020, 11:08:40 am
Do you think it would have been so much more expensive?

I think so. When we are at this scale of "upscaling/modding", any small change in any part of the chain might force big € increments in the rest of the chain / total redesign. But, of course, IMHO.

Look: https://mysku.ru/blog/aliexpress/80036.html#comment3580231

Quote
If R12 is reduced to 10-22 Ohm, the frequency response at the HF will become flat to 100 MHz.
If you increase C2, it will level out at the low frequency response.

(https://pic.mysku-st.ru/uploads/pictures/10/83/75/2020/06/25/bddbbe.jpg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 21, 2020, 01:25:01 pm
To provide good transient responses the input LP filter corner should be no more than 40-50% of Nyquist.

The steeper the filter skirt, the more the step response rings.

With a 100 MHz Nyquist, a 30-35 MHz LP corner is actually a good design choice.

Have Fun!
Reg

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 21, 2020, 02:29:52 pm
Playing around with the stb-3 board :

[attachimg=1]

The demo board provides a variety of testsignals, ideal for doing a quick "overall" test on new scopes.
Sinewaves, squarewaves, pwm, runt, glitch, modulation, eres and several serial bus signals.
And inbetween it´s limitations, the scope performed well.
PWM signals are no problem:

[attachimg=2]

Runt and glitch pulses....Well, no.  ;)
Also it couldn´t display the AM signal (25Mhz carrierfrequency) proper, but the rest is not too bad, single/normal trigger works fine.
Showstopper is the minimum resolution of 500mV/div. in 10x mode and the missing of other triggerfunctions.
Interesting:
Frequency will only be measured when the trigger is in "auto" mode, in normal mode it doesn´t work.
Also you can´t "zoom" in after stop.

Continue playing with the board and scope...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on July 21, 2020, 03:10:44 pm
I don't understand why people are so shocked by the lies and the performance of this oscilloscope.
Who would be willing to take precision measurements on a device at this price ? It is the price of 2 x 100Mhz Siglent or Rigol probe  :-DD
Yes it is ridiculous to put forward this kind of performance and it should be banned but this is the case for 95% of cheap Chinese products.

if you have 150$ to put in an oscilloscope and it will be your one and only oscilloscope, go find another used device.
This oscilloscope is interesting only for these unique specifications : cheap, 7" touch screen, no boot time, long battery operation and small form factor.
Very useful in many cases.

tv84 is in the place so he will soon be able to unlock the serial bus decoding, the eye diagram and the zone triggering :-/O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 21, 2020, 03:19:08 pm
Quote
I don't understand why people are so shocked by the lies and the performance of this oscilloscope.

I´m not shocked about, I´m positively surprised. ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on July 21, 2020, 03:35:03 pm
I don't understand why people are so shocked by the lies and the performance of this oscilloscope.
if you have 150$...
I'm not shocked!
Actual price is 100$ (on taobao.com in China, price is 699 RMB = ~100$), this is how much I paid...
Do you know any alternative for the same price?  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 21, 2020, 03:41:14 pm
Bodnar-Pulse :

[attachimg=1]

Terminated with 50 \$\Omega\$ ,although it makes no difference... ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 03:51:28 pm
Playing around with the stb-3 board :

(Attachment Link)

The demo board provides a variety of testsignals, ideal for doing a quick "overall" test on new scopes.
Sinewaves, squarewaves, pwm, runt, glitch, modulation, eres and several serial bus signals.
And inbetween it´s limitations, the scope performed well.
PWM signals are no problem:

(Attachment Link)

Runt and glitch pulses....Well, no.  ;)
Also it couldn´t display the AM signal (25Mhz carrierfrequency) proper, but the rest is not too bad, single/normal trigger works fine.
Showstopper is the minimum resolution of 500mV/div. in 10x mode and the missing of other triggerfunctions.
Interesting:
Frequency will only be measured when the trigger is in "auto" mode, in normal mode it doesn´t work.
Also you can´t "zoom" in after stop.

Continue playing with the board and scope...

Mine does "zoom" (alter gain and timebase), "pan" (change trigger level and position), toggle FFT, and all that in Stop mode? 

Duty cycle +/- and time +/- are also blocked in Normal and Single trigger mode. As I have said before 10x mode is irrelevant for my needs, I do wish triggering worked at slower (<10 ms) time base settings.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 21, 2020, 03:58:45 pm
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

But the amount of menu-diving required simply isn't worth it.

Another FAIL for FNIRSI.  ::)

Yeah, total fail. They totally should have added a whole extra menu just for that.  Not. :palm:
We need ask ourselves who might buy this $120 tablet instead of a proper DSO or for that matter a working CRO ?
At least an order of magnitude sensitivity better is available in all other scopes and totally without the apparent sensitivity to 10x probes.  :o
Yes older instruments do have their limitations too but not so for the most basic of measurements like these.

A buyers expectations of getting a somewhat capable instrument would not be met and for once on this forum I'd recommend the purchase of a CRO so not to be so disappointed. Yes I said that !  :palm:

Yet member bd139 picked up a mint condition TDS210 DSO yesterday for the same price as the topic of this thread of which I strongly suggest will be a much better investment.

I agree and stated earlier I suspect 99.44% of the buyers have no need for 100 MHz or < 50 mV/div performance--half of that number probably don't even know what those specs mean...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on July 21, 2020, 04:10:17 pm
I don't understand why people are so shocked by the lies and the performance of this oscilloscope.
if you have 150$...
I'm not shocked!
Actual price is 100$ (on taobao.com in China, price is 699 RMB = ~100$), this is how much I paid...
Do you know any alternative for the same price?  :)

No, it is why I have one in front of me right now.
Perfect for me when I need to see something
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 21, 2020, 04:15:51 pm
Quote
I suspect 99.44% of the buyers have no need for 100 MHz or < 50 mV/div performance--half of that number probably don't even know what those specs mean...

As stated before, this thing is a nice little toy you could do rudimental measurings with.
But in my opinion, it´s not a scope for beginners, they should save their money to buy a little siglent or rigol - Or buying a used, well known scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gf on July 21, 2020, 04:18:31 pm
Yep. It's 200MS/s actually as both ADC's in the one chip are clocked out of phase, same signal goes into both ADC channels.

I'm wondering, are the two ADCs still clocked anti-phase in 2-channel mode?

[ I'm asking because on my Hantek 2000 this is unfortunately the case, leading to 1/2 ADC clock cycle delay between the displayed CH1 and CH2 signals :( Usually hardly visible w/o zoom-in, nevertheless significant in cases where it matters. ]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 21, 2020, 04:19:26 pm
tv84 is in the place so he will soon be able to unlock the serial bus decoding, the eye diagram and the zone triggering :-/O

Yep, eye diagram: almost there. Just waiting for Sighound's MXR to do some comparison tests.  ^-^

This thing is so streamlined that it doesn't have much code for options! Even for bugs!!  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: hughtmccullough on July 21, 2020, 04:55:25 pm


Look: https://mysku.ru/blog/aliexpress/80036.html#comment3580231

Quote
If R12 is reduced to 10-22 Ohm, the frequency response at the HF will become flat to 100 MHz.
If you increase C2, it will level out at the low frequency response.


Maybe the Chinese are more clever than the Russians.  A simulation only gives the answer to the question you ask it.  If the combined capacitance of the switch contacts, op. amp and any other stray capacitance is about 10pF then the frequency response will be flat without the bump at 10kHz.  It looks as if the simulation only includes the capacitance of the op. amp and it is safe to assume that the design doesn't use relatively expensive low capacitance relays and that there will be other stray capacitance of the same order of magnitude.

If this is the case then the switching (using the values in the circuit) will follow fairly closely the sequence 5V/div, 2.5V/div, 1V/div, 500mV/div, 200mV/div and 100mV/div.  This leaves the 50mV/div scale and it is quite possible that it is done in software, reducing the resolution to 7 bits, unless there is another gain stage after the OPA356.

The specification claims both AC and DC coupling but the simulated circuit clearly has AC coupling only.  Does the real circuit have another switch that bypasses the input capacitor?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 21, 2020, 06:30:04 pm
Bodnar-Pulse :

(Attachment Link)

Terminated with 50 \$\Omega\$ ,although it makes no difference... ;D

That's quite respectable.  Makes me think that if the critical caps were variable you could trim it up and do better.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 22, 2020, 02:41:11 am
Has anybody measured the bandwidth in 1x mode?

What specifically did you want verified?

The measurements I took – with the instrument set to 1x mode, Active Heads set to 1 MOhm impedance – suggested a BW close to 50 MHz... however, the amplitude seems to bounce around above 30 MHz-ish, so it depends on what you're assessing.

It's pretty solid through to 20 MHz.  Beyond that it starts getting hinky.

I would call this a 20 MHz 'scope with the 3 dB around 30 to 40 MHz.  (The hinkyness factor that this instrument has going on isn't something you get with most 'scopes, even the most el cheapo varieties.)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 22, 2020, 05:37:23 am
Has anybody measured the bandwidth in 1x mode?

What specifically did you want verified?

I was wondering what the bandwidth was with the supplied probes in 1x mode. What would a 10Mhz square wave look like with probes in 1x mode?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: snoopy on July 22, 2020, 05:44:53 am
I quite understand and we needed to do maths on the fly with a CRO however most DSO's are able to display waveforms in the units of Amps.

But the amount of menu-diving required simply isn't worth it.

Another FAIL for FNIRSI.  ::)

Yeah, total fail. They totally should have added a whole extra menu just for that.  Not. :palm:
We need ask ourselves who might buy this $120 tablet instead of a proper DSO or for that matter a working CRO ?
At least an order of magnitude sensitivity better is available in all other scopes and totally without the apparent sensitivity to 10x probes.  :o
Yes older instruments do have their limitations too but not so for the most basic of measurements like these.

A buyers expectations of getting a somewhat capable instrument would not be met and for once on this forum I'd recommend the purchase of a CRO so not to be so disappointed. Yes I said that !  :palm:

Yet member bd139 picked up a mint condition TDS210 DSO yesterday for the same price as the topic of this thread of which I strongly suggest will be a much better investment.

People who want a compact battery operated portable scope they can take with them anytime and can also do floating measurements etc ;) If you have something better to offer let us know. So far I haven't seen any offers of something better for the price. I've seen a lot worse for the price for a portable scope with tiny iddy biddy screens or limited bandwidth etc :( If I want to make my TDS3012 portable I would have to pay $500 US just for a battery and extra for a charger etc !! Yes it's a lot better scope than this one but for on the job in-situ measurements this would be adequate in most cases and compact as well.

cheers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 22, 2020, 07:33:48 am
People who want a compact battery operated portable scope they can take with them anytime and can also do floating measurements etc ;) If you have something better to offer let us know. So far I haven't seen any offers of something better for the price. I've seen a lot worse for the price for a portable scope with tiny iddy biddy screens or limited bandwidth etc :( If I want to make my TDS3012 portable I would have to pay $500 US just for a battery and extra for a charger etc !! Yes it's a lot better scope than this one but for on the job in-situ measurements this would be adequate in most cases and compact as well.

cheers
I get that and for those that understand the limitations of these tablets the price is good however I would never recommend them as a beginners scope which due to their price is tempting to those with a limited budget.

This is a prime case to use a recent Keysight slogan: Get a real scope !
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 24, 2020, 08:30:43 am
What specifically did you want verified?

I was wondering what the bandwidth was with the supplied probes in 1x mode. What would a 10Mhz square wave look like with probes in 1x mode?

This is all using the timing signals from the calibrator.  1 Vpp at 10 MHz, nominally squarewave.

The supplied probes were used first, both set to 1X.

FNIRSI Channel 1 / probe A @ 1X:
[attach=7]

Shifted supplied probe A @ 1X to Siglent Channel 1:
[attach=11]

FNIRSI Channel 2 / probe B @ 1X:
[attach=1]
(Note: the signal on this probe seemed markedly more unstable.)

Shifted supplied probe B @ 1X to Siglent Channel 1:
[attach=8]


Setup used:

[attach=4] [attach=5] [attach=6]


Tested the same signal to Channel 1, but using a Siglent probe set to 1X.

FNIRSI Channel 1 / Siglent probe @ 1X:
[attach=2]

Shifted Siglent probe @ 1X to Siglent Channel 1:
[attach=9]

Tested the same signal to Channel 1, but using a Siglent probe set to 10X.

FNIRSI Channel 1 / Siglent probe @ 10X:
[attach=3]

Shifted Siglent probe @ 10X to Siglent Channel 1:

[attach=10]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 24, 2020, 08:57:45 am
I get that and for those that understand the limitations of these tablets the price is good however I would never recommend them as a beginners scope which due to their price is tempting to those with a limited budget.

This is a prime case to use a recent Keysight slogan: Get a real scope !

If you can get a decent second-hand one for the same money, sure.

However, you may want a battery-powered device for cheap.  So that means something similar to this.


As an aside, I have ordered one of these: Hantek 2D42.

https://www.youtube.com/watch?v=AWgslcNQLkw (https://www.youtube.com/watch?v=AWgslcNQLkw)

Once I have it I'll give it a look over.  My expectations are low, but we'll see.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 24, 2020, 09:08:58 am
I was wondering what the bandwidth was with the supplied probes in 1x mode. What would a 10Mhz square wave look like with probes in 1x mode?

This is all using the timing signals from the calibrator.  1 Vpp at 10 MHz, nominally squarewave.

The supplied probes were used first, both set to 1X.

 :-+

Food for thought. I'm surprised at how much difference the probes made at this frequency. There's other threads here that show even the cheapest eBay probes working fine at frequencies an order of magnitude higher.

eg. https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/ (https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/)

Edit: Did you compensate the probes on each device before the screenshots? Images like this say "uncompensated probe" to me:

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1031238;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 24, 2020, 09:10:50 am
Once I have it I'll give it a look over.  My expectations are low, but we'll see.

User interface looks awful.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 24, 2020, 02:23:46 pm
Hi,

Got enough time to play with the siglent demoboard and made some captures of it, see below - Not too bad for this cheap thing, especially see the runt pulses/glitches.

Only the 50mV/div. thing is bad :
Take screenshots from my deskew fixture, one is with "large loop" ( 125mA*8 turns = 1A), the second is "small loop", which means 1 turn and 147mA.
And you see...nothing.
It couldn´t display the 15mV ( 100mV/A).

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 24, 2020, 06:20:06 pm
In a not at all bandwidth related exercise I tested the 1013D's battery life.

It ran continuously for 6 h 45 m while monitoring two phases of a 4-phase stepper motor being accelerated and cycled clockwise/anticlockwise over a 270° sweep, pulse frequencies 7 to 44 Hz...

Pretty damned good, first thing I've tested that bettered the claimed spec. It took a 3½ hours to recharge at 1.8 A tapering to 0.3 A over the last ½ hour...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 24, 2020, 09:24:17 pm
That's very good, but the MicSigs last as long too.  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 24, 2020, 09:51:25 pm
25MHz sinus looks pretty distorted , no wonder why the 10MHz square wave is odd .
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 24, 2020, 10:02:02 pm
25MHz sinus looks pretty distorted , no wonder why the 10MHz square wave is odd .

I believe it is an AM signal, unless I missed it the modulating frequency does not seem to be stated....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 24, 2020, 10:05:32 pm
That's very good, but the MicSigs last as long too.  :-+

They cost 3.5 to 4 x more as well...

My Infiniti M37 is much better than many other cars, in fact the best car I have ever owned, at $52k it damned well should be. I suspect Rolls-Royce's are even nicer...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 24, 2020, 10:15:02 pm
25MHz sinus looks pretty distorted , no wonder why the 10MHz square wave is odd .

Hm, could test the FFT too.

Quote
I believe it is an AM signal, unless I missed it the modulating frequency does not seem to be stated....

One is the "pure" sinewave, the pic beside is the AM Signal with 25Mhz carrier and 2.5Mhz modulation signal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 25, 2020, 02:06:46 pm
I was wondering what the bandwidth was with the supplied probes in 1x mode. What would a 10Mhz square wave look like with probes in 1x mode?

This is all using the timing signals from the calibrator.  1 Vpp at 10 MHz, nominally squarewave.

The supplied probes were used first, both set to 1X.

 :-+

Food for thought. I'm surprised at how much difference the probes made at this frequency. There's other threads here that show even the cheapest eBay probes working fine at frequencies an order of magnitude higher.

eg. https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/ (https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/)

Edit: Did you compensate the probes on each device before the screenshots? Images like this say "uncompensated probe" to me:

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1031238;image)

I got similar results testing the probe that came with my FNIRSI 5012H. Probe was compensated and then I used a 1V square wave at 2Mhz with 1ns Rise time.

Fnirsi probe:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032676;image)

Generic P6100:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032680;image)

Lecroy AP020:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032684;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 25, 2020, 04:46:32 pm
The AP020 is a FET active probe, isn't it--a $550 (MSRP), $250 (used VG+) probe--that's comparing apples to lemons.

But I get your point, it shows that the signal is pretty damned clean...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 25, 2020, 05:42:44 pm
The AP020 is a FET active probe, isn't it--a $550 (MSRP), $250 (used VG+) probe--that's comparing apples to lemons.

But I get your point, it shows that the signal is pretty damned clean...

Mostly there to show you what the source really look like. I'm not trying to insinuate that you can compare a 5$ to a 500$ probe.

the difference between the generic p6100 and the Fnirsi is interesting though.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 25, 2020, 06:44:14 pm
the difference between the generic p6100 and the Fnirsi is interesting though.

Yep, I'm wondering how a probe can be that bad when even $5 eBay probes seem to work well up to 300MHz.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 25, 2020, 07:10:16 pm
Chineese P6100 are crappy compared to brand probes , not linear even bellow 100MHz , so that Fnirsi  should be the crappiest probes ever made  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 25, 2020, 10:34:00 pm
Chineese P6100 are crappy compared to brand probes , not linear even bellow 100MHz , so that Fnirsi  should be the crappiest probes ever made  :-DD

The probes that came with mine are just plain ol' Chinese P6100s¹--there would be no reason for FNIRSI to make their own, as l suspect in China P6100s come with Happy Meals :

(http://www.paladinmicro.com/TestEquipment/Yeapook/Probes-00.JPG)

------------------------------------------
¹ - Now pretty much generic, and most likely actually made by 37 or more manufacturers. From what I can tell, in Shenzhen, you cannot swing a dead cat without striking at least a dozen electronics producers.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 26, 2020, 05:28:44 am
Food for thought. I'm surprised at how much difference the probes made at this frequency. There's other threads here that show even the cheapest eBay probes working fine at frequencies an order of magnitude higher.

eg. https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/ (https://www.eevblog.com/forum/reviews/cheapest-100mhz-oscilloscope-probes-hands-on-review/)

Edit: Did you compensate the probes on each device before the screenshots? Images like this say "uncompensated probe" to me:

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1031238;image)

Yeah, at the 1X setting no compensation seemed to work for the supplied probes.  So I compensated at 10X properly, then just set them to 1X.   :-//

Did the same with the Siglent probes, which at least seemed to behave as expected.

Rotten apple to rotten apple comparison.   :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on July 26, 2020, 05:29:39 am
Funny how things are. In the early 1970's  a 20mhz scope was easily 600 bucks. This one would
have cost 30.00 back then. It would have changed so many things (limitations or not). So many
people would have had one and that would have educated so many people.

I say good job to the company that squeezed this out. Now can they come out a better one? I hope
so and if they can keep the price as is, it could make them millions. Yes they lied about the specs, so
what else is new. Companies lie, politicians lie and so many others. Tell them they are wrong and
perhaps how to fix the problem. Politicians just need to be voted out and maybe locked up.

This is a great thread. I wish everyone luck. 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 26, 2020, 05:35:24 am
Once I have it I'll give it a look over.  My expectations are low, but we'll see.

User interface looks awful.

Probably going to be hideous.  UI is one area where the Chinese don't seem to bother spending much effort.  Even very accurate, well engineered, equipment can have a godawful UI.

Then there's ridiculous hardware interface stuff like some of Rigol's instruments with slanted buttons and multiple fonts...  Why?   :palm:

(Does anyone know the answer to the mystery as to why so many cheap Chinese devices use that hideous serif font?  As an example, the FeelTech / FeelElec devices I have use it.  Is it just built-in to a build package and they can't be arsed to use a decent font?)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 26, 2020, 05:39:59 am
In a not at all bandwidth related exercise I tested the 1013D's battery life.

It ran continuously for 6 h 45 m while monitoring two phases of a 4-phase stepper motor being accelerated and cycled clockwise/anticlockwise over a 270° sweep, pulse frequencies 7 to 44 Hz...

Pretty damned good, first thing I've tested that bettered the claimed spec. It took a 3½ hours to recharge at 1.8 A tapering to 0.3 A over the last ½ hour...

Aligns with what I have found.

Turn it on, forget that it is still running, go back two hours later, still plenty of power.  Would be a good in-the-field device if they could improve the UI and accuracy.  (Still limited by triggering options, capture depth, etc. – so not going to replace a 'real' portable 'scope for some applications.)

Plug it in to a PC or what have you, and it's fully charged very quickly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 26, 2020, 05:45:33 am
I got similar results testing the probe that came with my FNIRSI 5012H. Probe was compensated and then I used a 1V square wave at 2Mhz with 1ns Rise time.

Fnirsi probe:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032676;image)

Generic P6100:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032680;image)

Lecroy AP020:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032684;image)

Possibly not my ineptness, then.

I tried adjusting both probes with the signal applied, and couldn't get any noticeable change at 1X.   :-//

Then the second probe was really bouncing around on that leading edge, while the first was pretty consistent.

Garbage probes, I guess.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 26, 2020, 05:52:29 am
The probes that came with mine are just plain ol' Chinese P6100s¹--there would be no reason for FNIRSI to make their own, as l suspect in China P6100s come with Happy Meals :

(http://www.paladinmicro.com/TestEquipment/Yeapook/Probes-00.JPG)

------------------------------------------
¹ - Now pretty much generic, and most likely actually made by 37 or more manufacturers. From what I can tell, in Shenzhen, you cannot swing a dead cat without striking at least a dozen electronics producers.

The "P6100" probes with my FNIRSI look slightly different to those pictured.  Text on labels is finer, moulded text shown in pic beside CE marking is absent, and possibly the moulded "X1" and "X10" are different.

Maybe my mysterious no-nameplate 'scope-type-thing was fished out of the same dumpster as some knock-off P6100s?   :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 26, 2020, 06:03:25 am

I tried adjusting both probes with the signal applied, and couldn't get any noticeable change at 1X.   :-//

You can't compensate probes on 1x only on 10x. The compensation trimmer cap is not part of the 1x probe circuit.
Still, the probes trimming range must suit the input capacitance of the scopes input for 10x work when matching probes to scopes. Yet it is just not that simple either as a probes frequency response when swept to a scopes max BW and beyond needs be a flat as possible for measurements at any rated frequency to be reasonably accurate.

FYI for any instrument tests it's always best to use direct BNC cable connections and assess the probes independently/separately.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 26, 2020, 09:22:52 am

I tried adjusting both probes with the signal applied, and couldn't get any noticeable change at 1X.   :-//

You can't compensate probes on 1x only on 10x. The compensation trimmer cap is not part of the 1x probe circuit.
Still, the probes trimming range must suit the input capacitance of the scopes input for 10x work when matching probes to scopes. Yet it is just not that simple either as a probes frequency response when swept to a scopes max BW and beyond needs be a flat as possible for measurements at any rated frequency to be reasonably accurate.

FYI for any instrument tests it's always best to use direct BNC cable connections and assess the probes independently/separately.

^+1, beat me to it...

I have always found that 10X passive HF probes MUST be adjusted at each use, with the scope set to the vertical gain and coupling at which you ill be performing your observations. I do not have much need for them in the work I generally perform (automotive repair & audio), and even those I have from Agilent, Lecroy, and Tektronix seem to behave differently at each use...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 26, 2020, 09:35:57 am
The "P6100" probes with my FNIRSI look slightly different to those pictured.  Text on labels is finer, moulded text shown in pic beside CE marking is absent, and possibly the moulded "X1" and "X10" are different.

Maybe my mysterious no-nameplate 'scope-type-thing was fished out of the same dumpster as some knock-off P6100s?   :-DD

I just scrounged through my "junk drawer" and found similar labeling and slight molding discrepancies with the dozen or so  "P6100" probes I have accumulated. Even if there is just one maker such inconsistencies could be expected between production runs--differently sourced labels, new/repaired molds, etc.

My great-grandson referred to the FNIRSI ADS5012H I had briefly as an"oscilloscope emulator"...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 26, 2020, 11:11:22 am
Who knows how many let's say "companies" produce P6100 probes ... hard to believe it is just one in the whole China  :D Because is low quality and cheap to made
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pascal_sweden on July 26, 2020, 11:21:23 am
What tools did you use for these nice screenshots? :)

I got similar results testing the probe that came with my FNIRSI 5012H. Probe was compensated and then I used a 1V square wave at 2Mhz with 1ns Rise time.

Fnirsi probe:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032676;image)

Generic P6100:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032680;image)

Lecroy AP020:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1032684;image)

Possibly not my ineptness, then.

I tried adjusting both probes with the signal applied, and couldn't get any noticeable change at 1X.   :-//

Then the second probe was really bouncing around on that leading edge, while the first was pretty consistent.

Garbage probes, I guess.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 26, 2020, 11:44:10 am
Who knows how many let's say "companies" produce P6100 probes ... hard to believe it is just one in the whole China  :D Because is low quality and cheap to made
Just one company makes the P6100 probes.
They have been making probes for decades and make many more than just P6000 models.

Other Chinese probe manufacturers exist too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 26, 2020, 03:47:43 pm
What tools did you use for these nice screenshots? :)

Simple screen grab from my lecroy scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 26, 2020, 03:51:31 pm
Who knows how many let's say "companies" produce P6100 probes ... hard to believe it is just one in the whole China  :D Because is low quality and cheap to made
Just one company makes the P6100 probes.
They have been making probes for decades and make many more than just P6000 models.

Other Chinese probe manufacturers exist too.

Not too sure about that. The generic 6100 (I have 4 identical samples bought from different sources) and FNIRSI Probes are not exactly the same. All generic 6100 in my possession look the same and behave the same. The FNIRSI probe is physically different and behave differently.

Generic 6100 on the left,  FNIRSI probe on the right.
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033510;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033514;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033518;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 26, 2020, 03:58:04 pm
The 6100 probe is probably like the DT830 multimeter - dozens of people trying to outdo each other in cost cutting.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 26, 2020, 04:06:08 pm
the difference between the generic p6100 and the Fnirsi is interesting though.

Yep, I'm wondering how a probe can be that bad when even $5 eBay probes seem to work well up to 300MHz.

I would say they work okish up to 50Mhz (FNIRSI more 25Mhz). 300Mhz not really. Like CDaniel mentioned, linearity is not really good.

I did some tests with a noise source over here:

https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2416473/#msg2416473 (https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2416473/#msg2416473)

https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2860544/#msg2860544 (https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2860544/#msg2860544)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: CDaniel on July 26, 2020, 05:50:15 pm
The 300MHz claim , if true , was perhaps from a lucky buyer who got something else ... but this cheap probes are pretty bad .
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 26, 2020, 08:15:26 pm
Who knows how many let's say "companies" produce P6100 probes ... hard to believe it is just one in the whole China  :D Because is low quality and cheap to made
Just one company makes the P6100 probes.
They have been making probes for decades and make many more than just P6000 models.

Other Chinese probe manufacturers exist too.

Not too sure about that. The generic 6100 (I have 4 identical samples bought from different sources) and FNIRSI Probes are not exactly the same. All generic 6100 in my possession look the same and behave the same. The FNIRSI probe is physically different and behave differently.

Generic 6100 on the left,  FNIRSI probe on the right.
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033510;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033514;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033518;image)
Yes but look at your second image, one probe is certainly a copy as it's NOT a P6100.

Of a good few P6100's I've bought over the years all have been from different sources yet by the same manufacturer which after considerable hunting I was able to find however they wouldn't deal with small fry like me.

Now I just get PP510 from Siglent as they are reasonably priced.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 26, 2020, 08:55:37 pm

I would say they work okish up to 50Mhz (FNIRSI more 25Mhz). 300Mhz not really. Like CDaniel mentioned, linearity is not really good.

I did some tests with a noise source over here:

https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2416473/#msg2416473 (https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2416473/#msg2416473)

https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2860544/#msg2860544 (https://www.eevblog.com/forum/testgear/test-equipment-anonymous-(tea)-group-therapy-thread/msg2860544/#msg2860544)

Excellent analysis! Stable, repeatable, flat response is much more important than peak response.

That reported 300 MHz response could have been peakiness from a maladjusted probe. I found that when  using the supplied X10 probe and playing with probe compensation, I could get my 1013D to display a reasonable representation of an 85 MHz sine wave.


a "sort of" related analogy:

With automobile engines peak H.P. of an engine is an interesting number--power generally happens briefly, just before you shift--but the level and flatness of the torque curve are much more important to real world performance on the street...

The original (1995) Honda S2000 delivered 247 H.P. @ 8600 RPM, but just 75 to 120 H.P. from 2500 to 5000 RPM, and barely able to launch itself from a stop. You had to "rev" it to 6 or 7 grand to get a respectable launch--whereupon everyone watching was wondering "WTF is wrong with that A-hole".

In the end it was just a plain ol' 150 H.P Jap 4-banger built to withstand 9000 RPM, and tuned to make the marketing people happy by producing an unusable horsepower "peak" at that engine speed. It was not at all a fun car to drive, which is the whole point of "sports cars".

The best description I ever saw was that "it is a great car as long as you drive it like you just stole it."

My point is that examining only a single characteristic of anything (oscilloscope probes, automobiles, or elephants) will earn you just a singular and partial perception  of it's value and utility. 

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kosmic on July 26, 2020, 09:49:40 pm
Code: [Select]
Who knows how many let's say "companies" produce P6100 probes ... hard to believe it is just one in the whole China  :D Because is low quality and cheap to made
Just one company makes the P6100 probes.
They have been making probes for decades and make many more than just P6000 models.

Other Chinese probe manufacturers exist too.

Not too sure about that. The generic 6100 (I have 4 identical samples bought from different sources) and FNIRSI Probes are not exactly the same. All generic 6100 in my possession look the same and behave the same. The FNIRSI probe is physically different and behave differently.

Generic 6100 on the left,  FNIRSI probe on the right.
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033510;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033514;image)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033518;image)
Yes but look at your second image, one probe is certainly a copy as it's NOT a P6100.

Of a good few P6100's I've bought over the years all have been from different sources yet by the same manufacturer which after considerable hunting I was able to find however they wouldn't deal with small fry like me.

Now I just get PP510 from Siglent as they are reasonably priced.

I also have one exactly similar to the "6100" but marked "P6100" instead.

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033746;image)

Just do a search for "p6100 probe" on ebay. They are all marked as p6100 but are all a little bit different. I don't think there's only one producer  :)

Anyway my point is, the P6100 probes from FNIRSI are particularly bad.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 26, 2020, 09:51:39 pm
Now we know all and enough about the probes... 8)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 27, 2020, 12:19:58 am
I also have one exactly similar to the "6100" but marked "P6100" instead.

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1033746;image)

Just do a search for "p6100 probe" on ebay. They are all marked as p6100 but are all a little bit different. I don't think there's only one producer  :)

Anyway my point is, the P6100 probes from FNIRSI are particularly bad.

You got my curiosity up and I did take a look at eBay's listings, something that caught my eye was how many vendors were touting their product's ability to work with "HP and Tektronix" 'scopes--HP hasn't made a 'scope in over 20 years. I'm not sure if Agilent still makes them
.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 27, 2020, 07:24:54 am
You got my curiosity up and I did take a look at eBay's listings, something that caught my eye was how many vendors were touting their product's ability to work with "HP and Tektronix" 'scopes--HP hasn't made a 'scope in over 20 years. I'm not sure if Agilent still makes them
.

No.  Keysight is the 'inheritor' of Agilent / HP / Hewlett Packard (remember back then?) oscilloscopes and other electrical measuring instrumentation.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 27, 2020, 07:29:53 am

I tried adjusting both probes with the signal applied, and couldn't get any noticeable change at 1X.   :-//

You can't compensate probes on 1x only on 10x. The compensation trimmer cap is not part of the 1x probe circuit.

I thought that was the case, but couldn't be bothered checking.  I don't think I have ever used probes set to 1X.

Quote
FYI for any instrument tests it's always best to use direct BNC cable connections and assess the probes independently/separately.

Yes, which is what I did earlier by directly connecting the Active Heads.  'Fungus' wanted some info using the supplied probes set to 1X, so that's what I did.

It's interesting that the Siglent probes respond radically differently.  What is the expected frequency limit for these when set to 1X?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 27, 2020, 07:35:20 am
The original (1995) Honda S2000 delivered 247 H.P. @ 8600 RPM, but just 75 to 120 H.P. from 2500 to 5000 RPM, and barely able to launch itself from a stop. You had to "rev" it to 6 or 7 grand to get a respectable launch--whereupon everyone watching was wondering "WTF is wrong with that A-hole".

That's because it was built to be driven, not to be "launched".

Take one out on some twisty mountain roads sometime.  :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tautech on July 27, 2020, 07:48:18 am
It's interesting that the Siglent probes respond radically differently.  What is the expected frequency limit for these when set to 1X?
For your SDS1202X-E its PP215 probes are 200 MHz probes and are listed as capable of just 6 MHz in 1x mode:
https://siglentna.com/product/pp215-200-mhz-oscilloscope-probe/
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 27, 2020, 07:57:20 am
The original (1995) Honda S2000 delivered 247 H.P. @ 8600 RPM, but just 75 to 120 H.P. from 2500 to 5000 RPM, and barely able to launch itself from a stop. You had to "rev" it to 6 or 7 grand to get a respectable launch--whereupon everyone watching was wondering "WTF is wrong with that A-hole".

That's because it was built to be driven, not to be "launched".

Take one out on some twisty mountain roads sometime.  :popcorn:

Bollocks. No torque no push, no push no fun, simple as that. It's a girly car anyways.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 2N3055 on July 27, 2020, 07:58:16 am

With automobile engines peak H.P. of an engine is an interesting number--power generally happens briefly, just before you shift--but the level and flatness of the torque curve are much more important to real world performance on the street...

The original (1995) Honda S2000 delivered 247 H.P. @ 8600 RPM, but just 75 to 120 H.P. from 2500 to 5000 RPM, and barely able to launch itself from a stop. You had to "rev" it to 6 or 7 grand to get a respectable launch--whereupon everyone watching was wondering "WTF is wrong with that A-hole".

In the end it was just a plain ol' 150 H.P Jap 4-banger built to withstand 9000 RPM, and tuned to make the marketing people happy by producing an unusable horsepower "peak" at that engine speed. It was not at all a fun car to drive, which is the whole point of "sports cars".

The best description I ever saw was that "it is a great car as long as you drive it like you just stole it."


And that is why I was able to humiliate a guy driving Mustang SVT with a "stupid little golf cart"(his words) Golf GTI (stock) up the short, few miles stretch up the mountains in Pennsylvania...  He almost got killed twice and was making smoke mostly while I was taking curve by curve at blazing speed... He was paying for the lunch for a week...

You're supposed to drive it like you stole it.. Race car driver that keeps engine anywhere less than 4/5  or more of it's rev range at all times is not much of a driver ..

You would also probably laugh at Class A racing Yugo, that had 230 HP from 1300cc (at 11000 RPM, ceramic pistons) and 650 Kilos... And 17" Lockheed brake disks with 4 cylinder calipers. But if a pro racer would drive you on hill climb with it, you would be very, very afraid..
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 2N3055 on July 27, 2020, 08:05:15 am
The original (1995) Honda S2000 delivered 247 H.P. @ 8600 RPM, but just 75 to 120 H.P. from 2500 to 5000 RPM, and barely able to launch itself from a stop. You had to "rev" it to 6 or 7 grand to get a respectable launch--whereupon everyone watching was wondering "WTF is wrong with that A-hole".

That's because it was built to be driven, not to be "launched".

Take one out on some twisty mountain roads sometime.  :popcorn:

Bollocks. No torque no push, no push no fun, simple as that. It's a girly car anyways.

Read a physics book. Power is RPM time torque time constant.
Torque at wheels happens in gearbox and diff ratios.

If you set gearbox for same speed at max power two cars with same HP will have same torque at wheels at same HP despite having it at different RPMs.

Torque curve is different thing.. If you have engine that has lots of torque at all RPMs you will be faster and easier to drive, because you have wider powerband.. Forced induction engines are nice that way.

But on a race car, you simply keep it in powerband and that's it.



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: GeorgeOfTheJungle on July 27, 2020, 08:11:12 am
Yeah, power is torque x rpm, choose your venom. But keep in mind that on the streets you can't drive like a maniac. That's why EVs are so fun to drive.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 2N3055 on July 27, 2020, 08:15:22 am
Yeah, power is torque x rpm, choose your venom. But keep in mind that on the streets you can't drive like a maniac. That's why EVs are so fun to drive.

Of course you can...  >:D

And yeah, EV are pure fun...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 27, 2020, 08:41:07 am
Just do a search for "p6100 probe" on ebay. They are all marked as p6100 but are all a little bit different. I don't think there's only one producer  :)

And they're all marked as "high quality".  :scared:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 27, 2020, 08:45:21 am
Read a physics book.

I read a bunch of them in school some years back--(MSME MIT '71).

Do you know where that "torque time constant" number (5252) comes from?

James Watt decided that a "good dray horse" could deliver 33,000 ft·lbf/ minute (actually he calculated 32,572, which was "rounded" to 33,000).

33,000 / 6.28 (pi X 2) = 5252...

Sounds as though you might be interested in my "How Much HP to Go How Fast? (http://www.paladinmicro.com/?frm=HPvsSpeedCalc.htm)" calculator. It defaults to "New Edge" Mustang properties, but they can be changed to match any car's specs.



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 27, 2020, 10:29:46 am
At least we've all moved on from units like "feet"...  :scared:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 2N3055 on July 27, 2020, 11:53:09 am
At least we've all moved on from units like "feet"...  :scared:
What's wrong with feet? I have two, use them all the time, marvelous stuff... :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on July 27, 2020, 02:10:45 pm
At least we've all moved on from units like "feet"...  :scared:

Not here in the "colonies", English/Imperial measure is still the official standard--us long with Myanmar (I don't even like saying that word) and Liberia.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on July 28, 2020, 09:53:09 am
Not here in the "colonies",

The Colonies that were treasonous terrorists...   ;)

Most of Britain's fading Empire went metric at some stage.

Quote
English/Imperial measure is still the official standard--us long with Myanmar (I don't even like saying that word) and Liberia.

Liberia doesn't really count, as that's the ex-slaves that were keen on 'going back to Africa' and thus technically also a sub-set of 'Muricans.

Myanmar / Burma must still love that Imperial legacy – or they're simply too poor to pay for the required changes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on July 30, 2020, 10:16:12 pm
Update on me trying to port U-Boot + Linux on the scope.

It turns out that the LCD backlight is controlled by the FPGA, which gets instructed by the original code to turn it on on boot. This means that the CPU<->FPGA protocol has to be reverse-engineered, or the FPGA code replaced with new code just to get the backlight working.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on July 31, 2020, 02:21:00 pm
Figure out which FPGA pin controls it, make some FPGA code to just set that pin and nothing more. Do the rest later :-)

Edit: Or.... just use the existing FPGA code and send it the command to turn the lights on.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on July 31, 2020, 06:06:02 pm
Figure out which FPGA pin controls it, make some FPGA code to just set that pin and nothing more. Do the rest later :-)

Edit: Or.... just use the existing FPGA code and send it the command to turn the lights on.

Or just cut the trace running to that pin and tie it to the logic level you need.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on August 07, 2020, 09:50:53 am
Well, I've had it for 3 weeks now, used it in real automotive and motorcycle diagnostic work 3 or 4 times, and find I like it. It is too bad the maker/vendors feel compelled to grossly overstate its specifications--but a handy 30 mhz 2-channel 'scope in a compact 7" tablet form for $165 is not too bad...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on August 10, 2020, 09:28:50 pm
The Banggood version is down to $119 https://www.banggood.com/DANIU-ADS1013D-2-Channels-100MHz-Band-Width-1GSa-or-s-Sampling-Rate-Oscilloscope-with-7-Inch-Color-TFT-LCD-Touch-Screen-p-1641865.html (https://www.banggood.com/DANIU-ADS1013D-2-Channels-100MHz-Band-Width-1GSa-or-s-Sampling-Rate-Oscilloscope-with-7-Inch-Color-TFT-LCD-Touch-Screen-p-1641865.html)

As usual, 5 star rating, given that for the last couple of years Banggood only allows 4 and 5 star reviews to be published. If you submit a 1 or 2 star review, it's never published, a well as most 3 star ones. Some people even resort to posting negative reviews, but with 4 or 5 star ratings just ot be able to post something negative (Banggood bots don't seem to pay attention to the content of the review, just the stars)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on August 10, 2020, 09:46:14 pm
In this case I won´t worry about it - For it´s price I would give it a 4-5 star rating, no doubt about it.
Still it´s a toy against "real scopes", but it´s the first of the real cheaps, you can partly work with it.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on September 02, 2020, 01:13:26 pm
Hi,

As the scope couldn´t measure in normal trigger mode, I´ve asked them if there will be any firmware upgrade in the future, to fix that.
This was on 13th august.
Today I receive an answer:

Quote
ReplyContent:
hi, friend
The situation you said is measurable, you can contact the store where you bought this product, and she will help you solve this problem. Thank you for your message and wish you a happy life!
ReplyDatetime:
2020-09-02 14:47

OK, I´m going to ask AMAZON... :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Dbuezas on September 06, 2020, 04:00:09 pm
[How to fix irresponsive touchscreen] [with solution]

Hi,

Story
I received a broken unit: the touchscreen was very irresponsive and would jump all over the place  :-BROKE. I think the unit Dave tested had a similar issue at the beginning of his video, but mine was WAY worse. Not usable at all.

I tried to send it back, but aliexpress decided I should pay for the postage and since I rejected that, they stopped asking me and refunded 30€ back. GREAT! I have a 100€ paperweight!  :palm:
I thought it may had a bad solder joint or some solder bridge so I took it apart a month ago, cleaned some solder droplets and cleaned and reconnected the display flat cables. That didn't do s*t.
Yesterday I decided to give it a second try before I throw it away and since it is trash I was very careless and started touching everything with bare hands. Maybe some static fixes it hehe. And then something happened  :phew::

Confusion
I connected the clock line of the I2C to another oscilloscope and realised the clock was not a nice square wave all the time, so I looked a bit closer and realised there is what seems to be a cap there (see question 1). The other side of the cap is neither ground nor vcc, it is another different square signal even of a different frequency (Question 2).
-> see img2.jpeg

Lucky Fix
Anyway, I realised that the touchscreen worked perfectly while I was touching the ends of the cap with my bare hands  :-DD, and since both sides are connected through resistors, I decided the added capacitance was what was fixing it.
So I tried a couple of low value caps (1pF, 5pF, 10pF and 100pF) and they all made things a bit better, but the 100pF one made it just PERFECT  :-DMM!
-> see img1.jpeg

Questions
1. Why is there a cap connected to SCL? 
1.1 That's a capacitor, right?
2. Why is the cap connected across two signal lines?
2.1 I never saw anything like that in I2C lines, is this some advance hack?
2.2 What could the other signal be?
3. Why do you think the touchscreen was defective in the first place?

Last words
This neat toy is now fully functional as far as I can tell. I'm obviously a hobbyist so although I hope this may help somebody else, this opened a bunch of questions for me. I'd be very thankful if some of the old wolves here could clarify wtf is a cap doing in an I2C line and why it is connected across two signal lines.
Sorry if this appears more than once, last two posts didn't work, probably imgs too big
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on September 06, 2020, 04:31:46 pm
Hi,

As the scope couldn´t measure in normal trigger mode, I´ve asked them if there will be any firmware upgrade in the future, to fix that.
This was on 13th august.
Today I receive an answer:

Quote
ReplyContent:
hi, friend
The situation you said is measurable, you can contact the store where you bought this product, and she will help you solve this problem. Thank you for your message and wish you a happy life!
ReplyDatetime:
2020-09-02 14:47

OK, I´m going to ask AMAZON... :-DD

I was more than willing to pay $45 more and get mine from Amazon--I've been banged good by a number of the online Asian vendors too many times to ever buy from them again. With AZ Prime, I received the instrument in 2 days as opposed to 2 months; and you simply have to say "I don't like it" and next thing you know you'll have a UPS return label and usually a refund within 1 hour of dropping the package off at UPS. 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boggis the cat on September 07, 2020, 02:20:07 am
[How to fix irresponsive touchscreen] [with solution]

So I tried a couple of low value caps (1pF, 5pF, 10pF and 100pF) and they all made things a bit better, but the 100pF one made it just PERFECT  :-DMM!

Maybe a bad cap in there?  Did you measure it?

The soldering looks OK, but if it's a dud cap the QC (:-DD) probably won't find such an issue.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on September 07, 2020, 03:21:17 am
Questions
1. Why is there a cap connected to SCL? 
1.1 That's a capacitor, right?
2. Why is the cap connected across two signal lines?
2.1 I never saw anything like that in I2C lines, is this some advance hack?
2.2 What could the other signal be?
3. Why do you think the touchscreen was defective in the first place?

My Answers
1. No idea
1.1. Certainly looks like it
2. No idea
2.1. Me either - maybe the touch controller datasheet had it in the reference design  :-//
2.2. Looks like SDA - based on the 2 pullup resistors
3. The capacitor plus pullup resistors that are too high in value would probably make the I2C signals a mess

In summary
The cap appears to be placed across SDA and SCL.  That makes pretty much no sense.  You want minimal capacitance on those signals.
The two resistors would appear to be the I2C pullups, and have an EIA marking of "01C" or 10k.  10k is a bit too high for 3.3V I2C signals.
Around 3k3 would be better for 3.3V logic, with no additional capacitance.
A scope might be useful to check the signal integrity...  >:D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on September 07, 2020, 07:37:50 am
The cap appears to be placed across SDA and SCL.  That makes pretty much no sense.

Maybe some intern added it because:
a) They have the wrong pullups
b) It didn't work reliably and kept locking up the I2C bus (because of A)
c) They had no clue about I2C (see point A) and by dumb luck the cap seemed to do something (maybe it keeps the lines somewhere in the middle instead of them going all the way down to ground).

Around 3k3 would be better for 3.3V logic, with no additional capacitance.

Even that's a bit high, IMHO. I'd be looking under 1k.

maybe the touch controller datasheet had it in the reference design

Very doubtful.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: SmokeyTheElectrician on September 08, 2020, 11:57:07 am
...
Waveform captures are 15 000 bytes.  Take slightly longer than a screen capture - maybe 2.5 seconds.  Why 15 000 bytes?  Don't know.  Perhaps that's the full memory for data points?
...

Yep, that is exactly why. The Cyclone IV ep4ce6 has 270,000 bits of memory.
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cyclone-iv/cyiv-51001.pdf (https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cyclone-iv/cyiv-51001.pdf)
Divide by 9 ( 8 bits data and 1 parity bit ) is 30,000, divided between the 2 channels is 15,000 samples.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin.M on September 13, 2020, 05:10:47 pm
Still a dual channel 20MHz 7" touch screen portable tablet scope for $140 isn't bad.

I have buyed the 20MHz scope today.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on September 28, 2020, 01:54:48 pm
I am a recent purchaser knowing that the specs were fantasy but so far I am well pleased with the device for the modest outlay.

One thing I am investigating is how to interpret the waveform .wav files as this can be useful for long term storage and further analysis on a computer. The aim is to write a script to transform the wav format into something more friendly like a spreadsheet or csv file. I am using intermediate versions of this to allow comparison between captures with different settings, data etc.

What I have discovered so far about the 15000 byte files is

0-999 Header data
1000 - 3999 CH1 data1
4000 - 6999 CH2 data1
7000 - 8499 CH1 data2
8500 - 9999 CH2 data2
10000 - 14999 seems to be just nulls in my captures so far.

The header data
CH1 vertical scale at 4 where 0-6 represents 5.0V,2.5V,1.0V,500mV,200mV,100mV,50mV/div
CH2 vertical scale at 14 (same as CH1

Time scale at 22 (repeated at 52 where 0 - 29 represents
50S,20S,10S,5S,2S,1S,500mS,200mS,100mS,50mS,20mS,10ms,5mS,2mS,1mS,
500uS,200uS,100uS,50uS,20uS,10uS,5uS,2uS,1uS,500nS,200nS,100nS,50nS,20nS,10nS

Ch1 measurements at 208 - 255 (12 4byte fields)
Ch2 measurements at 256 - 303 (12 4byte fields)

Ch dataBlock1 1500 2 byte fields (little endian) which represent in some way the vertical measurement on the screen.  I.e. doubling sensitivity doubles the values in this block.

I would be interested if anybody has any knowledge or insights in this area e.g. similarity to other formats, so I can avoid unnecessary work.

My current investigation is focussed on two area.

1) The representation of the data in dataBlocks1 and 2 in order to be able to transform it into 'real data'

2) The mapping of the measurement data regions on to the parameters and the encoding used in each 4 byte value. I have an inkling that the first byte is a type indicator and the next 3 are little endian values (maybe fixed point).






Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on September 28, 2020, 02:06:40 pm
I'd guess 'data1' is the raw sample data and 'data2' is what's shown on screen (double the number of horizontal pixels is quite common in 'scopes)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on September 28, 2020, 09:11:30 pm
Thanks.

Yes, that does seem to be the case for DataBlock2. If I compare a .bmp which is 800x400 it shows the active screen area as 750 pixels wide. The DataBlock2 is then the Y offset from the top of the screen for each of the 750 X positions.

The divisions on the screen are 50x50px so one could crudely extract values from the dataBlock2. More interesting is to use the values from DataBlock1 as that gives the full buffer.

The values in DataBlock1 do not appear to be raw ADC values but seem to  follow the same scale as the values in DataBlock2 but with a different baseline. E.g large square wave in DataBlock1 might have values 79 -> 391 corresponding to values 370 -> 58 in DataBlock2. Values are vertically mirroed as one might expect.

So I think DataBlock1 has been scaled to represent 50 / div. There are probably values in the hdr which give the baselines used> There will also be values giving things like vertical and horizontal offsets, trigger level etc. plus all other settings.

One trick they missed was allowing run after restoring a waveform as that would have been a neat way of saving / restoring setups.

 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on September 29, 2020, 12:42:36 am
The values in DataBlock1 do not appear to be raw ADC values but seem to  follow the same scale as the values in DataBlock2 but with a different baseline.

ADC values are often scaled and only use 200 of the 256 available values when the screen is 400-pixels tall. This way there's a simple 2:1 mapping of values to screen pixels.

eg. The Rigol DS1054Z does this and I'm sure many others do, too.

Why? I think it's just to avoid doing a divide in the screen display functions (which would be needed if all 256 values were used).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on September 29, 2020, 01:30:52 pm
Thanks.

The data buffer readings range 0 - 399 with 200 corresponding to 0. So with a 1V/div then 100 corresponds to -2.0V and 300 corresponds to +2.0V

However, it doesn't seem to be pure pixel doubling from an ADC range of 200 as both even and odd values appear in the buffer. E.g the top of a square wave can have values varying by 1.

I should be able to make a conversion that at least contains sensible data. I am working my way through capturing different settings like trigger so I can see how they are represented in the buffer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on September 29, 2020, 03:42:24 pm
he data buffer readings range 0 - 399 with 200 corresponding to 0

They're 16-bits but only using 9 of them? That seems a bit of a waste.

IOW data1 is a 16-bit version of data2? 3000 bytes instead of 1500 bytes?

However, it doesn't seem to be pure pixel doubling from an ADC range of 200 as both even and odd values appear in the buffer. E.g the top of a square wave can have values varying by 1.

Maybe it's had sin(x)/x applied to it (or some other filter).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on September 29, 2020, 09:53:41 pm
I think the use of 16 bit values is just because the numbers won't fit into 1 byte.

DataBlock2 is still 16 bit values but just showing the 750 display values instead of the 1500 values in the buffer.

I have updated further with latest results of investigation into header values with scope settings. Measures is still to be sorted out. Values need to have probe multiplier factored in.

I am keeping stuff including a test script at

https://github.com/roberttidey/FNISR1013DScope
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on September 30, 2020, 08:19:49 pm
I have now added onto the repository a python program FNISR1013D-JSON.py

When run it asks for a filename; enter the root filename of a wav file (e.g 9 for 9.wav). It will produce json file (9.json) containing the buffer and display data plus settings for the capture. The json format makes it easy to access the data.

Measures remain a work in progress as I have to figure out the encoding and mapping of the 24 byte measure fields.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on October 01, 2020, 08:52:01 pm
Mapping of measures onto header values is now added to the waveform file converter (python)

Most values seem Ok except for cycle and time+/- and I can't see at the moment how negative voltages are indicated. There is also appears to be a calibration factor for adjusting volates which may be in the header somewhere.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on October 02, 2020, 04:16:07 pm
The negative sign for voltage measures does not seem to be stored in the waveform file.

When a waveform capture is done then the absolute value is stored but when is restored then the signs of the values just pick up whatever the sign of the last live measurement was.

That's a bit of a drop off in the software.

It doesn't affect the data buffer values as they have an offset which effectively incorporates the sign.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: immajor on October 21, 2020, 07:24:48 am
Hi all!

Do you have any information of this version of the 1013D scope?
https://www.ebay.com/itm/New-7-Inch-Digital-Tablet-Oscilloscope-2CH-100MHz-Bandwidth-1GS-Sampling-Rate/224201664489?_trkparms=ispr%3D1&hash=item343375e7e9:g:PdkAAOSwp~BfjsN-&amdata=enc%3AAQAFAAACcBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkgCVySCgrNFPU8Iu85TabMFYhTVo3IqM%252FzGKGR3vdVEabyJHulwQChdSzH6KB94GZYu5MfT6rgNAtaRGTLIUCpexTIvDGcslyjO1hK3M2%252FbEG4cGjxtoUD%252F2ZDg4KfW1C%252BN9jXqLwnEVvwu%252BHvNrvYuqy0fQ1bWeGq7q4bvIcoJc6Mwyk3PjOvMRN5zKAxqi1aYvq5e3xZ5klYZvfRbM6%252Bn%252F%252Fv1ztctMIttzW5S8wEL2xGOj5xVD0dLo1iISebA%252Fos5f%252B5fO7DJQ7iY78%252FRoQi5ZGvm6Jj8G6qfNhIJlMLtsGqoY6VLDx9QGz9%252B6fTmN%252FO3rcGuv9oOin8OcYmsKWOS6xdvkYK0lL108W0tI3CXtqh94BXcVHAWmK5fTFTtM%252BgdllyAPIe7RwpYE3gK8iC4UyIwvNmYOslL%252FLXNWD6qNw%252FX8WmfLugV%252Byms2puXbjiyotkNPg7mrIv57JYNwrLYbAyDMH34ULzVuwlA88FRib5zq%252FopcduRZNKB1UCwtex6x8BGdKl3cpB6m9pK01divmHpVTM9ZLIB2CFNTGA%252BY2cuPQtxy6IU2yr97ZX8RUaBTV69jfIJQRS9p9CvYe71tNHmqW3V3PaMfHV0vt9aZQkqK4%252BrVefjcIyssKPAYvPb2SrfPcdUtC7yPsoztXbZtXncqXdnRcjimDbvoaNeTome08J%252Fst6ZHmhGw9PffHgQZN5R9ONmVkdmtKL5JuchMkQxPH7jhd5mJQaxwzO5cbiquZQx544ZZq6Amomtt41SxRmeqNW4NQW8rsykhdbw%253D%253D%7Ccksum%3A2242016644897785032e25c64909a60ad94dfafb7960%7Campid%3APL_CLK%7Cclp%3A2334524 (https://www.ebay.com/itm/New-7-Inch-Digital-Tablet-Oscilloscope-2CH-100MHz-Bandwidth-1GS-Sampling-Rate/224201664489?_trkparms=ispr%3D1&hash=item343375e7e9:g:PdkAAOSwp~BfjsN-&amdata=enc%3AAQAFAAACcBaobrjLl8XobRIiIML1V4Imu%252Fn%252BzU5L90Z278x5ickkgCVySCgrNFPU8Iu85TabMFYhTVo3IqM%252FzGKGR3vdVEabyJHulwQChdSzH6KB94GZYu5MfT6rgNAtaRGTLIUCpexTIvDGcslyjO1hK3M2%252FbEG4cGjxtoUD%252F2ZDg4KfW1C%252BN9jXqLwnEVvwu%252BHvNrvYuqy0fQ1bWeGq7q4bvIcoJc6Mwyk3PjOvMRN5zKAxqi1aYvq5e3xZ5klYZvfRbM6%252Bn%252F%252Fv1ztctMIttzW5S8wEL2xGOj5xVD0dLo1iISebA%252Fos5f%252B5fO7DJQ7iY78%252FRoQi5ZGvm6Jj8G6qfNhIJlMLtsGqoY6VLDx9QGz9%252B6fTmN%252FO3rcGuv9oOin8OcYmsKWOS6xdvkYK0lL108W0tI3CXtqh94BXcVHAWmK5fTFTtM%252BgdllyAPIe7RwpYE3gK8iC4UyIwvNmYOslL%252FLXNWD6qNw%252FX8WmfLugV%252Byms2puXbjiyotkNPg7mrIv57JYNwrLYbAyDMH34ULzVuwlA88FRib5zq%252FopcduRZNKB1UCwtex6x8BGdKl3cpB6m9pK01divmHpVTM9ZLIB2CFNTGA%252BY2cuPQtxy6IU2yr97ZX8RUaBTV69jfIJQRS9p9CvYe71tNHmqW3V3PaMfHV0vt9aZQkqK4%252BrVefjcIyssKPAYvPb2SrfPcdUtC7yPsoztXbZtXncqXdnRcjimDbvoaNeTome08J%252Fst6ZHmhGw9PffHgQZN5R9ONmVkdmtKL5JuchMkQxPH7jhd5mJQaxwzO5cbiquZQx544ZZq6Amomtt41SxRmeqNW4NQW8rsykhdbw%253D%253D%7Ccksum%3A2242016644897785032e25c64909a60ad94dfafb7960%7Campid%3APL_CLK%7Cclp%3A2334524)

Is it a fake?  :wtf:  The "specs" are the same, but the price is too good to be true :(

Sorry for the big pic, I cannot find a smaller.

(https://i.ebayimg.com/images/g/XeYAAOSw5MxfjsNA/s-l1600.jpg)
(counterfeit, counterfit, forgery)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: immajor on October 21, 2020, 07:51:58 am
By the time I would have order it, it was sold out, but I found another listing with the same price and I ordered it. We will see what is it :)

But in the meantime as I see they are changing back the pricing of the other listings to ~150USD :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on October 21, 2020, 08:53:13 pm
Quote
Is it a fake?

I don´t think it is.
It will be always the same hardware under different names = vendors.
My Fnirsi is a Yeapook.. ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: hughtmccullough on October 22, 2020, 04:28:37 pm
Banggood sell both this one and the original one.  They call this the "upgraded" version with the following improvements:

"Comparison between the new version and the previous version:
1. Product functions and parameters have not changed.
2. Replacement and improved appearance: the screen is replaced with a toughened glass screen, which is more wear-resistant and sturdy; the probe socket is also hidden, which is more beautiful. The overall appearance is more beautiful~"

So, if beauty is what you are after...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: immajor on October 22, 2020, 05:57:37 pm
So, if beauty is what you are after...
:-DD
(sorry for the extra post, but I had to react to this)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on October 25, 2020, 10:30:42 pm
To me the case difference is probably that the original was supposed to have a boot. Curved corners unprotected power and BNC conns. The new case sinks the power switch and so on.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Numex106 on November 11, 2020, 08:11:20 pm
I asked on another post and it seems like Apple likes to use these, too??

https://youtu.be/5AwdkGKmZ0I?t=943 (https://youtu.be/5AwdkGKmZ0I?t=943)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: MLutz on November 12, 2020, 09:21:24 pm
I bought this "new" version from Amazon Germany, and received it today. After using it for the first time, and saving one image and one waveform, this obviously damaged the internal SD image... Now I only get a red "SD ERROR" when switching on the device...
Here are some pictures: https://photos.app.goo.gl/zzHKWVhr7CXszsA66

Does anyone have a proper SD image for this device (FNRISI-1013D-II), that I can use to fix the device? Any help would be much appreciated!

Thank you very much & best regards from Vienna,
Markus
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 13, 2020, 03:34:14 am
I bought this "new" version from Amazon Germany, and received it today. After using it for the first time, and saving one image and one waveform, this obviously damaged the internal SD image... Now I only get a red "SD ERROR" when switching on the device...

That might be coincidence, not cause/effect.

Does anyone have a proper SD image for this device (FNRISI-1013D-II), that I can use to fix the device? Any help would be much appreciated!

Could be a bad SD card, not fixable. Or maybe it just needs pulling out and putting back in again.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on November 13, 2020, 11:46:40 am
I might be wrong, but I seem to remember that this card
is only used to store images. If so, try to reformat it or try
with another card.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LeisureSuitLarry on December 13, 2020, 04:47:21 pm
Would you mind dumping the winbond SPI flash and posting it here?
attached...

You'll need a CH341A (preferred)...
This is totally shit programmer...
I bought EZP2019+... Each reading get different result...
After that order SP16-B (www.sofi-tech.com (http://www.sofi-tech.com)) this one read stable.

Hi UniSoft,

I'd like to say thank you, since you made my day.

I got a new version of 1013D from Aliexpress (BNC inputs mechanically better protected and also power button is now more hidden), but the seller shipped a chinese version although an english version was advertised. So the device was pretty useless for me. On top of that, the seller wasn't really willing to fix his fault, so let's see what Aliexpress is finally suggesting.

In the mean time I spend some hours of investigating the hardware and tried reading out my W25Q16 with the chinese language user interface with a cheap CH431A programmer (and yes, it works perfectly, if you do it right!). Since it went well, I continued with flashing back your file, hoping that nothing else had been changed from the old to the new hardware version. At the end, I've now got a new version of 1013D with english user interface up and running. The only difference between the english and the chinese version is, that there is a welcome screen included with the chinese version, which pops up quite early after pushing the power button, whereas the english version remains dark for quite some time, which confused me the first time when powering up the device, but since I know it takes a bit longer to display anything, its ok.

I noticed some differences with respect to the new PCB: The solder pin for the RESET line of the F1C100s has been removed. The line needs to be pulled low now at the pull-up resistor. You can either solder a thin wire to the resistor or, as I did, use a pogo pin. Make sure you ground the side of the pull-up resistor, which faces the F1C100s.

The procedure to correctly readout the W25Q16 with a CH431A programmer is as follows:
  Pull down the RESET line of F1C100s
  Connect a suitable SOIC-8 test clip to the EEPROM and connect it with the programmer
  Power on the scope
  Read / Erase / Program the EEPROM

I added the chinese version to the attached ZIP file.

Best regards and Merry Christmas!




Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: theoldwizard1 on December 29, 2020, 06:10:17 pm
Version I of this 'scope appears to use BNC connectors.

Version II appears to use some kind of recessed connector, possibly MCX jack (female).

Can anyone confirm ?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: theoldwizard1 on December 29, 2020, 06:50:03 pm
Version I of this 'scope appears to use BNC connectors.

Version II appears to use some kind of recessed connector, possibly MCX jack (female).

Can anyone confirm ?

Well, I finally found the "money shot" of the new version.  It appears that it still uses BNCs, but the connectors and the power switch are now recessed into the top of the device

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on December 29, 2020, 07:00:18 pm
Version I of this 'scope appears to use BNC connectors.

Version II appears to use some kind of recessed connector, possibly MCX jack (female).

Can anyone confirm ?

Well, I finally found the "money shot" of the new version.  It appears that it still uses BNCs, but the connectors and the power switch are now recessed into the top of the device



Official product page was updated in the last 2 weeks: http://www.fnirsi.cn/productinfo/556152.html (http://www.fnirsi.cn/productinfo/556152.html)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on December 29, 2020, 07:03:35 pm
I have several "10X" probes, impedance adapters and other accessories that are extremely difficult for my old arthritic fingers to insert and remove with recessed BNC connectors; and some that just plain don't fit. It's a deal breaker for me--not a "feature"...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on December 29, 2020, 07:36:37 pm
Version I of this 'scope appears to use BNC connectors.

Version II appears to use some kind of recessed connector, possibly MCX jack (female).

Can anyone confirm ?

Well, I finally found the "money shot" of the new version.  It appears that it still uses BNCs, but the connectors and the power switch are now recessed into the top of the device



Official product page was updated in the last 2 weeks: http://www.fnirsi.cn/productinfo/556152.html (http://www.fnirsi.cn/productinfo/556152.html)

Same description and specs as provided in the manual received with the "Yeapook" branded version I got in July (http://www.paladinmicro.com/TestEquipment/Yeapook/FNIRSI-1013D English manual.pdf) (46.3 KB):

(http://www.paladinmicro.com/TestEquipment/Yeapook/PiercingClips-00.JPG)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Trader on December 29, 2020, 08:21:13 pm
ADS1013D tablet oscilloscope Review

https://chinese-electronics-products-tested.blogspot.com/p/ads1013d-tablet-oscilloscope-tested.html
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on December 29, 2020, 08:27:58 pm
The last sentences of the opinion I could underline it. 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on December 29, 2020, 09:44:08 pm
ADS1013D tablet oscilloscope Review

https://chinese-electronics-products-tested.blogspot.com/p/ads1013d-tablet-oscilloscope-tested.html (https://chinese-electronics-products-tested.blogspot.com/p/ads1013d-tablet-oscilloscope-tested.html)

A resonably factual and accurate review. Using the "rule of thumb" BW = .35 / rise time (s) promoted by Fluke, Tek and others and applying the reviewer's observed 21.2 ns rise time:

BW = 0.35 / 21.2e-9 = 16.5 MHz

Pretty much in keeping with the reports I and others here have posted.

I agree that within it's limitations it is a useful tool. I use it frequently on automobiles, motorcycles, other contemporary engine control systems--even used it to troubleshoot the CAN bus on my daughter's Samsung washing machine (a glaring example of the absurd complexity incorporated into modern consumer products).

My wife and I pondered how it has been that we managed to live 70+ years without being able to control our washers and dryers remotely?

When I questioned FNIRSI about the grossly mis-stated specs I received this response:

(http://www.paladinmicro.com/TestEquipment/Yeapook/FNIRSIResponse-00.jpg)

Bottom-line: If you want a 100 MHZ scope you should by one from a maker that does not lie...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 16, 2021, 06:30:58 pm
Hi, I,ve just bougt 1013d from Chinese. I tried to test it. And suprise!!! 2nd chanel menu do not resonse. I cant change it on or off, cant change sensivity, change anything. Touch control of this chanel does not work. Everything except this is ok. Touch control of the osilloscope except the 2nd chanel menu works. Has anyone any idea what is going on?. I start thinking about reprograming it with the W25Q16 file. But maybe there is other solution?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on January 16, 2021, 06:53:48 pm
It sounds more like a hardware problem to me--open it up and make sure the ribbon cable from the display to the mainboard is clean, plugged in squarely, etc. Unfortunately it is we, the end users, that provide final QC on most of this inexpensive Chinese scheisse (I.e. "Cheap Chinese crap")...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 16, 2021, 08:26:41 pm
Yep. Open it up and re-seat the wires.

If that fails, send it back.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 17, 2021, 11:55:39 am
Well... of course I've open it and check all connections. Interesting is that the touch screen generaly works. Only on 2nd chanal menu does not.  react. I,ve reset F1C100 IC (pin 70 to ground). It resets all but 2nd ch. I've startet the dispute witch Chinese but I dont know the result. Seller gives me 15USD to repair it myself !!! Carazy !!!  |O Maybe it is hardware fault but where to look for it. I have no idea. Is that possible that software is broken? By the way... the osscilloscope is the new wersion and it has W25Q32 memory.
I know that this osscilloscope can be named a toy but I'am using an old analog one and it is my first digital. I did not want to spend much money before I would decide to buy something better  ^-^
Interesting was that when I fist entered the 2nd ch. menu I could not switch off the chanal but I coluld switch on the FFT option. Once it was set on I could change anything. Now everyting is set to on and can not be changed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 17, 2021, 02:01:30 pm
Hello.
Can someone explain this phenomenon?

As shown in the attached image (5.jpg), a glitch occurs on the waveform at 25ns or 10ns / frequency 7 ~ 12Mhz related to the second channel.

Of course, like the (6.jpg) image, it looks fine at other timings or at higher frequencies.

After 1013d operation, wait 5 minutes and select autoset, it looks normal.
However, when the power is turned off and on, the glitch may appear again.

To solve this, I replaced OPAMP (opa356) and ADC (ad9288), but the result did not change.

Oh and I tried downloading the firmware again, but the result is the same.

Does anyone know how to fix it?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 17, 2021, 07:28:52 pm
Hi. About reading the memory. I've noticed that between old a new wersion of this oscilloscope there are some differences. The new one has CS pin of the memory connectet to the slot (also to F1C100 I think). The old one seemed to has this pin connected to Vcc permanently. Maybe because of this there is no connector for F1C100 reset... I think it is necessarily to find out the state of CS.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on January 17, 2021, 07:53:19 pm
Hello.
Can someone explain this phenomenon?

As shown in the attached image (5.jpg), a glitch occurs on the waveform at 25ns or 10ns / frequency 7 ~ 12Mhz related to the second channel.

Of course, like the (6.jpg) image, it looks fine at other timings or at higher frequencies.

After 1013d operation, wait 5 minutes and select autoset, it looks normal.
However, when the power is turned off and on, the glitch may appear again.

To solve this, I replaced OPAMP (opa356) and ADC (ad9288), but the result did not change.

Oh and I tried downloading the firmware again, but the result is the same.

Does anyone know how to fix it?

The glitch in the CH2 waveform looks to me as missing data in that channel's buffer being masked by the sin(x)/x interpolation algorithm
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 18, 2021, 01:15:10 am
Thank cliffyk .


I do it as a hobby, so I don't know the in-depth content.

In my 1013d case, the first channel is measured up to 82Mhz, and the second channel is only measured up to 70Mhz.

If so, it is assumed that the first channel is configured to use more resources than the second channel in terms of firmware.

 Eventually I have to wait for the updated new firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 18, 2021, 05:06:42 am
Well... of course I've open it and check all connections. Interesting is that the touch screen generaly works. Only on 2nd chanal menu does not. 

The next thing would be to look for a badly soldered pin on the touch screen IC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 18, 2021, 05:08:50 am
The glitch in the CH2 waveform looks to me as missing data in that channel's buffer being masked by the sin(x)/x interpolation algorithm

It should be OK at 10MHz. These things have been tested up to about 30Mhz with no problems.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 18, 2021, 01:03:52 pm
I just bought one from Aliexpress for 100 euro. Unfortunately there is a problem with the touchscreen. Can't change the zoom of the first channel or select the trigger edge. Also the vertical cursor won't go higher than a certain point. So applied for a refund. For the rest it is nice since it works on a battery and is small, but not as small as a JYETech Wave2 . The performance is not super. The 30MHz I saw and read in the reviews are to high for mine. the -3dB point is at ~18MHz. Used a Tektronix AFG3102 signal generator for the test. At 1KHz I tweaked the sine signal to be 7 divisions tall on the scope. At ~ 18MHz the signal shrunk to only 5 divisions which is -3dB. (0.707 x 7 = ~5). For measuring simple signals it is ok, but if you need a bit more save up for a Rigol or Siglent. I just wanted something for measuring signals coming from STM32 MCU's generated by software that does not take up a lot of workbench space. And that it certainly doesn't.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 18, 2021, 01:58:19 pm
Well... of course I've open it and check all connections. Interesting is that the touch screen generaly works. Only on 2nd chanal menu does not. 

The next thing would be to look for a badly soldered pin on the touch screen IC.

Do You think if there is something wrong witch touch screen, IC toch screen would generaly work but only one function could be fault? I think that even thou the touch is damaged after reseting F1C100 IC the 2nd chanel shold be reseted too. Is it at all possible that W25Q32 memory has a fault?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on January 18, 2021, 03:31:51 pm
The glitch in the CH2 waveform looks to me as missing data in that channel's buffer being masked by the sin(x)/x interpolation algorithm

It should be OK at 10MHz. These things have been tested up to about 30Mhz with no problems.

Not if the buffer memory also fails at 10 MHz--it would be interesting to see this same unit, same inputs in a raw data ("dot") non-interpolated display mode.

Can  the 1013 do this?  Mine is in my workshop in the barn right now and I'm too lazy to go look...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 18, 2021, 04:41:45 pm
Not if the buffer memory also fails at 10 MHz

I don't think the frequency of the buffer memory is linked to the frequency of the input signal in any way.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on January 18, 2021, 06:52:51 pm
Not if the buffer memory also fails at 10 MHz

I don't think the frequency of the buffer memory is linked to the frequency of the input signal in any way.

Nor do I, that's why I found your above comment: "It should be OK at 10MHz. These things have been tested up to about 30Mhz with no problems." to be perplexing?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 18, 2021, 08:47:12 pm
Dears, has anyone dump W25Q32 memory of the new wersion 1013d (Englisch) ? I would like to compare it with mine. I can't still find what is wrong.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 19, 2021, 12:13:34 pm
Nor do I, that's why I found your above comment: "It should be OK at 10MHz. These things have been tested up to about 30Mhz with no problems." to be perplexing?

The pics of the distortion here (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3418548/#msg3418548) show distortion at 10MHz but not at 30Mhz.

I can't explain that (but we know this is a sick oscilloscope...)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cliffyk on January 20, 2021, 12:02:06 am
Nor do I, that's why I found your above comment: "It should be OK at 10MHz. These things have been tested up to about 30Mhz with no problems." to be perplexing?

The pics of the distortion here (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3418548/#msg3418548) show distortion at 10MHz but not at 30Mhz.

I can't explain that (but we know this is a sick oscilloscope...)

I had not fully followed the original posting and missedd the second 30 Mhz screenshot--74 w/ Parkinson's can really suck at times.

I also am at a loss to explain it, however I have a difficult time believing it to be a firmware issue--smells like hardware to me...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 20, 2021, 02:13:23 pm
Hi, I still have problem with 2nd chanel menu. I would like to try to change the firmware of the W25Q32 memory. My content of the memory (W25Q32) differs from the one I've found in this forum (W25Q16). Can someone who has new wersion of 1013d attach a dump of this memory? Please. Here is my W25Q32.bin file.
There is no need to connect pin 70 to GND of 1C100 IC. In the new wersion of 1013d it is possible to connect CS to the programmer and it works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 20, 2021, 04:59:51 pm
I just ordered a CH341 programmer, so when it arrives I can try to get the firmware from mine. Have to open it up anyway to see what the problem with the touchscreen is. Waiting for aliexpress to come with a resolution for my dispute. Going for a full refund. They offered 15 bucks to get it repaired locally, but declined since there is no assurance it can be fixed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 20, 2021, 05:28:38 pm
I've asked for full refund. Seller want to give me also $15 but I rejected it. Aliexpres in dispute proposes half price without selling back or full refund if I send back oscilloscope but I must pay for sending back. I propably agree half refund hoping to repair it.
Maybe You will find the reason of the malunction of the 2nd chanel menu  ;D . My programmer came yesterday so now I can read and write the memory.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 20, 2021, 06:01:12 pm
If they offer half price without sending it back I will also take it. Shipping it back from Europe will cost at least 30 euro so no gain there. Does your unit show other problems aside from the channel 2 menu? With mine the vertical cursors won't go above half way the auto set button. I made a movie showing most of my problems. It is on youtube: https://youtu.be/mUZGER70dGo

I read a post here about a capacitor across I2C clock and data line,  (from the 6th of September 2020) but looking at the picture it is connected to the screen touch connector. What I know of it (which is not to much at the moment) the touch is not I2C but an X and Y setup over the screen and the square wave signals mentioned could be scan signals. It is a kind of analog system if I'm right. Have to look into it as soon as the dispute is resolved and the programmer has arrived.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 20, 2021, 08:18:30 pm
I watched Your movie. It seems that You have several problems with the touch screen. I have only with 2nd chanel menu. I try to test the oscilloscope beter but the line of FFT of the 2nd chanel is always on so part of the screen is busy.  Presently I know nothing about screen transmition protocol and I also have read something abot the capacitor but I am rather sceptical about it. I think the most important point is to consider if it is software or hardware problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 21, 2021, 08:55:57 am
It certainly is a strange phenomenon, and what I see on mine I suspect it is the hardware. I will try to solve it, but in the case it is software it will be more difficult since that involves reverse engineering of both soft and hardware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 21, 2021, 09:49:50 am
It certainly is a strange phenomenon, and what I see on mine I suspect it is the hardware. I will try to solve it, but in the case it is software it will be more difficult since that involves reverse engineering of both soft and hardware.

It can't be software*. Other people have the same software as you.

(*) Unless your firmware is corrupted.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 21, 2021, 10:41:45 am
When I'am talking about software I mean that it can be corrupted. It is obvious for me that others have the same software. However mine (W25Q32) differs from W25Q16 posted in this topic (not only because of the length ofcourse). My way of thinking is first to eliminate software corruption to be sure that it is hardware malfunction. But if it is hardware reason I have no idea where to look for (for now).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 21, 2021, 11:28:37 am
I looked into touchscreens a bit and found that there are screens with i2c communication. There are several controller chips that could be used in the screen. Also the type of capacitive touch can differ from screen to screen. So chances are it is in the screen that the problem lies. If so replacing it might be the only solution, but then it is the trick to find the correct match. I saw a screen on aliexpress for around 30 euro, so if they refund half what you paid for it you could try that road. The old screen can than still be used as a display without touch 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 21, 2021, 01:09:50 pm
Your problem with the touch screen seems to be a little different than mine. In Your case it does not react in many places. My problem is only in one function. Because of this I would like to know for sure if it is not because of corrupted software. I worry that we both will spend a lot of money for spare parts without certainty that we had found the reason of failure  :-DD.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 21, 2021, 01:25:37 pm
That is why I will do extensive research and testing and probing before buying anything for it. For you it is wait until I receive my CH341 programmer and I can retrieve the firmware from mine :=\
My dispute ends late today after which aliexpress has to step in and come up with a resolution. When that is out of the way I will open up the device and start my investigation :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 21, 2021, 02:13:04 pm
Your problem with the touch screen seems to be a little different than mine. In Your case it does not react in many places. My problem is only in one function. Because of this I would like to know for sure if it is not because of corrupted software.

Seems to me like you have one good device between you.

If you both get a refund you can combine the two broken ones into one good one.  :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 21, 2021, 05:15:58 pm
That is why I will do extensive research and testing and probing before buying anything for it. For you it is wait until I receive my CH341 programmer and I can retrieve the firmware from mine :=\
My dispute ends late today after which aliexpress has to step in and come up with a resolution. When that is out of the way I will open up the device and start my investigation :palm:

I received my CH431 in two days (costs about 3EUR). Today I received information that my half price refund would be proceded by aliexpress. I hope it will last no long. In a fact I don't need very sophisticated oscilloscope but If I'll fail with repairing 1013d I'll consider to look for something reliable.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 21, 2021, 09:52:49 pm
If I'll fail with repairing 1013d I'll consider to look for something reliable.

A lot of people have bought them with no problems. This is just bad luck.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 22, 2021, 03:57:05 am

I learned a few more test results for my 1013d.

1. At frequencies above 30mhz, both channels
 It comes out normally. (Previous article)

2. If the frequency is lowered by about 10mhz, a glitch occurs in the second channel at the bottom. (bottom.jpg)


3. Drag the lower second channel on the screen and raise it to the center to change the shape of the glitch. (middle.jpg)

4. Drag the second channel and move it toward the top first channel to remove the glitch. (top.jpg)

5. Turn off the first channel and use only the second channel to avoid glitches. (single.jpg)

6. If noise is applied to the first channel and a square wave is applied to the second channel, it is affected by the noise, and the waveform with noise is also seen in the second channel. (noise.jpg).
When I connect another oscilloscope to the second channel, there is no noise.

From the above facts, I came to the conclusion that this is not something that can be fixed by replacing one or two parts.

My 1013d seems to be an early pcb type. I know that the most recent release is shieldboxed in the opamp area.

Facts like this make me sad. ~~~ :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 22, 2021, 09:24:34 am
From the above facts, I came to the conclusion that this is not something that can be fixed by replacing one or two parts.

My 1013d seems to be an early pcb type. I know that the most recent release is shieldboxed in the opamp area.

Facts like this make me sad. ~~~ :(

It could easily be a bad solder joint on the PCB - an opamp with no GND or something like that. Go over everything with a soldering iron.

(also make sure there's no stray solder blobs or flux residue in the input area)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 22, 2021, 09:44:48 am
If I'll fail with repairing 1013d I'll consider to look for something reliable.

I'm thinking the same, but something more reliable is more expensive :( So when I do decide to spend more it also needs to bring more, like 4 channels, but still with a small form factor.

I opened up mine today and found that it uses a GT911 capacitive touch controller. Since the display is glued to the glass panel it is hard to tell if the touch panel is separate from the display and if so if it can be changed easily.

One thing is sure the designer of this part of the device is a moron since putting a capacitor across sda and sck is idiotic. Only creates cross talk between the two lines. Don't think my problem can be solved by removing it though, since communication between the main CPU and the GT911 works. I'm able to control parts of the screen. Depending on the layout of the panel the problem lies either in the TX or the RX lines of the GT911.

For eljot it might be something else, but could be the same. If only a small part of the capacitive sensor is corrupt it could result in just a small square on the screen that does not respond.

Take a look at the GT911 datasheet for how thinks work. It works with an array of small capacitors with TX lines driving and RX lines receiving. When there is a change in capacitance in an area it will detect that and the host can poll the device to see if there is some touch on the screen. So if part of the array is defect it could explain the problem.

Loose capacitive touch panels are obtainable and not that expensive. 8 or 9 euro's. Finding the right one might be tricky since the sellers on aliexpress are not to forth coming with info on their product pages.

I ordered my CH341 from aliexpress so will take a couple of weeks to arrive :-\ So eljot hope you are patient :scared:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 22, 2021, 10:04:40 am
I conceived a test with an Arduino the see if it is the touch panel it self that gives the problem. Need to check the voltage levels in the device first to see if it is running on 3.3V.

Level converters might be needed and one of these is also needed: https://nl.aliexpress.com/item/4000902737228.html?src=google&albch=shopping&acnt=248-630-5778&isdl=y&slnk=&plac=&mtctp=&albbt=Google_7_shopping&aff_platform=google&aff_short_key=UneMJZVf&&albagn=888888&isSmbAutoCall=false&needSmbHouyi=false&albcp=10191220514&albag=107473525128&trgt=743612850714&crea=fr4000902737228&netw=u&device=c&albpg=743612850714&albpd=fr4000902737228&gclid=Cj0KCQiAjKqABhDLARIsABbJrGl-0u0ETB6-mwfoK-29O56dhcee92wX7MQvD6llBxDYLSxhyvAGotoaAgbpEALw_wcB&gclsrc=aw.ds

It is a 4 pin fpc connector. You can disconnect the cable of the touch panel from the 1013D and connect it to an Arduino via the level converters. Make a sketch with the GT911 lib and start moving over the panel. Check the output on the Arduino to see if you get all the coordinates you expect. This will give conclusive evidence of where the problem lies. Consider it part of the hobby :-DD

I'm going to order the fpc connector and do the test myself. It will take it's time though :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 22, 2021, 11:22:08 am
For eljot it might be something else, but could be the same. If only a small part of the capacitive sensor is corrupt it could result in just a small square on the screen that does not respond.
My way of thinking is like that: If a small part of the screen is corrupted it would not response at all at this certain place. But when the 2nd chanel menu does not exist (is not switched on) on the screen the area of the screen is responding ie. I can move coursors and etc. So it means (deduce) the tuch screen is ok. Might be that I'm wrong???  |O
I'will wait patiently for Your programmer  :) but tempts me do replace my W25Q32 memory file with the old one W25Q16. Interesting what will happen...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 22, 2021, 11:38:03 am
Have a look at this. I have fond it at youtube.

https://www.youtube.com/watch?v=InCihC4Q1u8 (https://www.youtube.com/watch?v=InCihC4Q1u8)

 What do You think about it? Someone has uprgaded the firmware and the screen has gone crazy  :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 22, 2021, 01:19:55 pm
You are right about that if it is the touch it should not work for any thing in that region. With my device it is a small band across the whole display, but that being said the buttons run/stop and auto set work without problems and at least the auto set button is partially in the section that does not work.

So the test I wrote about is my best bet for investigating the problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 22, 2021, 04:02:53 pm

It could easily be a bad solder joint on the PCB - an opamp with no GND or something like that. Go over everything with a soldering iron.

(also make sure there's no stray solder blobs or flux residue in the input area)


Thank you for your answer.

I looked at the pcb a few times as per your comment, but found no cold solder or flux residue.

There is no glitch up to a 50ns time device. It is more difficult to understand because it only occurs at 25ns and 10ns (7MHz~14MHz frequency).

I carefully suspect that the relay is bad.

I really like the size and interface, but the glitch is the problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on January 22, 2021, 07:09:36 pm
You are right about that if it is the touch it should not work for any thing in that region. With my device it is a small band across the whole display, but that being said the buttons run/stop and auto set work without problems and at least the auto set button is partially in the section that does not work.

So the test I wrote about is my best bet for investigating the problem.

Well... I've just replaced my original W25Q32 with W25Q16 file. Unfortunately the 2nd chanel menu is still not working good. But... there is a little difference. Once I had switched some options on (ie. DC on or FFT on or sensivity to x1) it could not bo be changed - the same was with W25Q32 file - but now with W25Q16 file, after reseting the F1c100 IC (pin 70 to ground) everything is back to the initial state - otherwise than before. Before I could not be back to initial state. Maybe it is not a big thing but for me very puzzling...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 23, 2021, 04:45:38 am


6. If noise is applied to the first channel and a square wave is applied to the second channel, it is affected by the noise, and the waveform with noise is also seen in the second channel. (noise.jpg).
When I connect another oscilloscope to the second channel, there is no noise.


The question of the noise signal having an effect on the second channel has been solved.
The reason is that I wrapped the two probes together.
But still, the glitch question cannot be resolved.  :-\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on January 24, 2021, 03:47:58 am


6. If noise is applied to the first channel and a square wave is applied to the second channel, it is affected by the noise, and the waveform with noise is also seen in the second channel. (noise.jpg).
When I connect another oscilloscope to the second channel, there is no noise.


The question of the noise signal having an effect on the second channel has been solved.
The reason is that I wrapped the two probes together.
But still, the glitch question cannot be resolved.  :-\

Through several operational tests, I was able to eliminate glitches occurring in a specific time device (a specific frequency band).

Interestingly, I found this method to be removed as a simple operation method, not any hardware replacement or firmware modification.

This method is based on when I try to remove the 25ns glitch,
First, set it to 1us or larger and run autoset. Next, set it to 10ns and run autoset again.
After two or three repetitions, the 25ns glitch disappears and I can see a normal waveform. :phew:

Eventually, the standing waveform is output like the attached file.

Of course, I don't think this is the correct solution.

And it is very frustrating that the waveform does not get caught in one autoset. :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on February 07, 2021, 09:58:49 am
Here is the dump of ST 25P16VP... (this is FPGA stream data and connected to dedicated FPGA pins)
I don't think that it is useful for anyone, just let it be for history...
I2C I guess for store settings.

The attached archive contains firmware for RD6006 :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on February 07, 2021, 10:22:35 am
Dears, has anyone dump W25Q32 memory of the new wersion 1013d (Englisch) ? I would like to compare it with mine. I can't still find what is wrong.
https://1drv.ms/u/s!Av-Riptwsak2iskvoKrSKJR8rpKr_g?e=m4eMUw
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 07, 2021, 12:23:26 pm
Thanks. After I had "play" with flash memory I was able be to state touch screen damage. One tx chanel of the screen was grouded. I dont know if it is GT911 IC fault or connection tape fault. Now I am waiting for a new touch screen I hope it will fit.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on February 07, 2021, 01:22:07 pm
Thanks. After I had "play" with flash memory I was able be to state touch screen damage. One tx chanel of the screen was grouded. I dont know if it is GT911 IC fault or connection tape fault. Now I am waiting for a new touch screen I hope it will fit.

Where did you buy the touch screen? I also have a problem - does not work on part of the screen. The flashing did not help
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pjw1234 on February 07, 2021, 01:32:41 pm
Dears, has anyone dump W25Q32 memory of the new wersion 1013d (Englisch) ? I would like to compare it with mine. I can't still find what is wrong.
https://1drv.ms/u/s!Av-Riptwsak2iskvoKrSKJR8rpKr_g?e=m4eMUw

Reply #479 on: January 20, 2021, 02:13:23 pm <----- The firmware (4096kb size) attached
Reply #505 on: Today at 10:22:35 am <------ The firmware (4096kb size) attached 

The result of comparing the two files is the same as the attached file. The results are different.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on February 07, 2021, 02:45:36 pm
The attached archive contains firmware for RD6006 :-//
It is a bug on this forum... it is sometimes replace the file content.
Filename is correct, but really downloading another file which was uploaded later in another thread (with different filename). :-//
If still need it is here:
https://mega.nz/file/MGY3FI5b#wURGvOJB9Zb6dqilI2w5TRbJWrP3fHHG5muqNXtb-r4
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 08, 2021, 10:05:12 am

[/quote]
Where did you buy the touch screen? I also have a problem - does not work on part of the screen. The flashing did not help
[/quote]
I've ordered it on aliexpress ( https://www.aliexpress.com/item/33042057555.html?spm=a2g0s.9042311.0.0.6af64c4dZopY9k (https://www.aliexpress.com/item/33042057555.html?spm=a2g0s.9042311.0.0.6af64c4dZopY9k) ). Originally the touch screen is smaler than that I've ordered - looks rather like 6,2 inch screen not 7 inch screen. I dont know why because the LCD is 164*99 mm. I should receive the screen in about a week time, maybe more. I am curious if it will work properly. It is very hard to change the screen. It is glued to front glass. I've removed it with hot air. Ofcourse I,ve destroyed the original touch because it was very fragile. My steps with removing the screen: 1. take off the back cover of the LCD, 2. take off the content with LCD, 3. On the back of the front glass stays a frame, 4. The frame is glued to a touch screen with adhensive tape,  and the front glass is fixed to the housing with adhensive tape too - remoove both. 5. You will now have touch screen glued to the front glass. 6. Remove touch screen from front glass with hot air.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 08, 2021, 11:51:20 am
Thanks. After I had "play" with flash memory I was able be to state touch screen damage. One tx chanel of the screen was grouded. I dont know if it is GT911 IC fault or connection tape fault. Now I am waiting for a new touch screen I hope it will fit.

I did not receive my programmer nor the connector for the touch screen experiment yet, so not able to extract the firmware nor test the touch screen.

So eljot how did you found the problem? Where you able to measure on the lines coming from the GT911?

For me it is probably in the RX lines since it is a horizontal section instead of a vertical section on the screen.

Thanks for the instructions on how to get to the touch panel. I already noticed it was glued to the front and did not try to remove it because of that.

About the size of the panel you ordered, on the diagonal it is 7.5inches, so the visible part will be 7inch. Keep us updated if it actually fits and works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 08, 2021, 01:28:51 pm
Well... in sequence. After I've changed the flash memory I noticed that the difference was the new one oscilloscope memory remembers last setings. The old one resets to factory setings. Thanks of that I was able to notice that one of the tx line did not work. Next I decided to find a new touch screen but before I had to identify connections of the screen (six line tape). During this I discoverd accidentally that one of the tx line was gronuded - I mean short circuit. I did not measure the signals.
I will let You know when I connect the new one touch screen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 10, 2021, 10:35:08 am
Eljot, if you managed to get it out without damaging the front panel you are a better mechanic then I am. Tried your steps and got to the step of removal of the front panel, which is also glass, I unfortunately cracked  it. Also was not able to get the touch panel of the remainder. Went up to 280 degrees for the hot air but it still did not move. It ended up also broken. So now I have 25 euro hobby project. (Managed to get a 75% refund instead of the 50%, because I stated, hang on it will cost me at least 25 euros to return to get my money back, so that's not an option. And repair will cost time and money so I lowered to a 75% refund and Aliexpress accepted that)

Need to see if capacitive touch will work behind an acrylic screen, because making my own glass panel is beyond my skills.

So repairing is not as easy due to the way they constructed the device. Double sided sticky tape is a bitch (pardon the lingo) for repairs. To others, be also careful with the display itself. Once out of the metal case it is fragile.

Attached a picture of the broken panel
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 10, 2021, 11:21:26 am
Had to resize the images to get them up here. They show the different parts of the scope.

First is with the pcb removed.
Second shows the pcb. :popcorn:
Third shows the battery in the back.
Fourth is the lcd panel without the metal bracket.
Fifth is the metal bracket left in the front part of the housing. I used the small screw drivers to pry the lcd panel from the bracket. Started at the top away from the cable.
And last is the reassembled lcd panel.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 10, 2021, 11:54:30 am
About the touch panel I noticed that it does not use all the scan lines of the GT911.

On the side you can see it has only 10 of the 14 receive lines and on the bottom only 16 of the 26 transmit lines. So they do not use the full resolution of the GT911. Not sure if this is common for the 7inch touch panels one can buy on Aliexpress. Very curious to see if the one Eljot bought will work with the scope.

I'm going to try my luck with the 7 inch one from here: https://nl.aliexpress.com/item/33003864443.html?spm=a2g0s.9042311.0.0.68b84c4dkes3Il
It is 4 euros cheaper since for me it is free shipping and only 6,34 (at the moment)  compared to 8,25 and 1,79 shipping. I know the price and shipping can vary from country to country.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 10, 2021, 02:33:20 pm
Pcprogrammer You are right that the touch screen is rather strange. It is smaller respectively to 7 inch LCD and the resolution seems to  be strange. I doubt it will be possible to find something like that on aliexpress. For me the price of the touch screen You've showed is almost the same. I am very curious if it will work properly. I am still waiting for the delivery. I can put on it (if it works) a pice of acrylic to check. I've removed the toch screen with hot air piece by piece but it turns out that I have luck not to destroy the front glass  :scared:.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 11, 2021, 07:25:32 am
Hi Eljot, is your scope the new type, with the connectors recessed or the older one where the connectors stick out of the top. Mine is the newer one and the touch panel is 162mm x 96mm and 176mm diagonal in the see through area. This is about 7 inches.

So going on what you wrote, you basically broke the touch panel in bits of of the front glass panel. Then yes you are lucky not to have broken the front panel itself. Both are quite fragile. I cracked mine while trying to remove it from the plastic case. The touch panel it self did not crack at that time, but broke later when I tried to remove a broken bit of the front panel.

I think the best approach is to first remote the front panel from the plastic case using hot air (at about 150 ~ 160 degrees celcius) and a flat piece of metal. Warm up from the inside until a corner of the glass can be pushed up and the metal can be slit in between. Then while applying the hot air carefully move the piece of metal along the glass to get it out.

After that it might even be possible to do the same with the touch panel by using a very thin piece of metal (like what they use to gauge spark plugs) and using much hotter air. (~300 degrees celcius)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 11, 2021, 11:35:44 am
Hi, my scope is the new one with the connectors recessed . To push out the front glass I've used a thin sharp blade. Just for cut the adhensive tape. I cut it all around and then pushed the glass from plastic house. Removing the touch screen with the same blade (piece by piece) I used hot air about 400 deg. After all it was necessary to remove a glue. Also with hot air and sharp blade. In the end I washed the glass with solvent (acetone).
I worry the screen resolution is different.  I,am not an expert on digital technic so I cant forecast what will happen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 11, 2021, 06:07:16 pm
We just have to wait and see what happens. A friend of mine suggested to contact FNISRI directly to see if they can supply the front and touch panel for repairs, so I went through their website for contact. As it is Chines new year at the moment it might take a while.

I tried with an other touch screen system I have here if it works through acrylic. It did through a thin sheet of plastic, but when I tried with thicker plastic it did not. Only had 2mm acrylic and that does not work either. So not to optimistic there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 12, 2021, 09:34:45 am
I wrote to fnirsi a few weeks ago... at the begining I noticed the problem. No answer.
I have a piece of 1mm acrylic. It is from a picture frame. I think it's not a problem for You to find something like this. I will let You know if it works.  I'm still waiting for the delivery of the screen...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 12, 2021, 04:53:23 pm
That's the Chinese for you. Sell you something and when there is trouble they are not there. Even though they more or less state on their site that service is a priority. My order of the touch screen has to be shipped yet, so will take quite some time. The programmer arrived today, so if you still need it I can extract the firmware.

With aliexpress patience is the key :=\ |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on February 12, 2021, 05:02:45 pm
Some experience with Fnirsi "support":
About a year ago a bought a Fnirsi DSO Pro.
It did not come with a manual, so I sent a
mail to them (2020-01-17). I got the reply
exactly one month later (saying contact the
seller). Admittedly, this was during the
Chinese new year celebrations.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 13, 2021, 09:02:52 am
Hi, now I do not need the content of the memory. I am sure that the broblem concers the touch screen. Thnk You  ^-^
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: hans1961 on February 16, 2021, 11:24:57 am
Has anyone experience with the 1013D measuring voltages above 400 volts? With a 1: 100 probe head?
Is this possible with this oscilloscope? Does it have a default setting of 1:100?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on February 16, 2021, 11:55:31 am
Has anyone experience with the 1013D measuring voltages above 400 volts? With a 1: 100 probe head?
Is this possible with this oscilloscope? Does it have a default setting of 1:100?

Electrically? It has to work, it's physics.

Does the 'scope have a "100x" setting? I don't know, but all the setting does is change the scale of the numbers on the screen. There is no electrical difference inside the 'scope when you switch 1x/10x/100x, it's all done inside the probe.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolfy007 on February 16, 2021, 12:00:08 pm
Has anyone experience with the 1013D measuring voltages above 400 volts? With a 1: 100 probe head?
Is this possible with this oscilloscope? Does it have a default setting of 1:100?

Yes it does have a x100 scale on the channel settings.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on February 16, 2021, 01:23:25 pm
The advert (https://www.aliexpress.com/item/4000861098295.html) says:

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1175474;image)

(but it also says "100M bandwidth 1GS sampling rate" and we know that's not true  >:D )
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 19, 2021, 02:59:56 pm
Hi, I received the touch screen yesterday. First I've veryfied 6pin tape connection. 1. RST, 2. Vcc, 3. GND, 4. INT, 5. SDA, 6. SCL. It was the same that the original. I,ve found that the screen has its own pull up resistors (SDA, SCL). On the main board there are already pull up resisors. So one of them should be removed. I decided to remove them from the touch screen.
Time to connect everyting together. The scope starts to work. Touch screen works properly !!! :scared:
I've noticed that because of the touch screen is a little bit biger than the original it seems the picture fits the whole LCD. It is a little biger so the front glass frame could be now smaler (2..3 mm?). I'm not sure of this efect because I cant compare it to the original.
The touch screen has its own adhensive tape so I've glued it to LCD. Next I've put double sided adhensive tape on the front glass (enough wide to be possible to glue plastic housing and then screen). I put the glass into plastic housing and then put LCD screen).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 21, 2021, 08:19:35 pm
HELP!!! Disaster has happened !!! As I wrote above I put the new touch screen. Everything started to work properly. I decided to write back my original W25Q32 content of the memory. After I had done this the new touch screen stopped working. It reacted in some random places but generally it was comletly uncalibrated. I have changed a few times the content of the memory (W25Q16 and W25Q32) but with no effect. What happened? |O   
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2021, 11:24:29 am
Hi Eljot, that is very strange. The fact that it worked at first tells us that it did respond the way it should. Also since you replaced the firmware before with the old touchscreen on it and that did not break the system makes it rather difficult to think of what might have gone wrong.

Does the scope work in the sense that if a signal is attached you see a proper response on the screen?

Not sure about the working of a touchscreen but it might need some calibration. Aliexpress just shipped mine so it will take a couple of weeks before I can test things.

Did you test it throuhgout the different stages of the repair? So after taping it to the lcd and then after taping the pair to the front glass panel?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 23, 2021, 01:28:14 pm
Hi, Pcprogrammer  ^-^
I think that during writening the memory something is sending to GT911 IC.  The same I have found on youtube. Someone has written the memory in 1013d and the touch screen stopped work properly.
Conclusion: newer write the memory when the touch screen is connected the main board !!! I think that one thing I can do is to buy another touch screen. The same I've bought before  |O. I think that the TG 911 IC is programmed by the vendor and something happens when ISP is working in the main board. Maybe next conclusion: not every touch screen with GT911 seems to work properly in the scope. The one I've bought did... until I,ve written the memory.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2021, 01:57:12 pm
Hi Eljot,
I don't think that is likely, unless the cpu does strange things while you are programming the flash memory and the GT911 has some sort of eprom storage, or the flash is working on the same i2c bus, which I doubt since it will be SPI.

Looking at the video you mentioned shows that for him the X coordinates of the touch are somehow inverted and not really a random effect that you describe.

A problem with your device might be that the touchscreen is no longer responding well behind the glass panel. What I found on the net is that when a touchscreen is placed behind glass or acrylic it should be glued entirely. Take a look at what they say on this page: https://riverdi.com/capacitive-touch-panel-construction-and-working-principles/
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 23, 2021, 04:18:30 pm
Everything was ok after I had installed the new touch screen. Even when I've installed the front glass without a glue. I am angry with me because I could work with the old version program. I dont know if it is even any difference. But of course I had to go back to my native program. What for ? I dont know !!! I'am fool !!! Touch screen still reacts but has totally lost coordinates. It reacts not a random way, rather with shift coodinates.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2021, 04:23:49 pm
Very strange indeed. Can you shoot a video of what it does and upload that to youtube. Might give some insight in what is wrong.

Another idea: disconnected the battery and waite some time to clear residual memory content. After that power it up again and see what happens.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on February 23, 2021, 04:29:28 pm
I will try to make a movie but now it is in pieces. I must put together everything  ^-^
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2021, 04:32:14 pm
Ok. I will check later to see if you wrote a new entry :) :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 24, 2021, 11:48:37 am
Hi Eljot,
you mentioned that you removed the pullup resistors on the touchscreen. So I thought lets check the ones on the main board. These resistors are ~7K5 which is rather high for I2C where on 5V it is normal to use 2K2 and on 3V3 I guess they could be lower. So removing the resistors on the touchscreen was not necessary and might even cause problems considering the weird capacitor across sda and scl on the main board

It is just a thought so take from it what you will :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 03, 2021, 08:25:46 am
Hi Eljot, which touchscreen is still better to order in your opinion? 7 or 6.2 inches?  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 08, 2021, 01:20:18 pm
Hi Dmitrkov, I just received the one I ordered. The size (7 inch) is correct, but unfortunately the coordinate system is wrong. So to get it to work I need to rotate the touch screen. Outside the case it is doable and works, but due to different border sizes it will not fit in the case.

The one I ordered is from this shop: https://nl.aliexpress.com/item/33003864443.html?spm=a2g0s.9042311.0.0.6a9d4c4dko7B3Z
I choose the 7 inch version.

It arrived well packaged and with a useless extension cable (only 4 pins)

Not sure how to solve the incorrectness but maybe the older firmware Eljot used in his tests might solve it. I know from fast scanning the GT911 datasheet there is a setting to invert the X direction but I guess this would involve modifying the existing firmware, which at the moment is one leap to far.

Looked at the chip on the flexboard of the touch screen and it turns out to be a GT9157 and not a GT911. Not sure about the differences yet. The number of used scan lines on the panel is the same as the original one. 10 RX and 16 TX lines.

Here you can see how it is in the normal mounting position: https://youtu.be/cuPgxOR_OlM
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DaneLaw on March 09, 2021, 12:57:54 pm
I asked on another post and it seems like Apple likes to use these, too??

https://youtu.be/5AwdkGKmZ0I?t=943 (https://youtu.be/5AwdkGKmZ0I?t=943)

Hilarious, the Fnirsi1013D a poster boy in Apple's promo vids about going above and beyond and their highly clinical lab.
but also very clearly shows, that such a tool do have a place, where its relevant and the big bulky lab-grade scopes in the back, are perhaps not ideal, even though in such an environment lab scope ftw...
It looks like each of the 4 Apple workstations has a Fnirsi1013, alongside the Apple 5K display and other lab gear, and then there is one big labscope they can share in the middle on a rolling table..

(https://i.imgur.com/IwRYtRW.png)

(https://i.imgur.com/VCt6cTa.png)

but can also be a stage, solely for vid purpose, certainly looks like a rigged lap for vid & promo purpose..
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on March 09, 2021, 01:20:24 pm
but can also be a stage, solely for vid purpose.

Does that look like a real workplace to anybody here...?

Where's the coffee cups?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DaneLaw on March 09, 2021, 01:30:00 pm
If you take a look at the vid, it becomes quite clear, that it's rigged.
to many circuits on display with blinking LEDs all over.
though the rolling table with an expensive lab-grade-scope, on wheels, would make sense amongst numerous worktables..
8 workplaces, with a bonafide legit Fnirsi1013D on each of the 4 main table.
c'mon Apple you can give each workstation a full fledge Mac Pro tower and a 5K Display, but they need to share Fnirsi's.  :palm:

https://youtu.be/5AwdkGKmZ0I?t=547
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 09, 2021, 08:59:26 pm
Got a reply from FNIRSI after my request about spare parts. It landed in my spam folder and just only noticed it today (20 days later) Did not matter, because they state "hi, friend
We are very sorry, but we cannot provide you with replacement parts!" In a second email they state "Or you can go to the store where you bought this product and look for customer service!"

Already got large part of my money back so the later is not an option. Leaves the route of hacking the firmware to get the orientation of the new touch screen to line up with the lcd. There is a register in the GT911 (and most likely also in the GT9157 of the new touch screen I bought) where the cpu can set x2x and y2y to invert the coordinates. To investigate what the cpu is doing I'm going to monitor the I2C bus, but have to wait until the needed ffc/fpc cables arrive I ordered to make a breakout setup. Don't like soldering in the device just yet.

As of now it is a true hobby project.

I read way back in this thread that some people tried to hack it but did not got to the part (if there) where they state it is done and they have new software for it. So need to do some more reading.

And yeah the Apple lab looks a bit to clean to be the real deal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 10, 2021, 08:42:42 am
Has anyone reversed engineered the schematics of this device?
What is the status of the creating open source software for it?

I noticed that there is a second winbond flash on the board which by the looks of it is connected to the FPGA so most likely the configuration for it is stored in there and not in the main flash connected to the F1C100s.

Am I correct in stating that the proper way of programming these flashes is by not powering up the device and connect a programmer with its own power to the 6 pin headers found near the flash chips? (Or by using a special clip on the flash chip) There is a diode in the power connection of the flash, so this way the rest of the device is not powered.

Near the FPGA there is an other 8 pin chip (just below the oscillator) with the markings removed. Has anyone any idea on what this chip is or does?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: KPL on March 12, 2021, 08:57:17 am
Hi,
I'm evaluating this "scope" as a battery-operated tool to use when isolation from ground might be needed, like driver circuits in SMPS.
Is the limited sensitivity actually a problem in this kind of use? Or is it "good enough" to use for this? With 10x probe that sensitivity should show driving pulses well enough, but will small artefacts like ringing and overshoots be visible well?

I see Hantek 2D72/2D72 as another option for this, but bigger screen of 1013D seems like a nice feature. I do not think touch screen or buttons would make a big difference to me.

Are there any realistic options to cheaply build an active probe that could eliminate this sensitivity problem, for lower frequencies at least?

I haven't had to deal with scopes since my old analog one died several years ago, and I can not decide which of the current DSO's to buy. I have never handled a DSO. Cheap handheld scope might be the one to use while I'm thinking about spending bigger money.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on March 12, 2021, 10:44:24 am
Quote
I see Hantek 2D72/2D72 as another option for this ...
You could also take a look at the Owon HDS200 series with a 3.5" screen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: KPL on March 12, 2021, 11:51:14 am
Quote
I see Hantek 2D72/2D72 as another option for this ...
You could also take a look at the Owon HDS200 series with a 3.5" screen.
Yes, I have noticed those as well, but looks like those are just the same as mentioned Hantek's?
I still have not seen a proper review, is there any?

Then, I am kind of not interested in those multimeter-related functions, so would like to pay for more scope-related ones instead.
Sure, one can't have enough multimeters...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on March 12, 2021, 11:57:58 am
Are there any realistic options to cheaply build an active probe that could eliminate this sensitivity problem, for lower frequencies at least?

Yes, a simple op-amp will do it.

I don't know your exact needs but start here: https://www.aliexpress.com/wholesale?catId=502&SearchText=signal%20amplifier (https://www.aliexpress.com/wholesale?catId=502&SearchText=signal%20amplifier)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 12, 2021, 01:23:03 pm
I started with re-engineering the schematic, and by the looks of it the 8 pin ic might be an i2c eeprom. Since pin 7 is left floating (as well as pins 1, 2 and 3) it does not appear to be a 24LC04 since they need pin 7 (WP) tied either high or low. On semiconductor devices on the other hand allow for these pins to be floating. There is the N24C64 for instance, but probing the bus will need to be done to see if that is right.

Is going to be quite a bit of work, but as an retired engineer I have time on my hands :)
Title: FNIRSI-1013D "100MHz" tablet oscilloscope .wav files
Post by: wavoigt on March 12, 2021, 01:42:19 pm

Load, View, Analyze FNIRSI 1013D .wav files in Excel with VBA:
https://github.com/wavoigt/FNIRSI-1013D-WAV-Viewer-in-Excel-VBA

Credits @btidey
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 12, 2021, 03:23:39 pm
I started with re-engineering the schematic, and by the looks of it the 8 pin ic might be an i2c eeprom. Since pin 7 is left floating (as well as pins 1, 2 and 3) it does not appear to be a 24LC04 since they need pin 7 (WP) tied either high or low. On semiconductor devices on the other hand allow for these pins to be floating. There is the N24C64 for instance, but probing the bus will need to be done to see if that is right.

Is going to be quite a bit of work, but as an retired engineer I have time on my hands :)

Are you talking about this?
https://ibb.co/mG7R6R8
https://ibb.co/R475387

this is 25q80dvnig
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 12, 2021, 03:32:36 pm
No that is the one that holds the fpga configuration. There is another chip nearer to the fpga just below the 50MHz oscillator. (In the attached picture above the osc) It has two connections to the fpga and is also routed to the 4 pin not mounted connector near the winbond chip you pointed out.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 12, 2021, 03:46:39 pm
No that is the one that holds the fpga configuration. There is another chip nearer to the fpga just below the 50MHz oscillator. (In the attached picture above the osc) It has two connections to the fpga and is also routed to the 4 pin not mounted connector near the winbond chip you pointed out.
I understand. I didn't see her because of the matrix cable  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 12, 2021, 04:34:20 pm
I understand. I didn't see her because of the matrix cable  :)

Is yours also unmarked? (Same as the fpga and the adc's)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 12, 2021, 05:11:09 pm
I understand. I didn't see her because of the matrix cable  :)

Is yours also unmarked? (Same as the fpga and the adc's)
Yes, i have a chip unmarked too  >:(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on March 18, 2021, 06:29:11 pm
Hi to everyone !  :) I am back. I was waiting for another touch screen. The same I,ve bought before. As I described this touch screen was working correct till I tried to be back to my previous memory content.
Unfortunately the new touch screen came broken !!! Poor packing. To buy next ? Never !!! I decided to resolder the GT911 from the (new) broken screen to the one I,ve bought before. Operation was successful !!! And the most important - the touch screen again started to work properly !!!
Conclusion. When programming flash memory with ISP something is sending to GT911 and causing something wrong with it. I am fool about it but I will not continue any experiment....  any more !!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on March 19, 2021, 12:54:07 pm
Summarizing my previous actions. Whoever have problem witch touch screen.
The touch screen type ( https://www.aliexpress.com/item/33042057555.html?spm=a2g0s.9042311.0.0.6af64c4dZopY9k (https://www.aliexpress.com/item/33042057555.html?spm=a2g0s.9042311.0.0.6af64c4dZopY9k) ) works correctly with the  W25Q16 flash memory file (old type oscilloscope file). When programming flash memory with ISP the new touch screen must not to be connect (or do it with the old touch screen). I am not sure if the touch screen works with the original W25Q32 memory... maybe yes but when I tried to flash the memory with my original W25Q32 content (with the new touch screen connected to the device) I faild. I dont want to check it.
I think the simplest way is to connect the new touch screen (the link above) and check if it works. When not it will be necessary to change the flash memory with W25Q16 file but never do it with (new) touch screen connectet do the device !!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 22, 2021, 06:42:53 am
Hi Eljot, bold move, de-soldering and soldering on a flex pcb. What did you use? A hot air gun to get the job done or a soldering iron?
Still a strange story with the GT911. Just to be sure, you are now using the old firmware? (W25Q16 variant you downloaded from this forum)
How did you do the programming of the flash? With the device on or off? (or even with the battery disconnected?) Which programming software did you use?

Been away on family business, so not much progress on the reverse engineering yet.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on March 22, 2021, 08:49:04 am
Hi  :)
I've resolder the GT911 with hot air. I mean that I've removed GT 911 with hot air and then I soledered it with iron. I was very nervous but I can manage. I programmed flash memory with ISP. It is necessarily to power the main board. I think it is  possible to power the GT911 with the programmer but it is synonymous to power the whole main board. I programmed flash memory with ISP CH341A program and with the old touch screen (tat one I've spoiled) on board so I did not care if something went wrong with the screen. After reprograming I put the new touch screen and it startet to work properly. I used the W25Q16 from that forum. But I must emphasize that I dont know if the touch screen will not work with its native W25Q32 flash just because when I startet to solve the problem with the touch screen malfunction I startet with reprogramming the flash memory. Than when I tried to came back to native memory content I had problem. Jut because I reprogrammed the memory with ISP and the new touch screen connected to main board. Maybe nothing would happen if I had the new touch screen unconnected from the main board. I did not want to check it because I was afraid of buing next touch screen (the third time) :). So I am not sure If the touch screen I"ve bought works with W25Q32 memory or not. For sure it works with W25Q16 file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 22, 2021, 09:49:31 am
Hi Eljot,
I can imagine you were nervous, because it is small and fragile. From my observation of what I got so far of the schematics the device does not need to be powered on for flashing when power is applied to the flash itself. There is a diode in the VCC path of the flash. This might give problems with parasitic power from the clock and data lines, but that depends on the protection system in the F1C100s chip.

The cables I ordered for connecting the touch screen via a breakout board arrived, so later this week I'm going to monitor the I2C data being send to the touch screen. As said it is now a hobby project and might lead to open source scope software. It is in line with interests I have. ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on March 22, 2021, 04:26:01 pm
Hi, I will be wating for Your new experiences  ^-^ Hope for improvements. I am glad that my oscilloscope starts to work !!! I also hope that You will manage with Yours.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 23, 2021, 03:08:28 pm
It is quite a puzzle, but the first part is almost there. The FPGA with the ADC's. Not sure about the capacitors (just used 1nF for all of them for now) because there are no markings and measuring in circuit is a bit tricky. Also the ferrites are a guess. Still a lot to do.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 23, 2021, 05:19:21 pm
The front end looks a little bit different compared to the old one. I removed the tin cans to be able to further reverse engineer the schematic.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 23, 2021, 07:32:25 pm
In the front end there is a 5 pin smd (sot23-5) with markings 8751 2023. In the old one the marking is OAAI which probably is an OPA356 operational amplifier. Anyone an idea if it is the same ic?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on March 24, 2021, 03:21:44 am
As said it is now a hobby project and might lead to open source scope software. It is in line with interests I have. ;D

I tried to boot Linux on the F1C100S but I couldn't get any display (and yes, the backlight was on). Without a UART port it's quite hard to know what was going wrong...

I'd like to know what protocol are they using to talk between the F1C100S and FPGA, just so that we don't have to reimplement everything from scratch at the beginning.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on March 24, 2021, 04:25:38 am
In the front end there is a 5 pin smd (sot23-5) with markings 8751 2023. In the old one the marking is OAAI which probably is an OPA356 operational amplifier. Anyone an idea if it is the same ic?
OAAI is OPA356 (https://www.ti.com/lit/ds/sbos212a/sbos212a.pdf)
8751 is RS8751XF (https://datasheet.lcsc.com/szlcsc/2010160333_Jiangsu-RUNIC-Tech-RS8754XQ_C236993.pdf)

I'm more interested in whether the original libraries/SDK of F1C100s can be found.
I started to restore the original code, but after a while I gave up.
It takes a lot of time to restore the library code. In the absence of complete documentation.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 24, 2021, 05:56:22 am
For sure it will be quite a task to get down to the last bit. If the ones that already did some research in the code are willing to share what they have so far it would help.

I'm a bit new to the disassembly and hacking game, so first have to get used to the tools.

The first step of getting to know the hardware is probably child's play compared to getting to know the software 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 25, 2021, 12:34:13 pm
Filled in the processor part. Can anyone verify the LCD connection. Tried to find pinouts on the net but failed. The display has a barcode on the back with "HT070QB-27W2012HZ". It looks like a 565 RGB setup with sync and clock.
The connection to the FPGA is made with 11 port pins (PE0~PE10), so maybe 8 data and 3 control lines.
Capacitors are still undetermined and just set to 1nF.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: UniSoft on March 25, 2021, 02:21:31 pm
Can anyone verify the LCD connection. Tried to find pinouts on the net but failed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 25, 2021, 06:04:46 pm
Power supply also done so leaves the analog input. Was able to determine the values of some capacitors and figured that the ones with the same size most likely have the same value ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 26, 2021, 12:42:40 pm
Schematics are done. No idea if the analog makes any sense. I have never been very good with analog stuff.  :bullshit: More a digital and programming guy :D

Next up is taking a look at what is being communicated with the touch screen and the eeprom.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 27, 2021, 06:59:48 am
I'm looking for a 7 inch lcd for a lichee nano to do development for the scope but find it hard to obtain specifications of displays offered on aliexpress.
I asked the seller of this one (https://nl.aliexpress.com/item/32691414835.html) for a datasheet, but they don't have it |O
Searching on google does not render much info either.
I think it is a 50pin and might be the same as what is in the FNIRSI-1013D. If so I only need to make a converter from 50pin to 40pin.

Anyone any suggestions or a pointer to a cheap 40pin 7 inch 800x480 lcd compatible with the lichee nano. Preferably on aliexpress.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 28, 2021, 07:36:14 am
Hi, I received two touchscreens from different sellers:
1.https://aliexpress.ru/item/33003864443.html?spm=a2g0s.12269583.0.0.728a4b88KF5Hr5 (https://aliexpress.ru/item/33003864443.html?spm=a2g0s.12269583.0.0.728a4b88KF5Hr5)
2.https://aliexpress.ru/item/33042057555.html?spm=a2g0s.12269583.0.0.219c4940cF1t1D&sku_id=67429988410 (https://aliexpress.ru/item/33042057555.html?spm=a2g0s.12269583.0.0.219c4940cF1t1D&sku_id=67429988410)
Both have the GT9157 chip. The first one works great! But the second one does not work at all. What do you think will work if i resolder the chip from the first to the touchscreen of the oscilloscope? Or is it better to change the entire touchscreen at once?

The first photo is the first touchscreen

Others - photo of the second

Added a comparison photo, on the left is the first touchscreen, on the right is the touchscreen of the oscilloscope

P.S. The right edge of the touchscreen is not working on my oscilloscope
https://www.youtube.com/watch?v=svarajdeEvA (https://www.youtube.com/watch?v=svarajdeEvA)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 28, 2021, 11:52:45 am
Hi dmitrkov,
it is most likely that the defect in your original touch screen is not in the chip but in the sensor (the glass plate with the electrodes on it) which will not be solved by exchanging the chips. (I might be wrong of course)

Based on your video, one of the tx lines is down. The resolution of the touch screen used here is not that big. Only 16 TX lines and 10 RX lines, so one scan line makes up a whole section of the screen and in your case the buttons on the right.

The one with the HY007 marking looks the same as what I received. It works with inverted coordinates, which is what I'm trying to fix by looking into the hard and software.

Does yours show the same reversal of the coordinates when you connect it to the scope?

The other one looks like it uses more scan lines which might not work properly on the scope. The connection to the glass plate seems to have more traces connected. You can confirm this by looking at the sides of the panel and count how many sections there are. In my picture the gray bar's behind the double sided (black) tape. There are 16 on my sensor for the horizontal and 10 for the vertical axis.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on March 28, 2021, 01:12:47 pm
Does yours show the same reversal of the coordinates when you connect it to the scope?
No. The touchscreen I received is doing fine with the coordinate system. Works correctly.

I read that the chip contains the calibration data of the glass. So I think it makes no sense to re-solder the chip ... I'm waiting for a string from China to separate the glass (https://aliexpress.ru/item/1005001476505787.html?spm=a2g0s.12269583.0.0.901fbdd6O044bZ). I will try to replace the touchscreen entirely
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 28, 2021, 03:56:10 pm
Strange. I wonder where this difference resides. Will know more when I capture the i2c communication. Already measured on it with a rigol mso5000 and saw it works at around 40KHz. They use bit banging in software, because there is no TWI (I2C) interface on the mcu pins where the touch panel is connected. They also do not work with the interrupt the panel generates. It is a polling system by reading the GT911 0x814E register. (Might be that an earlier version worked with a resistive touch panel since that is what the mcu pins are intended for, even though the mcu has three twi interfaces and external interrupt pins they could have used)

Basically you are lucky it works as is. And good tip about the cutting wire. Too late for me, but may be others can use it for needed repairs. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on March 29, 2021, 12:54:00 am
I'm looking for a 7 inch lcd for a lichee nano to do development for the scope but find it hard to obtain specifications of displays offered on aliexpress.
I asked the seller of this one (https://nl.aliexpress.com/item/32691414835.html) for a datasheet, but they don't have it |O
Searching on google does not render much info either.
I think it is a 50pin and might be the same as what is in the FNIRSI-1013D. If so I only need to make a converter from 50pin to 40pin.

Anyone any suggestions or a pointer to a cheap 40pin 7 inch 800x480 lcd compatible with the lichee nano. Preferably on aliexpress.

Any 800x480 RGB lcd should be compatible, only timing will change!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 29, 2021, 06:44:23 am
Any 800x480 RGB lcd should be compatible, only timing will change!

The problem is that I think this is not the case. LCD's can have a parallel ttl/cmos interface or one or more serial lvds interface(s). For the lichee nano it needs to be parallel. It is hard to find specifications on the net :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Melman on March 30, 2021, 12:14:07 am
How does this scope compare to the miniware DS203/213? Looking for a cheap scope that realistically will only get used a few times a year and can't justify spending $$$ on something nicer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 30, 2021, 06:01:05 am
Al depends on your requirements. The FNIRSI-1013D has a AD9288 per channel so 200Msps and ~30MHz bandwidth. It lacks the signal generator though. The size factor is much nicer in my opinion. The 7 inch display is easy to read. I don't have a DS203 or DS213, but reading the specs and comparing the price made me buy the FNIRSI,  not long after I bought a jyetech wave 2 :(

Unfortunately mine arrived with a defect in the touch screen, as you can read in this thread |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 02, 2021, 10:36:21 am
Probably already tried by others, but just to share the information, it is possible to boot the scope into FEL mode (programmable via usb) by inserting a SD card with a special image on it. See: https://linux-sunxi.org/FEL#Entering_FEL_mode for more info. The scope then lists itself in linux (lsusb) as "ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode"

Here is the bit about this specific procedure:
Through a special SD card image, included in our sunxi-tools repository, there is a small SD CARD boot image that does nothing more than jump to FEL.
Just install it on a sd card as you would with the u-boot SPL (be sure to change /dev/sdX to where your sd card is):
  wget https://github.com/linux-sunxi/sunxi-tools/raw/master/bin/fel-sdboot.sunxi
  dd if=fel-sdboot.sunxi of=/dev/sdX bs=1024 seek=8

So it should be possible to load a linux image on a SD card and boot it from there. The question is what is done on uart0. It is connected to the FPGA. I connected my MSO5074 to it and the signals do not look like serial communication. With the go to FEL SD card in it there is no signal at all. So the linux image should not have a tty connected to any of the uarts on the F1C100s. Maybe it is possible to use the usb interface for this purpose.


So the story continues
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 03, 2021, 07:45:50 pm
Started with analyzing the I2C from the touch panel. Made a breakout board for it with headers for a bluepill STM32F103C8 and ffc/fpc 0.5mm 6 pin conversion boards. This way it is easy to connect to the signals with either or both the STM and a scope.

At startup a blob of data is being written to the panel and after that it starts polling the panel to see if there is touch. Unfortunately I see errors in the communication where it looks like the SCL is being pulsed more than it should. Have to hook the scope up again to see what is actually going on.

Need to analyze the data being send to see what it is doing. It starts at address 0x8047 (config version) and writes a lot of bytes. Most are acknowledged by the panel, but some are nacked.
After I analyzed the data I will post the results here.

Also monitored the INT and RST lines to see what is happening there, because the device address can be set with these lines. What they do is not so nice. At the startup of the scope the RST line is set high and then the INT line is toggled with a 13ms/200us pulse width ratio for quite some time.

Have to search the disassembly files I made with Ghidra to see if I can find where port A is being controlled.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 03, 2021, 08:30:38 pm
Started with analyzing the I2C from the touch panel. Made a breakout board for it with headers for a bluepill STM32F103C8 and ffc/fpc 0.5mm 6 pin conversion boards. This way it is easy to connect to the signals with either or both the STM and a scope.

At startup a blob of data is being written to the panel and after that it starts polling the panel to see if there is touch. Unfortunately I see errors in the communication where it looks like the SCL is being pulsed more than it should. Have to hook the scope up again to see what is actually going on.

Need to analyze the data being send to see what it is doing. It starts at address 0x8047 (config version) and writes a lot of bytes. Most are acknowledged by the panel, but some are nacked.
After I analyzed the data I will post the results here.

Also monitored the INT and RST lines to see what is happening there, because the device address can be set with these lines. What they do is not so nice. At the startup of the scope the RST line is set high and then the INT line is toggled with a 13ms/200us pulse width ratio for quite some time.

Have to search the disassembly files I made with Ghidra to see if I can find where port A is being controlled.

Don't worry about the touch panel I2C, the datasheet is available and I've written a driver for Goodix before (for a phone actually), it's pretty easy to use!

I think we should move our attention to the FPGA protocol since that's what controls the LCD backlight and everything else :)

PD: It's possible that they messed up the I2C implementation, since they're not using the peripheral but bit-banged it instead!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DaneLaw on April 03, 2021, 10:26:34 pm
How does this scope compare to the miniware DS203/213? Looking for a cheap scope that realistically will only get used a few times a year and can't justify spending $$$ on something nicer.

Don't have either Fnirsi1013 or DS203/213, though do have the Miniware scope, but the lesser DS212 (70US) and would not recommend these small Miniware DS200 series-scopes, unless you'r dead set on its main features, like very nice build-quality and extremely small form factor that wihtout probes can be in your jacket or backpocket and looks like a modern mobile.
The biggest con in my view on the MiniWare DS200series is handling the interface' and the lack of touch, and you need to rely on these clickable rollers, which for me became a pain in the azz.

Sure the Miniware DS scopes is better than the old and extremely small Fnirsi DSO188 here in the picture below beside the MiniwareDS212, but that doesn't say a lot as DSO188 is more proof of concept 30g 1.8" 5x3x1cm.  (FnirsiDSO188 also been rebranded as Daniu DSO188  great brief textreview¨of that model)
https://lygte-info.dk/review/Equipment%20Oscilloscope%20DANIU%20DSO188%20UK.html (https://lygte-info.dk/review/Equipment%20Oscilloscope%20DANIU%20DSO188%20UK.html)

https://i.imgur.com/lJ1Y3LW.jpg (https://i.imgur.com/lJ1Y3LW.jpg)
.
DS203/210 or the Fnirsi1013D I would definately choose the Fnirsi1013D from what I have seen in this thread..the Miniware DS200series is great as secondary if you just need a small scope a secondary option that is very compact and can be in your back pocket.

There is also another new 7" touch scope model that has just been released with incl. 30MHz signal generator, I wrote about its spec here, it from the brand JINHAN who likely is most known for their rugged JDS-series handheld scope-line.. the new 7" touchscope' starts around 130USD but the 100MHz/1GSas is above 170US

https://www.eevblog.com/forum/testgear/new-2ch-handheld-touch-oscilloscope-from-jinhan-(smto502s)-with-1ch-signal-gen/msg3532694/#msg3532694 (https://www.eevblog.com/forum/testgear/new-2ch-handheld-touch-oscilloscope-from-jinhan-(smto502s)-with-1ch-signal-gen/msg3532694/#msg3532694)

SMTO502S  60MHz 250MSas + 1ch. signal generator. 135USD.  (incl, EU VAT)
SMTO1002 100MHz 1GSas  175USD (excl. VAT)
SMTO1002S 100MHz 1GSas + 1ch. signal generator. 205USD (Excl. VAT)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 04, 2021, 05:54:11 am
I think we should move our attention to the FPGA protocol since that's what controls the LCD backlight and everything else :)

For sure, that is an important step in making new open source software for the scope, but for now I'm looking for a quick fix of my reversed coordinates problem. Hope that it can be fixed by patching a single byte in the code.

Getting the FPGA interface is more difficult since it needs to be done through reversing the software. It is rather a pain in the bum to attach a logic analyzer to the 11 interface pins. For me soldering wires to the pins is not a real option anymore. Pins are very small and aging f... ups the eyesight. Even with a microscope it is more a young mans game :palm:
Leaves getting an adapter like these spring ones to connect to sop ic's, but these are expensive and harder to find for 144pin lqfp or 88 qfn

Another option is reverse engineering the bit stream. I was able to find several bits of code for doing such a thing but not for this specific fpga (cyclone iv). There is a claim that it is done, but the software for it is not made public. To my understanding the bit stream is not encrypted, but still quite the job to get it done.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 04, 2021, 04:03:00 pm
I now know why they using 10K pullups and added a capacitor across the SCL and SDA line. At some moments there is a large spike in the clock and data signal. It is very narrow and hard to see in the pictures, but they are there. The first picture is without the capacitor. The second is with added 2K2 pullup resistors. (RigolDS0.png) There it is much larger. In the third picture the capacitor is re soldered and the extra pullups removed. The spike is still there but not that big. I2C interfaces will probably filter these out with the builtin analog filters.

Still a crappy design trying to save one capacitor. They should have used one per line connected to ground. Better yet they should have used a build in TWI (I2C) of the MCU. Would also have allowed for UART1 to be used for terminal connection. (Iscle this might be an option for you. Disconnect the touch panel and connect your usb to serial adapter to the scl and sda pins. RX (mcu TX) on SCL, pin 6 and TX (mcu RX) on SDA, pin 5. This way you are not bound by the FPGA messing up UART0)

Without the capacitor the new touch panel does not respond, so it does help.

Adding more capacitance in a per line fashion does not solve the reversal problem, so it is not due to miscommunication. In the text file is the capture of the configuration data send to the panel. It starts writing on register address 0x8047 and sends 186 bytes. (S is start, A is ACK, N is NACK and P is stop)

According to the programming manual of the GT911 it sets the "Y2Y, X2X, Strech_rank 3, X2Y ,Software Noise Reduction, Falling Edge INT" in register 0x804D (Module_Switch1). So if it is possible to change this byte it sends it should be possible to reverse the coordinates of the panel.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 08, 2021, 09:33:08 am
Did several steps in the hacking process the last couple of day's. Used Ghidra to disassemble the code. Thanks to tv84 for pointing out the block structure in the flash image. Made separate binary files for the different parts and analyzed them in Ghidra. The ARM version is actually v5t little instead of v4t which was pointed out  earlier in the thread. The BLX instruction is used, which does not exist in v4t.

ARM assembly is new to me so the process is slow, but I'm working my way through the second program loader, since it already does some communication with the fpga in that part of the code.

Based on a quick scan of the code, I got the idea that for the touch panel the software it is getting settings from what I thought to be an I2C EEPROM, but it turns out it is not. Tried reading it with a CH341 programmer, but it does not respond to the slave address. It is an I2C ic, but it only responds to the slave address 0 which is the general call address. Monitored the signals with my MSO5074 and noticed it is running at ~800KHz. It does read and write sessions with the ic on address 0, and always in groups of 8 bytes on the bus (including the slave address). So the question is what is this ic? Is it a micro controller or some special storage ic?

Monitored a couple of read write actions with the following results: (All bytes are listed, first being the slave address)
write: 0x00 0x23 0x3C 0xD2 0x40 0xBF 0x45 0xFF
read: 0x01 0x68 0xCD 0x52 0xFE 0x01 0x91 0x58
write: 0x00 0xEC 0xA7 0x36 0xFE 0x01 0x0E 0x96

A read directly after startup of the scope: 0x01 0xEC 0xF5 0xAF 0x9B 0x9B 0x75 0x55
But a second time after startup the bytes were shifted: 0x01 0xF5 0xAF 0x9B 0x9B 0x75 0x55 0x01

After the write session a stop is send. The read session is terminated by a NACK of the host. No stop and a repeated start for the next write session.

Attached is a zip with a csv file from the MSO containing the two signals shown in the picture.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 08, 2021, 06:14:53 pm
Hello, I have results on disassembling firmware 1013d. You can reach me in telegram, find me there https://t.me/ser_8989
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 08, 2021, 07:01:38 pm
I don't have a telegram account. What do you have for us? Does it look like attached file below?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 08, 2021, 09:12:13 pm
There are addresses in the firmware dump of the values written in the registers of the gt910.
The thing is that the data structure itself has an incomprehensible structure, because part of the values of one structure is used in the other one.
Do you have any experience in calculating the data address used by the function writing values to the gt910 registers. There are 4 candidate functions(1da04, 1da8c, 2b96c, 4d164 In file FSI-1013en.bin) exchanging with gt910.
I made a primitive sketch for the arduino and read the configuration of the gt910.
0x804D register has no effect.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 08, 2021, 09:36:58 pm
The most important thing is that the touchscreen mirrors from the fact that the non-original touchscreen is gt915, and in registers 0x80B7 to 0x80C4(Sensor_CH0 to Sensor_CH13, Channel number on chip corresponding to ITO Sensor) and 0x80D5 to 0x80EE(Driver_CH0 to Driver_CH25, Channel number on chip corresponding to ITO Driver ) must be written upside down byte sequences. Original sequences
0x14,0x12,0x10,0x0E,0x0C,0x0A,0x08,0x06,0x04,0x02(0x80B7 to 0x80C4)
0x28,0x26,0x24,0x22,0x21,0x20,0x1F,0x1E,0x1D,0x0C,0x0A,0x08,0x06,0x04,0x02,0x00(0x80D5 to 0x80EE). That is, 0x80B7 to 0x80C4 should be written to 0x02, 0x04, 0x06, and so on. But at startup English version of the firmware will overwrite gt915 with wrong config and the touchscreen will mirror, but Chinese version doesn't overwrite gt915 and the touchscreen works fine.
I apologize for the bad English I wrote through the translator.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 09, 2021, 05:54:32 am
I came to a similar conclusion, but it turns out that the program I used to search the binary is not working properly on my linux mint version. wxHexEditor. Yesterday I tried searching for eGON as text, but it did not find it, while it is right there in the first page of bytes on the screen |O. So decided that I would write my own binary search program today to search for the config strings.

So thanks ser8989, you saved me some work.

There are many things that need to be done for getting to the bottom of this scope and trying to get linux to run. Found two promising buildroot setups for the lichee nano, which uses the same MCU. Started building one yesterday, but it was not finished when I turned in for the night so, need to start it again today and see what it does. Then need to switch the uart to 1 and check if it will work on the scope.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 09, 2021, 10:43:48 am
Unfortunately the LCD I bought on aliexpress (https://nl.aliexpress.com/item/32691414835.html?spm=a2g0s.9042311.0.0.27424c4dNyDqyg) does not work with the FNIRSI-1013D. The pinout looks the same and it did not wreck the scope, but when connected on power up it shows white fading and stabilizes in a blue bar on the right side of the display. So timing problem? or incorrect voltages on some of the power pins?

One of the buildroot configs I found did compile and works on the Lichee nano, but I was not able to change the default uart from 0 to 1 yet. Needs more reseach on how to do that :palm: The struggle continues :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 09, 2021, 01:01:01 pm
Took quite a bit of searching through the .dts and .dtsi files and there meanings to get something done. Also a change to one of these files leads to having to rebuild the whole bunch, so a day goes by quickly. On the lichee nano the kernel now uses uart1 as its default ttyS0 and uart0 is disabled. Unfortunately this does not affect u-boot. This part still uses uart0. Have to test this build on the scope to see what happens.

If it works on the scope I will post the steps I took to get it done.

It works :-DD, but too bad the display does not. The back-light did not turn on. At least linux is running. I can login (root/root) do cd.. and ls to see the directory list.

What I did:
I setup a virtualbox with linux mint 20.
Followed the instruction here: "https://hackaday.io/project/171402/instructions"  down to building the sunxi tools. (Used  sunxi-fel version to see what the scope returned)
After that I used the instructions here: "https://www.thirtythreeforty.net/posts/2020/01/mastering-embedded-linux-part-3-buildroot/"  to setup buildroot (used the latest date 2021.2) and tested it with the raspberry pi config
Then I followed te instructions here: "https://unframework.com/2020/05/27/setting-up-embedded-linux-on-lichee-pi-nano/" to build the linux with uart0 for the lichee nano
Had to resolve some errors due to missing packages. "sudo apt-get install swig python-dev libssl-dev" Also needed to change the defconfig to overcome legacy options.
Then to get uart1 in the picture I had to make modifications to some .dts and .dtsi files. The latter is found in several places and concerns these suniv-f1c100s.dtsi or suniv.dtsi. Not sure editing which did the trick.

I moved the files from unframework into the buildroot directory and modified them to work from there.

In the zip are the files I changed.
Place the board/licheepi_nano directory in the buildroot board directory (only the licheepi_nano directory ofcoarse)
Place the configs/licheepi_nano_defconfig in the buildroot configs directory (only the file)
Search for the other two files and replace them everywhere you find them. ( suniv-f1c100s.dtsi of suniv.dtsi)

Type in terminal in buildroot directory
make licheepi_nano_defconfig
make

This will make the needed image for the sd card.

With "sudo dd if=~/buildroot/output/images/sdcard.img of=/dev/sdb" I wrote it to my card and placed it in the scope.

Used a breakout board to connect the usb serial and putty on the linux mint machine et voila.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 09, 2021, 05:16:04 pm
There are 4 candidate functions(1da04, 1da8c, 2b96c, 4d164 In file FSI-1013en.bin) exchanging with gt910.

Hi ser8989, the problem is that I'm working with the code of the new version. I did find the byte string in the code, but the addresses you mentioned do not lead to anything there.

I'm now looking at code that makes use of the port A address 0x01C20800 (config) and  0x01C20810 (data). The first one is found 12 times in the 2nd executable part. The second one is not found but indexing is used to get to that address. As I'm in the process of learning ARM assembly it is not the easiest task. Look at the code, look at the reference manual for the instruction, try to work out what the code does, etc.

I tried to attach the Ghidra result for this part of the code, but even zipped it is just to big for the forum. 121.2MB plain text and 5.1MB zipped. I will put it in github. Will update this post when it is done.

Made a repository for it: "https://github.com/pecostm32/FNIRSI-1013D-Hack"

Needed to zip the file, because github has a limit of 25MB >:(

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 09, 2021, 10:23:39 pm
On the lichee nano the kernel now uses uart1 as its default ttyS0 and uart0 is disabled.

Holy sh*t, this is why I wasn't getting any UART output after U-boot then! Okay, I can try to get the LCD working, I'm sure the only issue is the timings, and fortunately the LCD which comes with the oscilloscope is already suported by mainstream Linux :)

Thanks for the mini guide, I'll try to follow it and report back.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 10, 2021, 03:16:49 am
I've been trying but for some reason I can't get it to boot... Not even the U-Boot uart works now... Strange

If you could share your image it would be nice :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 10, 2021, 07:29:11 am
I have added a linux directory in the github repository with the images output of the buildroot build. Also added the files I changed and the instructions in a readme.txt file.

In the image directory I added a "readme.txt" and "location of uart1 connections.jpg" file.

Will try to change u-boot to use uart1 today and if it works I will upload the image and changed files to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack)

Next step would be to move the communications to the USB port like thirtythreeforty did in his business-card, and disable all the uarts.
Might be a good idea to create a new board config for the scope with these options.
u-boot probably needs additional changes to handle initial communication with the fpga, but that still requires a lot of research.

My problem with the back-light not being on is a bit tricky to initially solve in the hardware. The fpga pin is directly connected to the enable pin of the back-light power converter. It is pulled low by a resistor and needs to be high to enable the converter. There is a risk of damaging the fpga when this pin is pulled high by connecting it to the 3,3V rail.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 10, 2021, 10:22:48 am
Tried to change uboot to use uart1 instead of uart0. Unfortunately it did not work. I found that the same type of .dts setup is used for uboot and also learned that buildroot on clean removes al the files and when it builds again the linux and uboot files are extracted from the tar.gz files and not copied from the /git directory, so needed to make the changes in the archives to get buildroot to use the changes :(

But after compiling and putting the image on a sd card the lichee nano did not start :-// Reconnected uart0 to the usb serial adapter (only have one 3.3v type yet, so no monitoring both ports at the same time) and noticed uboot still outputs some initial data there.

U-Boot SPL 2018.01 (Apr 10 2021 - 11:45:10)
DRAM: 32 MiB
Trying to boot from MMC1

After that nothing happens on either port.

So need to do more research to get that resolved :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 10, 2021, 03:40:30 pm
I have added a linux directory in the github repository with the images output of the buildroot build. Also added the files I changed and the instructions in a readme.txt file.

In the image directory I added a "readme.txt" and "location of uart1 connections.jpg" file.

Will try to change u-boot to use uart1 today and if it works I will upload the image and changed files to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack)

Next step would be to move the communications to the USB port like thirtythreeforty did in his business-card, and disable all the uarts.
Might be a good idea to create a new board config for the scope with these options.
u-boot probably needs additional changes to handle initial communication with the fpga, but that still requires a lot of research.

My problem with the back-light not being on is a bit tricky to initially solve in the hardware. The fpga pin is directly connected to the enable pin of the back-light power converter. It is pulled low by a resistor and needs to be high to enable the converter. There is a risk of damaging the fpga when this pin is pulled high by connecting it to the 3,3V rail.

Just tried it again with the sdcard.img you uploaded to github, and still no uart on any of the ports (tried uart0 and uart1)... Weird... However, by removing the sd card the oscilloscope boots normally, so it's not broken.

I also tried flashing the card with Win32DiskImager and with dd from Linux, same result. Very strange.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 10, 2021, 05:29:56 pm
As I'm walking multiple paths in getting to the bottom of the scope I added some new stuff to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering/Analysis)

I'm dissecting the listings into smaller parts and try to make some flow analysis of where the different ports are being controlled. In the 2nd executable I'm looking for interaction with 0x01C20800 which is the address of port A, which is used for handling the touch screen.

In the SPL I'm looking for interaction with 0x01C2086C (port D, display) and 0x01C20890 (port E, FPGA). Also found that 0x01C25000 (UART0) is being used, so maybe it is used to control the FPGA.

I'm fairly certain that FUN_00017D8 is a set pin ctrl function. It is called many times with the port config register addresses.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 10, 2021, 05:38:18 pm
Just tried it again with the sdcard.img you uploaded to github, and still no uart on any of the ports (tried uart0 and uart1)... Weird... However, by removing the sd card the oscilloscope boots normally, so it's not broken.

I also tried flashing the card with Win32DiskImager and with dd from Linux, same result. Very strange.

Indeed strange. I used a small (128MB) micro sd card, and within the scope it boots to linux without problems. When I insert the sd card in my card reader connected to my linux computer it opens two partitions, showing the boot image and the root file system.

Which version of the scope do you have? The one with the 16Mbit flash or the one with the 32Mbit flash?

I can also mount the image file on my linux mint system with the same result. Two partitions. See picture.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 10, 2021, 06:16:36 pm
Just tried it again with the sdcard.img you uploaded to github, and still no uart on any of the ports (tried uart0 and uart1)... Weird... However, by removing the sd card the oscilloscope boots normally, so it's not broken.

I also tried flashing the card with Win32DiskImager and with dd from Linux, same result. Very strange.

Indeed strange. I used a small (128MB) micro sd card, and within the scope it boots to linux without problems. When I insert the sd card in my card reader connected to my linux computer it opens two partitions, showing the boot image and the root file system.

Which version of the scope do you have? The one with the 16Mbit flash or the one with the 32Mbit flash?

I can also mount the image file on my linux mint system with the same result. Two partitions. See picture.

Yep I can mount the partitions too on Ubuntu. I tried using a 2GB SD card which booted U-Boot at one point in time, and also the one that came with the scope which is 1GB. Neither of them output anything to UART1.

I have the old version of the scope, with 16Mb flash.

I'm running out of ideas on what could be happening :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 10, 2021, 07:36:00 pm
Could there be such a difference between the two versions that it is causing this to happen? I think eljot was able to run his new version with the old 16Mbit firmware so no problem there.

Do you have some pointers on where to look for getting u-boot changed completely to uart1? Besides from the devicetree stuff, because that is what I changed and I can verify by looking at the generated dtb file for the boot section.

I have no idea of how the whole linux system sticks together. As said before it is al new to me.

Do you have another scope to do measurements on the signals?

There is one thing I noticed on the lichee nano with the image. Have to test it again tomorrow, but with the usb to serial adapter connected to uart1 (port a) it did not start into linux directly. After connecting to uart0 and rebooting I got the uboot sequence output and then I could connect to uart1 to get the linux prompt (actualy the password prompt), but not the linux startup messages.
In the scope on the other hand I do see the linux startup messages on uart1 and it runs to the login as prompt. It takes a bit of time before it spits out messages, which I have to measure to see how long it actually is.

Will update on this tomorrow

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 10, 2021, 08:03:10 pm
@pcprogrammer, are you doing the analysis in ASM??!?

Why don't you do the analysis in pseudo-C?

Code: [Select]
int sub_800167A0()
{
  sub_8001764C(0x1C20890, 0, 0);
  sub_8001764C(0x1C20890, 1u, 0);
  sub_8001764C(0x1C20890, 2u, 0);
  sub_8001764C(0x1C20890, 3u, 0);
  sub_8001764C(0x1C20890, 4u, 0);
  sub_8001764C(0x1C20890, 5u, 0);
  sub_8001764C(0x1C20890, 6u, 0);
  return sub_8001764C(0x1C20890, 7u, 0);
}

int __fastcall sub_800168FC(unsigned __int8 a1)
{
  unsigned __int8 v1; // r4@1

  v1 = a1;
  sub_8001764C(0x1C20890, 0, 1);
  sub_8001764C(0x1C20890, 1u, 1);
  sub_8001764C(0x1C20890, 2u, 1);
  sub_8001764C(0x1C20890, 3u, 1);
  sub_8001764C(0x1C20890, 4u, 1);
  sub_8001764C(0x1C20890, 5u, 1);
  sub_8001764C(0x1C20890, 6u, 1);
  sub_8001764C(0x1C20890, 7u, 1);
  sub_8001774C(0x1C20890, 9);
  sub_80017738(0x1C20890, 10);
  v1C208A0 = v1 | v1C208A0 & 0xFFFFFF00;
  sub_80017738(0x1C20890, 8);
  return sub_8001774C(0x1C20890, 8);
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 10, 2021, 08:05:39 pm
Interesting.

I do have some linux experience. Maybe the issue you're having with U-boot is that the code to enable UART1 has not been added (port configuration, multiplexer config, etc). I'll take a look and see if I can get it to output on UART1 and work from there. I'm tired of soldering the FPGA pins with wirewrap just to get the U-boot uart :P

I have managed to boot u-boot again, both for your image, my image and a licheepi nano image, but no linux seen at the moment.

We'll manage to do it, I'm sure!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 10, 2021, 08:32:18 pm
Here is the dump of ST 25P16VP... (this is FPGA stream data and connected to dedicated FPGA pins)
I don't think that it is useful for anyone, just let it be for history...
I2C I guess for store settings.
https://mega.nz/file/MGY3FI5b#wURGvOJB9Zb6dqilI2w5TRbJWrP3fHHG5muqNXtb-r4

Below is the output of my crude parser of this FPGA flashing file (just the basic envelope):

Code: [Select]
WARNING: the .RBF file has the bytes bit-reversed!  Reversing...
FPGA - RBF/RPD (Raw Binary File) - Filesize: 16 777 216 bits (00200000 bytes)
00000000 - Start of File  (Type 1)

         [00000048                      00000021]
Bit 7  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 6  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 5  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 4  - 1111111111111111111111111111111111111111       FFFFFFFFFF
Bit 3  - 1111111111111111111111111110111010000000       FFFFFFEE80
Bit 2  - 0000011100110011001011111000000000111111       07332F803F
Bit 1  - 1100000000000111100011000000010111111111       C0078C05FF
Bit 0  - 0000000000010101000100010110110111111111       0015116DFF
Bits 0080 - EPCS/EPCQ ID check: Enabled
Bits 005F - Stream size: 943 711 bits  (0001CCCC bytes)  Compression Bit ON  (+1)       Size NOT OK
Bits 0056 - 0000 0000 : 0x56-0x5D
Bits 004C - Programming Mode: Active Serial (AS x1)
Bits 003B - IDCode (Version+Part Number only): 0x020F1  (-> 0x024F1)
Bits 0008 - Usercode: 0015116D
00000049 - Header CRC-16_MODBUS: 0033  [00000021-00000048]        CRC OK
0000004B - Data Framesize: 207  [0000004B-000000F1]
000000F2 - 4-byte words: 1260  [000000F2-000014A1]
00000000 - Stream Size (Uncompressed): 15 610 872 bits
000014A2 - CRC Framesize: 207+0     # Data Frames: 1727  [000014A2-00059D4F]
Start address: 00000000
00059D50 - Post-device bitstream pad bytes (0xFF): 1583407  [00059D50-001DC67E]
File Checksum: 1E469589


Reversing the programming: only in God mode...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 05:30:14 am
@pcprogrammer, are you doing the analysis in ASM??!?

Why don't you do the analysis in pseudo-C?

I just started with it, and did not think of a good format just yet. Yours looks like a good idea. It will take its time because it is a lot of work.

And for the fpga, yes that won't be an easy task either, but who knows :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 07:22:21 am
Interesting.

I do have some linux experience. Maybe the issue you're having with U-boot is that the code to enable UART1 has not been added (port configuration, multiplexer config, etc). I'll take a look and see if I can get it to output on UART1 and work from there. I'm tired of soldering the FPGA pins with wirewrap just to get the U-boot uart :P

I have managed to boot u-boot again, both for your image, my image and a licheepi nano image, but no linux seen at the moment.

We'll manage to do it, I'm sure!

It is interesting indeed, and strange.

I did some tests with the lichee nano and when uart0 RX (PE0) is left floating it will not boot. Tried it several times with constant results. When I pull it down to ground via 2K2 resistor it works. Takes about 4 seconds before it comes with the linux messages via uart1.

Decided to put some more wires and a level converter into action to connect both ports. This way I can see the u-boot startup on uart0 and then the linux startup on uart1.

The image with u-boot on uart1 still does not start beyond the first three lines it sends to uart0.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 11, 2021, 07:47:24 am
We'll manage to do it, I'm sure!

I would also be interested in understanding this uart part because this absence of output is present in the majority of equipments around here.

If you have any hints that deserve analysis tell me, maybe I can help.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 09:10:57 am
I added the image with u-boot on uart1 that fails in the repository. Also added the tar.gz of the uboot source I used and changed. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/changed%20packages/Using%20uart1%20(uboot%20fail))

The linux tar.gz is to big (159MiB) and has to many files to get it in the repository. The only changes I made are the files described in an earlier post and these are in the repository.

So tv84 maybe you can take a look at the uboot and figure out where it uses uart0 to output the first three lines, and why it won't continue after that.

Today I'm going to try to check what ser8989 pointed out about the GT911 coordinates reversal via the sensors. Thought is to capture the I2C from the scope with a STM32 and do the conversion there and forward the data to the touch screen. All other data needs to be passed through directly. It is not intended as a solution but as a proof of concept :) All part of the hobby.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 11, 2021, 10:05:56 am
I added the image with u-boot on uart1 that fails in the repository. Also added the tar.gz of the uboot source I used and changed. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/changed%20packages/Using%20uart1%20(uboot%20fail))

Correct link (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/changed%20packages/Using%20uart1%20(uboot%20fail)/).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 11, 2021, 10:22:35 am
Do the UART (tx, rx) lines go through the FPGA?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 10:28:17 am
In the scope the uart0 lines are connected to the fpga, but they don't come out of it. The uart1 lines are connected to the touch panel (bit banged I2C) I did not connect to uart0 (iscle did) and for uart1 I disconnected the touch panel and used a 6pin 0.5mm fpc breakout board (found here: https://nl.aliexpress.com/item/4000099171451.html?spm=a2g0s.9042311.0.0.27424c4dBdVfUz)

On the lichee nano both uarts are connected to io pins and can easily be connected to usb serial adapters.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 11, 2021, 10:31:18 am
Is it possible for the FPGA to ground the lines, disabling the output?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 10:52:12 am
I measured the lines in my scope with my MSO5074 while booting the linux and they go up and down, but it did not look like normal serial where the signals are high and go low for transmission. Might be that in the new version of the scope the RX line is held low at the right moment to allow u-boot to start.

The schematics I made of the scope are also in the repository, so all the connections are in there. Only the capacitors are mostly wrong, since they are not marked and it is hard to measure them in circuit.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 11:30:55 am
Quick update before I go to eat. I can give a more detailed reply later during the evening.

The u-boot souce code is indeed not prepared for output on UART1. The following link shows how the pin configuration is only available for UART0:
https://github.com/Lichee-Pi/u-boot/blob/013ca457fd64b72444a0f5f480b1bbdd8b7481eb/arch/arm/mach-sunxi/board.c#L86
(this is only pin multiplexer configuration, it won't enable uart1 output even if configured for port A)

Also, in order to get the backlight working under linux, what I do is boot the scope without an SD card inserted, then when it powers up the backlight, I insert the SD card and reset the CPU by pulling the reset pin to GND briefly. This will keep the backlight on, and I think that the FPGA pins are kept high-z because it did not finish initializing it.

Also, thanks for pointing out that u-boot will hang when the RX pin is left floating. This makes sense because the way UART works is having a pull-up by the transmitter, and if the receiver is left open then it might be seeing junk and stopping the boot process. Can you try pulling it to 3.3v instead of GND?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 12:23:16 pm
Yes, you are right. The RX pin has to be stable and wether it is high or low that does not matter. Come to think of it this is logical, because when the usb to serial adapter is turned on it will be on a high level too. When it is off the level will be low, and this is how I initially tested it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 01:08:32 pm
The u-boot souce code is indeed not prepared for output on UART1. The following link shows how the pin configuration is only available for UART0:
https://github.com/Lichee-Pi/u-boot/blob/013ca457fd64b72444a0f5f480b1bbdd8b7481eb/arch/arm/mach-sunxi/board.c#L86
(this is only pin multiplexer configuration, it won't enable uart1 output even if configured for port A)

Also, in order to get the backlight working under linux, what I do is boot the scope without an SD card inserted, then when it powers up the backlight, I insert the SD card and reset the CPU by pulling the reset pin to GND briefly. This will keep the backlight on, and I think that the FPGA pins are kept high-z because it did not finish initializing it.

Thanks for the pointer. I made some modifications to the u-boot stuff and started a new build. Fingers crossed :popcorn: and see what happens.

Got an error in building u-boot. Needed to edit one more file. Got a new image, so on the the test bench :-DMM

Succes!!!!! :-DD
The lichee nano starts with everything via uart1, even with uart0 rx floating. Next step is testing in the scope. (But that has to wait till after dinner)


Resetting the MCU in the new version is a bit tricky. There is no neat pcb pad like in the old version, but a tiny smd resistor to touch with a wire. I will give it a try if the new build works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 02:11:14 pm
Awesome! What modifications did you end up doing?

If you can upload the sdcard.img, I'll test it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 03:11:08 pm
Hmm, it works in the scope, but was not able to use the reset trick. When I pull reset low it freezes the display in a weird pattern, waits for a while and starts in scope mode again. So no telling if the display works, because of no back-light.

The image is in the repository (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/images/lichee_nano_both_uart1) as is the changed u-boot package
(https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/changed%20packages/Using%20uart1)

I had to change four files to get the uart1 in there:

1) /uboot-nano-v2018.01/arch/arm/mach-sunxi/board.c
Added:
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV)
   sunxi_gpio_set_cfgpin(SUNXI_GPA(2), SUNIV_GPA_UART1);
   sunxi_gpio_set_cfgpin(SUNXI_GPA(3), SUNIV_GPA_UART1);
   sunxi_gpio_set_pull(SUNXI_GPA(3), SUNXI_GPIO_PULL_UP);

2) /uboot-nano-v2018.01/include/asm/arch-sunxi/gpio.h
Added:
#define SUNIV_GPA_UART1      5

3) /uboot-nano-v2018.01/include/configs/sunxi-common.h
Added:
#elif CONFIG_CONS_INDEX == 2 && defined(CONFIG_MACH_SUNIV)
#define OF_STDOUT_PATH      "/soc@01c00000/serial@01c25400:115200"

4) /uboot-nano-v2018.01/configs/lichee_nano_defconfig
Added:
CONFIG_CONS_INDEX=2


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 03:49:53 pm
It works!

I'm able to pull the reset trick, however the display is not working. The dts has to be edited to include the proper display timings. Our display is "innolux,at070tn92", already included in the mainline kernel, after setting it in the dts, it *should* work :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 11, 2021, 03:52:31 pm
Nice job. Can you point me to an image compiled without those changes and one with the changes?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 03:54:37 pm
And, we've got image!

(https://i.postimg.cc/Lsdrzmb5/photo-2021-04-11-17-52-43.jpg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 03:58:05 pm
Nice job. Can you point me to an image compiled without those changes and one with the changes?

Everything's in this github repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/images/
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 04:03:35 pm
Nice job. Can you point me to an image compiled without those changes and one with the changes?

To get an image without any of the changes just follow the steps of building the image of unframework,  so my steps in the buildroot readme.txt file without changing any of the files. Well the changed one is in the repository.

And well done to iscle on getting the display up and running. What did you to to get that done?

Is it this section that needs to be changed?

   panel: panel {
      compatible = "lg,lb070wv8", "simple-panel";
      #address-cells = <1>;
      #size-cells = <0>;
      enable-gpios = <&pio 4 6 GPIO_ACTIVE_HIGH>;
      power-supply = <&reg_vcc3v3>;

       port@0 {
         reg = <0>;
         #address-cells = <1>;
         #size-cells = <0>;

          panel_input: endpoint@0 {
            reg = <0>;
            remote-endpoint = <&tcon0_out_lcd>;
         };
      };
   };
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 04:11:19 pm
And well done to iscle on getting the display up and running. What did you to to get that done?

Is it this section that needs to be changed?

Yes, just replace "lg,lb070wv8" with "innolux,at070tn92" and it will work  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 04:15:47 pm
Ok I will try that.

As you seem to know your displays any idea on this:

I received the display I bought (https://nl.aliexpress.com/item/32691414835.html?spm=a2g0s.9042311.0.0.27424c4dER5LsR) but it does not work with the FNIRSI-1013D. It shows some white fading and stabilizes in a blue bar on the right side of the display.

On the cable there is "7300130906 E231732 NETRON-YF P08 94V-0\1332"

I made a video of what it does and posted it on youtube (https://youtu.be/K5SbKid2z_o)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 04:23:52 pm
Ok I will try that.

As you seem to know your displays any idea on this:

I received the display I bought (https://nl.aliexpress.com/item/32691414835.html?spm=a2g0s.9042311.0.0.27424c4dER5LsR) but it does not work with the FNIRSI-1013D. It shows some white fading and stabilizes in a blue bar on the right side of the display.

On the cable there is "7300130906 E231732 NETRON-YF P08 94V-0\1332"

I made a video of what it does and posted it on youtube (https://youtu.be/K5SbKid2z_o)

This is very similar to what happened on the Fnirsi LCD before setting that setting correctly. It's a timing issue, fixing the timing parameters will make it work. Do you have a datasheet for it?

PD: A quick search shows it is a 1024x600 instead of 800x480
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 04:32:44 pm
That's the problem, I could not find any datasheet for it. If it has a higher res than great :-DD, but finding the timings how does one go about? Lots of trying?

I ordered an other display of which I think is the one in the scope. The number on the cable matches. (https://nl.aliexpress.com/item/32693491775.html?spm=a2g0s.9042311.0.0.25c54c4dDSoxby) Hope to get one working with the lichee nano to do development on.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 05:17:14 pm
I made the version with the new display setting and uploaded it to the repository (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/images/lichee_nano_uart1_innolux%2Cat070tn92)

Still not able to get it displaying, because the reset trick fails. So maybe iscle can verify if the image shows anything on the display?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 05:26:20 pm
Yes, that version works for me with the reset trick!

Edit: A small LVGL demo running! Of course, no touch...

(https://i.postimg.cc/7L2KDcw2/photo-2021-04-11-19-49-39.jpg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 11, 2021, 07:27:10 pm
Nice, but without the fpga interface it is just a small linux computer :-//

Next up is getting the console to be on the usb interface. For this we have to check out thirtythreeforty's work on his business-card. When that is running the touch can be programmed. Should not be to hard to write a bit bang I2C driver for it.

Did not get much done on the proof of concept about ser8989's thought on how to reverse the touch panel's coordinates. Read and compared the configs of both the old and the new panel and they are the same. It is not an exact match with the byte string found in the program, but fragments do, so it might be what is used to send to the panel, or it might not be.

Need to write code for the stm32 to handle both i2c interfaces under interrupt and do the translation. Not to complex, but with the linux stuff on the side it slowed down, so maybe tomorrow ;D

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 11, 2021, 08:19:21 pm
It's very easy to reverse the coordinates when writing a linux driver, it's just a conditional (although, if it can be done in the IC, that's one less branch that the CPU has to worry about).

Once we get usb uart, I'll begin to code the touch driver.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 11, 2021, 09:29:56 pm
This is not a concept because I have already tested it, you have the same configs in the old and new panels because when you start the firmware config is written to the panel, but this happens only on the English version of the firmware, but in the Chinese version config is not overwritten. The entire config is missing in the firmware because in fact the config is several independent data structures.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 11, 2021, 09:46:43 pm
By the way, I got an oscilloscope with a dead vertical bar on the touchscreen, was broken (defective), one of the channels ITO gt911, I was able to find a replacement only gt915, pinout and features they are the same based on the datasheet, but in default configuration, ITO channels gt915 are in reverse order so the touchscreen works in a mirror mode, reconfiguration of channels and use the Chinese version of the firmware corrects this situation. The easiest way for those who have the touchscreen with gt915, find and solder gt911 (at the moment I managed to find and gt911). But to find and fix the part of the code that is engaged in reconfiguration for me is a matter of principle.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 05:19:23 am
I was wondering about the differences between the two GT ic's. According to your findings it is that the sensors are scanned in reversed order and therefore the order has to be changed in the configuration. For me de-soldering and re-soldering the GT ic's is not an option. To small and fragile. It is also the question if on the defective panels it is caused by the ic or by the ITO.

For the code changing it depends on the config checksum that needs to be correct. When it is just a sum of the bytes, then the order of the sensor numbers will not matter and a simple change of the binary might do the trick. (Maybe you already tried it) Otherwise, if the software does not do this itself, it involves calculating a new checksum and changing that byte also.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 06:19:38 am
Does yours show the same reversal of the coordinates when you connect it to the scope?

I received a wire the other day for separating the screen. When replacing the touchscreen, I found the following feature. Initially, after the experiments, I had the firmware installed from the forum (https://1drv.ms/u/s!Av-Riptwsak2iskn0CO56k7NHOOyzg?e=lBgubm) The touchscreen works absolutely correctly on this firmware. But I decided to return the stock firmware (https://1drv.ms/u/s!Av-Riptwsak2iskpuqmWeb7_qvBy2g?e=7FLSUm) - the touchscreen works in reverse on this firmware! Interestingly, the stock touchscreen works the same on the stock firmware and on the firmware from the forum - not reversible
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 07:23:59 am
And were you able to revert back to a correct working system or did you end up like eljot and me with a reversed touch system. If I have a correct understanding of it all, once the configuration has been written to the new touch screen it holds on to it. This means that it is non volatile. I did see something about flash in the datasheet or programming manual, but it is a bit obscure.

But no worries, we (iscle, ser8989, I and maybe others) will find the solution. It takes time since we are trying multiple things, like making linux operational for open source scope-ware, either with the original fpga or an fpga config or our own (this is an option but takes more of an effort. Is another of my interests). The other path is find out how to change the binary that it works with the other touch screen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 08:45:53 am
I'm looking into thirtythreeforty his work for the console to usb, but he only did it for the linux part. He did not remove the bindings to uart0 in u-boot and linux, so it looks like his version still boots on uart0 and for the linux part maybe using both as communication path. His version of u-boot is newer than what we are using now and looks like stuff has moved to other locations, so would have to find the correct files to edit. I will stick to the older version for now.

I did find settings for u-boot to make it use usb as console interface, but not sure if it will work. So will test this first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 09:20:33 am
And were you able to revert back to a correct working system or did you end up like eljot and me with a reversed touch system.

It was no longer possible to return to the correct operation of the touchscreen |O. Now the touchscreen works in reverse on any firmware. Which is very strange  :-//, since I was writing the firmware to the memory chip by completely removing it from the board and also disconnecting the touchscreen loop. It seems to me that there is a code in the oscilloscope firmware that changes something in the touchscreen firmware.
I also downloaded the firmware from another oscilloscope (https://1drv.ms/u/s!Av-Riptwsak2ithz1mLIZsvK0lsp9Q?e=hZYflj). On it, the touchscreen also works in reverse, but the screen image is also shifted on it.
(http://[attach=2])
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 09:36:10 am
The touch screen gets the config the moment you start the scope with the stock firmware. In the GT911 (GT9157) there is a register that tells the touch panel to save the configuration, if it is newer than the previous one. The scope writes a 1 to this register meaning it should store the config. You can probably use an arduino (make sure to not use 5V on the touch panel) to write a reversed configuration like ser8989 suggested to your panel and load your scope with the old firmware and it should work as before.

Did not test this myself. Tried reading my flash chips just now and it did not work with my programmer |O. It is a CH341 programmer and for some reason it does not work. It lifts the voltage on the flash chip to 4.1V when connected to the chip. (No power on the scope itself, since there is a diode in the flash power line) So need to investigate that also.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 09:52:54 am
You can probably use an arduino (make sure to not use 5V on the touch panel) to write a reversed configuration like ser8989 suggested to your panel and load your scope with the old firmware and it should work as before.
It will be fun to try. But where can I get an Arduino sketch?

I wanted to download the GT911 dump. But I could not find information anywhere how and with what programmer it is possible to do this
Found just this http://andr7e.blogspot.com/2015/05/c-goodix-gt9xx.html (http://andr7e.blogspot.com/2015/05/c-goodix-gt9xx.html)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 10:25:34 am
Might be that ser8989 wrote one. But should not be that difficult to write one your self. I do not have arduino ide installed at the moment, so can't do it for you.

When you have a STM32F103C8T6 bluepill board I can write code for that.

In the file are the bytes being written from the scope, starting at register address 0x8047, to the touch panel. This is the wrong setup for the new panel. Needs to be changed like ser8989 described some posts back.
The other file is changed to hopefully match what ser8989 described. The checksum is based on a summing algorithm so should not suffer from changing byte order.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 10:30:39 am
When you have a STM32F103C8T6 bluepill board I can write code for that.

I do not have this board, but I can buy it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 10:44:46 am
That is an option. I can write and test it anyway. Not yet with the scope itself since my CH341 programmer is not doing what it is supposed to do >:(

It is a board like this: https://nl.aliexpress.com/item/4000212446459.html?spm=a2g0o.productlist.0.0.41ef66deCPLsO4&algo_pvid=224a892b-2adc-436f-95c0-8ae21bd6135d&algo_expid=224a892b-2adc-436f-95c0-8ae21bd6135d-0&btsid=0b0a050116182243223341827e38d4&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

And you would need a st-link v2 like this for programming: https://nl.aliexpress.com/item/1005001621626894.html?spm=a2g0o.productlist.0.0.39f67ebbr0exNU&algo_pvid=5d37c412-5aae-4291-9d5f-94f414132190&algo_expid=5d37c412-5aae-4291-9d5f-94f414132190-4&btsid=0b0a050116182244556433490e38d4&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Just search for the best deal you can find. Prices went up quite a bit since last year |O

To connect to the touch panel this might also be handy: 0.5mm 6pin adapter board and cable type A
https://nl.aliexpress.com/item/4000099171451.html?spm=a2g0s.9042311.0.0.27424c4dBEU6wL
https://nl.aliexpress.com/item/4000686812211.html?spm=a2g0s.9042311.0.0.27424c4d6QprfB
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 10:58:16 am
That is an option. I can write and test it anyway. Not yet with the scope itself since my CH341 programmer is not doing what it is supposed to do >:(

It is a board like this: https://nl.aliexpress.com/item/4000212446459.html?spm=a2g0o.productlist.0.0.41ef66deCPLsO4&algo_pvid=224a892b-2adc-436f-95c0-8ae21bd6135d&algo_expid=224a892b-2adc-436f-95c0-8ae21bd6135d-0&btsid=0b0a050116182243223341827e38d4&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

And you would need a st-link v2 like this for programming: https://nl.aliexpress.com/item/1005001621626894.html?spm=a2g0o.productlist.0.0.39f67ebbr0exNU&algo_pvid=5d37c412-5aae-4291-9d5f-94f414132190&algo_expid=5d37c412-5aae-4291-9d5f-94f414132190-4&btsid=0b0a050116182244556433490e38d4&ws_ab_test=searchweb0_0,searchweb201602_,searchweb201603_

Just search for the best deal you can find. Prices went up quite a bit since last year |O
I bought it at a local online store (https://arduino.ua/prod3022-plata-razrabotchika-cs32f103c8t6-arm-stm32-minimalnaya-konfigyraciya). I'll get it the day after tomorrow. st-link v2 I already have

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 11:01:44 am
See my previous post for handy stuff.

The board you ordered has the CS chip on it. Not a problem, but for programming an other chip ID needs to be used. I use openocd under linux for the programming. Will add the correct config for the CS chip too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 12, 2021, 11:11:25 am
The board you ordered has the CS chip on it. Not a problem, but for programming an other chip ID needs to be used. I use openocd under linux for the programming. Will add the correct config for the CS chip too.
This one will be ok? https://www.rcscomponents.kiev.ua/product/stm32f103c8t6-modul-dlya-maketirovaniya_72591.html (https://www.rcscomponents.kiev.ua/product/stm32f103c8t6-modul-dlya-maketirovaniya_72591.html)


I have a CH341 programmer available. If there is an instruction on how to do this with it, then I could try
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 11:22:21 am
Yes that is one with an STM chip on there, judging by the STM32F103... text. The rest is "Russian" to me, and sorry if that is not the correct language.

For programming the scope you can either use a sop clip (like with this programmer: https://nl.aliexpress.com/item/32263275388.html?spm=a2g0s.9042311.0.0.27424c4djoGaBI (https://nl.aliexpress.com/item/32263275388.html?spm=a2g0s.9042311.0.0.27424c4djoGaBI)) or solder a 6 pin header and check the schematics in the repository on the connections. I tried it that way and did not work here, but not sure why. Measured the connections and they are correct pin for pin. Did not brick the scope fortunately.

For software I used the sources from this guy: https://github.com/setarcos/ch341prog (https://github.com/setarcos/ch341prog)
Under windows I believe there is software from the manufacturer: https://www.onetransistor.eu/2017/08/ch341a-mini-programmer-schematic.html (https://www.onetransistor.eu/2017/08/ch341a-mini-programmer-schematic.html)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 12, 2021, 11:38:30 am
I'm looking into thirtythreeforty his work for the console to usb, but he only did it for the linux part. He did not remove the bindings to uart0 in u-boot and linux, so it looks like his version still boots on uart0 and for the linux part maybe using both as communication path. His version of u-boot is newer than what we are using now and looks like stuff has moved to other locations, so would have to find the correct files to edit. I will stick to the older version for now.

I did find settings for u-boot to make it use usb as console interface, but not sure if it will work. So will test this first.

I'm working on porting the latest version of u-boot, so that we can always stay updated and not 3 years behind :) Same goes for the linux kernel, but that is easier since the f1c100s is already on the mainline kernel :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 11:47:26 am
Ok. When finished we have to see how to get it in the repository.

I noticed that my u-boot usb console finished building, so have to test it. Been working on dmitrkov's touch panel config rewrite code in the mean time.

Will update on both soon :)

Hmm, no success on the USB boot. Still outputs on uart1 for the boot process. It says "starting USB..." and then "No controllers found". Needs more to get it done.

Added:
CONFIG_USB_DEVICE=y
CONFIG_USB_TTY=y
# CONFIG_USBD_HS is not set
CONFIG_SYS_CONSOLE_IS_IN_ENV=y
# CONFIG_USBD_MANUFACTURER
# CONFIG_USBD_PRODUCT_NAME
# CONFIG_USBD_VENDORID
# CONFIG_USBD_PRODUCTID
to the licheepi_nano_defconfig file in the uboot-configs directory. Found this in the uboot readme file. Guess the usb device needs to be added in the board.c or device tree files too.

Another problem of going this route is when to attach a program to the usb device on the host computer. It is not like with the usb to serial adapter where you can have it open in putty or screen and then turn on the target. So if it is going to work will u-boot be delayed until connected or will we loose the u-boot startup al together, and is that bad?

We can't leave it on uart1 since it might mess with the touch panel.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 12, 2021, 12:15:16 pm
Write the sketch to the esp8266 or arduino 3,3v. Connect your touchscreen to the board and apply power, the correct configuration will be written to the gt915 registers and the touchscreen should then work normally with the firmware you had it working normally.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 12:53:38 pm
You beat me to the punch :)

I just uploaded my writer and reader projects for the bluepill.

https://github.com/pecostm32/STM32F103_GT911_Conf_Writer
https://github.com/pecostm32/STM32F103_GT911_Conf_Reader

Tested them with my old panel and the configuration is changed as wanted.

I noticed in your sketch that you used 0x5D for the slave address. It is possible it does not respond to it when it starts up in the other address mode 0x14. I made a fall through on failure in mine to use the other when it fails on the first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 02:54:27 pm
Forgot the config files for the CS32 chip. Attached here in a zip.

The cs32f1x.cfg needs to be copied to openocd config folder. The other one needs to be in the project folder from where openocd is run.

Use like this
openocd -f CS32F103C8T6.cfg -c init -c targets -c halt -c "flash write_image erase f103_i2c_tp_conf_writer.elf" -c "verify_image f103_i2c_tp_conf_writer.elf"
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 03:52:19 pm
Found the problem with my CH341 programmer. Some idiot designer thought it to be a good idea to make a device targeted at 3.3V flash chips with 5V io levels.  :-// That is why I measured 4.1V on the flash VCC.  |O Modified the device like pointed out here: https://www.chucknemeth.com/usb-devices/ch341a/3v-ch341a-mod (https://www.chucknemeth.com/usb-devices/ch341a/3v-ch341a-mod) and now it seems to be working, at least with a separate W25Q128 device I had lying around.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 05:07:12 pm
Managed to read the flash chips in my scope. For the main flash it is ok to disconnect the scope from the battery and use the power from the programmer. For the FPGA flash it is a different story. First the scope needs to startup. Then connect the programmer (with or without power of the programmer connected) and read the flash. When tried in the same way as the main flash, without the scope powered on it will fail. Cyclone IV documentation did provide some information about in circuit programming and shows the FPGA needs to be powered on. With the programmer connected before poweron, it will not start.

Uploaded the files to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Binaries)

Found that both the files differ from the others in the forum (also in the repository) For the main flash it is only in the bitmap image part. For the FPGA it looks like the bitstream in the new version is not compressed. Maybe tv84 can verify this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 12, 2021, 05:37:40 pm
W25Q80_FPGA seems like an FPGA raw dump (attached is conversion to bitmap).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 12, 2021, 06:47:36 pm
I found a function in the code that looks like it is for sending the configuration to the touch panel, but it is not called from within the rest of the code :-//
Can't find the filling in of the ram buffer for the configuration either. So bit of a mystery |O

Code: [Select]
undefined4 FUN_8001794c(void)  //This is the function that sets up the configuration for the touch panel??

{
  char *pcVar1;
  undefined4 uVar2;
  byte bVar3;
  uint uVar4;
  undefined4 in_r3;
  int iVar5;
  undefined4 local_10;
 
  uVar2 = DAT_80017ab4;                        //DAT_80017ab4 = 0x01C20800 (config register of port A)
  local_10 = in_r3;
  FUN_8001764c(DAT_80017ab4,3,1,0);   //Maybe generation of start condition and sending slave address in next part
  FUN_8001764c(uVar2,2,1,0);
  FUN_8001774c(uVar2,3);
  FUN_8001774c(uVar2,2);
  FUN_8001764c(uVar2,0,1);
  FUN_8001764c(uVar2,1,1,0);
  FUN_80017738(uVar2,0);
  FUN_80017738(uVar2,1);
  FUN_8000bc34(100);
  FUN_8001774c(uVar2,1);
  FUN_8000bc34(DAT_80017ab8);
  FUN_8001774c(uVar2,0);
  FUN_8000bc34(DAT_80017abc);
  FUN_8001764c(uVar2,1,0);
  FUN_8000bc34(DAT_80017ac0);
  uVar2 = DAT_80017ac4;
  local_10._0_1_ = 2;
  FUN_80017d2c(DAT_80017ac4,&local_10,1);
  bVar3 = 0;
  uVar4 = 0;
  do {
    pcVar1 = (char *)(DAT_80017ac8 + uVar4);              //There is a buffer at 0x8019CF82 in RAM where it calculates the checksum for the config of the touch panel
    iVar5 = DAT_80017ac8 + uVar4;
    uVar4 = uVar4 + 2 & 0xfffeffff;
    bVar3 = *(char *)(iVar5 + 1) + bVar3 + *pcVar1;
  } while (uVar4 < 0xb8);
  *(byte *)(DAT_80017ac8 + 0xb8) = ~bVar3 + 1;
  FUN_80017d2c(DAT_80017acc,DAT_80017ac8,0xba);          //Function to write data to I2C bus?? (DAT_80017acc = 0x8047, DAT_80017ac8 = 0x8019CF82, 186 bytes)
  FUN_8000bc34(DAT_80017ad0);
  local_10 = (uint)local_10._1_3_ << 8;
  FUN_80017d2c(uVar2,&local_10,1);
  return 0;
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: alangave on April 12, 2021, 10:25:35 pm
Hi,
New to this forum and thanks for helping if any idea:
Mine has a strange behavior : when power up, let's say, once a day, it works for a while, then signal is superseeded/mixed by a sine like signal, 25Khz ~20PP

Very strange, I have tested all my probe, both channel, cable between generator and probe etc...

I'm in audio (modular synth), and mainly using this scope for audio signal visualisation, no high frequency.

don't know what to look after inside the scope to fix.
Below, same signal (2 probes from same point), bare square wave: FnIRSI and old Hitachi scope

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 05:03:21 am
Can you open up your scope and do measurements with the other in the analog part to see if the signal is there?
Look at the schematics here: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Schematics
It is for the new version of the scope, but the analog did not change that much I think.
In the pictures folder in the repository there is also a good picture of the old scope pcb. You can figure out where to measure based on this information.
If it's cause is in the analog part you should see it with your other scope on the output of the opamp. Also check the 2.5V power rail of the opamp and the VRF1 voltage.
The faulty scope says it is 20Vpp but when it is introduced in the opamp section it will be much smaller.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 09:23:33 am
Not a happy camper |O
Tried flashing my scopes flash with the CH341 programmer, but did not go that well. Took a long time, and I canceled the process. Reading the flash showed nothing changed, so I thought I need to erase first. That did work. So tried flashing again, this time with verbose on and it showed progress until 54% done. Canceled again. Read the flash and it was not written properly :palm:

Tried the FEL way, but the sunxi tools I compiled do not support the flash programming. :-//

So left with kind of a brick for now.

How did any of you out there who flashed the scope did it? (eljot, dmitrkov)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 13, 2021, 12:02:34 pm
How did any of you out there who flashed the scope did it? (eljot, dmitrkov)
1. I desolder w25q32 from the board
2. using an adapter SOP8-208mil(https://aliexpress.ru/item/32827349954.html?spm=a2g0o.cart.0.0.19233c00EaUwqh&mp=1), I connected the chip to the programmer
3. I used the CH341A Programmer software in windows 10 (settings in the screenshot)
(http://[attach=1])
4. Read/Write
5. Solder w25q32 on the board
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 12:24:29 pm
Had some idea that you did it like that (de-solder) from one of your posts. Just ordered such an adapter from aliexpress together with 10 w25q32 chips.
I have the same programmer you have, so be aware the io signals might be on 5V (https://www.chucknemeth.com/usb-devices/ch341a/3v-ch341a-mod (https://www.chucknemeth.com/usb-devices/ch341a/3v-ch341a-mod))

Did modify mine a bit different than he did. Will add some pictures.

I figured I would not need the 5V on the header pins, so I cut the trace on the bottom of the pcb. Then soldered a wire between c3 and the middle pin of the AMS1117 and a wire between the 3.3V and 5V pins.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 01:09:10 pm
Finally found the correct version of sunxi-fel with spi support and tried flashing with it and again failure, so I think my flash is broken.

There are fragments of the code in there but large parts are FF.

It still works with the sd card and can run linux on it, so will continue with that part of the project.

Too bad, because I wanted to test if the function I found is actually the part that sends the touch panel config. To remove it from the code I patched the instruction right after the push function to be the pop function found at the end of the function. Probably has to wait until I get my new flash chips.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 04:12:22 pm
I just had to know.

And I was right. De-soldered the flash chip and connected a w25q128 board I had lying around. Was able to use sunxi-fel to write the flash with my modified image and it worked. Used my stm32 with the GT911_Conf_Writer code to bring the touch panel back to the correct configuration and attached it to the modified scope. I can now use it as it was, except for the missing front glass panel |O Still have to find a fix for that.

The hacked image file is here:
https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Binaries/Hacked%20files

The function that writes the configuration to the touch panel is bypassed, so the scope writes no configuration anymore.

Updated the readme in the https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux/images/fel_boot directory to indicate where the correct sources for the sunxi tools can be found and instructions for writing the flash of the scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 13, 2021, 06:00:27 pm
You and I did it at the same time, I found this function today too, only I replaced its call with NOP.
I corrected the configuration of the gt915 with the arduino 3.3v (esp8266) sketch I posted earlier.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 06:09:53 pm
Well done :)
So you found where the function is called from. In the Ghidra analysis it did not show any reference to the function I found, but my mod showed it is being called.
Did you find where the ram buffer is being filled with the configuration bytes?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 13, 2021, 06:22:56 pm
Well done :)
So you found where the function is called from. In the Ghidra analysis it did not show any reference to the function I found, but my mod showed it is being called.
Did you find where the ram buffer is being filled with the configuration bytes?
I couldn't find it.
Let's chat on some messenger or social network. How do I find you?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 13, 2021, 06:48:35 pm
I use AsProgrammer for flashing, in my opinion it is better than the standard software ch340.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 13, 2021, 07:18:44 pm
The linux console on the USB-OTG seems to be a bit tricky. Still not found a solution.

https://stackoverflow.com/questions/63104542/can-usb-otg-be-used-for-u-boot-and-linux-consoles

Here it says it is possible, but none of the startup messages will be show. So maybe easier to disable u-boot and linux serial console and use the USB_G_Serial only for communicating with linux from a login. The display of the scope can be used to show the messages. For that I have to find how to control the brightness in the FPGA. This kind of research has more my interest than linux kernel work. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: alangave on April 13, 2021, 10:20:38 pm
Can you open up your scope and do measurements with the other in the analog part to see if the signal is there?
Look at the schematics here: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Schematics
It is for the new version of the scope, but the analog did not change that much I think.
In the pictures folder in the repository there is also a good picture of the old scope pcb. You can figure out where to measure based on this information.
If it's cause is in the analog part you should see it with your other scope on the output of the opamp. Also check the 2.5V power rail of the opamp and the VRF1 voltage.
The faulty scope says it is 20Vpp but when it is introduced in the opamp section it will be much smaller.
Thank you
I just checked, the signal looks ok ( I mean square wave) till the ADC pin but screen still sowing weird stuff, I'll dig into further tomorrow
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 05:43:04 am
Hmm very strange. Do you have the problem on both channels?

Check the following signals on the ADC's to see what is there. Should be stable DC levels. REFOUT (pin 6), AINA = AINB (pin 3 and 10).

Also check if there is distortion on the 3.3V supply, since the ADC's are powered with it. And take a look at the ADC1_OFFSET and ADC2_OFFSET signals coming from the FPGA.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 14, 2021, 07:37:32 am
I'm still waiting for the touchscreen connectors. I decided to download the modified firmware for now. I found out such a feature - the touchscreen does not work at all on the modified firmware (i checked both versions pcprogrammer,ser8989). At first I thought that I broke the touchscreen, but after returning the stock firmware, the touchscreen worked again in reverse.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 08:22:24 am
Interesting, Maybe the touchscreen initialization to slave address 0x14 is also removed by killing that one function. Not sure how the touchscreen chooses its address when not programmed with the rst and int line. The scope uses address 0x14 to communicate with it. I noticed while making the configuration writer code the touch panel was a bit random in which address it responded on. (0x14 or 0x5D) I did not implement the address select with the rst and int line and left them floating.

Have to investigate the function a bit further and see if I can fix it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 14, 2021, 10:20:40 am
Turning on the oscilloscope on a modified firmware several times in a row, I caught a working (reversible) touchscreen on one of the inclusions. But the next time it was turned on, it did not work again. This happened 2 times at random.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ser8989 on April 14, 2021, 10:44:47 am
Turning on the oscilloscope on a modified firmware several times in a row, I caught a working (reversible) touchscreen on one of the inclusions. But the next time it was turned on, it did not work again. This happened 2 times at random.
Попробуйте мой патч, он немного другой.

Try my patch, it's a little different.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 11:04:46 am
That is why I think I removed to much of the code. It most likely is not initializing the touch panel to slave address 0x14.

I'm looking at the code in depth to see what is going on.

Would be interesting to see what ser8989's modification does.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 14, 2021, 01:21:42 pm
I wrote earlier that I tried both versions of the modified firmware.  In both cases, the touchscreen does not work.  Tomorrow I'll get a connector for connecting a touchscreen, I'll try it after flashing the touchscreen
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 01:47:49 pm
I made a new version. I was right about that the  slave address initialization was also removed. Nopped the call to the send the configuration function to stop only that part. Uploaded it to the hacked files section of the repository. Tested it with my I2C monitor connected and some of the other calls to the touch panel that where removed are now back in.

So the new patched file should work on every power up. Tested it a couple of times. The touch panel needs to have the right configuration of coarse.

Here is the startup communication with the touch panel
Code: [Select]
S
0x28 A 0x80 A 0x40 A 0x02 A P
//Config used to be send here
S
0x28 A 0x80 A 0x40 A 0x00 A P
S
0x28 A 0x81 A 0x4E A S
0x29 A 0x80 N P
S
0x28 A 0x81 A 0x4E A 0x00 A P
S
0x28 A 0x81 A 0x4E A S
0x29 A 0x00 N P
S
0x28 A 0x81 A 0x4E A S
0x29 A 0x00 N P
S
0x28 A 0x81 A 0x4E A S
0x29 A 0x00 N P

Analyzed the function to what it is doing and added comments
Code: [Select]
undefined4 FUN_8001794c(void)                   //This is the function that sets up the configuration for the touch panel
{
  char *pcVar1;
  undefined4 uVar2;
  byte bVar3;
  uint uVar4;
  undefined4 in_r3;
  int iVar5;
  undefined4 local_10;
 
  uVar2 = DAT_80017ab4;                         //0x01C20800. Base register address for Port A
  local_10 = in_r3;
  FUN_8001764c(DAT_80017ab4,3,1,0);             //Setup SCL (PA3) as output
  FUN_8001764c(uVar2,2,1,0);                    //Setup SDA (PA2) as output
  FUN_8001774c(uVar2,3);                        //Set SCL high
  FUN_8001774c(uVar2,2);                        //Set SDA high
  FUN_8001764c(uVar2,0,1);                      //Setup RESET (PA0) as output. Start of slave address init of touch panel
  FUN_8001764c(uVar2,1,1,0);                    //Setup INT (PA1) as output
  FUN_80017738(uVar2,0);                        //Set RESET low
  FUN_80017738(uVar2,1);                        //Set INT low
  FUN_8000bc34(100);                            //Delay function.    100
  FUN_8001774c(uVar2,1);                        //Set INT high. Sequence for selecting 0x14 as slave address (0x28/0x29, write/read bytes)
  FUN_8000bc34(DAT_80017ab8);                   //Delay again.     20000 (Should be 100uS)
  FUN_8001774c(uVar2,0);                        //Set RESET high
  FUN_8000bc34(DAT_80017abc);                   //Delay again.     10000
  FUN_8001764c(uVar2,1,0);                      //Set INT as input
  FUN_8000bc34(DAT_80017ac0);                   //Wait again.     100000
  uVar2 = DAT_80017ac4;                         //0x00008040
  local_10._0_1_ = 2;
  FUN_80017d2c(DAT_80017ac4,&local_10,1);       //Write 0x02 to register address 0x8040. Touch Panel command (read diff data or raw data)
  bVar3 = 0;
  uVar4 = 0;

  do
  {
    pcVar1 = (char *)(DAT_80017ac8 + uVar4);    //There is a buffer at 0x8019CF82 in RAM where it calculates the checksum for the config of the touch panel
    iVar5 = DAT_80017ac8 + uVar4;
    uVar4 = uVar4 + 2 & 0xfffeffff;
    bVar3 = *(char *)(iVar5 + 1) + bVar3 + *pcVar1;
  } while (uVar4 < 0xb8);

  *(byte *)(DAT_80017ac8 + 0xb8) = ~bVar3 + 1;

  //This is the function I nopped out with mov r0,r0
  FUN_80017d2c(DAT_80017acc,DAT_80017ac8,0xba); //Write the configuration data the the touch panel starting from register address 0x8047

  FUN_8000bc34(DAT_80017ad0);                   //Wait again.  200000
  local_10 = (uint)local_10._1_3_ << 8;
  FUN_80017d2c(uVar2,&local_10,1);              //Write 0x00 to register address 0x8040. Touch Panel command (read coordinate status)
  return 0;
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 14, 2021, 04:13:50 pm
I made a new version.
In this version, the touchscreen works!  :-+ :clap: (while still reversible)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 04:48:01 pm
Hopefully you get your connectors tomorrow and can set the touchscreen right :)

Make sure to only connect 3.3V to the touch panel. Reversal of SDA and SCL won't damage it, but my program will say E1 and DONE. E1 means it failed. Don't forget about the pullups to 3.3V (2K2) on the SDA and SCL lines

Success
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 14, 2021, 06:30:37 pm
While further analyzing the I2C code, I stumbled on code that is used for communication with the FPGA. Why this is done while reading the I2C bus is a puzzle, but it means I'm closing in on the FPGA.
It looks like they created an 8 bit bus with 2 selects and a clock signal.
Figuring out what the different selects mean is probably not going to be so easy :palm:

Code: [Select]
//Read something from the FPGA
uint FUN_80016850(void)
{
  int iVar1;
 
  FUN_800167a0();                                   //Setup port E pins 0:7 for input
  iVar1 = DAT_8001689c;                          //0x01C20890. Port E config register base
  FUN_80017738(DAT_8001689c,9);          //Set pin PE09 low
  FUN_80017738(iVar1,10);                       //Set pin PE10 low
  FUN_80017738(iVar1,8);                         //Set pin PE08 low
  FUN_8001774c(iVar1,8);                         //Set pin PE08 high
  return *(uint *)(iVar1 + 0x10) & 0xff;      //Read a byte from the FPGA (port E data register holds twelve bits)
}

//Set port E pins 0:7 as input
void FUN_800167a0(void)
{
  uint *puVar1;
 
  puVar1 = DAT_8001684c;                   //0x01C20890. Port E configuration register (FPGA)
  FUN_8001764c(DAT_8001684c,0,0);    //Set pin PE0 as input
  FUN_8001764c(puVar1,1,0);               //Set pin PE1 as input
  FUN_8001764c(puVar1,2,0);               //Set pin PE2 as input
  FUN_8001764c(puVar1,3,0);               //Set pin PE3 as input
  FUN_8001764c(puVar1,4,0);               //Set pin PE4 as input
  FUN_8001764c(puVar1,5,0);               //Set pin PE5 as input
  FUN_8001764c(puVar1,6,0);               //Set pin PE6 as input
  FUN_8001764c(puVar1,7,0);               //Set pin PE7 as input
  return;
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 15, 2021, 08:21:40 am
Interesting... What memory map do you have configured in Ghidra?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 08:55:36 am
Take a look at the readme.txt file in the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Binaries/Separated%20parts

Also added a new directory in the Software reverse engineering directory with all the related C functions in separate files with added comments and a text file describing what the functions do within the system.

My next step is looking into why the base address of UART0 is used in the code. Found several locations where it is used, so interesting to see what it is being used for and how they combined it with the parallel fpga bus. (If that is actually the case.)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 09:55:52 am
I want to download STM32F1_I2C_TP_conf_reader in bluepill with ST-Link v2. I have windows 10. I connected bluepill to ST-Link v2. Opened the application STM32 ST-LINK Utility. File - Open, The program requires *.bin, *.hex, *.srec, *.s19. I have not found such files in the repository.  :-//

Download the elf file with STM32 CubeProgrammer!  :)


Now I can't understand where the data will be output? How do I get them?...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 10:38:16 am
In the repository is a .elf file that holds the code including debug information. I will take a look at making a .hex or .bin for you.

Attached is a .hex file. Try if that works for you.

After the bluepill has been programmed it can be connected via the usb port to your computer and you should be able to open it as a serial port like a ch340. The baudrate settings don't matter and do nothing since it is just data over usb.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 10:58:13 am
In the repository is a .elf file that holds the code including debug information. I will take a look at making a .hex or .bin for you.

Attached is a .hex file. Try if that works for you.

After the bluepill has been programmed it can be connected via the usb port to your computer and you should be able to open it as a serial port like a ch340. The baudrate settings don't matter and do nothing since it is just data over usb.
Thank You! Can You make reader.hex file to?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 11:02:26 am
You can find it in the repositories. Just uploaded them there
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 11:13:11 am
will output anything to the com port without a connected touchscreen?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 11:18:07 am
Yes you will see Press key, E1 and Done message for writer and Press key for reader
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 11:42:52 am
The firmware has loaded successfully. But there is nothing in the com port monitor.  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 12:45:40 pm
Strange. I will take a look at it here. May be the conversion to hex with "objcopy -S -O ihex f103_i2c_tp_conf_writer.elf f103_i2c_tp_conf_writer.hex" did not do the trick. Need to startup my old laptop to get to the linux version of the STM programmer software. Have not yet installed on my new desktop system :( Don' t use it that much.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 01:04:55 pm
Just reprogrammed my bluepill with the STM32 CubeProgrammer and the writer.hex file and it works just fine. Looks like the .hex file is ok.
Even without the two pull-up resistors connected it outputs "Press key", so you should see at least that.

For the I2C part of the code to work the pull-ups need to be connected, otherwise the mcu can't generate the start condition.

Also tested the reader.hex file and it works also.

Started an even older laptop with windows 7 on it. Had to install the ch340 driver and putty since hyperterm is no longer there. Had the reader.hex in the bluepill and had to hit a key after opening putty, and it worked. The writer code does not have a loop back to the beginning and most likely receives some garbage on connection and jumps through the hit a key message and is done before you can open up your terminal program. Linux seems to buffer the data, and opening with cutecom brings it up.

Also noticed that windows needs the carriage return and the line feed, so the text shifts to the right on every key hit. :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 04:28:25 pm
I'm out of ideas. |O I tried it on two different boards with cs and no cs. On two different PCs with Windows 10 and Windows 7. I tried different programs for monitoring the com port. In which port nothing is displayed. In this case, bring the simplest sketch on arduino to the com port normally ...   :-//  It remains only to install Linux.....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 04:33:53 pm
By the looks of it the UART0 is not actually used on the port E pins. Within the code, so far, I only found the pins being setup for input or output and not for uart. The code that makes use of the uart looks like for sending some sort of debug info. Messages like "D_info->sectorSize=[%d]\r\n" The code makes use of 0x01C25000 (RX and TX data register) and 0x01C2507C (status register).

For now I added it to the repository without comments under the C analysis directory.

For the FPGA I think they use one line as a read/write indicator and the other as a data/command indicator. Needs a lot of analyzing to go through all the files and comment on what it is doing. So far I separated the top functions that make use of the 0x01C20890 address and the three gpio functions I found. (Also added to the repository)

There are a couple of big functions in there, so maybe these are the ones that get the signal data from the FPGA.

One thing is for sure, it is starting to reveal a lot of its secrets. And there is room for improvement, by for instance not using 8 calls to the set io pin to input or output function when you can do it in one write to the register.

Also in the I2C routines it is possible to avoid the spikes in the signal I noticed, by not using this io pin setup function and do direct writes to the register. The status of the other pins is always known, so no need for and-ing and or-ing.

When I'm done with the FPGA analysis I will put the result in the repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 04:41:17 pm
I'm out of ideas. |O I tried it on two different boards with cs and no cs. On two different PCs with Windows 10 and Windows 7. I tried different programs for monitoring the com port. In which port nothing is displayed. In this case, bring the simplest sketch on arduino to the com port normally ...   :-//  It remains only to install Linux.....

Did you try the reader.hex, to see if that gives output like I saw on windows 7? Because that one keeps looping on receiving usb input.

If that works, you can connect your touch panel to it and see if it reads the config. And when that is the case you can, most likely, safely use the writer to write the config. Just connect it to the usb and the change is big it will write to the touch panel. After that confirm with the reader or the scope if it did the trick.

I did not spend to much time on making these programs and they are crude and could do with improvements, but only if really needed :palm: Because there is so much to do on the project and a day has only so many productive hours :)

And sure linux is an option. It works for me :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 15, 2021, 04:43:02 pm
I've been investigating the original firmware in ghidra and I've found how data gets written to and from the FPGA.
While doing so, I noticed an interesting function which could very well be the function that sets the LCD brightness. I've translated the required functions to normal C from the ghidra pseudocode in case anybody wants to try to implement them.

Code: [Select]
#define Pn_BASE(n) (0x01C20800 + (n * 0x24))
#define Pn_CFG0(n) ((volatile uint32_t *) (Pn_BASE(n) + 0x00))
#define Pn_DATA(n) ((volatile uint32_t *) (Pn_BASE(n) + 0x10))

#define SET_PIN(n, x) (*Pn_DATA(n) |= (1 << y))
#define CLR_PIN(n, x) (*Pn_DATA(n) &= ~(1 << y))
#define FPGA_SET_DATA(x) (*Pn_DATA(4) = (*Pn_DATA(4) & ~0xFF) | (x & 0xFF))

void fpga_set_input(void) {
*((volatile uint32_t *) Pn_CFG0()) = 0x00000000;
}

void fpga_set_output(void) {
*((volatile uint32_t *) Pn_CFG0()) = 0x11111111;
}

void fpga_write_cmd(uint8_t data) {
SET_PIN(PE_DATA, 9);
SET_PIN(PE_DATA, 10);
FPGA_SET_DATA(data);
CLR_PIN(PE_DATA, 8);
SET_PIN(PE_DATA, 8);
}

void fpga_write_data(uint8_t data) {
SET_PIN(PE_DATA, 9);
CLR_PIN(PE_DATA, 10);
FPGA_SET_DATA(data);
CLR_PIN(PE_DATA, 8);
SET_PIN(PE_DATA, 8);
}

void set_backlight(uint8_t level) {
fpga_set_output();
fpga_write_data_2(0x38);
fpga_write_data(0xEA);
fpga_write_data(level);
}

fpga_write_data_2 and fpga_write_data are temporary names. I think they might be "fpga_write_cmd" and "fpga_write_data".

Edit: As @pcprogrammer says, pin PE9 looks like a "W/!R" pin, while pin PE10 looks like a "CMD/!DATA" pin.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 04:49:08 pm
That might be it.
For the I2C coordinates register read the command seems to be 0x41.

So that means we might already have two commands
0x38  Set display brightness
0x41  Read touch panel coordinates register address

I will do my analysis first and then look into writing code to test things.

For the data register write an and with 0xFF should be used, to avoid changing the other pins.

Also setting the direction of the databus pins needs to be incorporated in the functions, because you won't know what they are set to. So register 0x01C20890 needs to be set to 0x111111111 to make them outputs, or 0x00000000 for inputs.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 05:24:24 pm
Did you try the reader.hex, to see if that gives output like I saw on windows 7?
I tried it. It also does not output anything to the com port. What connection speed of the com port should be set?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 15, 2021, 05:25:38 pm
I've updated the code. It's not the best thing I've ever wrote, but it's not that bad either :)

Turns out, to make them outputs you had to write 0001001001001001001001001, setting them to all 1s will disable them.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 06:24:36 pm
I think it is safe to say that code below is true. The problem now is to identify the commands and I have seen already more than a hand full. For example 0x21 tells the fpga to setup for reading either 1500 or 750 bytes of data, and also a similar function where the command being written before reading is supplied by an other function where a sequence of other commands (0x6X range) each followed by a read of a data byte is done.

Quite the puzzle.

Code: [Select]
//PE0:7 Databus
//PE08  Clock
//PE09  read/write     0 = read, 1 = write
//PE10  data/command   0 = data, 1 = command
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 06:28:36 pm
Did you try the reader.hex, to see if that gives output like I saw on windows 7?
I tried it. It also does not output anything to the com port. What connection speed of the com port should be set?

The speed of the port does not matter, there is no conversion to real serial.

Then maybe it is best to see if you can get a linux (I'm using linux mint 20) up and running. If then you still can't get it done I will improve the code for you.

edit: I used cutecom for communication, but it also works with putty, and probably with screen and other terminal programs.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 06:30:12 pm
I've updated the code. It's not the best thing I've ever wrote, but it's not that bad either :)

Turns out, to make them outputs you had to write 0001001001001001001001001, setting them to all 1s will disable them.

Totally correct, that is why I wrote the hexadecimal form of it. (0x11111111) :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 15, 2021, 06:38:16 pm
I've updated the code. It's not the best thing I've ever wrote, but it's not that bad either :)

Turns out, to make them outputs you had to write 0001001001001001001001001, setting them to all 1s will disable them.

Totally correct, that is why I wrote the hexadecimal form of it. (0x11111111) :-DD

Not right. To be 0x111.. it must be 000100010001...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 06:45:43 pm
That is true. I did not read it right because I thought he had 3 zero's per 1 in there. And according to the manual it needs to be so. Bit 3 is reserved, so it is 4 bits per pin.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 15, 2021, 07:14:25 pm
I could not flash the touchscreen with the bluepill. I connected it to the touchscreen, there is no result - the touchscreen works in reverse. I fleshed it with the arduino (sketch from ser8989). The touchscreen now works correctly!  Many thanks to ser8989 and pcprogrammer for the work done!  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 07:17:46 pm
Update for the possible brightness. The actual brightness is most likely a second byte written after the 0xEA. This is the sequence I found with Ghidra.

FUN_800169F8 is write command to fpga
FUN_800168FC is write data to fpga
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 15, 2021, 07:21:34 pm
I could not flash the touchscreen with the bluepill. I connected it to the touchscreen, there is no result - the touchscreen works in reverse. I fleshed it with the arduino (sketch from ser8989). The touchscreen now works correctly!  Many thanks to ser8989 and pcprogrammer for the work done!  :-+

Your welcome.

Too bad the bluepill did not work for you, but luckily you had ser8989 his solution. Glad your scope is working normally again. Have fun with it. :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 15, 2021, 08:06:53 pm
That is true. I did not read it right because I thought he had 3 zero's per 1 in there. And according to the manual it needs to be so. Bit 3 is reserved, so it is 4 bits per pin.

You're right! I missed the reserved bit. I've updated the code once again haha
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 15, 2021, 08:08:22 pm
Update for the possible brightness. The actual brightness is most likely a second byte written after the 0xEA. This is the sequence I found with Ghidra.

FUN_800169F8 is write command to fpga
FUN_800168FC is write data to fpga

Yep, in my code the brightness level is written after the EA byte, so 1 cmd byte, 2 data bytes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 16, 2021, 03:44:04 am
Slightly modified the sketch from ser8989. Added error output (Read configuration Error!) If the touchscreen is not connected or not connected correctly. Added messages about the beginning and end of the recording. Configuration reading is performed 2 times - before writing and after writing. After switching on, there is a delay of 2 seconds. Then the read / write is restarted every 30 seconds
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dmitrkov on April 16, 2021, 04:27:44 am
Another version of the sketch. Now the action is performed on a command from the com port (Read Write)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 16, 2021, 11:28:15 am
An update on the FPGA analysis. So far I already found the use of 42 different commands being written to the FPGA.

I identified 4 functions that inter-act on low level with the FPGA:
void FUN_800169f8(byte Command)          //Write a byte to the command register
void FUN_800168fc(byte Data)                  //Write a byte to  the data register
byte FUN_80016850(void)                         //Read a byte from the data register
void FUN_800167a0(void)                         //Set the databus for input

The other functions use these functions to do the communications.

The command 0x38 is used twice in the code, so either they set the brightness on two locations or it is not what we think it is.

Live tests with own written code need to be done to see what all the commands do.

There will be commands to control the relays in the analog input section, maybe control the sample speed, set trigger parameters, etc.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on April 16, 2021, 11:41:33 am
The command 0x38 is used twice in the code, so either they set the brightness on two locations or it is not what we think it is.

I think that you can find it in two parts of the code because one of them is the init (when you power on the scope) and the other one the user menu, where the user can adjust it. At least it makes sense to me.

I will try to boot bare-metal code and try to write some commands and see what they do.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 16, 2021, 11:50:55 am
That is a good idea.

The brightness is probably also set in the second program loader or the 1st executable, of which I think it is just used to display the initial image on the display. So a search through these parts might confirm things.

An option for testing can also be to make use of the FEL mode. With it is possible to load code to DRAM and execute it. This way you don't have to burn a SD card for every test. With the touch panel disconnected you can use UART1 for debug output.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 16, 2021, 12:14:22 pm
Question:

I still, did not find where the initialization functions are being called. Found the initialization function (FUN_800168A0) for communication with the FPGA, but there is no XREF for it like for other function.
The XREF in the attached image is for the local_8 variable.

This is the same for the I2C init function for the touch panel.

So if anyone knows where these initialization functions are called please let me know.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 16, 2021, 04:11:31 pm
The command 0x38 is the only command being written to the FPGA in the second program loader part. After it two data bytes are written, of which the first is 0xEA. The second byte is read from SRAM. (address 0x0000EA60)

So it most certainly will be the back-light control.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 16, 2021, 06:40:07 pm
I have uploaded what I got so far.  (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering/C%20analysis/FPGA%20analysis)

It is not fully done because it is a lot of tedious work to plow through the code. The list of commands, I believe, is complete for what is used in the code, but many of them need further exploration.

As I'm more of a hands on man, I will dive into writing test code and use the FEL method mentioned before to run stuff on the scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 16, 2021, 08:36:49 pm
Question:

I still, did not find where the initialization functions are being called. Found the initialization function (FUN_800168A0) for communication with the FPGA, but there is no XREF for it like for other function.
The XREF in the attached image is for the local_8 variable.

This is the same for the I2C init function for the touch panel.

So if anyone knows where these initialization functions are called please let me know.

In function sub_80035320.  (I labeled the funcs according to your findings)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 04:24:49 am
Looking at tv84 his output the display brightness is set to 0xEA 0x60 just before displaying the SD ERROR message, which you get when you remove the SD card and start the scope. So that explains the double use of the brightness setting command.

The other one will be the brightness setting when the scope starts up normally and when the user adjusts the brightness.

Edit: The command 0x38 with data 0xEA 0x60 I found is in yet another section of the code, where it handles other errors the system might encounter. (FUN_8001c138) Apparently it can detect failure of "AD9288_1_2"
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 08:08:06 am
Maybe I'm using Ghidra with incorrect settings or it is not as good as the program tv84 is using. But it explains why I could not find the calls to the init functions. Ghidra does not find code at that address.

Edit: Found the option to disassemble this section and now it shows the function calls. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 17, 2021, 09:15:10 am
Maybe I'm using Ghidra with incorrect settings or it is not as good as the program tv84 is using. But it explains why I could not find the calls to the init functions. Ghidra does not find code at that address.

Sure it can. You just have to force it, in that case.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 09:36:16 am
Did that and edited my previous post.

Had some idea's come up overnight and found some interesting stuff based on them. The FPGA is used to talk to the unknown I2C chip connected to it and I believe the MCU uses the FPGA commands in the range 0x6X to communicate with this unknown chip.

For the brightness setting in FUN_8001d380 a call is made to FUN_800248f8 with 0x10 and some other parameter. In this function the 0x6X commands are used. There are writes to 0x68 ~ 0x6E. This entails 7 bytes, and what did I find earlier in my quest, the communication with this unknown chip is done in bursts of 8 bytes. 1 slave address and 7 data bytes.

So I have to write an experiment to check this out.

If it is so, things become much clearer. I did notice that the scope remembers it's settings, so we have to identify what each byte used, when calling FUN_800248f8, means.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 17, 2021, 09:43:53 am
Edit: The command 0x38 with data 0xEA 0x60 I found is in yet another section of the code, where it handles other errors the system might encounter. (FUN_8001c138) Apparently it can detect failure of "AD9288_1_2"

That function is something like a Check_HW.  See below:

Code: [Select]
int Check_HW()
{
  int result; // r0@1
  int v1; // r0@2
  int v2; // r0@2
  int v3; // r0@2
  int v4; // r0@2
  int v5; // r0@2
  int v6; // r0@2
  int v7; // r0@2
  int v8; // r0@2
  int v9; // r0@2
  int v10; // r1@2
  int v11; // r0@2
  int v12; // r4@2
  signed int v13; // r0@8
  int v14; // r0@13
  int v15; // r4@14
  const char *v16; // r0@15
  int v17; // r0@24
  int v18; // r0@24
  int v19; // r0@24
  int v20; // r0@24

  result = sub_8002330C();
  if ( result != 2 )
  {
    v1 = sub_80027D88();
    v2 = sub_8000690C(v1);
    v3 = sub_80009658(v2);
    v4 = sub_80001314(v3);
    v5 = sub_8000689C(v4);
    v6 = sub_800095E8(v5);
    v7 = sub_800068D4(v6);
    sub_80009620(v7);
    sub_80012A4C();
    v8 = sub_800267E8();
    sub_80002790(v8);
    sub_80026808();
    sub_800267C4();
    v9 = sub_80026828();
    v11 = sub_8000696C(v9, v10);
    sub_800096B8(v11);
    FPGA_write_cmd(0x38u);
    FPGA_write_data(0xEAu);
    FPGA_write_data(0x60u);
    sub_80017778();
    sub_80019704(0);
    sub_80018F6C(0);
    sub_80019730(off_8018B738);
    sub_800197C8(0);
    FPGA_write_cmd(6u);
    v12 = (FPGA_read_data() << 8) & 0xFF00;     // Check_FPGA
    if ( (FPGA_read_data() | v12) != 0x1432 )
    {
      sub_80019704(0xFF0000);
      print_msg((int)"FPGA", 30, 90);
      print_msg((int)"Failed", 100, 90);
      while ( 1 )
        ;
    }
    sub_80019704(0xFFFFFF);
    print_msg((int)"FPGA", 30, 90);
    print_msg((int)"OK", 100, 90);
    sub_80017CE0();
    if ( Check_Encrypt() != 0x8150 )
    {
      sub_80019704(0xFF0000);
      print_msg((int)"Encrypt", 30, 110);
      print_msg((int)"Failed", 100, 110);
      while ( 1 )
        ;
    }
    sub_80019704(0xFFFFFF);
    print_msg((int)"Encrypt", 30, 110);
    print_msg((int)"OK", 100, 110);
    v13 = Check_AD9288();
    if ( v13 != 3 )
    {
      if ( v13 != 1 )
      {
        if ( v13 != 2 )
        {
          sub_80019704(0xFF0000);
          print_msg((int)"AD9288_1_2", 30, 130);
          print_msg((int)"Failed", 120, 130);
          while ( 1 )
            ;
        }
        sub_80019704(0xFF0000);
        print_msg((int)"AD9288_1", 30, 130);
        print_msg((int)"Failed", 120, 130);
        while ( 1 )
          ;
      }
      sub_80019704(0xFF0000);
      print_msg((int)"AD9288_2", 30, 130);
      print_msg((int)"Failed", 120, 130);
      while ( 1 )
        ;
    }
    sub_80019704(0xFFFFFF);
    print_msg((int)"AD9288", 30, 130);
    v14 = print_msg((int)"OK", 100, 130);
    if ( !Check_Analog(v14) )
    {
      sub_80019704(0xFF0000);
      print_msg((int)"Analog", 30, 150);
      print_msg((int)"Failed", 100, 150);
      while ( 1 )
        ;
    }
    sub_80019704(0xFFFFFF);
    print_msg((int)"Analog", 30, 150);
    print_msg((int)"OK", 100, 150);
    sub_80019704(0xFFFFFF);
    print_msg((int)"Touch", 30, 170);
    print_msg((int)"...", 103, 167);
    v15 = Check_Touch();
    if ( v15 )
    {
      sub_80019704(0xFFFFFF);
      v16 = "OK ";
    }
    else
    {
      sub_80019704(0xFF0000);
      v16 = "Failed";
    }
    result = print_msg((int)v16, 100, 170);
    if ( v15 )
    {
      sub_80019704(0xFFFFFF);
      print_msg((int)"Hard Checked Successful !", 30, 190);
      v8019D5A3 = 0;
      v8019D5A6 = 300;
      v8019D5AF = 0;
      v8019D5B2 = 100;
      v8019D5AA = 19;
      v17 = sub_8000696C(0x8019D5A0, 0);
      v18 = sub_800096B8(v17);
      v19 = sub_8000689C(v18);
      sub_800095E8(v19);
      v20 = sub_800266C4();
      sub_80025BB0(v20);
      result = sub_8000BC00(500);
    }
  }
  return result;
}

So, they check (by this order):

1 - FPGA              // ID ??
2 - FPGA_Encrypt     // Checksum ??
3 - AD9288
4 - Analog
5 - Touch

If all is well it returns: "Hard Checked Successful !"
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 09:50:20 am
The FPGA Encrypt check is nothing else than sending command 0x41 to the FPGA and read two bytes. The result is checked against 0x8150, being the GT911 register address for "point 1 lsb X coordinate"

Did not look at the other checks yet.

The question is if this function is even used, or how they do the check on the touch panel. Because it it possible to not have the touch panel connected. The scope starts just fine in that case.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 17, 2021, 10:12:42 am
This func is called for sure BUT, depending on its 1st verification : sub_8002330C, it may bypass the HW check.

Or the Touch only fails if you have an invalid touch HW attached.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 10:24:52 am
Which is an interesting function full with all kind of hardware checks, down to the detecting of failure of the AC/DC relays (KAQY214S)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: alangave on April 17, 2021, 11:01:32 am
Hmm very strange. Do you have the problem on both channels?

Check the following signals on the ADC's to see what is there. Should be stable DC levels. REFOUT (pin 6), AINA = AINB (pin 3 and 10).

Also check if there is distortion on the 3.3V supply, since the ADC's are powered with it. And take a look at the ADC1_OFFSET and ADC2_OFFSET signals coming from the FPGA.
Unfortunatelly, nothing weird: Supply ok, no ripp^le (at least nothing visible on my old 20Mhz scope), voltage on above pin looks ok too, I mean, stable
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 17, 2021, 11:31:09 am
When you are probing the signals with your other scope, can you still see the distortion on the FNIRSI scope? The grounding with the other scope might change the playing field. Is a bit of a problem with this kind of measurements.

It is unlikely that the sine is introduced in the FPGA or the F1C100s code. Since at startup you say it works normal for a while, it might be some capacitor that starts to leak.

Check the power supply schematics, and measure on the switchers to see if you can find a ~25KHz signal. Best bet is the LCD back-light, which is being modulated by the FPGA. Come to think of it, see what happens when you change the brightness to another level. When the signal on the screen changes frequency, then you are closing in on the source.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: alangave on April 17, 2021, 04:21:16 pm
no difference when probing the signal on the other scope, or not ...

I was also suspecting a bad component starrting leaking or something
Even though about external electromagnetic perturbation (led lamp, computer , ...), but no change after having powered off eveything or changing place

Regarding screen, I have noticed that it start flipping when I try to reduce screen brightness when phenomenum occur, after a ~1 minutes.

The strange but noticeable thing is that this parasite appears on both channel even unplugged.

I'll check the LCD back light...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 18, 2021, 06:12:41 am
no difference when probing the signal on the other scope, or not ...

I was also suspecting a bad component starrting leaking or something
Even though about external electromagnetic perturbation (led lamp, computer , ...), but no change after having powered off eveything or changing place

Regarding screen, I have noticed that it start flipping when I try to reduce screen brightness when phenomenum occur, after a ~1 minutes.

The strange but noticeable thing is that this parasite appears on both channel even unplugged.

I'll check the LCD back light...

Based on the photo in your first post I did some calculations. The signal on the screen shows it is ~2 divisions whilst the full screen is 8 divisions. This means the signal you are looking at is a 1/4 of the ADC input range. This is according to the specs +/-512mV p-p, so a 1.24V swing. This means the signal on the differential inputs of the ADC is only 0.31Vpp.

Since it is on both channels, even when nothing is plugged in, this means that it resides in the common signals for both the ADC's. 3.3V supply, 2,5V supply and VRF1. Look at these signals again with AC coupling and zoom in on the ripple. See if you can find a ~25KHz, >300mVpp signal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 18, 2021, 10:36:25 am
First test with FEL code execution failed. Probably due to missing configuration of the clock registers. Just wrote a simple piece of code setting up the FPGA bus and writing the back-light command to it.
Nothing happened apart from a locked up scope.

Code: [Select]
#include "fpga_control.h"

int main(void)
{
  fpga_init();
 
  fpga_write_cmd(0x38);
  fpga_write_short(0xEA60);
 
  while(1);
}

So some study of the MCU itself is needed to enable the peripherals.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 18, 2021, 12:03:40 pm
Are you doing the correct delays? Have you analyzed your sequence timings? I think they have embedded delays in the code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 18, 2021, 01:23:47 pm
I looked at the assembly of the code I wrote and it looks similar to what is in the scope. No delays in there. Only difference is that they use function calls for the clock pulse, which might make some timing difference. And the scope might run on a different CPU frequency, but that is most likely higher than default. They switch to 600MHz. Default is 408MHz according to the manual.

Did not find a register for enabling the GPIO yet, so not sure if it is always on. I'm used to the STM devices, and there you have to turn on every peripheral there is including GPIO. I'm always on about the bad quality of the STM documentation, but this is even worse.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 18, 2021, 01:54:20 pm
I looked at the assembly of the code I wrote and it looks similar to what is in the scope. No delays in there.

For you, what is the use of sub_8000BC34 ?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 18, 2021, 01:56:40 pm
That is a delay function, but that is not used when clocking the FPGA. It is used in between some actions they do with the FPGA.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 18, 2021, 04:22:35 pm
It turns out that the GPIO is indeed enabled when the MCU is running in FEL mode. I hooked up my MSO5074 to the touch panel connection (Port A) and used sunxi-fel to set the port configuration to output and was able to toggle the pins and see it on the scope. Wrote a program to do the same, uploaded it to 0x80000000, called exe on the same address and it did not work.

So now I'm wondering if it is the internal DRAM that needs to be enabled first. I read the three BUS_CLK_GATING_REG registers and the only part turned on is the USB_OTG_GATING.
There is a bit SDRAM_GATING, but most likely other registers need to be configured to make it work. It is back to the Ghidra output and check the SPL part to see what is done in there.

Edit: Had a brain wave |O There is SRAM at address 0x00000000, that can be used. Tested the back-light code there and it just works. This means that for testing bigger stuff FEL is not the way to go, unless a script is made to use the sunxi-fel writel option to configure all the needed registers for enabling the DRAM.

The default PLL_CPU setting is 0x80011000, which translates into 204MHz instead of the 408MHz mentioned in the manual.

Edit2: Used sunxi-fel to set the clock to 600MHz and tested the back-light code again. It still works. Tested it with my port A toggle program and was able to verify that the MCU is indeed running on the higher speed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 19, 2021, 10:01:03 am
Analyzing the code of function FUN_80024EE0 makes me think the commands in the 0x6X range have the following meaning. In the function FUN_800248f8 the function FUN_80024EE0 is called to do a write and then a read is done. Still have to analyze FUN_800248f8, because there is some sort of fail safe in there. It seems the reading can be done at max 50 times and the whole process (writing and reading) 6 times.

The writing followed by reading, I have also observed when I was measuring on the I2C bus coming from the FPGA.

Code: [Select]
//Commands to interface with the I2C chip connected to the FPGA
//0x64    Prepare bus for reading. Send twice in a row.
//0x65    Prepare bus for writing. Send twice in a row.
//0x66    Start the communication.
//0x67    Read the status flag. Bit 0 needs to become 1. Needs to be preceded by 0x66
//0x68    Not clear about this one. Is read from a memory address and Ghidra sees it as 0x09.
//0x69    Parameter id and byte count. iiiiiicc. 6 bits id and 2 bits count.
//0x6A    Checksum. sum of the other 6 bytes
//0x6B    Value byte 3 MSB. 0x69 when not used.
//0x6C    Value byte 2. 0x96 when not used.
//0x6D    Value byte 1. 0x99 when not used.
//0x6E    Value byte 0 LSB.

Edit: Found a third function that uses the I2C read commands. It is in the initialization section of the code. FUN_80024E18. Based on that I wrote some test code that repeatedly sends the commands to the FPGA. Hooked up my MSO5074 to the I2C bus pins and it is working as I suspected. This first read is used to set the byte in memory that is later used to fill in the byte for command 0x68.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 19, 2021, 12:51:16 pm
Am I stupid or can the if parts in below code be done with a single XOR???  |O :-DD

And guess what I'm not. This code is used to invert bits in the received bytes based on the byte received from command 0x68.

Why they made the parameter storage like how they did it, and not with a fer-rite based or other long lasting non volatile storage I don't know. Don't know the prices of these chips and how much a difference it would have made, but I find it stupid design decisions.

Code: [Select]
void FUN_80024b14(void)
{
  byte *pbVar1;
  uint uVar2;
  byte bVar3;
 
  pbVar1 = DAT_80024c78;                                                 //0x8035EC04. Buffer in DRAM
  uVar2 = 1;
  bVar3 = ~*DAT_80024c78;                                                //Byte received from command 68 inverted
  *DAT_80024c78 = ~*DAT_80024c78;                                        //Keep it in the same spot for later

  do
  {
    if ((bVar3 & 0x80) != 0)                                             //When bit 7 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 0x80 | pbVar1[uVar2] & 0x7f;      //Invert bit 7 and or it back in with the rest of the bits
    }

    if ((bVar3 & 0x40) != 0)                                             //When bit 6 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 0x40 | pbVar1[uVar2] & 0xbf;      //Invert bit 6 and or it back in with the rest of the bits
    }

    if ((bVar3 & 0x20) != 0)                                             //When bit 5 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 0x20 | pbVar1[uVar2] & 0xdf;      //Invert bit 5 and or it back in with the rest of the bits
    }

    if ((bVar3 & 0x10) != 0)                                             //When bit 4 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 0x10 | pbVar1[uVar2] & 0xef;      //Invert bit 4 and or it back in with the rest of the bits
    }

    if ((bVar3 & 8) != 0)                                                //When bit 3 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 8 | pbVar1[uVar2] & 0xf7;         //Invert bit 3 and or it back in with the rest of the bits
    }

    if ((bVar3 & 4) != 0)                                                //When bit 2 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 4 | pbVar1[uVar2] & 0xfb;         //Invert bit 2 and or it back in with the rest of the bits
    }

    if ((bVar3 & 2) != 0)                                                //When bit 1 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 2 | pbVar1[uVar2] & 0xfd;         //Invert bit 1 and or it back in with the rest of the bits
    }

    if ((bVar3 & 1) != 0)                                                //When bit 0 of the byte from command 0x68 is set
    {
      pbVar1[uVar2] = ~pbVar1[uVar2] & 1 | pbVar1[uVar2] & 0xfe;         //Invert bit 0 and or it back in with the rest of the bits
    }

    uVar2 = uVar2 + 1 & 0xff;
  } while (uVar2 < 7);                                                  //Process each of the received bytes except the first
  return;
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 20, 2021, 04:59:55 pm
First attempt of running linux with the back-light turned on failed. Added the tested turn back-light on code to the mach-sunxi/board.c file to be called at the end, after the init of ethernet function, but nothing. Linux started just fine, but no back-light.

I'm now checking the SPL of the scope and a call to a brightness set function is made. Not sure at what point in time though. The FPGA also needs some time to load it's configuration (have to check how much this is) and maybe my linux try does the write to soon when the FPGA is not ready yet.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 22, 2021, 11:28:44 am
Did some investigation and measurements on the FPGA configuration loading. The measurement with my MSO5074 shows it takes almost a second to load the FPGA. It clocks the flash with ~2.4MHz.
In the picture is the measurement on the flash clock. Also measured the FPGA conf_done pin and it shows the same time frame.

So within the u-boot the back-light can only be turned on after the configuration of the FPGA. This means that when one wants to see the u-boot messages on the display a delay of 1 second is needed.

I also measured on the F1C100S_FPGA_CLK pin and could see the 3 clock pulses for writing the brightness, but these are way to early.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 22, 2021, 01:36:07 pm
I'm a bit at a loss. Made a delay loop in the code with some extra code to try to avoid optimization from taking it out, and tested it. Did not seem to do the trick. Measurements show that the "void s_init(void)" function I added the code to, is called twice. No idea why, but it gave me the possibility to measure the delay on being extended. Changed the 50000 to 200000 and it made no difference. So it looks like it is optimized out. Extended the code a bit more and that is compiling now.

The pictures show the FPGA flash clock (blue line) with the yellow line being the F1C100S_FPGA_CLK line. It is hard to see, but there are two spikes going low. These are the three clock pulses to set the brightness. In the zoomed in pictures it is possible to see them with the time of center screen in the top of the screen.

Code: [Select]
void fpga_delay(void)
{
  int i,j;

  //The FPGA has a loading time of ~900mS
  //Delay for allowing the FPGA to be up and running
  for(i=0,j=0;i<50000;i++)
  {
    j += 2;
  }

  if(j>1000)
   i=0;
}

Edit: The change in the code did not make a difference.  |O

Code: [Select]
void fpga_delay(void)
{
  int i,j,n;

  //The FPGA has a loading time of ~900mS
  //Delay for allowing the FPGA to be up and running
  for(i=0,j=0,n=0;i<2000000;i++)
  {
    j += 2;
    n = (j * 3) + i;
  }

  if((j>1000) && (n>1000))
   i=0;
}

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 22, 2021, 04:07:25 pm
Decided to use some other method of waiting for the FPGA. It has a command 0x06 which returns the version number 0x1432. So I just repeat a write of this command followed by two reads and check if the right number is returned. It is a bit blunt as can be seen on the picture with the MSO5074. The pink line is the FPGA flash clock and the yellow one is the F1C100S_FPGA_CLK signal. After ~350ms the s_init function is called. It then starts probing the FPGA and once it is ready it gets the right number. It is called a second time ~150ms later, which is the write/read of command 0x06 and the write of the brightness command 0x38.

So there is linux output on the display now, without the need of iscle's trick to use reset to have it starts linux after the screen has been turned on. This only works in the old (16Mbit) version because in the new (32Mbit) version the reset vector is set to jump to 0x80000000 and just starts the scope again.

I will upload the u-boot archive and the image to the repository (https://github.com/pecostm32/FNIRSI-1013D-Hack)

Edit: A better location for setting the brightness is after the display has been initialized. The way it is now the display is in an all white mode and when the back-light is turned on it is very bright. It takes a while after that before any linux output is send to the screen. So most likely this u-boot version is not setup for a display at all or not for this display. The whole embedded linux stuff is still new to me and takes a lot of digging to understand what is going on.

As for the scope, there are still many things to figure out before anything working can be made. The whole signal handling is not clear yet. I'm trying to get to a bare-metal implementation of some copy of the original scope, but the lack of documentation for parts of the F1C100s make it difficult to understand. To get the DRAM inside the chip working requires the setting of a lot of registers. u-boot does do this, but with all the different defines for the different models of the allwinner processors it is not that simple to figure it out.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 08:57:19 am
Found an interesting archive in a thread on github (https://github.com/RT-Thread/rt-thread/issues/3648). The archive (https://github.com/RT-Thread/rt-thread/files/4730121/F1C100S_USB_Driver_V1_1.2.zip) holds source code for the startup of the F1C100S and there is a file sys-dram.c in it, which matches code I found in the SPL of the scope.
For instance at address 0x00001150 I found the function dram_get_dram_size.

This makes live a bit easier. Still missing is a good description of a lot of the registers existing in the F1C100s. So if anyone out there has a more complete programming manual of the F1C100s please post it here in the forum.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on April 23, 2021, 09:41:19 am
And, we've got image!

(https://i.postimg.cc/Lsdrzmb5/photo-2021-04-11-17-52-43.jpg)

Nice, but without the fpga interface it is just a small linux computer

You say that as if a portable Linux computer with screen for 65 Euros is a bad thing.   :-//

The next question should be "Does it run MAME"?

Edit: It's not 65 Euros, it's over 100. My bad.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 09:59:07 am
You say that as if a portable Linux computer with screen for 65 Euros is a bad thing.   :-//

The next question should be "Does it run MAME"?
Ok, I got mine for 25 euros due to refund, but if I was on a salary, by the time it is fixed it would be way more expensive. But where did you find it for 65 euros? Cheapest I have seen them was 100 euro on Aliexpress and that was when it was on special sale. Now it is >110 euros.

For as far as what will run on it I will leave that experiment to others for now.

Still trying to get to the bottom of the signal part of the scope. Getting better with using Ghidra, which is a great tool, so there is progress.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on April 23, 2021, 10:29:11 am
where did you find it for 65 euros? Cheapest I have seen them was 100 euro on Aliexpress and that was when it was on special sale. Now it is >110 euros.

My bad, I searched for it and it showed some of those Aliexpress "fake price" results. 65 Euros is the nasty yellow one.

100 Euros still isn't a terrible price for ARM computer+screen+case+battery.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 10:56:02 am
where did you find it for 65 euros? Cheapest I have seen them was 100 euro on Aliexpress and that was when it was on special sale. Now it is >110 euros.

My bad, I searched for it and it showed some of those Aliexpress "fake price" results. 65 Euros is the nasty yellow one.

100 Euros still isn't a terrible price for ARM computer+screen+case+battery.

For sure, it is not a bad little machine. And definitely a nice hobby project :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 12:04:16 pm
It was a bit of work, but I plowed through the SPL (second program loader) and it is doing the system setup for memory, clocks, spi, fpga and display. It turns out that it is not what I thought before. The SPL loads the bitmap image from the flash and puts it on the display. Then it starts to load the header of the 2nd executable (at address 0x00027000 in the flash), to get the length and what more. If that gives an ok result it loads the rest of the program into the DRAM at 0x80000000. Only if it fails the 1st executable is tested and loaded. If that also fails it runs into an endless loop.

So what is in the 1st executable at address 0x00006000 in the flash? Some test program?

Might give it a try and patch the SPL so it loads the 1st executable instead of the 2nd one.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: JordanW on April 23, 2021, 01:27:03 pm
I understand that discussion around this cheap tablet scope has turned to hacking the firmware.

Taking a step back -- I'm looking at getting this scope for purely hobbyist purposes. I've used oscilloscopes before but have never had one of my own.

I've watched the review(s) and think I understand its limitations (I really only need about 20 MHz bandwidth). Space is at a huge premium for me and budget is also an issue, so it's between this and something like a USB scope (e.g. https://canada.newark.com/multicomp-pro/mp720016-us/pc-based-osc-2-ch-25mhz-100msps/dp/10AH2399) Which would you choose?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 01:44:25 pm
Both will have their uses. The advantage of the FNIRSI-1013D is that you can take it with you and don't need a PC (laptop) to do measurements. If the USB type is powered from the PC (I did not see a power plug) then it must have very good filtering in it to over come the noise on it, because USB power is rubbish.

There is always a risk with the FNIRSI that there is a problem with the touch panel. Don't know the stats, but it is one of the reasons the hacking game started. At least it is now known how to fix it and with what parts. :-+

I myself would go for the FNIRSI.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 23, 2021, 03:57:10 pm
Tested the 1st executable hack. It either is, or starts the FEL program. When connected to USB it shows up as the same "ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode" device as when booted with the FEL SD card.

So nothing interesting there.

I will upload it to the repository just for the sake of it :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 25, 2021, 12:15:12 pm
While working on writing a copy of a bare metal bootloader for the scope, based on what is there now, but optimized, I decided to take a look at the bitmap.

Wrote a simple conversion program to make it into a windows .bmp file, and surprise surprise it is the FNIRSI logo seen at startup. Converted to a .png to be able to post it here. The bitmap and the original binary is in a .zip archive.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on April 25, 2021, 06:00:50 pm
Wow, this thread is grown... :D
Knowing only the first pages, too lazy to read all the pages after :
Is something interesting happen, new firmware, hacks ?

Martin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 25, 2021, 06:18:41 pm
Working on it.

Found a lot of interesting things already. Managed to solve the touch panel reversed coordinates problem when replaced with one from aliexpress. (due to defects in the original touch panel) For this a patch has been made to the new version of the code. Also reversed engineered the schematics and have some knowledge about controlling the FPGA used in the scope.

Check out the repository here: https://github.com/pecostm32/FNIRSI-1013D-Hack

At the moment working on my own version of the bootloader to get a better understanding of the F1C100s. After that it is writing my own version of the scope software. Basically open sourcing the existing code with some cleanup.

When that is done it is time to make improvements.

But it will take some time :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 26, 2021, 07:11:13 pm
Too bad, A quick test of my new bootloader fell in the water. For some reason sunxi-fel times out when I try to load the ~8KB of program data to address 0x00000000. With small programs it works just fine.

So now I have to do a bit more work and make a flash-able image with at least the bitmap image in there. Or try to only write to the first part of the flash. Not sure about what sunxi-fel does when writing to flash. Have to do some experiments.

If the new code works it is at least 4KB smaller than the original :-DD

It still needs some polishing in the comment and defines sections to make it better maintainable. Especially in the DRAM section. The lack of documentation makes it a bit of a guess what is what. DRAM controlling is also new to me, so lots to learn.

For now it will stop after loading and displaying the bitmap image. Adding the loading of the main program is peanuts compared to the rest.

So again, the story continues :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: vzgherea on April 26, 2021, 11:54:24 pm
I've got a Chinese version of this device.
Flashed it with the English version - https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Binaries/Original%20files/W25Q16en.bin (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Binaries/Original%20files/W25Q16en.bin)
Got the same result as it is shown here - https://www.youtube.com/watch?v=InCihC4Q1u8&ab_channel=%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9%D0%A1, (https://www.youtube.com/watch?v=InCihC4Q1u8&ab_channel=%D0%94%D0%BC%D0%B8%D1%82%D1%80%D0%B8%D0%B9%D0%A1,) it looks like the input and touch coordinates do not match.
My chip is W25Q16 and the initial firmware is different from https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Binaries/Original%20files/W25Q16cn.bin (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Binaries/Original%20files/W25Q16cn.bin)
Am I using a wrong firmware? Do I need to reset anything?
Thank you!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 27, 2021, 05:40:45 am
Looking at the video shows only the reversal of the x coordinate. This can be solved by modifying the parameters being written into the touch panel. To my understanding the English W25Q16 version of the firmware found in this thread is not sending any configuration to the touch panel, so you only need to write a modified configuration to your touch panel.

Get hold of a 6pin 0.5mm adapter (https://nl.aliexpress.com/item/4000099171451.html) for connecting the touch panel to either a 3.3V arduino (nano) or a STM32F103 based board. (Bluepill). Look at the STM code in my other repositories or the arduino code found in the thread. Read the config from your touch panel and make modifications for reversing only the x coordinates, and write them back. (Either the x2x bit or the order of the sensor assignments)

The programming manual of the touch panel chip can be found in the repository.

Should do the trick.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on April 27, 2021, 09:02:21 pm
By the way,

In periods of 2 month I´m writing to finirsi and ask for a new firmware....
And getting always the same answer:

Nothing. ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: vzgherea on April 28, 2021, 03:03:03 am
Read the config from your touch panel and make modifications for reversing only the x coordinates, and write them back. (Either the x2x bit or the order of the sensor assignments)

My config for some reason is completely different from one I can see in post #712.
Executed the WRITE command from sketch in the same post, however after another reading I found that the config remained the same.

Is my config correct? What bit should I change in order to fix this issue?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 28, 2021, 06:30:42 am
I took a look at the sketch from post #713 (version with read / write action on request via serial) and there are two things that can go wrong and the configuration change in it is for both X and Y reversal.

The things that can cause problems is that register 0x8047 is not written to a value equal or higher to what is in the touch panel. (See picture of that part of the manual) and or the checksum is not correct for the new configuration. For this it is necessary that all the bytes from 0x8047 to 0x80FE are known to calculate it. There is code out there that does the calculations. (Not behind the computer I use for development, so can't check it right now).

In my conf writer the whole configuration string written by the scope (new 32Mbit firmware version) is given. When only the order of the sensor array bytes are changed the checksum will remain correct.

Data destined for register 0x80B7 - 0x80C4 for changing the Y direction, and register 0x80D5 - 0x80EE for changing the X direction. (It is all in the Goodix GT911 programming manual, except how the checksum is calculated)

Changing any of the other bytes in value needs a recalculation of the checksum.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 28, 2021, 10:09:29 am
For those interested an update on the getting to an open source and improved copy of the scope bootloader.

It took some research to get to a binary that can be loaded into the flash. It needs the BROM header and the correct startup code to set the MMU coprocessor. On a first try it did not start, since it needs a correct checksum in the BROM header. Found a program to make that right, so second attempt did start, but did not finish. Due to no easy debug possibilities I added my toggle port A test and connected the MSO5074 to see where the code failed. Found that I did not interpreted the SPI code correctly and it got stuck in reading the large part of the image data. Reading the header was not a problem. So it got stuck when reading more then 64 bytes (which is the FIFO size).

Managed to fix that, but still not a correct image on the display. Since I raised the clock to what the scope main program is running on (600MHz), it might be in the settings for the display and timing is off.

Doing separate tests now with small bits of code that can be loaded to the SRAM with the FEL tool.

Not happy with the way the SPI code works. Even on the 600MHz it takes almost 50uS to copy just 64 bytes to memory. The code now starts a read burst of 64 bytes (similar to the code I found and what is in the scope) waits till the FIFO is filled and then copies them to memory and starts the next burst. There should be a way to improve on this by either using DMA or skip the FIFO and do a byte per byte run.

It is a bit of a problem to verify with the MSO5074 what the original bootloader is doing, because at startup of the scope it loads the bootloader from flash with the SPI. So the MSO5074 is triggered directly and the loading of the image starts after the bootloader is loaded. To even see the beginning the MSO5074 needs to be on 200mS/div and then it is impossible to zoom in on the signal. The BROM runs the SPI on ~3MHz while the scope bootloader goes up to maybe 50MHz.

So I keep on experimenting and learning.

Edit: The image shows the reading of 250 bytes of data in 64 bytes bursts
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 28, 2021, 12:42:10 pm
I'm getting there. Had to hard code the image sizes to get it to work. With the previous version, where I get the image sizes from the header, it took almost 8 seconds for the display_bitmap function to complete, so there had to be something wrong. As the code itself looked ok, I decided to just put in the numbers directly and with that it just works.

Ok there is an issue of clearing the screen memory first. The background is some sort of yellow spotted pink. But that is just writing a block of memory. There is plenty of time before the FPGA is ready to do this task in.

Also have to figure out what goes wrong in getting the image x and y size from the header data. The length of the image data is also obtained from the header and is used for reading it from the flash, and that is spot on. (Was able to determine this by measuring the time the flash CS line was asserted for reading the data. Only ~50ms for the ~58K of the image, so the SPI optimization is not a big issue)

So almost there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 28, 2021, 02:11:24 pm
The bootloader is somewhat finished. Uploaded the code here: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_bootloader

There is still room for additional comments and maybe some cleanup in the dram control part.

But it works. The initial image is displayed and after that it takes ~1.6S to start the scope code.

The attached image shows the SPI clock and cs of the total startup sequence. The first messy bit is the BROM loading the bootloader. Then the small spike is the loading of the image. The large blob is the loading of the scope main program. The large amount of noise is due to the fact it is 50MHz signals connected via 20cm wires and then probed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: serverror on April 29, 2021, 12:33:07 am
Really enjoying following your progress. Thanks for your efforts. Will those of us on the older/bulkier version of the scope with a W25Q16 need to make any changes before being able to use some of your work?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 29, 2021, 05:33:02 am
Really enjoying following your progress. Thanks for your efforts. Will those of us on the older/bulkier version of the scope with a W25Q16 need to make any changes before being able to use some of your work?

Nice to hear my work is appreciated. :)

Have not tried it myself, but others have used the W25Q16 version floating around in this tread in the new version of the scope, so looks like the basic hardware is the same. This means that once the main code has been opened up, it should be usable on the old version as well.

The only big difference is the flash size, but the new code will most likely be smaller due to removal of unneeded stuff.

Testing it on a old version scope once it is al done will be the proof of the pudding ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on April 29, 2021, 08:36:45 am
Nice to hear my work is appreciated. :)

Sure it is.  :-+ Keep it coming.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 29, 2021, 04:53:51 pm
Well here is some more stuff 8)

it is going to be quite the job to get the main scope code opened up. Now working on the initialization section of the C variables and found that there are 2584 bytes initialized with a value other then zero. 7055620 bytes are being made zero.

Then there is something else done with the data, which I don't get just yet. In the startup code there is a loop that gets 4 registers filled with data from 0x80192e6c. r0 is used as source, r1 as destination, r2 as byte counter and r3 the address of the function to call. The first group is for the bytes with a value other then zero. The second group for the call I don't get, and the third groups is for the bytes that are set to zero.

I uploaded a new Ghidra zip to the repository with more function names filled in.

The functions used for the init are at address 0x8000008C for the looping through the three groups, 0x800000C8 for the special byte handling, 0x80000124 for the copying of the non zero data and 0x8000014C for the clearing of the variables set to zero.

Anyone any idea on this. I know that for C there is a data and a bss section, so what is the third.

Edit: the fog is lifting just a bit. The first data copy is to make room for the actual data. So it is basically moving the data to be used by the special routine, which writes back to the section it came from. It is "moving" 2584 out of the way and then does some formatting to copy it back to a much larger byte array. (42756 bytes) The third action overwrites the bytes "moved" in the first action. So I copied the bytes from the binary and put them in a C array and will write a test program to see what the special copy function does.

Edit2: It is a kind of run length encoding scheme. I outputted the expanded data to a binary file and I was able to find the touch panel configuration string (without the checksum, because that is calculated in the code) in it :) So yet another mystery solved. Attached the code and the output file. The tp config is at offset 41190.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 30, 2021, 07:17:48 pm
Today the 1mm thick 200x200mm plexiglass I ordered arrived (https://nl.aliexpress.com/item/32833660352.html)

I made a new front for my scope. Left the protective film on until I fix it with some double sided tape. Then I have to mount the touch panel and display behind it.
Also still waiting for the new flash chips to arrive. Only then can I restore the scope to normal working order.

On the hacking front not a lot of progress. Got the clock initialization into a .c file. It is slightly different from the boot loader init. I am now working on the timer setup. It is using timer 0 on a 1ms interval. It is interrupt based. The function for setting up the interrupt is called from two other locations, so there are three things using interrupt. Have not identified the other two yet. The Ghidra file is getting more and more functions named, so tracking gets easier.

Edit: the three interrupts are: TIMER0, USB_OTG, PORTE. The latter is for the power monitoring pins.

But still a long way to go.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Paul-H on May 01, 2021, 07:37:15 am
Sorry to resurrect and old thread

In the stripdown pics above there is what appears to be a SD or microSD card reader, anyone know what it's for, as there is no access to it with the case on.

Thanks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 01, 2021, 08:42:26 am
The micro SD card is used as storage for the pictures and waves one can save on the scope. Via USB the data can be retrieved. When the micro SD card is removed or it is defective on startup "SD ERROR" is shown on the screen.

It works with cards that are default factory formatted. I bought a 32GB card and stuck it in and the scope started normally. Did not test writing anything, but guess it will work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 01, 2021, 02:17:30 pm
Had an interesting experience :o

I put the scope back together and turned it on. Forgot that I had reloaded the original firmware, so the touch panel was reversed again. Since I now know where the touch panel config is in the init data, I decided to patch it there, so I could let the scope do the change itself. Flashed it to the scope and dammed it started with a "SD ERROR". Stuck another card in it and it started doing something again. It went into its self test mode, and it failed on the input relays capacitance. |O The touch panel was working correctly though. :-DD

Wrote my first hack with the touch panel config writing removed in the flash and now it works as it is supposed to. :-//

Within the test procedure is a touch panel test where one has to touch the four corners and the center. It probably decides on this info that the touch panel is not working.

No idea how it went into this test mode though.

Edit: Tried it again with the version where I changed the touch panel configuration and it went straight into the test mode. So I messed something up. Luckily it still works with the other patch.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 01, 2021, 05:00:55 pm
Found the reason why it went into hardware check mode. To make the modified touch panel configuration I had to add 3 bytes in between the init data section. This lead to shifting of data higher up in the flash. At flash address 0x001FE000 the code expects 0x9086. If it is not there it does the hardware checks. So I removed three bytes just after the init data and now it works normally.

There are more of these reads done, so maybe there is some configuration data in there and since that was also shifted my scope failed the hardware checks.

Uploaded the new hack to the repository, with a text file showing what changes I made. With this hack it is no longer needed to use separate hardware to write a new config to your touch panel.

The unpacking of the init data uses some interesting scheme. It can copy bytes from the init data to the target, add trailing zeros or copy data from a previous unpack.
Each packet has a variable header. The first byte holds information about how many zeros in the high nibble, how many bytes to copy directly in the low nibble lowest 3 bits. Bit 3 tells the unpacker to copy data from a previous unpack. If the low 3 bits are zero an additional byte is loaded as the byte copy counter. The actual count is -1. (A 1 means don't copy bytes) If the high nibble is zero an additional byte is loaded as the zero or copy previous counter. When bit 3 is set the last byte of the packet is used to point back to previous data. This also means no zeros are added.

Attached is a file that shows the location in the flash, the packet number, the packet bytes and in the last column the unpacked data for that packet.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 02, 2021, 05:29:06 pm
Seems that my last post disappeared, so here it is again.

I found that the scope is loading data from flash at address 0x001FD000. (0x1F4 bytes)

Don't know what they are used for yet, but it might be some calibration data. So when one wants to flash new or hacked firmware make sure to backup the old one first and compare the data in that segment. Copy your own in when it is different.

Here is the data from my scope.

Code: [Select]
int8_t config_data[0x1f4] =
{
  0x01, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x01, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00,
  0x0F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, 0xD3, 0x02, 0x00, 0x00, 0x00, 0x00,
  0x90, 0x01, 0x90, 0x01, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x63, 0x01, 0x5F, 0x00, 0x2C, 0x01, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3D, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0xDC, 0x00, 0x4D, 0x05, 0x45, 0x05, 0x54, 0x05, 0x4D, 0x05, 0x53, 0x05, 0x4C, 0x05, 0xD9, 0x00,
  0x5B, 0x05, 0x56, 0x05, 0x61, 0x05, 0x5B, 0x05, 0x60, 0x05, 0x5A, 0x05, 0x00, 0x00, 0x03, 0x00,
  0x01, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x01, 0x00, 0x02, 0x01, 0x3A, 0x02, 0x00, 0x00, 0x5A, 0x00, 0xC1, 0x00, 0x05, 0x00,
  0x04, 0x00, 0x07, 0x00, 0x11, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x32, 0x14, 0x0F, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00
};
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: YurkshireLad on May 02, 2021, 05:42:53 pm
You could almost turn this epic adventure into a YouTube series.   :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 02, 2021, 07:27:26 pm
An epic adventure it is indeed. The bootloader was easy for play. Useful though. A lot of the initialization is the same, but for some reason they set a different horizontal back porch for the lcd in the main code. In the bootloader the TCON0_BASIC_TIMING1 register is written with 0x41E0044, whilst in the main code it is written with 0x041E004A. It is only 6 clock pulses and does not seem to make a difference. They both work.

At the moment I'm working on getting the whole display code out in the open. It is a lot of code that needs to be examined, but I already found some memory addresses that are definitely used for video. The screen memory used by the DEBE is from address 0x803849A0 up. Then there is a video buffer at 0x804FB9B4, which can be copied over to the memory used by the DEBE.

The screen memory address is also set in 0x8019CF60 which seems to be some place holder. Not sure if it is also used for other parts of the code, or just for the video. This address has 353 hits in Ghidra search, so one can see the amount of work to be done.

To get to the FPGA commands in depth is also a hell of a job, and my thoughts are that once I have the video up and running making test code is much easier.

The whole thing will take its time.

But when I get there I will put in a new startup screen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 03, 2021, 03:54:29 pm
The adventure of looking into the display part of the code revealed that the pointer I found at address 0x8019CF60 is indeed dedicated to the display system. I think it only holds one of two values.
a) the base address of the screen itself. 0x803849A0
b) the base address of a frame buffer. 0x804FB9B4

Found two more frame buffers but it seems these are not used via the global pointer. (0x804401B4 used in 7 functions and 0x805B7228 only used in two functions) Maybe one of these buffers is used to capture the screen for writing to a file on the SD card. (save picture)

So far I extracted 67 functions of which I suspect some 39 to be part of a drawing library. They sit in memory almost consecutively.

At the beginning of the code I found functions like memcpy and memset and two divide functions.

From the 67 functions, I identified and named 4.

Previous investigations revealed functions that do not use the buffers or pointers I found, but do belong to the display system. Need to extract and investigate them to.

Uploaded what I have so far to the "software reverse engineering" section of the repository.

Again, the story continues :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: eljot on May 04, 2021, 12:52:36 pm
Hi Dears, I havent been here for a long time. I had a lot of work so I had to put away my toys  :). Many interesting information since last time I've been here  :). My regards.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: vzgherea on May 04, 2021, 04:32:44 pm
Besides the X/Y inversion my screen had another problem, it was configured to work at a lower resolution - 800x480. In order to click a button I had to touch the screen to the right of the button and a little lower. The fix was to set the right resolution of 1024x600 in the 0x8048-0x804B registers. Modifying these values requires checksum update. The attached arduino sketch sets resolution to the 1024x600 and also includes checksum computation logic. IMPORTANT: Use 3.3V Arduino for programing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 04, 2021, 05:07:47 pm
Since the scope does the checksum calculation and the location of the configuration data in the flash is now know it is also possible to follow a route where one modifies the configuration there and let the scope do the setup of the touch panel.

The configuration data is coming from the packets 716 to 734. In the cpu memory it is set at address 0x8019CF82. The byte there is send to the touch panel config register 0x8047. The bytes are send consecutive. The data in the code below is the patched version. It is possible to extend the packed data, but make sure to remove the same amount of bytes just after the initial data section. There is a range of zero's there that can be removed. (beyond flash address 0x001BA8D8 or so)

Code: [Select]
flash: 0x001BA610  |  packet 716: 0x12, 0xFF                                                                                  0x8019CF82: 0xFF, 0x00,
flash: 0x001BA612  |  packet 717: 0x16, 0x04, 0x58, 0x02, 0x0A, 0xFD                                                          0x8019CF84: 0x04, 0x58, 0x02, 0x0A, 0xFD, 0x00,
flash: 0x001BA618  |  packet 718: 0x70, 0x09, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05                                  0x8019CF8A: 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
flash: 0x001BA622  |  packet 719: 0x30, 0x0C, 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77, 0xB2, 0x04                0x8019CF99: 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77, 0xB2, 0x04, 0x00, 0x00, 0x00,
flash: 0x001BA62F  |  packet 720: 0x14, 0x9A, 0x01, 0x11                                                                      0x8019CFA7: 0x9A, 0x01, 0x11, 0x00,
flash: 0x001BA633  |  packet 721: 0x92, 0x01                                                                                  0x8019CFAB: 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
flash: 0x001BA635  |  packet 722: 0x27, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08                                                    0x8019CFB5: 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00,
flash: 0x001BA63C  |  packet 723: 0x14, 0x04, 0xA1, 0x55                                                                      0x8019CFBD: 0x04, 0xA1, 0x55, 0x00,
flash: 0x001BA640  |  packet 724: 0x13, 0x8F, 0x62                                                                            0x8019CFC1: 0x8F, 0x62, 0x00,
flash: 0x001BA643  |  packet 725: 0x13, 0x7F, 0x71                                                                            0x8019CFC4: 0x7F, 0x71, 0x00,
flash: 0x001BA646  |  packet 726: 0x13, 0x73, 0x82                                                                            0x8019CFC7: 0x73, 0x82, 0x00,
flash: 0x001BA649  |  packet 727: 0x13, 0x69, 0x95                                                                            0x8019CFCA: 0x69, 0x95, 0x00,
flash: 0x001BA64C  |  packet 728: 0x02, 0x24, 0x69                                                                            0x8019CFCD: 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
flash: 0x001BA64F  |  packet 729: 0x18, 0x0C, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0x01          0x8019CFF2: 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF,
flash: 0x001BA65D  |  packet 730: 0x01, 0x11                                                                                  0x8019D000: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
flash: 0x001BA65F  |  packet 731: 0x28, 0x10, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0x24    0x8019D011: 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0xFF, 0xFF, 0xFF, 0xFF,
flash: 0x001BA671  |  packet 732: 0x49, 0x01                                                                                  0x8019D024: 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
flash: 0x001BA673  |  packet 733: 0x01, 0x11                                                                                  0x8019D02A: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
flash: 0x001BA675  |  packet 734: 0x89, 0x90                                                                                  0x8019D03B: 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 04, 2021, 07:08:38 pm
Cracking the display code is not easily done. Found the function that initializes the data for it to make it function. There are 35 functions for this task. It starts with setup_display_lib just after the display hardware has been initialized and just before the touch panel is setup. This function calls 7 functions of which one is very simple. It does nothing. The other 6 functions setup function pointers and what more. At some point it looses sense. The content of a pointer is multiplied by 0x78 (120). It is set with 0x80189750 and the multiplication is done in two 32 bit steps. The first one multiplies by 15 and the second one by 8. This leads to 0x0B86ED80 which makes no sense since there is no memory there. Not clear what they do with it next.

Code: [Select]
     rsb        r0,r0,r0, lsl #0x4
     mov        r5,r0, lsl #0x3

The display system seems to work with function pointers and function pointer pointers, so this makes tracing it by hand very hard to do. The display_text function uses 39 functions and there is no direct connection with the screen buffers.

Code: [Select]
void main(void)
{
  int iVar1;
  undefined auStack568 [568];
 
  sys_clock_init();
  some_memory_stuff();
  sys_init_uart0(BAUD_115200);
  setup_timer_int();
  sys_spi0_init();
  fpga_init();
  turn_off_brightness();
  sys_init_display();
  setup_display_lib();
  tp_i2c_setup();

So, that story stops for now. Need to think of another way to figure out the working of the scope. Either write a kind of emulator to track the code or write test code that works with uart1 and do tests directly on the scope hardware to figure out the FPGA commands. Most of the commands in use are known and can be traced in the original code to see how many bytes need to be send or retrieved. At least the relays should be easy to find this way, since they click :)

It is not the end of the adventure. :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 05, 2021, 03:41:13 pm
Decided to go the emulator route. Wrote an xlib based first setup of the scope. This is the simple part. Next is an emulator window where the MCU can be monitored. This will take a bit more time :)

It can also aid in later development.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 05, 2021, 07:06:46 pm
For the emulator window I made a first draft. Needs some push buttons to control things and maybe some more displays with control information. It is based on earlier work I did when I made an emulator for the Elka Synthex and the Siel Opera 6 (Back in the day's I wrote programs under windows with devstudio) Started making a HTML/PHP based copy but never finished it. For the Opera 6 I made my first xlib based version as a controller for an STM32 based digital version of the synth. (To many projects and to little time |O)  The code is still handy though for quick startups of new projects.

First picture is a screen cap of the arm emulator window. The second of the HTML canvas based 6502 emulator window, which is part of the Synthex project of which the third image is the screen cap. The fourth window is of the Siel Opera 6 controller I wrote using xlib. It connects via USB to a STM32 bluepill and sends control information based on the mouse input. The fifth picture is of the digital Siel Opera 6 project I was working on. There is one master controller and 6 voice controllers. It is just hobby fun :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 07, 2021, 09:04:49 am
Now the real programming begins. The user interface of the emulator will most likely be extended but for now it will do. The processor status and register displays are set to give an idea of what it is going to look like.

Edit: Since the Synthex picture in the previous post is looked at quite a bit, I uploaded the project to github: https://github.com/pecostm32/Elka_Synthex_Emulator.

Edit2: The Siel Opera 6 project is far from finished and is what I was working on before I took up the scope project, so it has to wait  :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 14, 2021, 04:24:33 pm
Just a short update.

Still working on the emulator. It is a lot of work but a great learning experience. Getting a lot of insight in the ARM processor. The emulator is already capable of running the first instructions of the scope boot loader, but got stuck on the switch to thumb instructions, since these were not yet programmed in. Working on that part now. These are much easier to decode, but it is still a lot of programming. Got the first three sections done. (Thumb instructions more or less have the top three bits as a main separation of types)

The code is in the repository but still under development :)

I know there is code out there that might do the trick, but would also be a lot of work. Getting qemu to work would take a lot of research, in how to hook in all the peripherals the F1C100s has. I rather write my own code and learn about ARM and the F1C100s than dive into projects like qemu.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 16, 2021, 09:11:52 am
Most of the arm and thumb instructions are implemented. Some are tested and the original boot loader code of the scope runs smoothly to the part where it initializes the DRAM. There is a check on the PLL getting stable and locked, which never happens since it it not implemented in the emulator yet.

So it is time to add the F1C100s peripherals to the emulator code.

It is going to be a useful tool, not just for the scope, but my other projects will benefit from the work too. Having an emulator makes embedded development easier. At least, during development, for initial checking of code. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 17, 2021, 09:51:07 am
Again a short update.

The core is running smoothly and with very basic implementation of the F1C100s CCU and DRAMC controllers it continues to arrive at address 0x051C where it calls the initialization routine for the spi0 controller to be able to read from flash. So next on the list is the implementation of this peripheral.

Updated the repository with the code so far.

Still a lot of work to be done.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 20, 2021, 07:36:30 pm
Due to other chores it took a while to get the emulation of the flash reading via SPI0 implemented. I did it a bit unstructured and needs improvement for a final version of the emulator, but for now it does the trick. To get it working I had to tackle a programming error in the arm core code for determining an overflow. It was correct for addition but not for subtraction causing the compare instruction to give wrong results. The check "is 0 less then 4" (bytes to transmit) was not seen as such and therefore the scope code did not reach the transmition of  the bytes part.

It is working now and the code flows through to the loading of the actual scope program at address 0x05FC, so it is time to hook up the emulator display and see if the startup bitmap can be displayed.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 22, 2021, 12:16:37 pm
The startup image gets displayed :) but I need to improve on performance. The screen update is called to often and that kills the core performance. So there is progress, but at the same time a set back |O

Edit: Stupid me :palm: Forgot to save the previous counter value for making a delay on the cpu instruction counter, so the display update was called every instruction. :o

The story keeps on going.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on May 22, 2021, 01:38:23 pm
Your emulator work is interesting and impressive :-+
I would never have tried to write one, it would have seemed too complicated a task (which it is, for me).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 22, 2021, 01:58:27 pm
Your emulator work is interesting and impressive :-+
I would never have tried to write one, it would have seemed too complicated a task (which it is, for me).

Thanks.

It is not the first one for me. And I have many (~40) years of experience in programming and also like the challenge :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 22, 2021, 05:14:51 pm
I found the next challenge. The scope code runs into a delay loop that is controlled with timer0 under interrupt. In the interrupt handler the value written to 0x8019cf68 is incremented with one. So this is the next item on the list. Implement the arm interrupt handling and the f1c100s timer peripheral.

For now it still is investigating the scope code with the gnu debugger in netbeans. Doable, but having output in the emulator window and the ability to single step would be very nice.

In the emulator window the processor status and the registers are updated semi live. Still need to do stack and memory and the disassembly. Also the buttons need to be connected to the code to do things.

It will take its time, but it is getting to be more and more fun.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 24, 2021, 12:27:31 pm
Hit a, most likely, programming error in my arm core. |O

implemented the timer and interrupt system and the code continues to run but at address 0x800197AC it encounters the instruction "bx r3". Unfortunately r3 is 0 instead of some correct code address and now I need to find out why this is.

Is it indeed an error in the core or is it missing peripheral implementation? The FPGA support is not there yet and I know the scope reads from the I2C device connected to the FPGA.

The core is working for most of the instructions since it is capable of loading the display image and do quite a bit before it hits this snag. It even calls thumb code and returns to arm state.

Did a full program counter trace with a change to the code where the trace file is split in separate files when it holds 250K lines. For arm execution it shows "pc: 0x800197AC  exec: 1" and for thumb "pc: 0x80000116  T". This leads to a difference in file size by which I could tell thumb code is called at some stages.

The part where it goes wrong is part of the display lib setup. In main the function setup_display_lib is called and from that function a call is made to FUN_80019764. And there it fails :-//

This means I have to implement a better tracing system. Already have some ideas about this. It will need an other program to read the trace data. The idea is to gather data for each instruction and write it in binary to a file. Already made a structure for it and support in the core code to allow for a circular buffer to be filled with trace data. Next up is add code to the instructions that load or store to or from memory.

Code: [Select]
typedef struct tagARMV5TL_REGS              ARMV5TL_REGS;
typedef struct tagARMV5TL_TRACE_ENTRY       ARMV5TL_TRACE_ENTRY;

struct tagARMV5TL_REGS
{
  u_int32_t r0;
  u_int32_t r1;
  u_int32_t r2;
  u_int32_t r3;
  u_int32_t r4;
  u_int32_t r5;
  u_int32_t r6;
  u_int32_t r7;
  u_int32_t r8[2];
  u_int32_t r9[2];
  u_int32_t r10[2];
  u_int32_t r11[2];
  u_int32_t r12[2];
  u_int32_t r13[6];
  u_int32_t r14[6];
  u_int32_t r15;
  u_int32_t cpsr;
  u_int32_t spsr[5];
};

struct tagARMV5TL_TRACE_ENTRY
{
  u_int32_t    instruction_address;    //Address of the traced instruction
  u_int32_t    instruction_word;       //Instruction word for arm, half word for thumb
  u_int32_t    execution_status;       //Information about if the arm instruction has been executed or not
  ARMV5TL_REGS registers;              //The 37 registers
  u_int32_t    memory_address;         //Depending on the type of instruction this is set with the targeted memory address
  u_int32_t    memory_direction;       //For load or store multiple instructions this signals if the given address is incremented or decremented
  u_int32_t    data_width;             //For instructions that load or store half words or bytes this will reflect this, otherwise word width
  u_int32_t    data_count;             //The number of words read or written by the instruction
  u_int32_t    data[16];               //The data read or written. Single instruction can do a max of 16 words
};
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on May 24, 2021, 01:01:36 pm
This means I have to implement a better tracing system. Already have some ideas about this. It will need an other program to read the trace data. The idea is to gather data for each instruction and write it in binary to a file. Already made a structure for it and support in the core code to allow for a circular buffer to be filled with trace data. Next up is add code to the instructions that load or store to or from memory.

 :palm: Respect for your work! Would love to see your working methods.  :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 24, 2021, 01:54:37 pm
:palm: Respect for your work! Would love to see your working methods.  :clap:

Thanks.

About my working methods, some would say very unstructured. I don't have a plan laid out. Just started with the idea of "I need an emulator" and started writing code. It evolves as I go along. This means code changes and needs adaptation once in a while to suit a new idea. Most of what I made in my live has been done this way :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 25, 2021, 07:18:51 pm
To keep the fans happy 8)

The new tracing is implemented and produces huge amounts of data. Limited it to 25000 instructions per file and for just the display lib setup to the point where it fails it results in 88 files. Well over 2 million instructions :o

Started the trace file reader and already have some output. It lacks the disassembly which is vital for a proper trace, so began the implementation of that part. Will take a couple of days to get something working.

The trace lines are the last lines of the last trace file, but the registers and the memory are not real yet. The idea is to have an asterisks on the current line (CUR field) for which the second display shows the register and optional memory data. The memory data will only be displayed for load and store instructions.

With the scroll buttons one can move through the list. Will probably add extra buttons to jump to the start or the end of the list, and maybe a search field to allow quick jumping to a desired address.

As with all my work it grows into what it needs to be :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 27, 2021, 11:45:44 am
The trace system helps to find out what is happening, but it did not help to solve the problem yet. Found an earlier address where it goes sour due to some data not being set. Why this data is not set is the next question. The arm core code seems to be correct looking at the contents of the registers and the memory. Made an excerpt of the trace data. Removed the not used registers.

Had to fix some copy paste errors and other oversights in the disassembler (still have to add the mul instructions and the thumb instructions) and it is working nicely. Will be a good tool for other projects once it is finished.

Code: [Select]
0x8002FAA8  0xE92D4070  YES  stmdb  sp!, { r4 r5 r6 lr }  r0:0x80857D4C  r1:0x8019D464  r2:0x8019D45C  r3:0x00000320  r4:0x00000000  r5:0x00000000  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8001933C  r15:0x8002FAA8  cpsr:0x80000053   memory:0x81FF35A4  type:word   count: 4  dir:down  0x8001933C  0x00000000  0x00000000  0x00000000 
0x8002FAAC  0xE59F509C  YES  ldr    r5, [pc, #156]        r0:0x80857D4C  r1:0x8019D464  r2:0x8019D45C  r3:0x00000320  r4:0x00000000  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8001933C  r15:0x8002FAAC  cpsr:0x80000053   memory:0x8002FB50  type:word   count: 1  dir:up    0x8019D464 
0x8002FAB0  0xE1A04000  YES  mov    r4, r0                r0:0x80857D4C  r1:0x8019D464  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8001933C  r15:0x8002FAB0  cpsr:0x80000053
0x8002FAB4  0xE595000C  YES  ldr    r0, [r5, #12]         r0:0x80857D4C  r1:0x8019D464  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8001933C  r15:0x8002FAB4  cpsr:0x80000053   memory:0x8019D470  type:word   count: 1  dir:up    0x80857D4C 
0x8002FAB8  0xE28FE030  YES  add    lr, pc, #48           r0:0x80857D4C  r1:0x8019D464  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAB8  cpsr:0x80000053
0x8002FABC  0xE2801004  YES  add    r1, r0, #4            r0:0x80857D4C  r1:0x80857D50  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FABC  cpsr:0x80000053
0x8002FAC0  0xE5800038  YES  str    r0, [r0, #56]         r0:0x80857D4C  r1:0x80857D50  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAC0  cpsr:0x80000053   memory:0x80857D84  type:word   count: 1  dir:up    0x80857D4C 
0x8002FAC4  0xE580103C  YES  str    r1, [r0, #60]         r0:0x80857D4C  r1:0x80857D50  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAC4  cpsr:0x80000053   memory:0x80857D88  type:word   count: 1  dir:up    0x80857D50 
0x8002FAC8  0xE2801008  YES  add    r1, r0, #8            r0:0x80857D4C  r1:0x80857D54  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAC8  cpsr:0x80000053
0x8002FACC  0xE5800040  YES  str    r0, [r0, #64]         r0:0x80857D4C  r1:0x80857D54  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FACC  cpsr:0x80000053   memory:0x80857D8C  type:word   count: 1  dir:up    0x80857D4C 
0x8002FAD0  0xE5841014  YES  str    r1, [r4, #20]         r0:0x80857D4C  r1:0x80857D54  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAD0  cpsr:0x80000053   memory:0x80857D60  type:word   count: 1  dir:up    0x80857D54 
0x8002FAD4  0xE5D01011  YES  ldrb   r1, [r0, #17]         r0:0x80857D4C  r1:0x00000000  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAD4  cpsr:0x80000053   memory:0x80857D5D  type:byte   count: 1  dir:up    0x00000000 
0x8002FAD8  0xE2850024  YES  add    r0, r5, #36           r0:0x8019D488  r1:0x00000000  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAD8  cpsr:0x80000053
0x8002FADC  0xE7900101  YES  ldr    r0, [r0, r1, lsl #2]  r0:0x00000000  r1:0x00000000  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FADC  cpsr:0x80000053   memory:0x8019D488  type:word   count: 1  dir:up    0x00000000 
0x8002FAE0  0xE590100C  YES  ldr    r1, [r0, #12]         r0:0x00000000  r1:0x00000000  r2:0x8019D45C  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAE0  cpsr:0x80000053   memory:0x0000000C  type:word   count: 1  dir:up    0x00000000 
0x8002FAE4  0xE5912030  YES  ldr    r2, [r1, #48]         r0:0x00000000  r1:0x00000000  r2:0x00000000  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAE4  cpsr:0x80000053   memory:0x00000030  type:word   count: 1  dir:up    0x00000000 
0x8002FAE8  0xE2841008  YES  add    r1, r4, #8            r0:0x00000000  r1:0x80857D54  r2:0x00000000  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x8002FAE8  cpsr:0x80000053
0x8002FAEC  0xE12FFF12  YES  bx     r2                    r0:0x00000000  r1:0x80857D54  r2:0x00000000  r3:0x00000320  r4:0x80857D4C  r5:0x8019D464  r6:0x00000000  r7:0x80192E6B  r8_usr:0x80000E48  r9_usr:0x81000000  r10_usr:0x80192E9C  r11_usr:0x80192E9C  r12_usr:0xFFFFFFFF  r13_svc:0x81FF3598  r14_svc:0x8002FAF0  r15:0x00000000  cpsr:0x80000053


So the search again continues. Like a dog with a bone, relentless :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 27, 2021, 06:28:59 pm
Hope my updates are still appreciated, because here is another one.

I'm not sure, but I think I found the cause of the system failing. I did not implement memory management in the arm core, because I thought it is not used in a special way. It is used at startup, but that is for testing where the vectors need to be written. 0x00000000 or 0xFFFF0000. I assumed 0x00000000, but maybe I'm wrong and should it be 0xFFFF0000 to get them out of the way of the memory at address 0x00000000.

The things I see happening is that at some point the code writes to addresses in the 0x00000000 to 0x000001E0 range, which is where the exception vectors are located in my setup. They use register r0 for this and check against it being 0, so it seems intentional. No idea on what the mmu can do in this case :-//, but there is this function I named some_memory_stuff that is called right after the clock initialization well before the setup_display_lib.

It does all sorts of reads and writes to the p15 co-processor. (forgot all about that |O)

Code: [Select]
                             main                                            XREF[1]:     prepare_for_main:800001a8(c) 
        80035320 8e df 4d e2     sub        sp,sp,#0x238
        80035324 00 00 a0 e3     mov        r0,#0x0
        80035328 3e cb ff eb     bl         sys_clock_init                                   void sys_clock_init(void)
        8003532c 54 08 00 eb     bl         some_memory_stuff                                void some_memory_stuff(void)
        80035330 20 01 9f e5     ldr        r0,[BAUD_115200]                                 = 0001C200h
        80035334 58 cb ff eb     bl         sys_init_uart0                                   void sys_init_uart0(uint baudrate)
        80035338 2a cb ff eb     bl         setup_timer_int                                  void setup_timer_int(void)
        8003533c 72 bf ff eb     bl         sys_spi0_init                                    void sys_spi0_init(void)
        80035340 56 85 ff eb     bl         fpga_init                                        void fpga_init(void)
        80035344 14 9d ff eb     bl         turn_off_brightness                              void turn_off_brightness(void)
        80035348 a1 a0 ff eb     bl         sys_init_display                                 void sys_init_display(void)
        8003534c f2 8f ff eb     bl         setup_display_lib                                int setup_display_lib(void)
        80035350 7d 89 ff eb     bl         tp_i2c_setup                                     void tp_i2c_setup(void)

So new study material. Figure out how the mmu works and how to implement it in my arm core.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 28, 2021, 12:48:07 pm
I looked into the memory management and when I understand it correctly it is not the solution to what is going wrong :palm:

The function setup_mmu_trans_table is called to setup the first level translation table. 

The first call to it sets the first part of the table with translation address 0x000 - 0x7FF in the upper part of the word and 0xC12 in the lower part. The 0xC12 in binary shows 11 0 0000 1 00 10. The first two bits (left to right) are the AP bits for specifying the access. The third bit is always zero. The next 4 bits give the domain number. Only domain 0 is being used and set to client mode. The next bit is always one. The two zero bits specify that this section is not cache-able. The last two bits specify it it a section descriptor, and therefore translate (M)VA to a PA directly, and since the table is written linear they are basically the same.

The second call sets the second part with translation address 0x800 - 0xFFF in the upper part of the word and also 0xC12 in the lower part.

The third call replaces some of the entries written by the second call. the range 0x800 - 0x81F (DRAM) is replaced with 0xC1E in the lower part. This signals that these addresses can be cached and buffered.

If I'm right they could have sufficed with just enabling the caches and not the mmu.

Code: [Select]
void setup_mmu(void)
{
  uint baseaddress;
 
  baseaddress = 0x80730000;
  setup_mmu_trans_table(baseaddress,0x80000000,0,0,0,0,0x80000000,0,0);
  setup_mmu_trans_table(baseaddress,0,0x80000000,0,0x80000000,0,0x80000000,0,0);
  setup_mmu_trans_table(baseaddress,0x80000000,0x80000000,0,0x80000000,0,0x2000000,0,3);
  mmu_set_base_address(baseaddress);
  mmu_clear_wb_tlb();
  mmu_set_domain_access(1);
  mmu_enable();
  mmu_instr_cache_enable();
  mmu_data_cache_enable();
  return;
}

void setup_mmu_trans_table(uint baseaddress,uint param_2,uint param_3,uint param_4,uint memaddress,uint param_6,uint param_7,uint param_8,uint cacheable)
{
  uint uVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  bool bVar5;
 
  uVar2 = param_3 >> 0x14 | param_4 << 0xc;
  uVar3 = memaddress >> 0x14;
  uVar4 = param_7 >> 0x14 | param_8 << 0xc;
  uVar1 = param_8 >> 0x14;

  while ((uVar1 | uVar4) != 0)
  {
    *(uint *)(baseaddress + uVar2 * 4) = uVar3 << 0x14 | 0xc10 | (cacheable & 3) << 2 | 2;
    bVar5 = uVar4 == 0;
    uVar4 = uVar4 - 1;
    uVar1 = uVar1 - bVar5;
    uVar2 = uVar2 + 1;
    uVar3 = uVar3 + 1;
  }
  return;
}

So unless some other part of the code rewrites the translation table the fault lies somewhere else

Guess it is back to analyzing the display lib setup code to see where it goes sour |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 29, 2021, 12:25:00 pm
Question for tv84 (or others whom are interested)

What do you make of this function?

It is called through the display_lib_setup sequence of functions. On entry the parameters are: param_1 = 0x8036B7A0, param_2 = 0x00002800.

I have the idea it is pointless and is only a waste of cpu time. (runs for > 2150000 instructions)

Code: [Select]
void FUN_80030564(int *param_1,uint param_2)
{
  byte bVar1;
  ushort uVar2;
  byte extraout_r1;
  ushort extraout_r1_00;
  int extraout_r1_01;
  int extraout_r1_02;
  uint extraout_r1_03;
  uint extraout_r1_04;
  uint uVar3;
  uint uVar4;
  int *piVar5;
  int iVar6;
 
  uVar3 = 0;
  do {
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2 >> 2) {
      divide(uVar4 + uVar3,0xff);
      uVar4 = uVar4 + 1;
      *piVar5 = extraout_r1_01;
      piVar5 = piVar5 + 1;
    }
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2 >> 2) {
      iVar6 = *piVar5;
      divide(uVar4 + uVar3,0xff);
      if (extraout_r1_02 != iVar6) {
        return;
      }
      uVar4 = uVar4 + 1;
      piVar5 = piVar5 + 1;
    }
    uVar3 = uVar3 + 1;
  } while (uVar3 < 2);
  uVar3 = 0;
  do {
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2 >> 1) {
      divide(uVar4 + uVar3,0xff);
      uVar4 = uVar4 + 1;
      *(ushort *)piVar5 = extraout_r1_00;
      piVar5 = (int *)((int)piVar5 + 2);
    }
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2 >> 1) {
      uVar2 = *(ushort *)piVar5;
      divide(uVar4 + uVar3,0xff);
      if (extraout_r1_03 != uVar2) {
        return;
      }
      uVar4 = uVar4 + 1;
      piVar5 = (int *)((int)piVar5 + 2);
    }
    uVar3 = uVar3 + 1;
  } while (uVar3 < 2);
  uVar3 = 0;
  do {
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2) {
      divide(uVar4 + uVar3,0xff);
      uVar4 = uVar4 + 1;
      *(byte *)piVar5 = extraout_r1;
      piVar5 = (int *)((int)piVar5 + 1);
    }
    uVar4 = 0;
    piVar5 = param_1;
    while (uVar4 < param_2) {
      bVar1 = *(byte *)piVar5;
      divide(uVar4 + uVar3,0xff);
      if (extraout_r1_04 != bVar1) {
        return;
      }
      uVar4 = uVar4 + 1;
      piVar5 = (int *)((int)piVar5 + 1);
    }
    uVar3 = uVar3 + 1;
  } while (uVar3 < 2);
  uVar3 = 0;
  while (uVar3 < param_2) {
    uVar3 = uVar3 + 1;
    *(byte *)param_1 = 0;
    param_1 = (int *)((int)param_1 + 1);
  }
  return;
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on May 29, 2021, 12:42:55 pm
Yes, it looks like a delay function.

The number of instructions that are executed is param based.

Maybe it has into account some specific calibration of the device/components or freq. set by the user.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 29, 2021, 12:56:37 pm
But it makes no sense in light of initializing a display library, at least not to me.

Can't be for the FPGA startup, because that is already running. Delays for that are in the secondary program loader.

It first writes 0x00 to 0xFE to word based memory (2560 words) then reads them back and checks if they are the same, which when the memory is functional will be the case. Then they repeat this with the data offset by one.

The "divide(uVar4 + uVar3,0xff);" call, which does a modulo since they use the remainder, in the second run has uVar3 set to 1 and 0 in the first run.

Then in the second do while loop they repeat this process on short based memory (5120 shorts) and in the third do while loop they do it again but now on byte based memory (10240 bytes).

Finally they clear the memory in the last while loop.

There is no return value, so no check on any failure of the memory.

Very strange :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on May 29, 2021, 01:09:19 pm
Is it writing in the display mem area? Like a display clear?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 29, 2021, 01:14:44 pm
Does not look like it. It is not the main display buffer it is writing to. Nor is it one of the other screen buffers I found earlier.

Also the numbers do not add up for that. The display buffer is 800 pixels by 480 lines of 2 bytes per pixel. Is 768000 bytes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 29, 2021, 04:43:05 pm
Found an error in my arm core caused by not reading the manual correctly. |O

The conditional execution checks for "Unsigned lower or same" and "Signed less than or equal" were wrong. Both required an or instead of an and between the two flag checks.

Was
Code: [Select]
        case ARM_COND_LOWER_SAME:
          //For execute on lower or the same C needs to be cleared and Z needs to be set
          if((core->status->flags.C == 0) && (core->status->flags.Z))
            execute = 1;
          break;

        case ARM_COND_LESS_THAN_EQUAL:
          //For execute on less than or equal than N needs to be not equal to V and Z needs to be set
          if((core->status->flags.N != core->status->flags.V) && (core->status->flags.Z))
            execute = 1;
          break;

and needs to be
Code: [Select]
        case ARM_COND_LOWER_SAME:
          //For execute on lower or the same C needs to be cleared and Z needs to be set
          if((core->status->flags.C == 0) || (core->status->flags.Z))
            execute = 1;
          break;

        case ARM_COND_LESS_THAN_EQUAL:
          //For execute on less than or equal than N needs to be not equal to V and Z needs to be set
          if((core->status->flags.N != core->status->flags.V) || (core->status->flags.Z))
            execute = 1;
          break;

Unfortunately it did not solve all the problems, but at least one hurdle has been taken. There are still unimplemented peripherals that can make things go wrong.

The startup screen at least is cleared and after a while this comes up.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on May 30, 2021, 08:54:45 am
@pcprogrammer
First, your work is highly appreciated.  :clap:
But do the daily water level reports really help anyone?

And now something completely different ;)

Last year's Ali black week I ordered a 1013D Digital Tablet Oscilloscope for roundabout 119$ (~99e).
So far so good, it came in a black cardboard named "TABLE OSCILLOSCOPE". As a short test it could display all the stuff from my MHS5200A up to 25 MHz.
The name "FNIRSI" appears only on the boot screen.
But no FW version etc, no further info.
[attach=1]

Due to a momentary lack of my USB scopes I must use it 2 weeks ago to analyze a problem with pulsed Mosfet arrays.
I read somewhere on the internet that its impossible to capture pulses.
I can state, its not easy.., but I did and stumbeled about a lot of glitches in the firmware... and my usecase passed away for its no DSO

- The captured waveform is really poor, its only TWO!! screens.
 
On top there is a green marker, I can move the wave until this marker touches one side.
When visible, the values  of the auto measurements are all ZERO(!).
When this marker isn't visible (maybe at longer time intervals, 20msec and longer, I didn't dig for) you cannot move the wave and cannot change the timebase but the measurement field have some values.. and sometimes(pulses) quite weird ;)
[attach=2]
When I capture a wave (stop the scope, NOT save the wave), save a pic, change the timebase to a shorter one and save the new pic the old measuring cursors are saved and on the screen itself the cursors are lost.
[attach=3]
And sometimes the wave is lost..
[attach=4]
When you like to view at the captured pics on the scope you have to choose them from an index, when I returned to the index afterwards for another pic the index is displayed a little mismatched.
[attach=5]
Connected to a PC or similar host the storage appeares as a disc, captured pics show up as BMPs and all files are dated on March, 22, 2020, 23:48
[attach=6]


- The scope is useless for low voltage signals.

I know, the lowest vertical voltage is 50vV/div, quite poor although same as on my DDS140.
But the DDS140 can display low voltage signals, noisy, but you can see something and can trace them.
When trying to monitor a low voltage signal with 1013-D I did see... nothing but a zero line. I checked with my MHS5200, On CH1 signals below 30mV aren't displayed any more!
In my case the trigger jumped in at 29mV, a stable signal needed more than 33mV!
Between 29mV and 33mV the screen showed a flashing signal over a zero line.
[attach=7]
CH2 is even more crazy.
Flickering junk down to 20mV and up to ~50mV, unstable trigger up to 200mV.
Stable trigger only on signals above 200mV!!
[attach=8]
Short vids attached
[attachurl=9]
Bad firmware or concept due to high noisefloor?

Resume:
The 1013D maybe fine for juggling with logic levels without capturing and many audio purposes but it fails for low voltage (pre)amlifiers.
Its better than no scope but I cannot recommend it - only as an addendum.
Its not a DSO but a DTO, just as stated.

----

7:Storage depth: 240Kbit
Source??
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 30, 2021, 09:19:40 am
@pcprogrammer
First, your work is highly appreciated.  :clap:
But do the daily water level reports really help anyone?

7:Storage depth: 240Kbit
Source??

a) Thanks :)
b) They help me ;) For me it helps to write about what I encounter and sometimes brings light to my brain.
c) The storage depth has to do with the FPGA used. It has in total 270Kbits of embedded memory and I guess they use 240Kbits for the acquisition memory.

And you are right it is a simple hobby scope. But who knows what it can become. That is also a reason for me to do the work on it.  8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on May 30, 2021, 10:49:38 am
@pcprogrammer
First, your work is highly appreciated.  :clap:
But do the daily water level reports really help anyone?

I like them a lot. It helps systematize the progress and evaluate the level of work that is putted into this process.

Most people like to see the end product. I truly appreciate a good description of the path to get there. But that's me...

"It's a shitty scope." - Well it could be a toaster or a vibrator... The level of work and method is awesome! It's reversing at its finest.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 30, 2021, 11:39:42 am
For tv84 :)

An insight in how I found the programming error. You already know I made trace listings and that they are long. 88 full files of 25000 lines each and one with just 1731 lines. The problem was written in file number 88. Files 1 to 87 where mostly the strange function I wrote about yesterday, so I did not have to read through all of the lines :phew:.

I used the pseudo C output of Ghidra on one screen and the listing on a second screen. Once in a while I compared things with the assembly in Ghidra. It was looking at the pseudo code and check against the trace data what was really going on when I noticed that a compare was not executed correctly.

It was in the function shown below that I noticed the  "if (uVar5 <= param_1)" not being taken. The trace data is in the second code part.

At first I thought could my carry logic be wrong, but the divide function called many times by the function mentioned yesterday worked as it should. Did test it by inverting the carry logic and run the program again. It did not even get to the displaying of the startup screen. So I was thinking what can it be when a light went on. Every instruction can be conditional and the ones with ls condition did not execute whilst they should have. The rest is history :-DD

Code: [Select]
int FUN_8002cf28(uint param_1)
{
  uint *puVar1;
  int iVar2;
  uint uVar3;
  int iVar4;
  uint uVar5;
  uint uVar6;
  int unaff_r5;
 
  FUN_8002fb5c();                        //Already called from FUN_80018464 and therefore does nothing

  puVar1 = DAT_8002d040;                 //0x80857C80
  uVar5 = DAT_8002d040[0x10];            //*0x80857CC0 = 0x00000010

  if (uVar5 <= param_1)                  //16 <= 6032 ??  cmp r1,r4  | r1 = 0x00000010, r4 = 0x00001790 | carry not set ???
  {
    uVar5 = param_1 + 3 & 0xfffffffc;    //Make it on a word boundary.
  }

  uVar5 = uVar5 + 0xc;                   //uvar5 = 0x1C

Code: [Select]
pa:0x8002CF34  0xE59F6104  YES       ldr         r6, [pc, #260]   r0:0x00000001  r1:0x00000080  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x20000053
pa:0x8002CF38  0xE5961040  YES       ldr         r1, [r6, #64]    r0:0x00000001  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x20000053
pa:0x8002CF3C  0xE1510004  YES       cmp         r1, r4           r0:0x00000001  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x80000053
pa:0x8002CF40  0x92840003  NO        addls       r0, r4, #3       r0:0x00000001  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x80000053
pa:0x8002CF44  0x93C01003  NO        bicls       r1, r0, #3       r0:0x00000001  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x80000053
pa:0x8002CF48  0xE5960000  YES       ldr         r0, [r6, #0]     r0:0x00000000  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x00001790  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x80000053
pa:0x8002CF4C  0xE281400C  YES       add         r4, r1, #12      r0:0x00000000  r1:0x00000010  r2:0x00000178  r3:0xFFFFFFB8  r4:0x0000001C  r5:0x80857C8C  r6:0x80857C80  r7:0x80192E6B  cpsr:0x80000053

Unfortunately there are other errors in my code. The same errors were also in the thumb conditional branch instruction, but that did not solve what is going wrong. Found an oversight today where some special data processing functions (ADD(4), CMP(3) and CPY, MOV(3)) were not being handled. But again that did not solve the problem.

Working hard on getting to the root of this next problem :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 30, 2021, 06:14:25 pm
Here is the last update for today :-DD

Solved the problem. It was a stupid copy paste not modify error.

The thumb blx in the next code segment is made up of two thumb instructions (Ghidra shows it as if it is an arm instruction). A bl for the jump address offset << 12 and the blx with the low part of the jump address offset. In my code I made a separate instruction decode struct for it which is used in an union. But whilst renaming the element I forgot to rename the type from ARMV5TL_INSTR_THUMB_B6 to ARMV5TL_INSTR_THUMB_B7 and therefore the first part of the pair was skipped and the wrong jump was taken.

I found it after making the thumb disassembler and looking at the trace listing.

Code: [Select]
                             LAB_80000634                                    XREF[1]:     80000628(j) 
        80000634 02 2c           cmp        r4,#0x2
        80000636 0b d3           bcc        LAB_80000650
        80000638 67 08           lsr        r7,r4,#0x1
        8000063a 32 04           lsl        count,r6,#0x10
        8000063c 7f 00           lsl        r7,r7,#0x1
        8000063e 32 43           orr        count,r6
        80000640 79 00           lsl        data,r7,#0x1
        80000642 28 00           mov        dest,r5
        80000644 00 91           str        data,[sp,#0x0]=>local_20
        80000646 00 f0 3a e9     blx        FUN_800008bc                                     undefined FUN_800008bc()
        8000064a 00 99           ldr        data,[sp,#0x0]=>local_20
        8000064c e4 1b           sub        r4,r4,r7
        8000064e 4d 19           add        r5,data,r5

Next problem was the not yet implemented CLZ instruction. Implemented that and now the code runs down to the sd card part of the code and hangs there in a loop checking on some response of the sd card interface. Since this peripheral is not yet implemented it will stay there until that part of the system has been implemented.

As this is uncharted territory for me, both the sd card interface in the f1c100s and sd card interfacing in general it will take it's time. :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 31, 2021, 03:01:01 pm
Getting closer :o

The loop the code hung in yesterday was a check on the uart0 tx being empty. So I implemented the uart to return always empty and the code continued to show the "SD ERROR" message. As a test I decided to just remove the call to the sd card check and see what happens.

It continues to a basic scope screen, but hangs again so not there yet.

Edit: It ran into a not implemented instruction. smulbb

At least closing in on the FPGA stuff which is what it is all about. Still a lot of coding to do. Need to implement mouse to touch screen input to be able to control the scope, FPGA interfacing for the parts we already know about and what more is needed to get a full functioning scope emulator.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 02, 2021, 09:40:44 am
It is nearly there.

Implemented the I2C handling on port A and the mouse part for the scope window, but to get it to work the FPGA part is needed since the panel register address 0x8150 is read from it. Made a trace of what is being send to the FPGA and noticed it tries to read from the special chip connected to the FPGA and that slows the system down since it tries it many times. Which was already known.

So that needs to be implemented. Fortunately this part is already analyzed and known.

The trace also shows the commands initially used and one that is called repeatedly after the scope screen came up. 0x0A, so maybe this is a check to see if there is trace data available.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 02, 2021, 04:42:29 pm
The display shows more of the scope screen, but even though I can see that the scope code reads coordinates from the touch panel it does not show any response on the screen.

So again more research is needed |O

Did not implement the special memory chip stuff yet. Only the reading of FPGA command 0x41 which returns the touch panel register address for the coordinates (0x8150).

Since the scope code reads the right touch panel coordinates, which I verified whilst debugging the scope emulator. By looking at the assembly in Ghidra and checking the contents of the registers in the emulator core and the touch panel data, also in the emulator core, I could see that the numbers are the same.

Why the scope does not respond with the menus or red squares when the buttons are touched needs to be researched. :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 02, 2021, 07:06:20 pm
One more for the road ;D

I realized one thing, but unfortunately it was not the full solution, the real touch panel will continue to return status "there is touch" as long as there is touch. My first mouse solution did not do that. It only signaled status when there was a change (mouse button down or movement), so had to change that. As it did not work I decided to do another FPGA trace. This shows I have to implement the handling of the special memory chip, because it is called after most touch events. What also happens is that the touch panel is scanned twice followed by another command sequence.

The implementation of the special memory chip will at least speed up the scope, since it will then not loop through trying it so many times.

It is a tough nut to crack, but I keep on cracking :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 05, 2021, 07:15:17 pm
Had to attend to other business so it took a while to get to the implementing of the parameter storage emulation.

I still wonder what the designer was thinking when he came up with this, to my opinion idiotic, system for the parameter storage. The data seen on the I2C bus between the FPGA and the special chip is "encrypted" with an xor for which the key (a byte) changes after every write and read. After a write the scope code mangles the byte by swapping bits in always the same pairs (7,2),(5,0),(6,4),(3,1). After a read it inverts the byte. There is also a checksum which is checked in the scope code.

Still have to implement the write part, which needs some investigation, because before every read it does a write, so when to know if a value needs to be stored as a new setting.

The reading works, but for now all the parameters return 0, but at least the repeated reading has been eliminated. (It did the write and then tried the read 50 times and repeated this sequence 5 times)

Unfortunately the scope still shows no response to the "touch".

The whole parameter part needs to be investigated to see which settings are read and what the response should be for it to work properly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 06, 2021, 04:49:30 pm
Question.

Is there someone with a 1013D scope and a good I2C sniffer willing to capture the data communication between the fpga and the special chip.

The connections can be made with the 4 pin header next to the fpga flash chip. Tried it myself with a STM32F103 but it is not fast enough. Also the Rigol MSO5074 does not help because triggering on the first data is tricky. The lines flip when the fpga loads and then it takes to long before the actual data comes.

The sniffer needs to be able to handle 820KHz, because that is the rate of the clock signal.

What I need is the raw data. It is a fairly constant process of packets of 8 bytes. First a write session to I2C address 0 and then a read session from I2C address 0. At startup there will be an initial read session without the write. This is to get the "crypt key". I also noticed that when the touch panel is touched the communication stops as long as there is touch.

It would be a great help in the reverse engineering.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on June 06, 2021, 06:44:42 pm
I have a cheap eBay "Logic Analyzer" dongle, which *should* support up to 24MHz. (Searching for "24MHz 8 channel login analyzer" brings it up). I can try to sniff it, but I have never used this so I don't even know if it works.

I'll have a try in a few days.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 06, 2021, 08:30:45 pm
Hello.
I have this Logic Analyzer, too.
What kind of dataformat you need? And how many "sequence/frame"?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 06, 2021, 09:25:52 pm
I saved the "turn on procedure" of the scope, with "Saleae Logic 2" (my prog version is 2.3.26)
I hope it can be open without hardware device too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 07, 2021, 12:03:37 pm
b) They help me ;) For me it helps to write about what I encounter and sometimes brings light to my brain.

That's absolutely ok!
BUt it should be very hard to read for people just searching for some funded infos on the scope.
Instead of a daily diary i would suggest a seperated thread of its own - "Hacking the tablet scope" .
Or a detailed diary on github or something else ;)

And now back to the roots..
After a two weeks break with this stuff I managed the capture of short pulses e.g. slope of a rectangle edge.
Despite the info that the Single Trigger does not work I found out, that it works sometimes..
On MY scope it works after switching on and choosing "Single" trigger at once.
[attach=1][attach=2]
I can save the actual waveform and continue with my observations.
But when I save a pic (in single trigger mode) the scope does not trigger any more.
When I change the timebase before saving, the screen gets black and I'm forced for a switch-circle-party...
When I save a pic elsewhere and change the trigger to single later I 'll get the screen.. but no signal line, the single trigger does not work.
Saving pics the scope still has problems catching the actual measuring cursors...
[attach=3]

I strongly recommend DO NOT SAVE PICS during your working session!
Save waveforms and choose the pics you like to save at the end from the stored waveforms.

Question.
Is there someone with a 1013D scope and a good I2C sniffer willing to capture the data communication between the fpga and the special chip.
Maybe later this week.
My problem: I didn't use my DSLogic for a longer time and  with my Ubuntu 20.04 upgrade there went something wrong and must install my system from scratch -> no DSView, no patched Pulseview
Standard pulseview does not recon my hacked DSLogic(plus) :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 07, 2021, 01:01:23 pm
I saved the "turn on procedure" of the scope, with "Saleae Logic 2" (my prog version is 2.3.26)
I hope it can be open without hardware device too.

Thanks very much.  :-+

I'm able to start the "Saleae Logic 2" program without hardware device and it looks very nice. Did not find an option to actually export the i2c data bytes (did not look very hard though, and maybe there is an option), so I will note them down by hand and decode them to get the "unencrypted" data and see if I can get my code to return the intended results.

Did find what one of the fpga commands needed to return. The 0x0A command seems to always return a 0x01, at least this is what he code check on and skips the touch panel wait if it is true. So the emulator now continues to the scope screen without having to "touch" the screen.

Hope that all the used parameter id's are in the trace you made, but hope that you are willing to capture more if needed. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 07, 2021, 01:38:28 pm
The I2C implementation of the chip they used is not up to specs. Found what the capture software rightfully identified as a re start, but actually is data. Could this be the reason why they have this multiple repeat loop in the software.

Edit: I can actually see it going wrong multiple times in the capture. The wider blobs at the beginning and end of the screen are repeated reads.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 07, 2021, 05:05:56 pm
Thanks very much.  :-+
.
.
...hope that you are willing to capture more if needed. :)

Yes,
I'm happy to help.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 07, 2021, 06:34:58 pm
BUt it should be very hard to read for people just searching for some funded infos on the scope.
Instead of a daily diary i would suggest a seperated thread of its own - "Hacking the tablet scope" .
Or a detailed diary on github or something else ;)

A poll:
How many of the readers of this post want me to move the hacking updates to another thread?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 07, 2021, 06:41:59 pm

A poll:
How many of the readers of this post want me to move the hacking updates to another thread?

The current is good for me. 
But I'm just a newbie, here. :-)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 07, 2021, 06:51:36 pm
Yes,
I'm happy to help.  :)

Hi e_Johny, can you make a capture where you do touch on the screen. Start with the top right button that changes the right menu bar and then touch the v+ of the first channel. After that touch the main menu button. Hopefully this will give me insight in how it works, because a setting is read after the touch and the result of it is used in the code.

Edit: also do a capture when changing the brightness.

The data you provided is also useful but it seems to repeats a certain pattern of id's. The first four seem to be initialize calls of which the 0x10 is for the brightness. The others repeat.

Code: [Select]
{ 0x00, 0x36, 0x28, 0x89, 0x69, 0x96, 0x99, 0x13 },  //Checksum ok  Crypt mangle ok  Id: 0x0A  Len: 0
{ 0x01, 0x25, 0x55, 0x39, 0x69, 0x96, 0x99, 0x27 },  //Checksum ok
{ 0x00, 0xA1, 0x50, 0xBC, 0x69, 0x96, 0x99, 0xED },  //Checksum ok  Crypt mangle ok  Id: 0x14  Len: 0
{ 0x01, 0xCA, 0x55, 0xC4, 0x69, 0x96, 0x99, 0x0D },  //Checksum ok
{ 0x00, 0x1E, 0x58, 0x06, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Crypt mangle ok  Id: 0x16  Len: 0
{ 0x01, 0x05, 0x5A, 0x8B, 0x69, 0x96, 0x7E, 0xAF },  //Checksum ok
{ 0x00, 0xA0, 0x40, 0xE4, 0x69, 0x96, 0x99, 0x64 },  //Checksum ok  Crypt mangle ok  Id: 0x10  Len: 0
{ 0x01, 0x70, 0x5A, 0x13, 0x69, 0x96, 0xEA, 0x60 },  //Checksum ok
{ 0x00, 0x51, 0x45, 0x09, 0x69, 0x96, 0x7D, 0x97 },  //Checksum ok  Crypt mangle ok  Id: 0x11  Len: 1
{ 0x01, 0x31, 0x5A, 0x6C, 0x69, 0x96, 0x07, 0xDB },  //Checksum ok
{ 0x00, 0x61, 0x30, 0x0B, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Crypt mangle ok  Id: 0x0C  Len: 0
{ 0x01, 0xC1, 0x55, 0xCE, 0x69, 0x96, 0x99, 0x20 },  //Checksum ok
{ 0x00, 0x34, 0x2C, 0xF8, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Crypt mangle ok  Id: 0x0B  Len: 0
{ 0x01, 0xA7, 0x55, 0x41, 0x69, 0x96, 0x99, 0xAD },  //Checksum ok
{ 0x00, 0xAD, 0x45, 0x4A, 0x69, 0x96, 0xA5, 0xFA },  //Checksum ok  Crypt mangle ok  Id: 0x11  Len: 1
{ 0x01, 0xA7, 0x5A, 0x6B, 0x69, 0x96, 0x0A, 0x61 },  //Checksum ok
{ 0x00, 0xAD, 0x30, 0x8F, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Crypt mangle ok  Id: 0x0C  Len: 0
{ 0x01, 0x8C, 0x55, 0x99, 0x69, 0x96, 0x99, 0x20 },  //Checksum ok
{ 0x00, 0x86, 0x2C, 0x4A, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Crypt mangle ok  Id: 0x0B  Len: 0
{ 0x01, 0x99, 0x55, 0x33, 0x69, 0x96, 0x99, 0xAD },  //Checksum ok
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 07, 2021, 07:57:37 pm
Sigrok does not compile on my actual system and Ubuntu's pulseview makes nonsense :(
DSView 0.99 doesn't compile too, casting errors 64bit->8bit..
DSViev 1.12 did compile and found a DSLogic Basic..
I captured two sessions a' 20 seconds, first samplrate 10MHz, 2nd 4MHz.
Switch on, moving lines(signal*cursors), timbase,  trigger, vertical sensivity, switch off - CH1 only with CH2 turned off.
Data saved as DSView format, csv and gnuplot.
[attachimg=1]
The zips contain tgzs, tgz didn't upload :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 08, 2021, 04:27:45 am
Unfortunately, the touch panel of my scope has two bugs.

1. (Original-, "factory" fault) The mid column is blind. Therefore cannot be switched anything in  the Ch2 menu.

This was the main reason to follow this forum-thread.

2. The top row of the touch panel is blind.
(This is my fault. I measured the traces between the glass and the GT911. Maybe I made something mistake, because since then no reaction on the top row. I will continue the checking, but its very slow (for my other duties).

I ordered a new touch panel, but it is still in shipping from China.

I can switch the RUN/STOP, and the lower buttons.

So, if you want presently, I can capture something only with these...

(Sorry, if my english is sometimes a little poor.)


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 08, 2021, 04:53:13 am
Hi e_Johny,

your English is fine :)

So it seems it is quite a few scopes that have issues with the touch panel. Luckily it can be solved easily with what has been discovered here. And yeah shipping form China takes it time unfortunately :=\

Any capture with touch will help. It will give an insight in the logic behind it all.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 08, 2021, 06:01:29 am
I captured two sessions a' 20 seconds, first samplrate 10MHz, 2nd 4MHz.
Switch on, moving lines(signal*cursors), timbase,  trigger, vertical sensivity, switch off - CH1 only with CH2 turned off.
Data saved as DSView format, csv and gnuplot.
(Attachment Link)
The zips contain tgzs, tgz didn't upload :(

Hi bianchifan, thanks for the effort, but the data is incomplete. The 3rd line seems to be the clock and changes regularly, but what I assume to be the data line (no trace number) is one and stays one. The other traces (0,1) are zero and stay zer0.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 08, 2021, 05:57:51 pm
Good news:

The "top-line" error  is over.  :-+
// Fault was maybe:
// - thin short between 2 "legs" (~QFN package),
// - or the ribbon cable contact (~bending).

I captured the asked procedures.

At the brightness modifications I made a "full menu path"- and a "just the slider moving" capture.
Both was made with steps, and countinous variant. (detailed file names)

( At the first procedures - I don't remember - the "V+" how many times was pressed.
Maybe one, or maybe all steps (while relays switch)...)

Edit:
The scope was in RUN mode, at all procedures.
/In STOP mode, the V+/V- just do 2 relay-steps up/down. (In RUN mode, it is more)./


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 08, 2021, 06:33:23 pm
Hi e_Johny,

well done. This now a days hardware is all very very small and probing with a sharp tool easily damages things or makes shorts :palm:

And thanks again for making the captures. :-+

Today I wrote a conversion program to read the saleae binary export and convert the data into the scope data. I uploaded it to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/i2c_bin_data_converter)

I converted the data you made yesterday and it shows that the reads of id 0x11, 0x0C and 0x0B are indeed repeated down to the end.

Added the results to the scope emulator, but it did not result in working "touch", so hopefully the captures you made today will shed some light on things.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 08, 2021, 06:48:30 pm
But it did not result in working "touch"

Does it matter if our firmwares (maybe) are different?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 08, 2021, 06:59:20 pm
Does it matter if our firmwares (maybe) are different?

Don't think it will, since others have used the "new" firmware in "old" scopes without real problems. (Apart from touch panel coordinates reversals)

I ordered a cheap 8 channel 24MHz usb logic analyzer from AliExpress (https://nl.aliexpress.com/item/1005001809356844.html) yesterday, so when it arrives, I can check what my scope does. In the mean time I can study what you supplied.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 08, 2021, 07:41:37 pm
For the brightness it shows that the special chip translates an 8 bit value into a 16 bit value. While adjusting it repeatedly sends the brightness id 0x10.

I also noticed that in the repeated sequence of the 0x11, 0x0C and 0x0B it is once in a while extended with 0x0E. In the emulator I saw 0x0D passing by. So maybe a per channel message?

The first capture (01_CTRL_+_V+_+_MENU_+_SystemSettings) did not show extra commands.

The data below shows the actual data on the wire, the "decrypted" data, checksum status, id and length indicator (0 means a byte)
Code: [Select]
{ 0x00, 0x4C, 0xD2, 0x07, 0xFB, 0x04, 0x0B, 0xDF },{ 0x00, 0xDE, 0x40, 0x95, 0x69, 0x96, 0x99, 0x4D },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xD2, 0x77, 0x63, 0x44, 0xBB, 0x95, 0x3D },{ 0x01, 0x2D, 0x5A, 0x4E, 0x69, 0x96, 0xB8, 0x10 },  //Checksum ok
{ 0x00, 0xA3, 0x6D, 0x23, 0x44, 0xBB, 0xB4, 0x60 },{ 0x00, 0x8E, 0x40, 0x0E, 0x69, 0x96, 0x99, 0x4D },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xB0, 0x15, 0x3F, 0x26, 0xD9, 0xF7, 0x5F },{ 0x01, 0x4F, 0x5A, 0x70, 0x69, 0x96, 0xB8, 0x10 },  //Checksum ok
{ 0x00, 0xBA, 0x0F, 0xBD, 0x26, 0xD9, 0xD6, 0x1F },{ 0x00, 0xF5, 0x40, 0xF2, 0x69, 0x96, 0x99, 0x50 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x80, 0x25, 0x49, 0x16, 0xE9, 0xC1, 0xDF },{ 0x01, 0x7F, 0x5A, 0x36, 0x69, 0x96, 0xBE, 0xA0 },  //Checksum ok
{ 0x00, 0xFB, 0x3F, 0x4E, 0x16, 0xE9, 0xE6, 0x2F },{ 0x00, 0x84, 0x40, 0x31, 0x69, 0x96, 0x99, 0x50 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x79, 0xDC, 0xBB, 0xEF, 0x10, 0x38, 0x26 },{ 0x01, 0x86, 0x5A, 0x3D, 0x69, 0x96, 0xBE, 0xA0 },  //Checksum ok
{ 0x00, 0x8C, 0xC6, 0x46, 0xEF, 0x10, 0x1F, 0xD6 },{ 0x00, 0x0A, 0x40, 0xC0, 0x69, 0x96, 0x99, 0x50 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x2C, 0x89, 0x59, 0xBA, 0x45, 0x6D, 0x73 },{ 0x01, 0xD3, 0x5A, 0x8A, 0x69, 0x96, 0xBE, 0xA0 },  //Checksum ok
{ 0x00, 0x7C, 0x93, 0xE1, 0xBA, 0x45, 0x4A, 0x89 },{ 0x00, 0xAF, 0x40, 0x32, 0x69, 0x96, 0x99, 0x5A },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x63, 0xC6, 0xD5, 0xF5, 0x0A, 0x48, 0x1C },{ 0x01, 0x9C, 0x5A, 0x49, 0x69, 0x96, 0xD4, 0x80 },  //Checksum ok
{ 0x00, 0xC6, 0xDC, 0x6C, 0xF5, 0x0A, 0x05, 0xC6 },{ 0x00, 0x5A, 0x40, 0xF0, 0x69, 0x96, 0x99, 0x5A },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xAC, 0x09, 0x53, 0x3A, 0xC5, 0x87, 0xD3 },{ 0x01, 0x53, 0x5A, 0x00, 0x69, 0x96, 0xD4, 0x80 },  //Checksum ok
{ 0x00, 0x78, 0x13, 0x84, 0x3A, 0xC5, 0xCA, 0x30 },{ 0x00, 0x2B, 0x40, 0xD7, 0x69, 0x96, 0x99, 0x63 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xA7, 0x02, 0x91, 0x31, 0xCE, 0xB0, 0x68 },{ 0x01, 0x58, 0x5A, 0xC9, 0x69, 0x96, 0xE8, 0x30 },  //Checksum ok
{ 0x00, 0x52, 0x18, 0x65, 0x31, 0xCE, 0xC1, 0x3B },{ 0x00, 0x0A, 0x40, 0x3D, 0x69, 0x96, 0x99, 0x63 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xC5, 0x60, 0x91, 0x53, 0xAC, 0xD2, 0x0A },{ 0x01, 0x3A, 0x5A, 0xAB, 0x69, 0x96, 0xE8, 0x30 },  //Checksum ok
{ 0x00, 0x4B, 0x7A, 0xC0, 0x53, 0xAC, 0xA3, 0x59 },{ 0x00, 0x71, 0x40, 0xFA, 0x69, 0x96, 0x99, 0x63 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0xA1, 0x04, 0x91, 0x37, 0xC8, 0xB6, 0x6E },{ 0x01, 0x5E, 0x5A, 0xCF, 0x69, 0x96, 0xE8, 0x30 },  //Checksum ok
{ 0x00, 0xDA, 0x1E, 0xF8, 0x37, 0xC8, 0xC7, 0x3A },{ 0x00, 0x84, 0x40, 0xA6, 0x69, 0x96, 0x99, 0x64 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x9D, 0x38, 0x67, 0x0B, 0xF4, 0x88, 0x02 },{ 0x01, 0x62, 0x5A, 0x05, 0x69, 0x96, 0xEA, 0x60 },  //Checksum ok
{ 0x00, 0x19, 0x22, 0x3B, 0x0B, 0xF4, 0xFB, 0x06 },{ 0x00, 0x7B, 0x40, 0x59, 0x69, 0x96, 0x99, 0x64 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x00, 0xA5, 0x5D, 0x96, 0x69, 0x15, 0x9F },{ 0x01, 0xFF, 0x5A, 0xA2, 0x69, 0x96, 0xEA, 0x60 },  //Checksum ok
{ 0x00, 0xFF, 0xBF, 0xBE, 0x96, 0x69, 0x66, 0x9B },{ 0x00, 0x00, 0x40, 0x41, 0x69, 0x96, 0x99, 0x64 },  //Checksum ok  Id: 0x10  Len: 0
{ 0x01, 0x24, 0x81, 0xA5, 0xB2, 0x4D, 0x31, 0xBB },{ 0x01, 0xDB, 0x5A, 0x7E, 0x69, 0x96, 0xEA, 0x60 },  //Checksum ok

The rest is for another day :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 10:45:22 pm
the data is incomplete.

I also was not happy with the data.
DSView 1.12 does not work correctly with my hacked/upgraded DSLogic.
Today I managed to turn it into a Basic one, so DSView should work ok.
But unfortunately I cannot upload my data, I always get a screen for a new topic ... :(

Nevertheless I noticed today a laggy screen and some quite wrong actions, the reason was...charging!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 10:53:19 pm
No success with upload, I fear the zip is too big..
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:08:22 pm
Scenario 1: 20sec - 10MHz
running system, moving lines and cursors, switchin trigger, timebase, sensivity and so on until sudden death due to time limit
[attachimg=1]
First zip contains DSView-Format, 2nd zip contains sigrok(Pulseview)-Format

TOO late, no idea how to upload my data  >:D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:11:38 pm
Scenario 2: 20sec - 4MHz
Scope turned off, switching on, moving lines and cursors, switchin trigger, timebase, sensivity, turn off after ~17sec.
[attachimg=1]
First zip contains DSView-Format, 2nd zip contains sigrok(Pulseview)-Format
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:14:07 pm
scene 3: 5sec - 4MHz
System is running, doing nothing but charging
[attachimg=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:19:03 pm
The zip is 3.1MB
[attachimg=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:22:03 pm
...[attachurl=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 08, 2021, 11:24:43 pm
...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 09, 2021, 05:08:49 am
Hi bianchifan,

looking at the images the data still looks as if there is something wrong. If you look at the image e_Johny attached in post #819 you can see the clock and data zoomed in on a singe packet. There should be 8 bytes per packet with 9 clock pulses per byte (1 for the ack/nack).

You could also check things with the I2C converter I uploaded to the repository yesterday. SCL should be in the first trace file loaded and SDA in the second. It expects double time values for each transition. Take a look here: https://support.saleae.com/faq/technical-faq/binary-export-format-logic-2. If you manage to get output like what I posted yesterday, it will be much less data and very well compressible, so no problems with uploading.

Maybe your capture device will work with the saleae program as well. It can be downloaded for linux as an appimage and I tried it on ubuntu 16.04 and linux mint 20. Don't have a device yet but I'm able to open the files e_Johny made.

Your efforts are appreciated :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2021, 12:03:44 pm
Examining e_Johny's captures of the communication between the FPGA and the special chip brought some light, but it is still quite dark :palm:

It looks like the id's 0x11 and 0x0B play a special role in the control of the state of the scope. There is also some interaction with the FPGA for this process. The scope reads two bytes from the FPGA after sending command 0x14. It does some coding on the data and then uses it as input for parameter id 0x11. The data returned after reading the parameter data is used in the code to do things. Not clear what and how.

The parameter id 0x0B is being used with 6 immediate values, but also with variable data. The immediate values are 0 to 5. One variable value I saw in a capture of e_Johny. 6. The special chip sends data back and I think it is a fixed response per input. 0 seems to return 0xAD and 6 0xB8.

If the intention of this special chip was to make hacking the scope difficult they did a good job.  |O

The hacking keeps on going. Still have ideas and options to get to the bottom of it all. I have a cyclone iv FPGA board lying around, so can try to load the bit stream in it and peek and poke the commands.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2021, 02:12:53 pm
It looks like that what the special chip does for id 0x11 is not that complex.

If I'm correct it just shifts the data 4 bits to the right and adds two.

The scope code takes the two bytes from the FPGA and does the following:

Code: [Select]
uint FUN_8001bec4(void)
{
  byte bVar1;
  byte bVar2;
  uint uVar3;
 
  fpga_write_cmd('\x14');
  bVar1 = fpga_read_data();
  bVar2 = fpga_read_data();
  uVar3 = get_setting(0x11, bVar1 & 0xf | (bVar1 & 0xf) << 0xc | (uint)bVar2 << 4);
  return uVar3;
}


I processed the capture e_Johny made to undo the action done to the FPGA data and show only the parameter 0x11 lines.
The last two bytes of the data in between the second set of brackets show what is received by the chip. (0x7D, 0x97 ==> 0x7D97 ==> 0x07D9)

Code: [Select]
{ 0x00, 0x51, 0x35, 0x79, 0x19, 0xE6, 0x0D, 0xE7 },{ 0x00, 0x21, 0x45, 0x09, 0x69, 0x96, 0x7D, 0x97 },  //Checksum ok  Data: 0x000007D9  Id: 0x11  Len: 1
{ 0x01, 0xCE, 0x6B, 0x5D, 0x58, 0xA7, 0x36, 0xEA },{ 0x01, 0x31, 0x5A, 0x6C, 0x69, 0x96, 0x07, 0xDB },  //Checksum ok  Data: 0x000007DB
{ 0x00, 0xAD, 0xE2, 0xED, 0xCE, 0x31, 0x02, 0x5D },{ 0x00, 0x0A, 0x45, 0x4A, 0x69, 0x96, 0xA5, 0xFA },  //Checksum ok  Data: 0x00000A5F  Id: 0x11  Len: 1
{ 0x01, 0x58, 0xFD, 0xCC, 0xCE, 0x31, 0xAD, 0xC6 },{ 0x01, 0xA7, 0x5A, 0x6B, 0x69, 0x96, 0x0A, 0x61 },  //Checksum ok  Data: 0x00000A61
{ 0x00, 0x66, 0xDC, 0xA0, 0xF0, 0x0F, 0x3C, 0x23 },{ 0x00, 0xFF, 0x45, 0x39, 0x69, 0x96, 0xA5, 0xBA },  //Checksum ok  Data: 0x00000A5B  Id: 0x11  Len: 1
{ 0x01, 0xA4, 0x01, 0x40, 0x32, 0xCD, 0x51, 0x06 },{ 0x01, 0x5B, 0x5A, 0x1B, 0x69, 0x96, 0x0A, 0x5D },  //Checksum ok  Data: 0x00000A5D
{ 0x00, 0x62, 0x5C, 0x1C, 0x70, 0x8F, 0xBC, 0xA3 },{ 0x00, 0x7B, 0x45, 0x05, 0x69, 0x96, 0xA5, 0xBA },  //Checksum ok  Data: 0x00000A5B  Id: 0x11  Len: 1
{ 0x01, 0xFA, 0x5F, 0xC0, 0x6C, 0x93, 0x0F, 0x58 },{ 0x01, 0x05, 0x5A, 0xC5, 0x69, 0x96, 0x0A, 0x5D },  //Checksum ok  Data: 0x00000A5D
{ 0x00, 0x60, 0x54, 0x42, 0x78, 0x87, 0xB4, 0xDB },{ 0x00, 0x71, 0x45, 0x53, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x1E, 0xBB, 0x43, 0x88, 0x77, 0xEB, 0xBF },{ 0x01, 0xE1, 0x5A, 0xA2, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0x68, 0x56, 0x3C, 0x7A, 0x85, 0xB6, 0xC9 },{ 0x00, 0x7B, 0x45, 0x2F, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x55, 0xF0, 0xC6, 0xC3, 0x3C, 0xA0, 0xF5 },{ 0x01, 0xAA, 0x5A, 0x6C, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0x63, 0x7C, 0x1D, 0x50, 0xAF, 0x9C, 0xA3 },{ 0x00, 0x5A, 0x45, 0x24, 0x69, 0x96, 0xA5, 0x9A },  //Checksum ok  Data: 0x00000A59  Id: 0x11  Len: 1
{ 0x01, 0x60, 0xC5, 0xC2, 0xF6, 0x09, 0x95, 0xC4 },{ 0x01, 0x9F, 0x5A, 0x5D, 0x69, 0x96, 0x0A, 0x5B },  //Checksum ok  Data: 0x00000A5B
{ 0x00, 0x9A, 0x0B, 0x13, 0x27, 0xD8, 0xEB, 0x84 },{ 0x00, 0xD4, 0x45, 0x5D, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0xD7, 0x72, 0xC1, 0x41, 0xBE, 0x22, 0x76 },{ 0x01, 0x28, 0x5A, 0xE9, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0x30, 0x04, 0xA2, 0x28, 0xD7, 0xE4, 0x8B },{ 0x00, 0x71, 0x45, 0xE3, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x38, 0x9D, 0x4F, 0xAE, 0x51, 0xCD, 0x99 },{ 0x01, 0xC7, 0x5A, 0x88, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0xA2, 0x48, 0x58, 0x64, 0x9B, 0xA8, 0xC7 },{ 0x00, 0xAF, 0x45, 0x55, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x38, 0x9D, 0x4F, 0xAE, 0x51, 0xCD, 0x99 },{ 0x01, 0xC7, 0x5A, 0x88, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0x91, 0x21, 0x20, 0x0D, 0xF2, 0xC1, 0xAE },{ 0x00, 0xF5, 0x45, 0x44, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x9A, 0x3F, 0x43, 0x0C, 0xF3, 0x6F, 0x3B },{ 0x01, 0x65, 0x5A, 0x26, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0xB6, 0x88, 0x5E, 0xA4, 0x5B, 0x00, 0x21 },{ 0x00, 0x7B, 0x45, 0x93, 0x69, 0x96, 0xCD, 0xEC },  //Checksum ok  Data: 0x00000CDE  Id: 0x11  Len: 1
{ 0x01, 0xC9, 0x6C, 0x4D, 0x5F, 0xA0, 0x3A, 0xD6 },{ 0x01, 0x36, 0x5A, 0x7B, 0x69, 0x96, 0x0C, 0xE0 },  //Checksum ok  Data: 0x00000CE0
{ 0x00, 0xB5, 0xA0, 0xD3, 0x8C, 0x73, 0x40, 0x3F },{ 0x00, 0x50, 0x45, 0x36, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x7C, 0xD9, 0xC6, 0xEA, 0x15, 0x89, 0xDC },{ 0x01, 0x83, 0x5A, 0x45, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0x91, 0x21, 0x30, 0x0D, 0xF2, 0xC1, 0xBE },{ 0x00, 0xF5, 0x45, 0x54, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x53, 0xF6, 0xC2, 0xC5, 0x3A, 0xA6, 0xF3 },{ 0x01, 0xAC, 0x5A, 0x6E, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0x51, 0x35, 0x54, 0x19, 0xE6, 0xD5, 0xFA },{ 0x00, 0x21, 0x45, 0x24, 0x69, 0x96, 0xA5, 0x8A },  //Checksum ok  Data: 0x00000A58  Id: 0x11  Len: 1
{ 0x01, 0x7E, 0xDB, 0xBF, 0xE8, 0x17, 0x8B, 0xDB },{ 0x01, 0x81, 0x5A, 0x3E, 0x69, 0x96, 0x0A, 0x5A },  //Checksum ok  Data: 0x00000A5A
{ 0x00, 0x25, 0xE4, 0x47, 0xC8, 0x37, 0x04, 0x3B },{ 0x00, 0x84, 0x45, 0xE6, 0x69, 0x96, 0xA5, 0x9A },  //Checksum ok  Data: 0x00000A59  Id: 0x11  Len: 1
{ 0x01, 0x28, 0x8D, 0x42, 0xBE, 0x41, 0xDD, 0x8C },{ 0x01, 0xD7, 0x5A, 0x95, 0x69, 0x96, 0x0A, 0x5B },  //Checksum ok  Data: 0x00000A5B
{ 0x00, 0xBF, 0xAA, 0xD7, 0x86, 0x79, 0x4A, 0x25 },{ 0x00, 0x50, 0x45, 0x38, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x9A, 0x3F, 0x43, 0x0C, 0xF3, 0x6F, 0x3B },{ 0x01, 0x65, 0x5A, 0x26, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0x5A, 0x1F, 0x37, 0x33, 0xCC, 0xFF, 0xC0 },{ 0x00, 0x00, 0x45, 0x6D, 0x69, 0x96, 0xA5, 0x9A },  //Checksum ok  Data: 0x00000A59  Id: 0x11  Len: 1
{ 0x01, 0xA1, 0x04, 0x42, 0x37, 0xC8, 0x54, 0x05 },{ 0x01, 0x5E, 0x5A, 0x1C, 0x69, 0x96, 0x0A, 0x5B },  //Checksum ok  Data: 0x00000A5B
{ 0x00, 0x61, 0x74, 0x53, 0x58, 0xA7, 0x94, 0xEB },{ 0x00, 0x50, 0x45, 0x62, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0xDB, 0x7E, 0xC2, 0x4D, 0xB2, 0x2E, 0x7B },{ 0x01, 0x24, 0x5A, 0xE6, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0x5A, 0x1F, 0x07, 0x33, 0xCC, 0xFF, 0x90 },{ 0x00, 0x00, 0x45, 0x5D, 0x69, 0x96, 0xA5, 0xCA },  //Checksum ok  Data: 0x00000A5C  Id: 0x11  Len: 1
{ 0x01, 0x12, 0xB7, 0x43, 0x84, 0x7B, 0xE7, 0xB3 },{ 0x01, 0xED, 0x5A, 0xAE, 0x69, 0x96, 0x0A, 0x5E },  //Checksum ok  Data: 0x00000A5E
{ 0x00, 0x49, 0x77, 0x2E, 0x5B, 0xA4, 0x97, 0xD8 },{ 0x00, 0x7B, 0x45, 0x1C, 0x69, 0x96, 0xA5, 0xEA },  //Checksum ok  Data: 0x00000A5E  Id: 0x11  Len: 1
{ 0x01, 0x7A, 0xDF, 0xCD, 0xEC, 0x13, 0x8F, 0xE5 },{ 0x01, 0x85, 0x5A, 0x48, 0x69, 0x96, 0x0A, 0x60 },  //Checksum ok  Data: 0x00000A60
{ 0x00, 0xE6, 0xD8, 0xFC, 0xF4, 0x0B, 0x38, 0x07 },{ 0x00, 0x7B, 0x45, 0x61, 0x69, 0x96, 0xA5, 0x9A },  //Checksum ok  Data: 0x00000A59  Id: 0x11  Len: 1
{ 0x01, 0xB7, 0x12, 0x4E, 0x21, 0xDE, 0x42, 0x13 },{ 0x01, 0x48, 0x5A, 0x06, 0x69, 0x96, 0x0A, 0x5B },  //Checksum ok  Data: 0x00000A5B
{ 0x00, 0x25, 0xE4, 0x87, 0xC8, 0x37, 0x04, 0x7B },{ 0x00, 0x84, 0x45, 0x26, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x3D, 0x98, 0x46, 0xAB, 0x54, 0xC8, 0x9D },{ 0x01, 0xC2, 0x5A, 0x84, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0xBE, 0x8A, 0xC6, 0xA6, 0x59, 0x6A, 0x15 },{ 0x00, 0x71, 0x45, 0x09, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x8E, 0x2B, 0x42, 0x18, 0xE7, 0x7B, 0x2E },{ 0x01, 0x71, 0x5A, 0x33, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0xF5, 0xB0, 0x23, 0x9C, 0x63, 0x50, 0x2F },{ 0x00, 0x00, 0x45, 0xD6, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0x79, 0xDC, 0xCE, 0xEF, 0x10, 0x8C, 0xD9 },{ 0x01, 0x86, 0x5A, 0x48, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F
{ 0x00, 0xBB, 0x2A, 0xA3, 0x06, 0xF9, 0xCA, 0xF5 },{ 0x00, 0xD4, 0x45, 0xCC, 0x69, 0x96, 0xA5, 0x9A },  //Checksum ok  Data: 0x00000A59  Id: 0x11  Len: 1
{ 0x01, 0xE9, 0x4C, 0xC2, 0x7F, 0x80, 0x1C, 0x4D },{ 0x01, 0x16, 0x5A, 0xD4, 0x69, 0x96, 0x0A, 0x5B },  //Checksum ok  Data: 0x00000A5B
{ 0x00, 0x3A, 0x0E, 0xC6, 0x22, 0xDD, 0xEE, 0x91 },{ 0x00, 0x71, 0x45, 0x8D, 0x69, 0x96, 0xA5, 0xDA },  //Checksum ok  Data: 0x00000A5D  Id: 0x11  Len: 1
{ 0x01, 0xD2, 0x77, 0xC2, 0x44, 0xBB, 0x27, 0x72 },{ 0x01, 0x2D, 0x5A, 0xEF, 0x69, 0x96, 0x0A, 0x5F },  //Checksum ok  Data: 0x00000A5F


The question now is what is going on in the FPGA that makes it return these different values when command 0x14 is read.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 10, 2021, 03:33:24 pm
looking at the images the data still looks as if there is something wrong....There should be 8 bytes per packet with 9 clock pulses per byte

I beg your pardon but I didn't took a closer look at the data for I have only very little I2C skills, normally I do not use.

There should be 8 bytes per packet with 9 clock pulses per byte (1 for the ack/nack).
IIRC I2C data may vary betwenn 7 and 11 bytes and I'm quite shure that 7and 9 are used, even thouhg quite rarely.

Maybe your capture device will work with the saleae program as well.
1st.. I do not think so, 2nd, I'm using FOSS only ;)

To get things done I passed up my bike ride this afternoon and digged instaed in my electronic cementary, at least I found my first LA, a 5in1 Combi from Banggood. I set it to USBee for it worked wih the sigrok FW a couple of years ago.
[attach=1]
First, I set SR to 4MHZ, same procedure as before (switch on, doing some stuff, switch off).
Zoomed in to have a closer look at the bytes, not happy due to varying no of samles for same timelength.
[attachimg=2]
[attachimg=3]

Next capture done with 12MHz, better but still varying samples but hopefully good enough...
[attachimg=4]
[attachimg=5]

Zips attached, format is srzip, standard pulseview format
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2021, 04:13:03 pm
looking at the images the data still looks as if there is something wrong....There should be 8 bytes per packet with 9 clock pulses per byte

I beg your pardon but I didn't took a closer look at the data for I have only very little I2C skills, normally I do not use.

There should be 8 bytes per packet with 9 clock pulses per byte (1 for the ack/nack).
IIRC I2C data may vary betwenn 7 and 11 bytes and I'm quite shure that 7and 9 are used, even thouhg quite rarely.

A) No problem.
B) We call it I2C, but what they made here is not true I2C. It looks like it, but it won't work with actual I2C hardware. That is why I wrote a conversion program to cater for the mishaps they made.

I will take a look at your captures later to verify my findings. The pictures are promising the data is correct.

And again thanks for doing the work :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2021, 04:23:37 pm
Found some FPGA commands from the captured data. Parameter id 0x0C returns 0x20. This is used to write to the FPGA and then read 750 or 1500 bytes. Don't know when it is 750 or 1500 yet, but I added code to the emulator to return data for this command. Also implemented it for 0x21. This one turns out to be for channel 2. The parameter used to get this data is 0x0D. The FPGA command 0x20 is for channel 1.

Still need to figure out what the levels need to be and how the data needs to change for showing a sine wave on the screen. Did manage to get a single square crossing to show on channel 1.

Also found the bit that can make the arrow in the battery level indicator disappear :D
For the battery level the KEYADC is used. Could implement it, but for now other parts are more interesting.

Edit: Actual square wave showing now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2021, 07:51:54 pm
Found a bug in my core code. The UMULL instruction was not correct. The upper 32 bits were always zero. Unfortunately the delays have longer duration so it is slower, but the "touch" does lead to changing the color of a button. Did not solve all the problems, because when "touch" is removed the color of the button stays changed and nothing else happens  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: iscle on June 10, 2021, 07:59:11 pm
That's great progress 👍🏻

While you are working on the simulator, I've ported the latest u-boot source code to the scope, and made it silent (it prints to uart0 but the pins are disabled by the pinmux).

It works perfectly, does not output anything to the lcd since I found it quite useless, and it starts booting linux right away.

The port is based on Icenowy's work, with SD-card support.

The patch to disable the uart is here: https://github.com/Iscle/u-boot-1013d/blob/081c12b95757eec06ea63be8999260da1df51bb3/arch/arm/mach-sunxi/board.c#L91

I'll proceed with booting the latest linux version now, and adding touchscreen drivers and an LVGL test app.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 11, 2021, 11:09:33 am
I'll proceed with booting the latest linux version now, and adding touchscreen drivers and an LVGL test app.

Hi iscle,

when you start to work on the touch be aware that the touch panel configuration set by the scope is based on 1024x600 pixels. In the scope code this is divided down to 800x480 pixels. A bit strange why they did this, because the display is only 800x480 and the touch panel can be set to this resolution.

So maybe make it such that you write your own configuration to the touch panel with the correct resolution and x/y directions.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 11, 2021, 04:10:03 pm
Solved some problems around the "touch" of the scope.

Again made a copy, paste not edit error.
The mouse up event was send to the mouse down handler, so the scope once touched did not get a "no touch" message.

This still did not solve the problem, because it turned out I misinterpreted the working of the touch panel.
On removal of touch it seems it still needs to send an activity status, but with zero points of touch.
I just signaled touch with one touch point when the mouse was down and no status when the mouse was released. Changed that and now it is working.

Made a short video, in which I found that there are still some problems |O, but one can find it here:  https://youtu.be/rJAYoyNg9T0

Edit: The problem is the slowness. :-DD The trigger menu that looks like it is not working in the video does work, but needs a longer touch. :palm:

The emulator is not very fast, and I removed the delay functions from the scope code to overcome this a bit. The modified binary is in the folder of the scope emulator.

Now the investigation of the FPGA commands can begin :)

As usual the changes can be found in the repository (https://github.com/pecostm32/FNIRSI-1013D-Hack)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 12, 2021, 11:16:32 am
Turns out that the special ic connected to the FPGA is not used for parameter storage.

The block of data at 0x001FD000 in the flash is where the parameters are stored. Apparently the scope writes the parameters back to flash. Not sure at what point in the code this is done and if it is only done when the power is turned off, but this means that the flash might fail after so many power cycles.

Changed some settings on my real scope and read the flash after a power cycle. Copied the data block to my emulator flash file (with the patched out SD support and  delays) and ran the program. The screen now shows the same setup as the real thing.

This means the special ic is used as some sort of translation or sequence device. I already identified what some of the id's used do, like 0x10 is for translating the 8 bit brightness setting to the 16 bits the FPGA wants for command 0x38.

0x0C is used to get the signal read command for channel 1, and 0x0D for channel 2. Not sure if they always return the same number.

One puzzle more or less solved. Many more to go |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 12, 2021, 06:07:02 pm
Tried to convert bianchifan's capture of the "I2C" communication between the FPGA and the special ic, but there are still errors. The first couple of packets are converted and then it misses starts and makes rubbish out of the data. Not sure why this happens.

To verify what is returned for parameter 0x0D (channel 2 data) I need a capture of a scope where channel 2 is enabled.

Looking at the output of the emulator makes me believe that e_Johny's scope has channel 2 disabled and he wrote that his problem with the touch panel is in that region.

So if anyone with a scope and a logic analyzer that works with the saleae software (https://www.saleae.com/downloads/ (https://www.saleae.com/downloads/)) is willing to supply a capture with both channels enabled that would be appreciated.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 12, 2021, 07:33:40 pm
The FPGA inner working is slowly being revealed.

Found the commands for the analog input controls.

Code: [Select]
Channel 1 settings
0x32  Is some sort of offset. Changes when the trace on the screen is moved up or down.
0x33  Select the input scaling (V/div). See table below
0x34  Select ac or dc coupling. 0x00 is ac coupling. 0x01 is dc coupling.

The offset is also changed when the V/div is changed.

         Scale        Screen offset
V/div    0x33         0x32
500mV    0x05         0x02 0xE0    //Uses the same setting as 1V/div. Scaling is done in software
1V       0x05         0x02 0xE0
2V       0x04         0x02 0xE7
5V       0x03         0x02 0xD3
10V      0x02         0x02 0xDA
25V      0x01         0x02 0xB9
50V      0x00         0x02 0xB9

Code: [Select]
Channel 2 settings
0x35  Is some sort of offset. Changes when the trace on the screen is moved up or down.
0x36  Select the input scaling (V/div). See table below
0x37  Select ac or dc coupling. 0x00 is ac coupling. 0x01 is dc coupling.

The offset is also changed when the V/div is changed.

V/div    0x36         0x35
500mV    0x05         0x04 0x99    //Uses the same setting as 1V/div. Scaling is done in software
1V       0x05         0x04 0x99
2V       0x04         0x04 0x9F
5V       0x03         0x04 0x96
10V      0x02         0x04 0x9C
25V      0x01         0x04 0x8B
50V      0x00         0x04 0x8D

Need to investigate the offset further to find the limits and to figure out what the FPGA does with them.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 12, 2021, 07:48:13 pm

Rarely, I can switch ON the Ch2.
The "open CH" and the "open FFT" buttons sometimes works,
but "coupling" and "probe mode" never. They are stay in "AC" and "100X".

Can I help you (~capture) with this conditions?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 12, 2021, 07:57:16 pm
Hi e_Johny,

All I need is an enabled channel 2, the rest of the settings don't matter :)

So if you can get the channel working and do a capture that would be great. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 13, 2021, 09:11:40 am
I made some "state-variant" captures.
(Details in the file names...)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 13, 2021, 09:55:56 am
I made some "state-variant" captures.
(Details in the file names...)

Hi e_Johny, thanks for the data. :-+

Things are getting clearer. Identified more of the FPGA commands. Now looking at how the trigger system works. It looks like some of it is done in software and some in the FPGA.
Getting some interesting signals out of it when switched down to 10nS/div :-DD

Inputting the same square wave since it is hard coded in the program, but getting a sine wave out of it :-//

The second channel, on which the trigger is enabled, slowly changes to the sine wave in the second image.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 13, 2021, 10:48:31 am
The capture with both channels enabled confirmed what I expected. The id 0x0D returns 0x22.

Code: [Select]
{ 0x00, 0xCB, 0x7B, 0xEA, 0x57, 0xA8, 0x08, 0x9D },{ 0x00, 0xF5, 0x45, 0xD4, 0x69, 0x96, 0x36, 0xA3 },  //Checksum ok  Data: 0x000036A3  Id: 0x11  Len: 1
{ 0x01, 0xC2, 0x67, 0x38, 0x54, 0xAB, 0x3E, 0x51 },{ 0x01, 0x3D, 0x5A, 0x05, 0x69, 0x96, 0x03, 0x6C },  //Checksum ok  Data: 0x0000036C
{ 0x00, 0xE3, 0x0D, 0xD0, 0x54, 0xAB, 0xA4, 0x3D },{ 0x00, 0xDE, 0x30, 0xED, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Data: 0x00000000  Id: 0x0C  Len: 0
{ 0x01, 0x77, 0xDD, 0x1D, 0xE1, 0x1E, 0x11, 0xA8 },{ 0x01, 0x88, 0x55, 0x95, 0x69, 0x96, 0x99, 0x20 },  //Checksum ok  Data: 0x00000020
{ 0x00, 0x06, 0xA4, 0x44, 0xE1, 0x1E, 0x11, 0x8A },{ 0x00, 0x8E, 0x2C, 0xCC, 0x69, 0x96, 0x99, 0x02 },  //Checksum ok  Data: 0x00000002  Id: 0x0B  Len: 0
{ 0x01, 0x24, 0x8E, 0xA7, 0xB2, 0x4D, 0x42, 0x6F },{ 0x01, 0xDB, 0x55, 0x7C, 0x69, 0x96, 0x99, 0xB4 },  //Checksum ok  Data: 0x000000B4
{ 0x00, 0x7E, 0xEF, 0x89, 0xB2, 0x4D, 0x42, 0xDB },{ 0x00, 0xA5, 0x34, 0x52, 0x69, 0x96, 0x99, 0x00 },  //Checksum ok  Data: 0x00000000  Id: 0x0D  Len: 0
{ 0x01, 0x64, 0xCE, 0x31, 0xF2, 0x0D, 0x02, 0xB9 },{ 0x01, 0x9B, 0x55, 0xAA, 0x69, 0x96, 0x99, 0x22 },  //Checksum ok  Data: 0x00000022
{ 0x00, 0x6E, 0xB7, 0xBF, 0xF2, 0x0D, 0x02, 0x99 },{ 0x00, 0xF5, 0x2C, 0x24, 0x69, 0x96, 0x99, 0x02 },  //Checksum ok  Data: 0x00000002  Id: 0x0B  Len: 0
{ 0x01, 0x84, 0x2E, 0x67, 0x12, 0xED, 0xE2, 0xCF },{ 0x01, 0x7B, 0x55, 0x1C, 0x69, 0x96, 0x99, 0xB4 },  //Checksum ok  Data: 0x000000B4

The scope reads the signal data from the FPGA with the command numbers returned from the special chip. When the time-base is lowered the scope either switches to or uses both (this happens in the emulator) to the command numbers 0x21 and 0x23. (In the emulator it reads them in sequence 0x20, 0x21, 0x22, 0x23)

So it would be interesting to see what the communication between the FPGA and the special ic is when the time base is set to 10nS/div.

e_Johny, are you willing to do this capture for me? (Both channels enabled, time base 10nS/div, trig mode auto)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on June 13, 2021, 11:36:54 am
Of course.  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 13, 2021, 12:18:50 pm
It looks like that the data returned stays the same. Guess this means that the scope reads two buffers of data per channel when in 25nS and 10nS per div mode. For the settings 50nS - 50mS it seems to read a single buffer per channel and for the settings 100mS - 50S it switches to reading data from command 0x24 and 0x26. Tracing showed 10 bytes per read.

The interfacing with the FPGA for the data and triggering is some sequence of commands that need some more exploration, but most of it is revealed.

For the trigger setting it seems to use two commands 0x0E for the lower settings and 0x0D for the higher settings.

Code: [Select]
Trigger time / div settings
0x0E  is written with four data bytes

time / div     Command 0x0E bytes
10nS           0x00 0x06 0x45 0xDC     (Read data from 0x20, 0x22 and 0x21, 0x23)
25nS           0x00 0x06 0x45 0xDC     (Read data from 0x20, 0x22 and 0x21, 0x23)
50nS           0x00 0x06 0x45 0xDC
100nS          0x00 0x06 0x45 0xDC
250nS          0x00 0x06 0x45 0xDC
500nS          0x00 0x06 0x45 0xDC
1uS            0x00 0x03 0x25 0xDC
2uS            0x00 0x01 0x45 0xDC
5uS            0x00 0x00 0x55 0xDC
10uS           0x00 0x00 0x55 0xDC
20uS           0x00 0x00 0x25 0xDC
50uS           0x00 0x00 0x15 0xDC
100uS          0x00 0x00 0x0B 0xB8
200uS          0x00 0x00 0x09 0xC4
500uS          0x00 0x00 0x09 0xC4
1mS            0x00 0x00 0x09 0xC4
2mS            0x00 0x00 0x09 0xC4
5mS            0x00 0x00 0x09 0xC4
10mS           0x00 0x00 0x07 0x08
20mS           0x00 0x00 0x03 0x20
50mS           0x00 0x00 0x03 0x20

From here on it seems that the FPGA switches to 0x0D for time base setting and the data is read with 0x24 and 0x26, 10 bytes per read.
time / div     Command 0x0D bytes
100mS          0x00 0x00 0x07 0xD0
200mS          0x00 0x00 0x07 0xD0
500mS          0x00 0x00 0x07 0xD0
1S             0x00 0x00 0x07 0xD0
2S             0x00 0x00 0x07 0xD0
5S             0x00 0x00 0x07 0xD0
10S            0x00 0x00 0x07 0xD0
20S            0x00 0x00 0x07 0xD0
50S            0x00 0x00 0x07 0xD0

This means it is possible to write one owns software for the scope :)

After I found the actual sequencing of commands I will make a document of it and upload it to the repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 13, 2021, 01:07:22 pm
a logic analyzer that works with the saleae software
no chance with me :(
If you still need some data and trouble wih he sigrok format I can try to compress one or more of SRs supportet logical binary formats (SaLEAE isn't supported as output) as there are: raw binary logic or digits logic.

This means it is possible to write one owns software for the scope :)
Until last night I had no idea of the F1C100 SOC, I only knew "Allwinner" from my Orange Pis.
Last night I must learn F1C..crap be ing based on a more than 20ys old ARM design.. |O |O |O |O :-DD :-DD :-DD
No GPU..no FPU!!

Really worth?
For a frontend with 50mV/div best if you can solve the trigger shit for signals below 200mV?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bianchifan on June 13, 2021, 01:36:49 pm
Just found some minutes ago

Hände weg vom FNIRSI 1013D - Keep your hands away (https://www.beis.de/Elektronik/FNIRSI-1013D/FNIRSI-1013D_de.html)  :o |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 13, 2021, 02:05:15 pm
a logic analyzer that works with the saleae software
no chance with me :(
If you still need some data and trouble wih he sigrok format I can try to compress one or more of SRs supportet logical binary formats (SaLEAE isn't supported as output) as there are: raw binary logic or digits logic.

This means it is possible to write one owns software for the scope :)
Until last night I had no idea of the F1C100 SOC, I only knew "Allwinner" from my Orange Pis.
Last night I must learn F1C..crap be ing based on a more than 20ys old ARM design.. |O |O |O |O :-DD :-DD :-DD
No GPU..no FPU!!

Really worth?
For a frontend with 50mV/div best if you can solve the trigger shit for signals below 200mV?

Sure it is an old processor, but it works and it is being used in other cheap Chinese scopes.

I have all the capture data I need for now.

To solve the trigger problems with the scope will involve making a new FPGA implementation. Doable, but will take some time. For now it still is fun to unveil all the secrets of the scope. For me that is hobby :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 14, 2021, 01:01:42 pm
Added a new directory to the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/FPGA%20explained (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/FPGA%20explained)

Most of the commands are now known and I believe it is possible to use the information to create a working scope.

Need to make some extra sequence traces for the different time base settings, because there are differences in how the scope reads signal data from the FPGA.

The file (Startup and signal data read sequence.txt) that is there now shows the working for 20uS/div and is valid for the range from 50nS to 50mS.

For the FPGA I will make a c source with what is needed for the communication with the special IC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 14, 2021, 07:06:25 pm
Guess this is it for now. :=\

Found most of the FPGA functions and added several trace files of the sequences for reading data from the FPGA to the repository. Also created a new directory with the c source for the FPGA functions https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/FPGA_functions (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/FPGA_functions)

Did not test the functions for communicating with the special IC yet, but most of that code has been tested in the code I made for decrypting the capture data and in the emulator itself were it returns the correct data to the scope code. It also needs a delay function. In the comments within the code it is indicated where this is needed.

I will continue with trying to fully reverse the original source code, but that will take a it's time. 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on June 14, 2021, 07:46:25 pm
Guess this is it for now. :=\

...enjoy your very well earned rest! :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on June 14, 2021, 08:23:16 pm
Guess this is it for now. :=\

You've been awake all this time??  :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 15, 2021, 04:41:57 am
Guess this is it for now. :=\

You've been awake all this time??  :clap:

If so I would have needed a coffin smiley :-DD

It was to indicate that there won't be any new updates about the reverse engineering for a while :-X might have been a better smiley for it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on June 21, 2021, 07:11:44 pm
Super enjoyable thread.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on June 21, 2021, 07:40:17 pm
If the Hantek thread had only 1/10 the interest I see here!  :-DD Nice reverse engineering
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 22, 2021, 10:19:26 am
Just to let everybody know I'm still at it.

Found a bit more about how the display part of the code works. It is quite the puzzle but I identified the fonts being used. There are 7 fonts in the flash.

Edit: I missed one. There are 8 fonts.
Edit: It looks like some of the fonts share data and some are for single byte characters and some look to be for 2 byte characters (UTF-8 / UTF-16 or something like that)

Code: [Select]
FONT addresses
0x8018A380
0x8018A3A4
0x8018AC58       (Used for the channel menus)
0x8018B738       (Used for error messages)
0x8018C1C0
0x8018D558
0x8018F508        (Edit: Missed this one)
0x801913B0

Also mapped parts of the structures being used to hold the data. Having done some work in the graphics industry (writing drivers for large inkjet and other kind of printers) I know a bit about what comes into play, and can make some educated guesses about what a variable is for, but still it ain't easy :palm:

The story keeps going on :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 25, 2021, 07:20:47 pm
There is some progress.

Don't think I can fully reverse the display library, because I suspect they used some C++ code and are only using part of the full functionality. That makes it hard to fill in the blanks in the data structures. There are a lot of function pointers and tables with function pointers. Some of them point to empty functions so look like callback functions to do extra or dedicated actions.

Did find the "render function" at least used for font_2. This is a variable width font and uses single pixel bitmaps per character. The "render function" has some painting modes. Before the display_text function is called this mode is set. Named this function "set_font_paint_mode" and is found at address 0x800197C8. It is used with either 0x00 or 0x02 as input.

When 0x00 is used the render function paints the background with the background color (assumed) and the character with the foreground color. (also assumed)

When 0x02 is used the render function paints the character with the background color (assumed) and leaves the background for what it is.

There are two other modes that don't seem to be used. 0x01 and 0x03 (the mode is anded with 0x03). These use the same code. Through a function pointer a function is called that returns a short. Each font dot is then read from a screen buffer and exored with this value. So some sort of color inversion.

Uploaded a new Ghidra archive with the latest findings to the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack))

With the found information I can extract some of the fonts from the binary and convert them to C.

For font_0 and font_1 I have to do more research. These are fixed width fonts, so for every character the same number of data bytes are used.

That's it for today. 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 26, 2021, 07:08:42 pm
Wrote a simple program to extract a variable width font from the binary.

Extracted font_2 as a c source. Made a header file with the font structures. Not all the names in there will be correct, but the ones that matter and are used look correct.

Need to test the font in some way, maybe in the emulator, but that requires some programming.

Also found more about the color handling. Will update the repository with the new Ghidra archive and the font extractor code.

The extracted font and header file plus the extractor code are also attached here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 01, 2021, 04:19:02 pm
Extracted the other variable width fonts and wrote a html/javascript test to print them. It turns out that the base of the font is the same for all of them and only the scale is different. A couple of them have extra characters for languages like French.

Researched the fixed width fonts and they have some special overlay system where two characters can be printed on top of each other. Did not extract them yet. Also found an extra font which is set as some default in initialization but did not found where it is used yet.

Attached the html/javascript code with the 6 fonts extracted from the scope code. Rewrote the extractor to output javascript.

Plan on writing a simple display library myself to provide what is needed for the scope. Nothing fancy. After that the actual scope code can be reversed on top of that.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 03, 2021, 01:41:56 pm
Extracted the fixed width fonts and these also have the same base font with different sizes. Font_0 and font_1 are the same except for the interline spacing. Font_0 uses a height and baseline of 16, while font_1 uses 16 for the height, but 18 for the baseline, so has 2 pixels more between the text lines.

The default font which does not seem to be used is smaller. It's height is only 8 pixels and the width 6 pixels.

All the fonts are in the repository as C sources. Font_0 and font_1 are in the same file (font_0.c)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 04, 2021, 09:59:15 am
Stumbled onto something interesting.

I was writing some initial code for testing on the scope and based it on the bootloader reversal I did. Here the code header for the F1C100s is included in the startup file and the checksum in there is set with mksunxi. Before running the code in the scope I decided to see what it looks like in Ghidra. Used the same methodology as for the original scope code and stripped of the header. This showed me that the jump to the main function was of by 20 bytes (the header size).

Decided to do the same with the bootloader code and noticed the same. But I tested it in the scope and it worked. :-//

Turns out that the first 4 bytes of the header are a branch instruction to the first instruction right after the header. So within this setup the header is also loaded in as code and execution starts at the beginning of the header.

Code: [Select]
                             **************************************************************
                             *                       THUNK FUNCTION                       *
                             **************************************************************
                             thunk undefined Reset()
                               Thunked-Function: FUN_00000020
             undefined         r0:1           <RETURN>
                             Reset                                           XREF[1]:     Entry Point(*) 
        00000000 06 00 00 ea     b          FUN_00000020
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined UndefinedInstruction()
             undefined         r0:1           <RETURN>
                             UndefinedInstruction                            XREF[1]:     Entry Point(*) 
        00000004 65 47 4f 4e     cdpmi      p7,0x4,cr4,cr15,cr5,0x3
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined SupervisorCall()
             undefined         r0:1           <RETURN>
                             SupervisorCall                                  XREF[1]:     Entry Point(*) 
        00000008 2e 42 54 30     subccs     r4,r4,lr, lsr #0x4
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined PrefetchAbort()
             undefined         r0:1           <RETURN>
                             PrefetchAbort                                   XREF[1]:     Entry Point(*) 
        0000000c c5 45 42 68     stmdavs    r2,{r0 r2 r6 r7 r8 r10 lr}^
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined DataAbort()
             undefined         r0:1           <RETURN>
                             DataAbort                                       XREF[1]:     Entry Point(*) 
        00000010 00 26 00 00     andeq      r2,r0,r0, lsl #0xc
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined NotUsed()
             undefined         r0:1           <RETURN>
                             NotUsed                                         XREF[1]:     Entry Point(*) 
        00000014 53 50 4c 02     subeq      r5,r12,#0x53
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined IRQ()
             undefined         r0:1           <RETURN>
                             IRQ                                             XREF[1]:     Entry Point(*) 
        00000018 00 00 00 00     andeq      r0,r0,r0
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined FIQ()
             undefined         r0:1           <RETURN>
                             FIQ                                             XREF[1]:     Entry Point(*) 
        0000001c 00 00 00 00     andeq      r0,r0,r0
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             undefined FUN_00000020()
             undefined         r0:1           <RETURN>
                             FUN_00000020                                    XREF[1]:     Reset:00000000(T),
                                                                                          Reset:00000000(j) 
        00000020 00 00 0f e1     mrs        r0,cpsr
        00000024 1f 00 c0 e3     bic        r0,r0,#0x1f
        00000028 db 00 80 e3     orr        r0,r0,#0xdb
        0000002c 00 f0 29 e1     msr        cpsr_cf,r0
        00000030 78 d0 9f e5     ldr        sp,[DAT_000000b0]                                = 00006C00h
        00000034 00 00 0f e1     mrs        r0,cpsr


So for the main code I have to incorporate the header in an other way or change the bootloader to treat the header also as part of the code and not skip it.

Simple solution might be to set the linker to see memory starting from 0x7FFFFFE0 instead of 0x8000000. This way the header sits before actual memory and the rest will be on the right addresses.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 05, 2021, 03:10:32 pm
Had to solve some linker issues concerning a data segment to get the right size of the program in the flash, but after that a test of bare metal programming resulted in text on the screen of the emulator. You have to look closely since the font is very small, but is what is used for the channel menu select buttons and the volts/div text next to it. :-DD

Also needed the header to use the eGON.EXE instead of eGON.BT0 marker, which is used for the bootloader. The original bootloader of the scope checks on this header part >:( causing the very first test to fail. The second one failed on the incorrect size in the header, causing the font data to not be loaded from the flash. :palm:

So I can now start with writing a simple display library and then finally try to replicate the original scope code.

Edit: The library is taking shape. Added the fixed width font handling and drawing of a rectangle.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 08, 2021, 02:30:42 pm
Still working on recreating the code and found yet another piece of the puzzle with a big why? :-//

The text for some of the buttons is not written with the display text function but by copying bitmaps from the code memory. For the CTRL button (Upper right on the screen) the function to display it can be found at address 0x8000C4B8. The bitmap can be found at address 0x800449E4. It is 16 bits per pixel and 60 pixels by 55 lines. The used pixels are set with 0xFFFF.

Extracted and converted the image to verify the find.

There are more of these bitmaps in there.

Why they did it like this, who knows? It will be faster than rendering the text with their code, but when optimized, the text printing is fast enough.

Also identified more drawing functions. One for filling a rounded rectangle and another for drawing the outline of a rounded rectangle. So have to add versions of it to my own code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 08, 2021, 05:16:53 pm
They used several handling styles in their code.  |O

The top bar uses a bitmap for the menu "button", a print text (CH1, CH2, T) and fill rectangle for the channel and trigger "buttons" and bigger bitmaps for the actual menus, instead of building them with code. Certainly faster, but why the mix. Using bitmaps for everything would have been the fastest. A full bitmap for the CTRL "button" instead of filling a rounded rectangle, drawing a rounded rectangle outline and copy in the text bitmap would have been faster.

But this puzzle is also nearing the end. Able to name more and more of the functions and get an understanding of how it works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on July 08, 2021, 11:44:17 pm
They used several handling styles in their code.  |O

The top bar uses a bitmap for the menu "button", a print text (CH1, CH2, T) and fill rectangle for the channel and trigger "buttons" and bigger bitmaps for the actual menus, instead of building them with code. Certainly faster, but why the mix. Using bitmaps for everything would have been the fastest. A full bitmap for the CTRL "button" instead of filling a rounded rectangle, drawing a rounded rectangle outline and copy in the text bitmap would have been faster.

But this puzzle is also nearing the end. Able to name more and more of the functions and get an understanding of how it works.
When that happens is because of legacy code, usually. Probably they have some legacy code for less powerful devices that used bitmaps, then added more flexible fonts for all languages, but kept using the old code for those elements since it works and it's tested... Everything new uses the new fonts code

BTW: I'm a long time lurker, who loves reading about the amazing work you do and the progress you are making. Kudos!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 09, 2021, 12:06:40 pm
Found hopefully all of the bitmaps. Labeled them and the functions using them in Ghidra and uploaded the archive to the repository.

With this new information tracking how the scope works should be easier. Have to make a decision on how to implement things in the recreation of the code. Copy and improve the bitmap setup or use display drawing and text functions to mimic the behavior.

Think I will give the latter a shot first since the printing of text already works :)

I'm also curious as to what people are doing with the data from the repository. I can see that every time I post here and update the repository, clones of the repository are being made. It is there for it, but as said curious about it :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on July 09, 2021, 12:22:21 pm
I'm also curious as to what people are doing with the data from the repository.

Sounds like you've got to expand your reversing capabilities!  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 09, 2021, 12:55:57 pm
I'm also curious as to what people are doing with the data from the repository.

Sounds like you've got to expand your reversing capabilities!  :-DD

Nah human targets way more difficult than computers and far beyond my skills :) :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 11, 2021, 03:23:04 pm
Nearly done with the first draft of the display library :)

Last to do are fill rounded rectangle and fill arc. For now everything is based on 1 pixel line width, which might do for the scope. Adding a dot size is probably not that difficult, but if it is not needed I might leave it.

The test result suits in a modern art gallery, if I say so myself :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 14, 2021, 02:23:02 am
Very fine work.  Can I get a signed print?

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 14, 2021, 09:33:39 am
Very fine work.  Can I get a signed print?

Sorry, I only do open license open source work :-DD

see https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/Display_Lib_Test (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/Display_Lib_Test)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 17, 2021, 07:24:30 pm
After an unfortunate break, today some good progress.

Due to my wife developing a cat allergy, we had the difficult task to find a new home for our 8 year old cat. It was not easy and of course emotional. Here in France there are many cats and people like the young ones and not the older ones. The SPA's are filled up and we could not get it over our hearts to put her there even if there was space. We eventually found a good home where some Dutch people run an animal paradise, but it required a trip of over 400Km. We did it because we wanted a good home for her, where she can spend the rest of her live. She was born on our veranda. The cat of our neighbors decided to deliver her kittens there because her previous litter was drowned by the same neighbor >:(

We decided to keep the kittens and had a lovely time with them. Unfortunately the blackish male got cancer in the kidneys and we had to have him put to sleep almost two years ago :'(

For the scope I managed to write a lot of the menu button functions. Need to finish the trigger settings and the battery symbol. Next after that is writing the touch panel interface and a state machine for the menu actions, to be able to control everything.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 19, 2021, 05:12:32 pm
Things are getting along.

Implemented the touch panel interface code. Made an improved copy of the original code. Tested it on the scope and it worked straight away. Modified the touch panel configuration to be on 800x480 instead of 1024x600 so no post processing of the coordinates is needed, as in the original code. Have to check the delay's with a scope to see if they need tweaking. Some of the delay's in the initialization can probably be reduced anyway, since they are quite long.

Next up is a state machine for control handling. Will be a bit more work to reproduce all the control functionality of the scope.

Once that is done, the real task begins. Reproducing the trace display. Still a lot of work needs to be done.

The picture shows the finished main screen with battery level and charge indicator. All controlled with variables. For now manually set in the main function to test everything.
There is still room for improvement since I'm in a somewhat fast coding mode :-DD

The new files are in the repository. https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 20, 2021, 10:13:30 am
Measurement showed the i2c was slower than the original. Did some tests with some port toggle code and noticed it being faster when running it in SRAM (using FEL) instead of in DRAM. I realized I did not implemented the memory management code of the original scope code. Since that uses a linear translation I decided to only try to enable the caches, and that did the trick. Makes a difference of almost a factor 2.

Tweaked the touch panel timing and now it works on ~140KHz instead of the ~40KHz of the original code. Since the delay is based on a simple for loop I have to be aware when turning up optimization level of the compiler. It might remove it and result in not working touch panel :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 20, 2021, 04:44:18 pm
Spend a while trying to work out the first function called in the main while loop. It is for monitoring the battery level and charging state, but I'm a bit at a loss of why they are doing it the way they are doing it.

Code: [Select]
void monitor_battery(void)
{
  int iVar1;
  undefined *puVar2;
  byte bVar3;
  uint uVar4;
  byte *pbVar5;
  int iVar6;
  int iVar7;
  byte bVar8;
  bool bVar9;
 
  iVar1 = DAT_8000a6a8;                               //Base of settings data
  bVar8 = 0xff;

  if (0xd < *(byte *)(DAT_8000a6a8 + 10))             //Time base setting   If 13 is smaller then, so 14 and up (1mS/div and down)
  {
    iVar7 = 0x1e;                                     //1mS/div --- 10nS/div, factor is 30
    goto LAB_8000a5bc;
  }

  if (*(byte *)(DAT_8000a6a8 + 10) < 0xc)             //Less then 0x0C
  {
    if (*(byte *)(DAT_8000a6a8 + 10) < 9)             //Less then 9
    {
      if (6 < *(byte *)(DAT_8000a6a8 + 10))           //If 6 is smaller then, so 7 and 8.
      {
        iVar7 = 100;                                  //200mS/div, 100mS/div, factor is 100
        goto LAB_8000a5bc;
      }

      if (3 < *(byte *)(DAT_8000a6a8 + 10))           //If 3 is smaller then, so 4, 5 and 6
      {
        iVar7 = 0x32;                                 //2S/div, 1S/div, 500mS/div, factor is 64
        goto LAB_8000a5bc;
      }

      if (1 < *(byte *)(DAT_8000a6a8 + 10))           //If 1 is smaller then, so 2 and 3
        goto LAB_8000a5b0;                            //10S/div, 5S/div, factor is 10
    }

    iVar7 = 3;                                        //0, 1, 9, 10, 11
                                                      //50S/div, 20S/div, 50mS/div, 20mS/div, 10mS/div, factor is 3
  }
  else
  {
LAB_8000a5b0:                                         //12, 13
    iVar7 = 10;                                       //5mS/div, 2mS/div factor is 10
  }

LAB_8000a5bc:

  uVar4 = check_port_pin(DAT_8000a6ac,0xc);           //Battery charge detect

  puVar2 = PTR_DAT_8000a6b0;                          //0x80192ed4  some global variable, some accumulator??

  if (uVar4 == 0)                                     //If pin is low the battery is being charged
  {
    if (*(char *)(iVar1 + 0x39) == '\0')              //BatteryCharging variable
    {
      *PTR_DAT_8000a6b0 = 0;                          //If previous state was not charging this variable is set 0
    }

    *(undefined *)(iVar1 + 0x39) = 1;                 //Indicate charging
  }
  else
  {
    *(undefined *)(iVar1 + 0x39) = 0;                 //Indicate not charging
  }

  bVar3 = read_keyadc_data();                         //Battery level reading. result 0 - 0x3F


  //0x80361378 Some base pointer

  //Some fractional addition to the adc value
  //            result from scan                                         byte from 0x8036137A (screen brightness)                                   0x068DB8BB
  uVar4 = (uint)bVar3 + (uint)((ulonglong)(uint)((int)(short)(ushort)*(byte *)(DAT_8000a6b4 + 2) * (int)(short)((ushort)bVar3 * 10)) * (ulonglong)DAT_8000a6b8 >> 0x28);  //High result byte logical shifted right an extra 8

  //Check if on charge
  if (*(char *)(iVar1 + 0x39) != '\0')
  {
    uVar4 = uVar4 - 7;   //Take of 7 as compensation
  }

  //Check if result is less then 25
  if (uVar4 < 0x19)
  {
    //If so set it to the minimum
    uVar4 = 0x19;
  }

  //Divide ((the result minus the minimum) multiplied by 20) by 21
  pbVar5 = (byte *)divide((uVar4 - 0x19) * 0x14, 0x15);

  //Get data from global variable which is reset when charging starts
  //Is an array index
  bVar3 = *puVar2;


  //0x802F1906 some array where the result is stored
  DAT_8000a6bc[bVar3] = (byte)pbVar5;

  //As long as the index is lower than the factor obtained from timebase setting
  if ((int)(uint)bVar3 < iVar7 + -1)
  {
    //Increment the index and store it back
    *puVar2 = bVar3 + 1;
    return; //and quit
  }

  //When several samples are stored it comes here
  //true since none of the timebase compare paths lead to iVar being set zero
  bVar9 = iVar7 != 0;

  if (bVar9)
  {
    pbVar5 = DAT_8000a6bc; //Point to the data
  }

  *puVar2 = 0; //Reset the index

  //As long as there is data to process
  while (bVar9)
  {
    bVar3 = *pbVar5;          //Get the first byte
    pbVar5 = pbVar5 + 1;      //Point to the next one

    if (bVar3 < bVar8)        //Determine the lowest value
    {
      bVar8 = bVar3;          //Keep the lowest value of the samples
    }

    iVar7 = iVar7 + -1;       //One count done
    bVar9 = iVar7 != 0;       //Check on done
  }

  //Store result in BatteryChargeLevel
  *(byte *)(iVar1 + 0x38) = bVar8;

  display_battery_status();
}


Based on the time base setting they determine a number of samples that needs to be monitored before the screen is updated. They store each sample in an array and once the number of needed samples is reached they look for the lowest value and use that to display. This can be easier done with one variable and keep the lowest one after taking a sample, and reset the variable at the start of a new run, but that aside.

What I don't get is the math they are doing after taking a sample. I have no experience with battery charge reading what so ever, so any input is welcomed.

The sample comes from the keyadc and is in range of 0 to 63. To this result they add some value. Looks like some fixed point fractional calculation.
They multiply the sample by 10. This is multiplied with the value coming from some variable (at 0x8036137A)
The result of this multiplication is multiplied with 0x068DB8BB. The top 24 bits are used to add to the sample.
After that they take of 7 when on charge.
Then it is checked against 25 and if less they make it 25.
From the resulting value is then 25 subtracted. The resulting value of that is then multiplied by 20 and that is divided by 21.

Anyone?????

Edit: The variable  (at 0x8036137A) used in the multiplication seems to be the screen brightness. This makes sense since it will drain the battery when it is higher.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 21, 2021, 10:20:51 pm
Hi folks,

Just found a review of the Fnirsi-1013D with a clear verdict:

Hands off the Fnirsi 1013D (https://www.beis.de/Elektronik/FNIRSI-1013D/FNIRSI-1013D_en.html)

Martin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 22, 2021, 05:33:04 pm
After again a bit of scanning the original code in Ghidra I found the code for displaying the channel 1 menu. This pointed me to the FFT enable variable, so that is one more down :) and I found out how they "animate" the menus, because when you select a menu it slides in from the top, or in case of the measures menu from the side. The bitmap is drawn repeatedly from the top of the screen with the bitmap from the end up, So in the first loop the 16 bottom lines are drawn, the second loop the 31 bottom lines, the third loop the 45  bottom lines until the whole bitmap is displayed.

Have not implemented this yet in my own code, but did implement the non bitmap version of the menu, as one can see in the screen capture of the emulator.

Also gained some insight in how they made their state machine. I will copy it for now just to get something up and running. But my programming gut tells me it can be improved on :-DD

Also found proof of the FPGA analysis I did. The second function in the main while loop is for displaying the traces and I can see that based on the time base setting the different values are written to the FPGA. These values match what I saw with tracing the data to the FPGA 8)

The third function might be for handling the cursors, but that needs further investigation.

So breakout the popcorn and sit back, the story continues :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on July 22, 2021, 07:37:55 pm
Hi folks,

Just found a review of the Fnirsi-1013D with a clear verdict:

Hands off the Fnirsi 1013D (https://www.beis.de/Elektronik/FNIRSI-1013D/FNIRSI-1013D_en.html)

Martin

Hello Martin.
Yes, it was in the #866 post (in other language).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Martin72 on July 22, 2021, 09:37:29 pm
Oops... :o

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 22, 2021, 10:01:47 pm
FWIW I am supposed to get first hand experience with a Hantek 2D42 DSO-DMM-AWG tomorrow.  It will be very interesting to see how it does.  I can live with a decent 40 MHz scope.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 23, 2021, 05:55:24 pm
Coded the channel 1 menu handling. Still need to scan through the original code some more to see what is being done, but the changing of the settings works. The menu slides in from the top, just as in the original code.

Reduced quite a bit on the number of calls to reading the touch panel status.

This is the code that came out of Ghidra.
Code: [Select]
LAB_8001dc04:
        do
        {
          tp_i2c_read_status();
          uVar11 = (uint)*(ushort *)(puVar4 + 2);

          if (uVar11 - 0xa2 < 0xb6)   //Check the xrange
          {
            uVar15 = (uint)*(ushort *)(puVar4 + 4);  //Get the y pos
            bVar27 = 0x2d < uVar15;
            bVar26 = uVar15 == 0x2e;

            if (0x2e < uVar15)
            {
              bVar27 = uVar15 <= uVar12;
              bVar26 = uVar12 == uVar15;
            }

            if (bVar27 && !bVar26)
            {
              uVar16 = uVar11 - 0xdc;

              if (((uVar16 < 0x3b) && (0x30 < uVar15)) && (uVar15 < 0x6a))
              {
                if (*puVar4 != '\0')           //Do we have touch
                {
                  *pcVar5 = '\x01';            //This is for channel 1 enable
                  display_channel1_menu();

                  FUN_80002790();

                  tp_i2c_read_status();
                  cVar1 = *puVar4;

                  while (cVar1 != '\0')
                  {
                    tp_i2c_read_status();
                    cVar1 = *puVar4;
                  }
                }
              }
              else
              {
                uVar18 = uVar11 - 0x11a;
                if (((uVar18 < 0x3a) && (0x31 < uVar15)) && (uVar15 < 0x6b))
                {
                  if (*puVar4 != '\0')
                  {
                    *pcVar5 = '\0';             //This is for channel 1 disable
                    display_channel1_menu();
                    FUN_80002790();
                    pcVar5[3] = '\0';
                    FUN_8000689c();
                    tp_i2c_read_status();
                    cVar1 = *puVar4;
                    while (cVar1 != '\0') {
                      tp_i2c_read_status();
                      cVar1 = *puVar4;
                    }
                  }
                }
                else {
                  if (((uVar16 < 0x3b) && (0x6f < uVar15)) && (uVar15 < 0xa9)) {
                    if (*puVar4 != '\0') {
                      pcVar5[4] = '\x01';
                      display_channel1_menu();
                      tp_i2c_read_status();
                      cVar1 = *puVar4;
                      while (cVar1 != '\0') {
                        tp_i2c_read_status();
                        cVar1 = *puVar4;
                      }
                    }
                  }
                  else {
                    if (((uVar18 < 0x3a) && (0x6f < uVar15)) && (uVar15 < 0xa9)) {
                      if (*puVar4 != '\0') {
                        pcVar5[4] = '\0';
                        display_channel1_menu();
                        tp_i2c_read_status();
                        cVar1 = *puVar4;
                        while (cVar1 != '\0') {
                          tp_i2c_read_status();
                          cVar1 = *puVar4;
                        }
                      }
                    }
                    else {
                      if (((uVar16 < 0x3b) && (0xad < uVar15)) && (uVar15 < 0xe7)) {
                        if (*puVar4 != '\0') {
                          pcVar5[1] = '\0';
                          FUN_800068d4();
                          display_channel1_menu();
                          tp_i2c_read_status();
                          cVar1 = *puVar4;
                          while (cVar1 != '\0') {
                            tp_i2c_read_status();
                            cVar1 = *puVar4;
                          }
                        }
                      }
                      else {
                        if (((uVar18 < 0x3a) && (0xad < uVar15)) && (uVar15 < 0xe7)) {
                          if (*puVar4 != '\0') {
                            pcVar5[1] = '\x01';
                            FUN_800068d4();
                            display_channel1_menu();
                            tp_i2c_read_status();
                            cVar1 = *puVar4;
                            while (cVar1 != '\0') {
                              tp_i2c_read_status();
                              cVar1 = *puVar4;
                            }
                          }
                        }
                        else {
                          if (((uVar11 - 0xe6 < 0x22) && (0xeb < uVar15)) && (uVar15 < 0x125)) {
                            if (*puVar4 != '\0') {
                              pcVar5[2] = '\0';
                              display_channel1_menu();
                              tp_i2c_read_status();
                              cVar1 = *puVar4;
                              while (cVar1 != '\0') {
                                tp_i2c_read_status();
                                cVar1 = *puVar4;
                              }
                            }
                          }
                          else {
                            if (((uVar11 - 0x108 < 0x20) && (0xeb < uVar15)) && (uVar15 < 0x125)) {
                              if (*puVar4 != '\0') {
                                pcVar5[2] = '\x01';
                                display_channel1_menu();
                                tp_i2c_read_status();
                                cVar1 = *puVar4;
                                while (cVar1 != '\0') {
                                  tp_i2c_read_status();
                                  cVar1 = *puVar4;
                                }
                              }
                            }
                            else {
                              if (((uVar11 - 0x129 < 0x20) && (0xeb < uVar15)) &&
                                 ((uVar15 < 0x125 && (*puVar4 != '\0')))) {
                                pcVar5[2] = '\x02';
                                display_channel1_menu();
                                tp_i2c_read_status();
                                cVar1 = *puVar4;
                                while (cVar1 != '\0') {
                                  tp_i2c_read_status();
                                  cVar1 = *puVar4;
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
              goto LAB_8001dc04;
            }
          }
        } while (*puVar4 == '\0');

        FUN_8000a6c0();  //Copy saved screen rect back to the screen


        tp_i2c_read_status();
        cVar1 = *puVar4;
        while (cVar1 != '\0') {
          tp_i2c_read_status();
          cVar1 = *puVar4;
        }


This is what I made.
Code: [Select]
  //Stay in the menu as long as there is no touch outside the menu 
  while(1)
  {
    //Scan the touch panel for touch
    tp_i2c_read_status();
   
    //Check if there is touch
    if(havetouch)
    {
      //Check if touch within the menu field
      if((xtouch >= 161) && (xtouch <= 344) && (ytouch >= 46) && (ytouch <= 298))
      {
        //Check on channel enable or disable
        if((ytouch >= 62) && (ytouch <= 84))
        {
          //Check on enable
          if((xtouch >= 239) && (xtouch <= 271))
          {
            //Enable the channel
            scopesettings.channel1.enable = 1;
           
            //Display this
            display_channel1_enable_select();
            display_channel1_settings(0);
          }
          //Check on disable
          else if((xtouch >= 291) && (xtouch <= 323))
          {
            //Disable the channel
            scopesettings.channel1.enable = 0;
           
            //Display this
            display_channel1_enable_select();
            display_channel1_settings(0);
          }
        }
        //Check on fft enable or disable
        else if((ytouch >= 124) && (ytouch <= 146))
        {
          //Check on enable
          if((xtouch >= 239) && (xtouch <= 271))
          {
            //Enable the channel
            scopesettings.channel1.fftenable = 1;
           
            //Display this
            display_channel1_fft_show();
          }
          //Check on disable
          else if((xtouch >= 291) && (xtouch <= 323))
          {
            //Disable the channel
            scopesettings.channel1.fftenable = 0;
           
            //Display this
            display_channel1_fft_show();
          }
        }
        //Check on coupling DC or AD
        else if((ytouch >= 188) && (ytouch <= 210))
        {
          //Check on enable
          if((xtouch >= 239) && (xtouch <= 271))
          {
            //Enable the channel
            scopesettings.channel1.coupling = 0;
           
            //Display this
            display_channel1_coupling_select();
            display_channel1_settings(0);
          }
          //Check on disable
          else if((xtouch >= 291) && (xtouch <= 323))
          {
            //Disable the channel
            scopesettings.channel1.coupling = 1;
           
            //Display this
            display_channel1_coupling_select();
            display_channel1_settings(0);
          }
        }
        //Check on probe magnification setting
        else if((ytouch >= 245) && (ytouch <= 283))
        {
          //Check on 1x
          if((xtouch >= 239) && (xtouch <= 259))
          {
            //Enable the channel
            scopesettings.channel1.magnification = 0;
           
            //Display this
            display_channel1_probe_magnification_select();
            display_channel1_settings(0);
          }
          //Check on 10x
          else if((xtouch >= 270) && (xtouch <= 293))
          {
            //Disable the channel
            scopesettings.channel1.magnification = 1;
           
            //Display this
            display_channel1_probe_magnification_select();
            display_channel1_settings(0);
          }
          //Check on 100x
          else if((xtouch >= 299) && (xtouch <= 329))
          {
            //Disable the channel
            scopesettings.channel1.magnification = 2;
           
            //Display this
            display_channel1_probe_magnification_select();
            display_channel1_settings(0);
          }
        }
       
        //Wait until touch is released before checking on a new position
        while(havetouch)
        {
          //Scan the touch panel for touch
          tp_i2c_read_status();
        }
      }
      else
      {
        //Touch outside the menu so quit
        return;
      }
    }
  }


Eventually I will think up a better setup with tables and function pointers. But first see if I can make a working scope ;D

It will be a lot of coding work, but with this first step taken, I'm confident it will happen 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 24, 2021, 06:52:21 pm
Made good progress today :D

The top menu is implemented for all the menus to be shown. Apart from the main menu the others are completely functional. Searching the Ghidra made code for the touch handling, I found more of the FPGA control functions. A lot of the initialization functions in the main function are now clear.

One strange thing I found is: The channels can be enabled or disabled, and this setting is saved at power down and read back in on startup. So far so good. On startup in the main function the functions "set_fpga_channel1_enable" and "set_fpga_channel1_enable" are called and they copy the settings to the FPGA. Command 0x02 for channel 1 and 0x03 for channel 2. So it looks like that at startup the channels are either enabled or disabled in the FPGA. Now comes the strange thing. In the menu function for setting the channel enabled of disabled this FPGA function is not called |O
The only other location where these functions are called from, according to Ghidra, is the "check_hardware" function, and that one is bypassed by a setting in the flash memory.

So could it be that these FPGA commands do nothing?

Next up is the main menu functionality for as far as possible without a lot of research of the Ghidra output. (USB connection :o)
After that the right menu.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: e_Johny on July 24, 2021, 07:26:52 pm

So it looks like that at startup the channels are either enabled or disabled in the FPGA. Now comes the strange thing. In the menu function for setting the channel enabled of disabled this FPGA function is not called |O
The only other location where these functions are called from, according to Ghidra, is the "check_hardware" function, and that one is bypassed by a setting in the flash memory.

So could it be that these FPGA commands do nothing?


Maybe useful info for you:

// On my scopes touch has some blind column, and I ordered a new one, and again a new one (because the first was small).//

When I tried replace with the 1. new touch, I set the 2nd Channel to ON. (here is blind the original touch).
After I connect back the original touch panel, the 2nd channel was OFF again.

My trick was not working. :-(
I sadly put the scope back in its box.
(I hope the 2. touch will arrive on next week)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 24, 2021, 08:00:31 pm

So it looks like that at startup the channels are either enabled or disabled in the FPGA. Now comes the strange thing. In the menu function for setting the channel enabled of disabled this FPGA function is not called |O
The only other location where these functions are called from, according to Ghidra, is the "check_hardware" function, and that one is bypassed by a setting in the flash memory.

So could it be that these FPGA commands do nothing?


Maybe useful info for you:

// On my scopes touch has some blind column, and I ordered a new one, and again a new one (because the first was small).//

When I tried replace with the 1. new touch, I set the 2nd Channel to ON. (here is blind the original touch).
After I connect back the original touch panel, the 2nd channel was OFF again.

My trick was not working. :-(
I sadly put the scope back in its box.
(I hope the 2. touch will arrive on next week)

Hi e_Johny,

sorry to hear that your scope is still non functional.

The thing I wrote about is something in the software itself. Just one of these Chinese mysteries :-DD

All the settings that one can change with the menus are in the flash and can be changed there to get things running, but I have not mapped out which setting is where in the memory. Not a great solution of course, but when in need it can be done.

Success with repairing your scope when the new touch panel arrives :)

Small update on the scope software. Tried to run it on the actual hardware and it does not work |O Probably some variable initialization issue. On the emulator the whole memory is cleared, which won't be the case on the actual hardware. An earlier test to see if the touch panel code was ok, did work and showed the coordinates when a location was touched, so that is not the problem. Ah well, tomorrow is another day. :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 24, 2021, 08:30:04 pm
How the hell are you emulating it?
Does !emu support the f1c100s hardware?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 25, 2021, 04:57:19 am
How the hell are you emulating it?
Does !emu support the f1c100s hardware?

Hi David,

I wrote my own emulator. It is not fully handling the F1C100s but enough to run a patched version of the FNIRSI-1013D. It is all described in this thread :)

It is a bit slow, but allows me to test the code I'm writing.

It most likely won't run linux since the mmu is not implemented.

Everything I do can be found in the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack)

The emulator is written for linux and uses xlib, since that is standard available on, I think, any linux flavor.

A question for you: For the hacking of the Hantek you make use of the sunxi fel with uboot to load the executable to ram and then start it.

Code: [Select]
sunxi-fel -p uboot u-boot-sunxi-with-spl.bin write 0x80500000 zImage write 0x81500000 devicetree.dtb write 0x81800000 rootfs.cpio.uboot

Does this also work with non linux code? Is the u-boot-sunxi-with-spl.bin dedicated for the hantek or can it also be used for the FNIRSI-1013D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 25, 2021, 08:47:01 am
Solved the issue of not working on the actual hardware. Was indeed a not initialized variable. Need to do some looking into performance because the sliding menu's are slower than the original. Made a video of how it responds.

https://youtu.be/kvgzotcQocY (https://youtu.be/kvgzotcQocY)

Also need to find a way to test the code on the hardware without having to flash it. Guess I will spend some time on that first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 26, 2021, 10:16:37 am
sunxi-fel is just a tool to interface the FEL mode. It allows writing anything to the memory and executing it.
The file you mention is the compiled u-boot. I don't think it's necessary to use it for launching your code, but theorically it could, uboot has the "go" command that executes any memory address.
But you must take in count that it would already have touched a lot of soc registers... so it could be a mess.
The F1C100s/200s BROM doesn't init the sdram by default, so you have only few KB available (20KB? I don't remember it right now).

A trick is to load u-boot but don't execute it using the spl command. That inits the sdram.
Then you can write your app anywhere and run it. I don't know if there's a proper way of initializing the sdram.
I think this would work:
Code: [Select]
sunxi-fel spl u-boot-sunxi-with-spl.bin write 0x80000000 my_code.bin exe 0x80000000

That would init the sdram, load your code to the sdram start and then execute it.
As long as your code uses relative branching or you make it to be executed at that address, it should work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 26, 2021, 11:31:26 am
Hi David,

I know. Have used the FEL mode to load some test programs to the SRAM, and that works. But this only works for small bits of code.

Tried the sunxi-fel with uboot command and that did not work indeed. The only thing that happens is that the back light is turned on because that is programmed into the u-boot-sunxi-with-spl.bin I made here to test linux on the scope.

I will give the spl command a try. If that fails I have to write my own USB stuff for the F1C100s to have it behave as a CH340 device and implement commands to load and execute code that way.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 26, 2021, 12:35:16 pm
Well gave it a try but no deal.

Code: [Select]
sudo ./sunxi-fel -p spl u-boot-sunxi-with-spl.bin write 0x80000000 fnirsi_1013d_scope_nh.bin exe 0x80000000

Tried the file I used to flash the scope with, but that does not work of course |O because it has the spl at the beginning of the file. Was not thinking :palm:

Then tried the output of the linker which is set to be loaded at 0x7FFFFFE0 and executed at 0x80000000, and I can see that something is done because the screen goes from white to some blueish color, but that's it :(

Took of the brom header so that the code starts at the beginning of the binary and it results in the same blueish screen.

So no luck there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 26, 2021, 04:28:00 pm
As far as I know the spl thing executes nothing. So it's probably something in the code or linker settings...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 26, 2021, 04:45:45 pm
As far as I know the spl thing executes nothing. So it's probably something in the code or linker settings...

Don't think so because the code I'm testing runs when it is written in the flash. And the fact that the brightness is enabled, which requires special code to control the FPGA tells me that the spl code is called to do things.

To get linux to work on this hardware I had to make modifications to u-boot. I do have a SD card with linux on it that runs. The problem is it still needs a uart for communication, which on this hardware is not available :palm:

As linux is not my forte, I did not continue with it. I believe Iscle is working on this, but I have no idea what the status is.

One way or another I will get there. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 26, 2021, 08:22:55 pm
I know. But the flash has a specific header (eGON) for the bootloader to recognize it. I'd try compiling a simple program that blinks a led or something, and work on that.
If it's small enough you could run it from the sram, I don't remember the address right now.
I don't know either, but also I don't feel it's worth the effort on these devices, specially when talking about linux.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on July 26, 2021, 10:31:22 pm
I doubt it could possibly run Linux later than 1.0.  But it would work really well with Mecrisp Stellaris.  The thing that forth excels at is bringing up new or unknown hardware.  You can test what things do interactively as you figure out what to do from documentation or FW dumps.

I am not a Linux guy.  I'm a Unix guy.  But Linux is close enough.  If it needs doing, I can do it.

FWIW My Hantek 2D42 uses an STM32F103.  Imagine what it could do with a '303 part.

BTW I'd relly appreciate a link to a summary of components and measurements of 1013D performance.  I've started reading the thread going back to the start, but it's pretty long.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 27, 2021, 05:27:53 am
I doubt it could possibly run Linux later than 1.0.  But it would work really well with Mecrisp Stellaris.  The thing that forth excels at is bringing up new or unknown hardware.  You can test what things do interactively as you figure out what to do from documentation or FW dumps.

I am not a Linux guy.  I'm a Unix guy.  But Linux is close enough.  If it needs doing, I can do it.

FWIW My Hantek 2D42 uses an STM32F103.  Imagine what it could do with a '303 part.

BTW I'd relly appreciate a link to a summary of components and measurements of 1013D performance.  I've started reading the thread going back to the start, but it's pretty long.

Have Fun!
Reg

It runs a quite recent version of linux for sure. See: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Linux)
Not sure about actual performance because I only booted it to the prompt and typed some commands like "ls".

About FORTH, sure it is nice to play with, but not a language to develop a big project with. I have used it in the past on 8051 a likes and have it in the project box for playing with it on STM devices :)

For the hardware of the FNIRSI-1013D look here: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Schematics (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Schematics)

Everything I do is put in the repository on github.

Have fun with it.

Edit: I looked back in the thread. I joined in on page 19. In the pages before that a lot of discussion goes on about the "performance" of the scope. Up to about page 30 it is all about the touch panel and getting it to work in the right orientation. After that it is mostly me about the actual reverse engineering  of the firmware :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 27, 2021, 05:41:25 am
I know. But the flash has a specific header (eGON) for the bootloader to recognize it. I'd try compiling a simple program that blinks a led or something, and work on that.
If it's small enough you could run it from the sram, I don't remember the address right now.
I don't know either, but also I don't feel it's worth the effort on these devices, specially when talking about linux.

For me it is not really about these devices. It is about learning. After 10 years of working in non embedded software development and system management and then 8 years of building my own house (it is always more work than you think) I'm getting back on the horse in embedded programming. The basics are the same as 30 years ago, but the devices have become so much more capable and more complex that it takes its time.

I like to do things bare metal, and that takes its effort to get to know the hardware. This Allwinner device is terrible since the documentation is crap. Way worse than the STM documentation, of which I hate the HAL stuff. For me just as easy to learn the bare hardware then to grasp the HAL layers.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Mr.B on July 27, 2021, 06:40:13 am
It has been over a year since I purchased one of these.
Never taken it out of the box... Bought it on a whim...
Thanks to everyone involved in this thread.
I will follow more closely and at a minimum actually get it out of the box and play with it this weekend.
Thanks again.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 27, 2021, 01:11:49 pm
Continued with the user interface.

Was quite a bit of going through the Ghidra output to see how things are done for the system settings menu.

Also stumbled on some confusing, still to be confirmed stuff. The buttons for the "always trigger 50%" and "x-y mode display" settings show a grey background when disabled on the actual scope, but the functions I found to draw them use dark green :wtf:

Again these Chinese mysteries :-DD

EDIT: My bad. Misread the C output/asm. The color is light grey (0x00888888)

Code: [Select]
    set_display_fg_color(DAT_80010f04);   //0x00008800 Dark green (my comment)

                             DAT_80010f04                                    XREF[1]:     display_sys_menu_always_trigger_
        80010f04 88 88 88 00     undefined4 00888888h

Implemented it the way I see it on the actual scope. :)

Also when closely observed on the actual scope one can see that the actual settings are drawn after the menu slid onto the screen. In my version the settings are drawn in before the sliding is done.

Consulted a friend of mine about the battery charge reading and he figured that when more current is drawn from the battery the voltage drop will be bigger due to the internal resistance and that a compensation in software is a good way to deal with it. The different sample lengths and then just use the lowest measurement did not make sense to him either. A walking average would be a much better solution.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 27, 2021, 08:03:11 pm
The performance is not that bad. I mean, you have  408MHZ core that easily gets 600+MHZ.
What's not so good is the memory interface. 64MB DDR, 16-bit interface, 312MHz effective clock that can usually be overclocked to 384MHz.
But the bandwidth is shared with the LCD driver and the processor instruction fetch. At least in linux, where it load the executables to the ram.
But it's still pretty capable!

If the battery voltage drops significantlywhen using the tablet, then it's crap. I mean, either the battery is rubbish or not correctly sized for the device power.
It's ok that it drops few mV, but not to the extend that the battery reading completely changes.
I recently replaced the battery for a friend, had the same issues. It was new! The current spikes made the battery level to change between fully charged to only a few %.
The voltage was dropping from 4.2V to 3.7V! Replaced it with some old 18650 that I removed from an electric drill. Their internal impedance had become too high for 20amps, but worked perfectly with smaller currents.

Does the circuitry have a shunt resistor or any other method to read the current? That way it would be easy to compensate.
Find out the internal battery impedance by appling a load and writing down the Vdrop and the current. Then just compute the Vdrop reading the current and sum it up to the Vreading.
But anyways, not a good thing if it's happening.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 28, 2021, 05:43:08 am
About the battery, it is not that it is dropping a lot of mV's when operated. It is about the software they use to display the remaining charge level. The compensation for charge left is not that big. Only a small percentage of what is left in the battery.

The hardware uses a TL431 in series with a 10K resistor to reduce the voltage to within the ADC range. The ADC only has 6 bits output. When fully charged the measured level is around 50 and when a charger is connected it goes up to maybe 56 to 58. In the code they take of 7 when on charge. For the brightness they compensate at max with 6. (Full brightness and full battery)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 28, 2021, 10:49:30 pm
I see. So you might have a lot of noise?
I recommend you the EMA filtering, it's very easy to use and can filter from little to a lot.
As you don't want the level to be changing all the time, I'd use a big factor.
An example:
https://blog.stratifylabs.co/device/2013-10-04-An-Easy-to-Use-Digital-Filter/

I use a different code in the stm32 soldering fw  but it's the same in the end.
To reduce the delay if the system changes quickly (ex. At power on, the average is 0 and with heavy filtering it will rise slowly), I set some limits, so if the difference between average and new readings is huge, I increase a "spike" counter, and if I get x times more consecutive readings like that, I override the filter average with the last reading.
And It works really nice. If you only get few readings a lot different than average, they will be filtered normally and barely affect it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 29, 2021, 05:17:57 am
Thanks for the example about the digital filter.

But I have the feeling you don't understand what it is about. I'm reverse engineering the FNIRSI software and not complaining about any possible hardware short comings.

The original post about this (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3611270/#msg3611270 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3611270/#msg3611270)) shows the pseudo code Ghidra made of it, and my asking about the why they did it like they did it.

The battery voltage does not fluctuate as far as I checked it with a DMM. It slowly drops when the device is operated, which is normal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 29, 2021, 09:50:44 am
Phase 1 complete 8)

The top control bar is implemented and working. All the menu's open or the setting is toggled on touch (move speed) The channel and trigger menu's work and the settings can be changed. For the main menu all the items respond to touch (highlight), but only the system settings menu has an action coupled. The others (picture view, waveform view and usb connect) still need their functionality implemented. But my first goal is to get the UI framework coded.

The systems settings menu is fully implemented for the settings. The baseline calibration opens the start text and the OK button responds to touch. The "Calibrating..." and "Calibration successful" texts are also shown. The actual calibration still needs to be reversed.

Next up is the right side control bar.

The code so far can be found in the repository. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope))

Did make a slight change in the trigger settings display on the top bar. Take a look at the pictures and see if you can spot it :-DD
The second image is of the original code and the third is of my code. You have to look close because the difference is very small.  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: serverror on July 30, 2021, 05:22:54 am
Take a look at the pictures and see if you can spot it :-DD

Hah, the falling edge symbol....how bizarre.


Excellent progress on your project, impressive as always! Thanks for the updates.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 01:56:11 pm
So the user interface framework is done.

The right control bar can be touched and in the code the actions taken in the original code are in the comments so making the coupling when the rest of the code is written should be easy.

Next I'm going to make another attempt on getting the testing via FEL working. Have some ideas on this. When it works life becomes a bit easier :phew:

I have said it before but have to say it again. The original code is a mess. It is hard work to find the logic behind a lot of it. My code is not a straight copy but an interpretation of the original.

Just looking at how they did the measures menu |O
First they slide the bitmap onto the screen whilst changing the red color to black and the white color to grey. Then they draw it again, whilst again changing the colors. After that they go through code checking if an item is enabled and if so make the text white again. Not in a loop, but 24 times more or less the same code. And then they copy what was already on screen back to the screen :palm:

Same for the handling of the touch. 24 times the more or less same code with different coordinates.

I made an array with coordinates and go through it in a loop. :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 04:01:58 pm
I was lucky :-DD

The first idea I had for loading with FEL sort of works.

I made my own bootloader that enables the DRAM and then returns to the FEL program. It does not work the same as the "Linux" version where the loading of the program to test can directly follow in the FEL command, but with two commands it works.

With this bootloader it is possible to start the scope in FEL mode with the DRAM enabled. The FNIRSI startup image is displayed. (Still need to implement my own image :))

Code: [Select]
sudo ./sunxi-fel -p spl fnirsi_1013d_startup_with_fel.bin
This starts the system and returns to FEL. After this DRAM is enabled and FEL is active.

Code: [Select]
sudo ./sunxi-fel -p write 0x7FFFFFE0 fnirsi_1013d_scope.bin exe 0x80000000
This command then loads and executes the output of the scope project.

Still needs a SD card with FEL boot to be able to switch between the original scope software and the FEL mode. It is possible to put this new bootloader in the FLASH, but then the original code also needs to be loaded through FEL. This way the SD card and USB code can be tested. But for now it allows for a bit more easy testing of the new code 8)

Tested the latest version of my code and everything works but the sliding menu's are still to slow. So this needs investigating.

The bootloader is in the repository. https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_startup_with_fel (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_startup_with_fel)

Edit: Tried a new idea that came to my mind. I wrote my bootloader to a SD card and stuck it in the scope. It starts with the FNIRSI image and goes into FEL mode. So now I only have to use the second command to test my code.

Wrote it to a SD card with this command. Make sure to change the /dev/sdc to where your SD card shows up.
Code: [Select]
sudo dd if=fnirsi_1013d_startup_with_fel.bin of=/dev/sdc bs=1024 seek=8
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 05:39:01 pm
I'm looking into the menu slide performance issue and it looks like it is mainly compiler optimization.

This is from the original code. The assembler for sliding the main menu onto the screen.
Code: [Select]
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             void __stdcall display_slide_down_main_menu(void)
             void              <VOID>         <RETURN>
             undefined4        Stack[-0x14]:4 local_14                                XREF[1]:     8000e7dc(*) 
             undefined4        Stack[-0x28]:4 local_28                                XREF[1]:     8000e7d8(*) 
                             display_slide_down_main_menu                    XREF[1]:     setup_main_menu:8002916c(c) 
        8000e6f8 00 5e 2d e9     stmdb      sp!,{r9 r10 r11 r12 lr}
        8000e6fc f0 01 2d e9     stmdb      sp!,{r4 r5 r6 r7 r8}
        8000e700 dc 00 9f e5     ldr        r0,[DAT_8000e7e4]                                = 001B1B1Bh
        8000e704 ea 52 00 eb     bl         convert_color                                    ushort convert_color(uint color)
        8000e708 00 40 a0 e1     mov        r4,r0
        8000e70c 00 00 a0 e3     mov        r0,#0x0
        8000e710 e7 52 00 eb     bl         convert_color                                    ushort convert_color(uint color)
        8000e714 cc 60 9f e5     ldr        r6,[PTR_DAT_8000e7e8]                            = 80192ef8
        8000e718 00 50 a0 e1     mov        r5,r0
        8000e71c 02 20 a0 e3     mov        r2,#0x2
        8000e720 2e 00 a0 e3     mov        r0,#0x2e
        8000e724 b0 20 c6 e1     strh       r2,[r6,#0x0]=>DAT_80192ef8                       = 0154h
        8000e728 97 10 a0 e3     mov        r1,#0x97
        8000e72c b2 00 c6 e1     strh       r0,[r6,#0x2]=>DAT_80192efa                       = 0914h
        8000e730 b4 10 c6 e1     strh       r1,[r6,#0x4]=>DAT_80192efc                       = 6828h
        8000e734 b6 00 c6 e1     strh       r0,[r6,#0x6]=>DAT_80192efe                       = 1409h
        8000e738 0e 24 00 eb     bl         set_screen_to_global_pointer                     void set_screen_to_global_pointe
        8000e73c a8 a0 9f e5     ldr        r10,[->BITMAP_MAIN_MENU]                         = 800ac420
        8000e740 a8 b0 9f e5     ldr        r11,[Global_Frame_Buffer_Pointer]                = 8019CF60h
        8000e744 eb 00 a0 e3     mov        r0,#0xeb
                             LAB_8000e748                                    XREF[1]:     8000e7d4(j) 
        8000e748 eb 00 50 e3     cmp        r0,#0xeb
        8000e74c 00 30 a0 e1     mov        r3,r0
        8000e750 19 00 00 2a     bcs        LAB_8000e7bc
                             LAB_8000e754                                    XREF[1]:     8000e7b8(j) 
        8000e754 b2 c0 d6 e1     ldrh       r12,[r6,#0x2]=>DAT_80192efa                      = 0914h
        8000e758 00 20 43 e0     sub        r2,r3,r0
        8000e75c b0 70 d6 e1     ldrh       r7,[r6,#0x0]=>DAT_80192ef8                       = 0154h
        8000e760 02 c0 8c e0     add        r12,r12,r2
        8000e764 95 10 a0 e3     mov        r1,#0x95
        8000e768 93 01 01 e0     mul        r1,r3,r1
        8000e76c 8c 91 8c e0     add        r9,r12,r12, lsl #0x3
        8000e770 00 80 9b e5     ldr        r8,[r11,#0x0]=>DAT_8019cf60
        8000e774 0c c2 89 e0     add        r12,r9,r12, lsl #0x4
        8000e778 8c c2 87 e0     add        r12,r7,r12, lsl #0x5
        8000e77c 95 20 a0 e3     mov        r2,#0x95
        8000e780 81 10 8a e0     add        r1,r10,r1, lsl #0x1
        8000e784 8c 70 88 e0     add        r7,r8,r12, lsl #0x1
                             LAB_8000e788                                    XREF[1]:     8000e7a8(j) 
        8000e788 b2 c0 d1 e0     ldrh       r12,[r1],#0x2=>TEXT_BITMAP_CALIB_START
        8000e78c 00 00 5c e3     cmp        r12,#0x0
        8000e790 04 c0 a0 01     moveq      r12,r4
        8000e794 01 00 00 0a     beq        LAB_8000e7a0
        8000e798 3e 0b 5c e3     cmp        r12,#0xf800
        8000e79c 05 c0 a0 01     moveq      r12,r5
                             LAB_8000e7a0                                    XREF[1]:     8000e794(j) 
        8000e7a0 01 20 52 e2     subs       r2,r2,#0x1
        8000e7a4 b2 c0 c7 e0     strh       r12,[r7],#0x2
        8000e7a8 f6 ff ff 1a     bne        LAB_8000e788
        8000e7ac 01 10 83 e2     add        r1,r3,#0x1
        8000e7b0 01 38 c1 e3     bic        r3,r1,#0x10000
        8000e7b4 eb 00 53 e3     cmp        r3,#0xeb
        8000e7b8 e5 ff ff 3a     bcc        LAB_8000e754
                             LAB_8000e7bc                                    XREF[1]:     8000e750(j) 
        8000e7bc 30 10 9f e5     ldr        r1,[DAT_8000e7f4]                                = 0000E38Fh
        8000e7c0 90 01 01 e0     mul        r1,r0,r1
        8000e7c4 21 0a 40 e0     sub        r0,r0,r1, lsr #0x14
        8000e7c8 01 00 40 e2     sub        r0,r0,#0x1
        8000e7cc 00 08 a0 e1     mov        r0,r0, lsl #0x10
        8000e7d0 20 08 b0 e1     movs       r0,r0, lsr #0x10
        8000e7d4 db ff ff 1a     bne        LAB_8000e748
        8000e7d8 f0 01 bd e8     ldmia      sp!,{r4 r5 r6 r7 r8}=>local_28
        8000e7dc 00 5e bd e8     ldmia      sp!,{r9 r10 r11 r12 lr}=>local_14
        8000e7e0 de 23 00 ea     b          set_frame_to_global_pointer


This is what Ghidra shows for the code I compile
Code: [Select]
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             void __stdcall display_slide_top_rect_onto_screen(ushort
             void              <VOID>         <RETURN>
             ushort            r0:2           xpos
             ushort            r1:2           ypos
             ushort            r2:2           width
             ushort            r3:2           height
             uint              Stack[0x0]:4   speed                                   XREF[2]:     80001a94(R),
                                                                                                   80001be0(R) 
             undefined4        Stack[-0x4]:4  local_4                                 XREF[2]:     80001a54(W),
                                                                                                   80001c28(*) 
             undefined4        Stack[-0xc]:4  local_c                                 XREF[4]:     80001b2c(W),
                                                                                                   80001b60(R),
                                                                                                   80001b98(R),
                                                                                                   80001ba0(W) 
             undefined4        Stack[-0x10]:4 local_10                                XREF[4]:     80001b14(W),
                                                                                                   80001b50(R),
                                                                                                   80001bb0(R),
                                                                                                   80001bb8(W) 
             undefined2        Stack[-0x12]:2 local_12                                XREF[7]:     80001ac4(W),
                                                                                                   80001af0(R),
                                                                                                   80001b30(R),
                                                                                                   80001bd8(R),
                                                                                                   80001bdc(R),
                                                                                                   80001c0c(W),
                                                                                                   80001c10(R) 
             undefined2        Stack[-0x14]:2 local_14                                XREF[4]:     80001b34(W),
                                                                                                   80001bbc(R),
                                                                                                   80001bc4(W),
                                                                                                   80001bc8(R) 
             undefined2        Stack[-0x16]:2 local_16                                XREF[6]:     80001b40(W),
                                                                                                   80001b48(R),
                                                                                                   80001b58(R),
                                                                                                   80001b70(R),
                                                                                                   80001b78(W),
                                                                                                   80001b7c(R) 
             undefined4        Stack[-0x1c]:4 local_1c                                XREF[3]:     80001ae0(W),
                                                                                                   80001b04(R),
                                                                                                   80001b20(R) 
             undefined2        Stack[-0x22]:2 local_22                                XREF[2]:     80001a74(W),
                                                                                                   80001ac8(R) 
             undefined2        Stack[-0x24]:2 local_24                                XREF[2]:     80001a7c(W),
                                                                                                   80001acc(R) 
             undefined2        Stack[-0x26]:2 local_26                                XREF[2]:     80001a84(W),
                                                                                                   80001b80(R) 
             undefined2        Stack[-0x28]:2 local_28                                XREF[4]:     80001a8c(W),
                                                                                                   80001a90(R),
                                                                                                   80001aa8(R),
                                                                                                   80001bcc(R) 
                             display_slide_top_rect_onto_screen              XREF[4]:     FUN_80005ae0:80005bac(c),
                                                                                          FUN_80005f40:8000608c(c),
                                                                                          FUN_8000667c:800067c8(c),
                                                                                          FUN_80006de8:80006f00(c) 
        80001a54 04 b0 2d e5     str        r11,[sp,#local_4]!
        80001a58 00 b0 8d e2     add        r11,sp,#0x0
        80001a5c 24 d0 4d e2     sub        sp,sp,#0x24
        80001a60 00 c0 a0 e1     mov        r12,xpos
        80001a64 01 00 a0 e1     mov        xpos,ypos
        80001a68 02 10 a0 e1     mov        ypos,width
        80001a6c 03 20 a0 e1     mov        width,height
        80001a70 0c 30 a0 e1     mov        height,r12
        80001a74 be 31 4b e1     strh       height,[r11,#local_22]
        80001a78 00 30 a0 e1     mov        height,xpos
        80001a7c b0 32 4b e1     strh       height,[r11,#local_24]
        80001a80 01 30 a0 e1     mov        height,ypos
        80001a84 b2 32 4b e1     strh       height,[r11,#local_26]
        80001a88 02 30 a0 e1     mov        height,width
        80001a8c b4 32 4b e1     strh       height,[r11,#local_28]
        80001a90 b4 32 5b e1     ldrh       height,[r11,#local_28]
        80001a94 04 20 9b e5     ldr        width,[r11,#speed]
        80001a98 92 03 03 e0     mul        height,width,height
        80001a9c 23 3a a0 e1     mov        height,height, lsr #0x14
        80001aa0 03 38 a0 e1     mov        height,height, lsl #0x10
        80001aa4 23 38 a0 e1     mov        height,height, lsr #0x10
        80001aa8 b4 22 5b e1     ldrh       width,[r11,#local_28]
        80001aac 03 30 42 e0     sub        height,width,height
        80001ab0 03 38 a0 e1     mov        height,height, lsl #0x10
        80001ab4 23 38 a0 e1     mov        height,height, lsr #0x10
        80001ab8 01 30 43 e2     sub        height,height,#0x1
        80001abc 03 38 a0 e1     mov        height,height, lsl #0x10
        80001ac0 23 38 a0 e1     mov        height,height, lsr #0x10
        80001ac4 be 30 4b e1     strh       height,[r11,#local_12]
        80001ac8 be 21 5b e1     ldrh       width,[r11,#local_22]
        80001acc b0 32 5b e1     ldrh       height,[r11,#local_24]
        80001ad0 58 11 9f e5     ldr        ypos,[DAT_80001c30]                              = 80012208h
        80001ad4 b0 12 d1 e1     ldrh       ypos,[ypos,#0x20]=>DAT_80012228
        80001ad8 91 03 03 e0     mul        height,ypos,height
        80001adc 03 30 82 e0     add        height,width,height
        80001ae0 18 30 0b e5     str        height,[r11,#local_1c]
        80001ae4 49 00 00 ea     b          LAB_80001c10
                             LAB_80001ae8                                    XREF[1]:     80001c18(j) 
        80001ae8 40 31 9f e5     ldr        height,[DAT_80001c30]                            = 80012208h
        80001aec 0c 20 93 e5     ldr        width,[height,#0xc]=>DAT_80012214
        80001af0 fe 30 5b e1     ldrsh      height,[r11,#local_12]
        80001af4 34 11 9f e5     ldr        ypos,[DAT_80001c30]                              = 80012208h
        80001af8 b0 12 d1 e1     ldrh       ypos,[ypos,#0x20]=>DAT_80012228
        80001afc 91 03 03 e0     mul        height,ypos,height
        80001b00 03 10 a0 e1     mov        ypos,height
        80001b04 18 30 1b e5     ldr        height,[r11,#local_1c]
        80001b08 03 30 81 e0     add        height,ypos,height
        80001b0c 83 30 a0 e1     mov        height,height, lsl #0x1
        80001b10 03 30 82 e0     add        height,width,height
        80001b14 0c 30 0b e5     str        height,[r11,#local_10]
        80001b18 10 31 9f e5     ldr        height,[DAT_80001c30]                            = 80012208h
        80001b1c 08 20 93 e5     ldr        width,[height,#0x8]=>DAT_80012210
        80001b20 18 30 1b e5     ldr        height,[r11,#local_1c]
        80001b24 83 30 a0 e1     mov        height,height, lsl #0x1
        80001b28 03 30 82 e0     add        height,width,height
        80001b2c 08 30 0b e5     str        height,[r11,#local_c]
        80001b30 be 30 5b e1     ldrh       height,[r11,#local_12]
        80001b34 b0 31 4b e1     strh       height,[r11,#local_14]
        80001b38 22 00 00 ea     b          LAB_80001bc8
                             LAB_80001b3c                                    XREF[1]:     80001bd4(j) 
        80001b3c 00 30 a0 e3     mov        height,#0x0
        80001b40 b2 31 4b e1     strh       height,[r11,#local_16]
        80001b44 0c 00 00 ea     b          LAB_80001b7c
                             LAB_80001b48                                    XREF[1]:     80001b88(j) 
        80001b48 b2 31 5b e1     ldrh       height,[r11,#local_16]
        80001b4c 83 30 a0 e1     mov        height,height, lsl #0x1
        80001b50 0c 20 1b e5     ldr        width,[r11,#local_10]
        80001b54 03 20 82 e0     add        width,width,height
        80001b58 b2 31 5b e1     ldrh       height,[r11,#local_16]
        80001b5c 83 30 a0 e1     mov        height,height, lsl #0x1
        80001b60 08 10 1b e5     ldr        ypos,[r11,#local_c]
        80001b64 03 30 81 e0     add        height,ypos,height
        80001b68 b0 20 d2 e1     ldrh       width,[width,#0x0]
        80001b6c b0 20 c3 e1     strh       width,[height,#0x0]
        80001b70 b2 31 5b e1     ldrh       height,[r11,#local_16]
        80001b74 01 30 83 e2     add        height,height,#0x1
        80001b78 b2 31 4b e1     strh       height,[r11,#local_16]
                             LAB_80001b7c                                    XREF[1]:     80001b44(j) 
        80001b7c b2 21 5b e1     ldrh       width,[r11,#local_16]
        80001b80 b2 32 5b e1     ldrh       height,[r11,#local_26]
        80001b84 03 00 52 e1     cmp        width,height
        80001b88 ee ff ff 9a     bls        LAB_80001b48
        80001b8c 9c 30 9f e5     ldr        height,[DAT_80001c30]                            = 80012208h
        80001b90 b0 32 d3 e1     ldrh       height,[height,#0x20]=>DAT_80012228
        80001b94 83 30 a0 e1     mov        height,height, lsl #0x1
        80001b98 08 20 1b e5     ldr        width,[r11,#local_c]
        80001b9c 03 30 82 e0     add        height,width,height
        80001ba0 08 30 0b e5     str        height,[r11,#local_c]
        80001ba4 84 30 9f e5     ldr        height,[DAT_80001c30]                            = 80012208h
        80001ba8 b0 32 d3 e1     ldrh       height,[height,#0x20]=>DAT_80012228
        80001bac 83 30 a0 e1     mov        height,height, lsl #0x1
        80001bb0 0c 20 1b e5     ldr        width,[r11,#local_10]
        80001bb4 03 30 82 e0     add        height,width,height
        80001bb8 0c 30 0b e5     str        height,[r11,#local_10]
        80001bbc b0 31 5b e1     ldrh       height,[r11,#local_14]
        80001bc0 01 30 83 e2     add        height,height,#0x1
        80001bc4 b0 31 4b e1     strh       height,[r11,#local_14]
                             LAB_80001bc8                                    XREF[1]:     80001b38(j) 
        80001bc8 b0 21 5b e1     ldrh       width,[r11,#local_14]
        80001bcc b4 32 5b e1     ldrh       height,[r11,#local_28]
        80001bd0 03 00 52 e1     cmp        width,height
        80001bd4 d8 ff ff 9a     bls        LAB_80001b3c
        80001bd8 be 20 5b e1     ldrh       width,[r11,#local_12]
        80001bdc fe 30 5b e1     ldrsh      height,[r11,#local_12]
        80001be0 04 10 9b e5     ldr        ypos,[r11,#speed]
        80001be4 91 03 03 e0     mul        height,ypos,height
        80001be8 23 3a a0 e1     mov        height,height, lsr #0x14
        80001bec 03 38 a0 e1     mov        height,height, lsl #0x10
        80001bf0 23 38 a0 e1     mov        height,height, lsr #0x10
        80001bf4 03 30 42 e0     sub        height,width,height
        80001bf8 03 38 a0 e1     mov        height,height, lsl #0x10
        80001bfc 23 38 a0 e1     mov        height,height, lsr #0x10
        80001c00 01 30 43 e2     sub        height,height,#0x1
        80001c04 03 38 a0 e1     mov        height,height, lsl #0x10
        80001c08 23 38 a0 e1     mov        height,height, lsr #0x10
        80001c0c be 30 4b e1     strh       height,[r11,#local_12]
                             LAB_80001c10                                    XREF[1]:     80001ae4(j) 
        80001c10 fe 30 5b e1     ldrsh      height,[r11,#local_12]
        80001c14 00 00 53 e3     cmp        height,#0x0
        80001c18 b2 ff ff aa     bge        LAB_80001ae8
        80001c1c 00 00 a0 e1     mov        xpos,xpos
        80001c20 00 00 a0 e1     mov        xpos,xpos
        80001c24 00 d0 8b e2     add        sp,r11,#0x0
        80001c28 04 b0 9d e4     ldr        r11=>local_4,[sp],#0x4
        80001c2c 1e ff 2f e1     bx         lr


It is much longer for the loop portion. The psuedo C output of Ghidra is not much different for the both

This is my C code
Code: [Select]
void display_slide_top_rect_onto_screen(uint16 xpos, uint16 ypos, uint16 width, uint16 height, uint32 speed)
{
  uint16 *ptr1, *ptr2;
  int16   startline;     //Needs to be an int because it has to become negative to stop
  uint16  line;
  uint32  startxy;
  uint16  pixel;

  //Starting line of the rectangle to display first
  startline = height - ((height * speed) >> 20) - 1;
 
  //Start x,y offset for source and destination calculation
  startxy = xpos + (ypos * displaydata.pixelsperline);
 
  //Draw lines as long as is needed to get the whole rectangle on screen
  while(startline >= 0)
  {
    //Source pointer is based on the current line
    ptr2 = displaydata.sourcebuffer + startxy + (startline * displaydata.pixelsperline);
   
    //Destination pointer is always the first line
    ptr1 = displaydata.screenbuffer + startxy;
   
    //Handle the needed number of lines for this loop
    for(line=startline;line<=height;line++)
    {
      //Copy a single line to the screen buffer
      for(pixel=0;pixel<=width;pixel++)
      {
        //Copy one pixel at a time
        ptr1[pixel] = ptr2[pixel];
      }
     
      //Point to the next line of pixels in both destination and source
      ptr1 += displaydata.pixelsperline;
      ptr2 += displaydata.pixelsperline;
    }
   
    //Calculate the new starting line
    startline = startline - 1 - ((startline * speed) >> 20);
  }
}


This is what Ghidra makes of it
Code: [Select]
void display_slide_top_rect_onto_screen(ushort xpos,ushort ypos,ushort width,ushort height,uint speed)
{
  int iVar1;
  ushort local_16;
  ushort local_14;
  ushort local_12;
  int local_10;
  int local_c;
 
  local_12 = (ushort)((((uint)height - (speed * height >> 0x14) & 0xffff) - 1) * 0x10000 >> 0x10);
  iVar1 = (uint)xpos + (uint)*(ushort *)(DAT_80001c30 + 0x20) * (uint)ypos;

  while (-1 < (short)local_12)
  {
    local_10 = *(int *)(DAT_80001c30 + 0xc) + ((uint)*(ushort *)(DAT_80001c30 + 0x20) * (int)(short)local_12 + iVar1) * 2;
    local_c = *(int *)(DAT_80001c30 + 8) + iVar1 * 2;
    local_14 = local_12;

    while (local_14 <= height)
    {
      local_16 = 0;
      while (local_16 <= width)
      {
        *(undefined2 *)(local_c + (uint)local_16 * 2) = *(undefined2 *)(local_10 + (uint)local_16 * 2);
        local_16 = local_16 + 1;
      }

      local_c = local_c + (uint)*(ushort *)(DAT_80001c30 + 0x20) * 2;
      local_10 = local_10 + (uint)*(ushort *)(DAT_80001c30 + 0x20) * 2;
      local_14 = local_14 + 1;
    }

    local_12 = (ushort)((((uint)local_12 - (speed * (int)(short)local_12 >> 0x14) & 0xffff) - 1) * 0x10000 >> 0x10);
  }
}


I can probably speed things up a bit by changing the variables to full integers instead of shorts. Only the pixel pointers need to be unsigned shorts.

If that does not do the trick I will have to raise the compilers optimization level and see what comes of that.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 07:49:33 pm
Managed to speed things up, but I'm not sure if it is the same as the original. Difficult to compare with only on scope :(

Told the compiler to keep variables in registers, which made a difference.
Code: [Select]
void display_slide_top_rect_onto_screen(uint32 xpos, uint32 ypos, uint32 width, uint32 height, uint32 speed)
{
  register uint16 *ptr1, *ptr2;
  register int32   startline;     //Needs to be an int because it has to become negative to stop
  register uint32  line;
  register uint32  startxy;
  register uint32  pixel;
  register uint32  pixels = displaydata.pixelsperline;

  //Starting line of the rectangle to display first
  startline = height - ((height * speed) >> 20) - 1;
 
  //Start x,y offset for source and destination calculation
  startxy = xpos + (ypos * displaydata.pixelsperline);
 
  //Draw lines as long as is needed to get the whole rectangle on screen
  while(startline >= 0)
  {
    //Source pointer is based on the current line
    ptr2 = displaydata.sourcebuffer + startxy + (startline * pixels);
   
    //Destination pointer is always the first line
    ptr1 = displaydata.screenbuffer + startxy;
   
    //Handle the needed number of lines for this loop
    for(line=startline;line<=height;line++)
    {
      //Copy a single line to the screen buffer
      for(pixel=0;pixel<=width;pixel++)
      {
        //Copy one pixel at a time
        ptr1[pixel] = ptr2[pixel];
      }
     
      //Point to the next line of pixels in both destination and source
      ptr1 += pixels;
      ptr2 += pixels;
    }
   
    //Calculate the new starting line
    startline = startline - 1 - ((startline * speed) >> 20);
  }
}


It is turned into this
Code: [Select]
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             void __stdcall display_slide_top_rect_onto_screen(ushort
             void              <VOID>         <RETURN>
             ushort            r0:2           xpos
             ushort            r1:2           ypos
             ushort            r2:2           width
             ushort            r3:2           height
             uint              Stack[0x0]:4   speed                                   XREF[2]:     80001a80(R),
                                                                                                   80001b48(R) 
             undefined4        Stack[-0x20]:4 local_20                                XREF[1]:     80001b74(*) 
             undefined4        Stack[-0x24]:4 local_24                                XREF[2]:     80001a60(W),
                                                                                                   80001ab0(R) 
             undefined4        Stack[-0x28]:4 local_28                                XREF[2]:     80001a64(W),
                                                                                                   80001aa8(R) 
             undefined4        Stack[-0x2c]:4 local_2c                                XREF[2]:     80001a68(W),
                                                                                                   80001b14(R) 
             undefined4        Stack[-0x30]:4 local_30                                XREF[4]:     80001a6c(W),
                                                                                                   80001a7c(R),
                                                                                                   80001a8c(R),
                                                                                                   80001b34(R) 
                             display_slide_top_rect_onto_screen              XREF[4]:     FUN_80005a2c:80005af8(c),
                                                                                          FUN_80005e8c:80005fd8(c),
                                                                                          FUN_800065c8:80006714(c),
                                                                                          FUN_80006d34:80006e4c(c) 
        80001a54 f0 0f 2d e9     stmdb      sp!,{r4 r5 r6 r7 r8 r9 r10 r11}
        80001a58 1c b0 8d e2     add        r11,sp,#0x1c
        80001a5c 10 d0 4d e2     sub        sp,sp,#0x10
        80001a60 20 00 0b e5     str        xpos,[r11,#local_24]
        80001a64 24 10 0b e5     str        ypos,[r11,#local_28]
        80001a68 28 20 0b e5     str        width,[r11,#local_2c]
        80001a6c 2c 30 0b e5     str        height,[r11,#local_30]
        80001a70 04 31 9f e5     ldr        height,[PTR_DAT_80001b7c]                        = 80012154
        80001a74 b0 32 d3 e1     ldrh       height,[height,#0x20]=>DAT_80012174
        80001a78 03 70 a0 e1     mov        r7,height
        80001a7c 2c 30 1b e5     ldr        height,[r11,#local_30]
        80001a80 04 20 9b e5     ldr        width,[r11,#speed]
        80001a84 92 03 03 e0     mul        height,width,height
        80001a88 23 3a a0 e1     mov        height,height, lsr #0x14
        80001a8c 2c 20 1b e5     ldr        width,[r11,#local_30]
        80001a90 03 30 42 e0     sub        height,width,height
        80001a94 01 30 43 e2     sub        height,height,#0x1
        80001a98 03 a0 a0 e1     mov        r10,height
        80001a9c d8 30 9f e5     ldr        height,[PTR_DAT_80001b7c]                        = 80012154
        80001aa0 b0 32 d3 e1     ldrh       height,[height,#0x20]=>DAT_80012174
        80001aa4 03 20 a0 e1     mov        width,height
        80001aa8 24 30 1b e5     ldr        height,[r11,#local_28]
        80001aac 93 02 02 e0     mul        width,height,width
        80001ab0 20 30 1b e5     ldr        height,[r11,#local_24]
        80001ab4 03 90 82 e0     add        r9,width,height
        80001ab8 28 00 00 ea     b          LAB_80001b60
                             LAB_80001abc                                    XREF[1]:     80001b64(j) 
        80001abc b8 30 9f e5     ldr        height,[PTR_DAT_80001b7c]                        = 80012154
        80001ac0 0c 20 93 e5     ldr        width,[height,#0xc]=>DAT_80012160
        80001ac4 0a 30 a0 e1     mov        height,r10
        80001ac8 97 03 03 e0     mul        height,r7,height
        80001acc 03 30 89 e0     add        height,r9,height
        80001ad0 83 30 a0 e1     mov        height,height, lsl #0x1
        80001ad4 03 60 82 e0     add        r6,width,height
        80001ad8 9c 30 9f e5     ldr        height,[PTR_DAT_80001b7c]                        = 80012154
        80001adc 08 20 93 e5     ldr        width,[height,#0x8]=>DAT_8001215c
        80001ae0 89 30 a0 e1     mov        height,r9, lsl #0x1
        80001ae4 03 50 82 e0     add        r5,width,height
        80001ae8 0a 80 a0 e1     mov        r8,r10
        80001aec 10 00 00 ea     b          LAB_80001b34
                             LAB_80001af0                                    XREF[1]:     80001b3c(j) 
        80001af0 00 40 a0 e3     mov        r4,#0x0
        80001af4 06 00 00 ea     b          LAB_80001b14
                             LAB_80001af8                                    XREF[1]:     80001b1c(j) 
        80001af8 84 30 a0 e1     mov        height,r4, lsl #0x1
        80001afc 03 20 86 e0     add        width,r6,height
        80001b00 84 30 a0 e1     mov        height,r4, lsl #0x1
        80001b04 03 30 85 e0     add        height,r5,height
        80001b08 b0 20 d2 e1     ldrh       width,[width,#0x0]
        80001b0c b0 20 c3 e1     strh       width,[height,#0x0]
        80001b10 01 40 84 e2     add        r4,r4,#0x1
                             LAB_80001b14                                    XREF[1]:     80001af4(j) 
        80001b14 28 30 1b e5     ldr        height,[r11,#local_2c]
        80001b18 03 00 54 e1     cmp        r4,height
        80001b1c f5 ff ff 9a     bls        LAB_80001af8
        80001b20 87 30 a0 e1     mov        height,r7, lsl #0x1
        80001b24 03 50 85 e0     add        r5,r5,height
        80001b28 87 30 a0 e1     mov        height,r7, lsl #0x1
        80001b2c 03 60 86 e0     add        r6,r6,height
        80001b30 01 80 88 e2     add        r8,r8,#0x1
                             LAB_80001b34                                    XREF[1]:     80001aec(j) 
        80001b34 2c 30 1b e5     ldr        height,[r11,#local_30]
        80001b38 03 00 58 e1     cmp        r8,height
        80001b3c eb ff ff 9a     bls        LAB_80001af0
        80001b40 0a 20 a0 e1     mov        width,r10
        80001b44 0a 10 a0 e1     mov        ypos,r10
        80001b48 04 30 9b e5     ldr        height,[r11,#speed]
        80001b4c 91 03 03 e0     mul        height,ypos,height
        80001b50 23 3a a0 e1     mov        height,height, lsr #0x14
        80001b54 03 30 42 e0     sub        height,width,height
        80001b58 01 30 43 e2     sub        height,height,#0x1
        80001b5c 03 a0 a0 e1     mov        r10,height
                             LAB_80001b60                                    XREF[1]:     80001ab8(j) 
        80001b60 00 00 5a e3     cmp        r10,#0x0
        80001b64 d4 ff ff aa     bge        LAB_80001abc
        80001b68 00 00 a0 e1     mov        xpos,xpos
        80001b6c 00 00 a0 e1     mov        xpos,xpos
        80001b70 1c d0 4b e2     sub        sp,r11,#0x1c
        80001b74 f0 0f bd e8     ldmia      sp!,{r4 r5 r6 r7 r8 r9 r10 r11}=>local_20
        80001b78 1e ff 2f e1     bx         lr
                             PTR_DAT_80001b7c                                XREF[4]:     display_slide_top_rect_onto_scre
                                                                                          display_slide_top_rect_onto_scre
                                                                                          display_slide_top_rect_onto_scre
                                                                                          display_slide_top_rect_onto_scre
        80001b7c 54 21 01 80     addr       DAT_80012154


Think it is a good idea to adapt my display library to this change, so a bit of re-coding to do, but that is how it goes whilst learning.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 31, 2021, 07:50:30 pm
It's slow because a for/for/for loop drawing one pixel at a time is extremely unefficient!
Code: [Select]
      //Copy a single line to the screen buffer
      for(pixel=0;pixel<=width;pixel++)
      {
        //Copy one pixel at a time
        ptr1[pixel] = ptr2[pixel];
      }     


Instead, try something like:
Code: [Select]
    //Copy a single line to the screen buffer
    memcpy( ptr1, ptr2, 2*width);     // *2 because memcpy works with bytes, and you're copying uint16_t!

   // You might need to do this instead:
    memcpy((uint8_t*)ptr1, (uint8_t*)ptr2, 2*width);
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 07:52:58 pm
It's slow because a for/for/for loop drawing one pixel at a time is extremely unefficient!

That might be, but the original code does the same.

But an example on how to do it the right way is always welcomed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 08:02:27 pm
It's slow because a for/for/for loop drawing one pixel at a time is extremely unefficient!
Code: [Select]
      //Copy a single line to the screen buffer
      for(pixel=0;pixel<=width;pixel++)
      {
        //Copy one pixel at a time
        ptr1[pixel] = ptr2[pixel];
      }     


Instead, try something like:
Code: [Select]
    //Copy a single line to the screen buffer
    memcpy(ptr1[pixel], ptr2[pixel], 2*width);     // *2 because memcpy works with bytes, and you're copying uint16_t!

That is a good suggestion :-+ I will give it a try.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on July 31, 2021, 08:02:34 pm
Are you enabling the I cache and D cache? Setting the cpu to 600MHz? And dram to 156MHz?
Damn, I corrected the code too late, you had already quoted me! :-DD

Sure, the original code coming from china, what a suprise it's crap!
Same with the soldering stations, stock fw updating the screen at 5fps, extrenmely laggy system,  while I can easily do 50x that with cpu mostly idling!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 08:04:48 pm
Yes the caches are enabled. CPU is running on 600MHz. Not sure about the memory though. I used code I found on the net and did not looked into it yet. So maybe it is set to slow.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 31, 2021, 08:08:16 pm
Damn, I corrected the code too late, you had already quoted me! :-DD

I did not even see the error in it. Just read the memcpy function name and thought yes, that is an option. Might be a problem that I'm not using standard lib.

Using "-T./fnirsi_1013d.ld -nostdlib -lgcc" this for the linker.

But that is for tomorrow. :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 01, 2021, 04:49:11 am
It's slow because a for/for/for loop drawing one pixel at a time is extremely unefficient!

I have been thinking about this and it is only true for architectures like ARM. For older CPU's like Z80, 6502, 8051 and maybe even the 8 bit AVR ones (not to familiar with those assembler wise) it makes no difference when the compiler optimizes.

On ARM the use of LDM and STM instructions will improve the efficiency since they can copy multiple words in a single instruction. The data still needs to be transferred over the bus though, and that is where bus width, and caching comes into play.

The first 15 years of my career I have written a lot of assembler for embedded devices using 6502, 6809 or 8051. Needed to be extremely efficient sometimes and shave of an instruction or two to get the wanted performance. We were talking about microseconds back in those days. Now it is nanoseconds or even less.

But it is nice to hear there are still true professionals out there who think about this. And not like what I have seen a lot, the idiots who think programming is easy and fully depend on their SDK's and whatever tools there are to make programs that are shit |O

I'm rusty and need to get the wheels going again. Forgotten a lot about proper programming in the last 15 years.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 01, 2021, 09:23:28 am
The memcpy function certainly helped. But I still have the feeling the original is faster :-//

Found an assembly source of a memcpy function, which allowed me to keep away from the standard library. The problem with the standard library is it needs the standard io implemented and I rather do without that.

Tried to compile with -O1, which reduces on code size, but the touchscreen then fails as expected. :palm:

Ah well that is for another day. Still a lot to do getting the rest of the code reversed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 01, 2021, 05:19:14 pm
I usually compile with O2. The speed increase is noticeable.
Why does the optimization break the touchscreen?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 01, 2021, 05:32:22 pm
I usually compile with O2. The speed increase is noticeable.
Why does the optimization break the touchscreen?

The touch panel delay routine was an empty for loop. This is removed by the compiler when optimization is set to 1 or higher. Changed it to an assembly loop and now it works with optimization level O2.

The speed of the sliding in of the menu's is much better now. There will still be room for improvement, but the first goal is to get working code that mimics the scope.

And that is coming along, but still a lot of work. Put in the code for changing the screen brightness. It uses special functionality of the FPGA, for which I reversed the code a while back but did not test it until now. Happy to say that it works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 01, 2021, 05:39:16 pm
Insert asm("nop"); in the loop and it won't be optimized
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 02, 2021, 09:35:41 am
The findings of the person who did the bashing of the FNIRSI-1013D did not even scratch the surface of what is wrong with it. (https://www.beis.de/Elektronik/FNIRSI-1013D/FNIRSI-1013D_en.html (https://www.beis.de/Elektronik/FNIRSI-1013D/FNIRSI-1013D_en.html))

Going through the software to be able to reverse it showed me that in single trigger mode the time base can't go up above 10ms/div. For normal mode it won't go up above 50ms/div. :palm:

For getting a grasp on how they do the moving of the lines on the screen I connected channel 1 to the calibration output. Probe setting on x1 with the actual probe on x10 shows 3,17Vpp. Switching the setting to x10 raises the measured voltage to 31,7Vpp, even after a new auto set. Switching the setting to x100 shows 317Vpp.

Should have been 3,17Vpp for the probe on x10 setting since the actual probe is set as such |O (Assuming the voltage is actually 3.17Vpp)

Then I took pictures of it with the save pic button. See below for what it made of it when transferred to my computer. :-DD
On the scope itself they look ok.

Edit: Turns out the probe is crap. Tried the other one and that works as expected. But still the image stuff >:(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 02, 2021, 01:26:10 pm
You could use the display front-end engine (Called DEBE in the datasheet) to merge different layers and tiles.
So you could copy the BMP as a tile and config the engine with an offset, timing the offset increase to provide a smooth effect.
You'll avoid copying the memory using CPU power.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 02, 2021, 01:50:55 pm
Hi David,

I did notice that DEFE (front end) device but since there is little documentation about it didn't consider using it yet. Certainly an option for later improvements where the scope signal stay's alive in the background whilst changing a setting. If that is possible of course.

Getting the scope up and running as is, is already a lot of work. Not yet time for big improvements :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 03, 2021, 02:00:22 pm
It looks like the scope has some self destruct code in it :-DD

Not sure under what conditions it would be called upon but reading the code shows it would clear the first 1000 bytes of the program in the flash :palm:

Code: [Select]
                             LAB_8000a4f8                                    XREF[1]:     8000a4a0(j) 
        8000a4f8 48 00 9f e5     ldr        r0,[DAT_8000a548]                                = 80360BA8h
        8000a4fc fa 1f a0 e3     mov        r1,#0x3e8
        8000a500 dc d8 ff eb     bl         memclear                                         void memclear(uint address, uint
        8000a504 3c 10 9f e5     ldr        r1,[DAT_8000a548]                                = 80360BA8h
        8000a508 fa 2f a0 e3     mov        r2,#0x3e8
        8000a50c 27 0a a0 e3     mov        r0,#0x27000                                      Start address of program in flash
        8000a510 24 6b 00 eb     bl         write_to_flash                                   void write_to_flash(uint address
        8000a514 16 77 00 eb     bl         sys_init_watchdog                                void sys_init_watchdog(void)
        8000a518 a3 df 8d e2     add        sp,sp,#0x28c
        8000a51c f0 01 bd e8     ldmia      sp!,{r4 r5 r6 r7 r8}=>local_24
        8000a520 00 8e bd e8     ldmia      sp!,{r9 r10 r11 pc}

This is in a function that is called from the initialization part in the main function. FUN_8000a024.

Guess I will skip this one.

Implemented already most of the functions that interact with the FPGA. The input sensitivity can be adjusted. I can hear the relay's click :)
For some of the functions I still need to know more about the variables being used, so further investigation of the code is needed 8)

This means the reversal of the function that displays the trace data. I'm afraid it will take some time before there is something new to show. :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on August 03, 2021, 02:21:06 pm
Guess I will skip this one.

Don't agree.  You promised a full reversal! :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 03, 2021, 02:24:03 pm
Guess I will skip this one.

Don't agree.  You promised a full reversal! :-DD

Well then I already failed since I skipped the whole display library and wrote my own :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 03, 2021, 09:50:23 pm
Probably for bootloader updating  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 05, 2021, 12:01:46 pm
Sooner then expected an update :)

Found the functions for drawing the grid, pointers and cursors so implemented an interpretation of them in my code.

Also found more meaning on several of the FPGA commands. Still a lot of code to investigate, but hope to get trace data out soon. The rest is icing on the cake ;D

Will probably make changes to the displaying of the measurements, because I don't like the way they did it. Depending on how you make the settings the items for the channels become interleaved. My idea is to have channel 1 items on the left and channel 2 items on the right, and probably also in a fixed order.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 07, 2021, 07:23:10 pm
Going through the data capture code makes me wonder how it can even work just a little bit :palm:

For the longer time base settings, 100mS/div and up, it reads ten bytes from the fpga at a somewhat regular interval. It sums the bytes together and divides it by ten, so an average sample for maybe every x position on the screen. (Did not reach that part of the code yet) This explains the under sampling behavior that can be seen. Connect the probe to the 1KHz output and see what happens on these longer time bases. :-DD

For the shorter time base settings they read more bytes and for the two lowest settings (25 and 10nS/div) they read a second set of data, but for the first channel they write the second set over the first one. :o

Also the parameter ic connected to the fpga, on init they use it to read the time base setting that needs to be written to the fpga. Later on in the code they use a switch statement to get the value. The same goes for an adjustment parameter they use. In the long time base handling they use more or less fixed values from the code (setup on init). In the short time base handling they call the parameter ic with id 0x0B and get the exact same values. |O

I'm afraid a new programming of the fpga is needed to make it a proper scope. I have worked with fpga's before, but that is a long time ago and used schematic entry (Orcad) to design the hardware and DOS based XACT to convert it to a bitstream for a XC3042 :)

So more learning to do before that can happen. :(

Also still a lot to learn about the F1C100s, to make it all work better.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 08, 2021, 11:18:15 am
Found another whopper :-DD

The scope handles data different for time base setting 100mS/div and up, and here they forgot to adjust the signal magnitude when the sensitivity is changed from 50mV/div to 100mV/div (probe 1x), because yes for the shorter time base settings the data is multiplied by two in software.

So when you are looking at some dc signal on say 100mS/div the trace stays on the same height when the sensitivity is on the lowest or one but lowest setting :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on August 09, 2021, 11:14:29 am
When I was on approximately 20th page of this thread I got so excited that I ordered one on ebay.
Now that I got to the page 38 I'm not sure anymore that this was wise decision. :P
I just hope that you (and community) will be able to fix many hidden shortcomings of this scope. Today I have received it and It's an older model with protruding BNCs but it seems really nice. ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 09, 2021, 12:08:03 pm
When I was on approximately 20th page of this thread I got so excited that I ordered one on ebay.
Now that I got to the page 38 I'm not sure anymore that this was wise decision. :P
I just hope that you (and community) will be able to fix many hidden shortcomings of this scope. Today I have received it and It's an older model with protruding BNCs but it seems really nice. ;)

For simple measurements it is fine, but indeed it has many flaws |O

Fixing it will take its time. At the moment I'm plowing through the part that does the up sampling. Yes indeed another short coming of the design. For the 250nS/div down to 50nS/div (haven't reached the 25nS/div and 10nS/div code yet) they do up sampling.

The FPGA time base stay's the same from 500nS/div down, and for 250nS/div they insert an average sample in between every sample, so doubling the number of samples.
For the 100nS/div they insert 4 samples with a 1/5th delta step. For the 50nS/div it is 9 samples with a 1/10th delta step.

It is a hard job to decipher the Chinese logic with a Ghidra sauce :-//

Code: [Select]
//------------------------------------------------------------------------------------------------------------------------------------------------

void scope_pre_process_50ns_data(uint16 *buffer,uint offset,uint count)
{
  uint uVar1;
  ushort uVar2;
  longlong lVar3;
  longlong lVar4;
  int iVar5;
  ushort *puVar6;
  uint16 *puVar7;
  undefined2 *puVar8;
  uint uVar9;
  uint16 *puVar10;
  ushort *puVar11;
  undefined2 *puVar12;
  int iVar13;
  int iVar14;
  uint uVar15;
  ushort uVar16;
  uint uVar17;
  short sVar18;
  short *psVar19;
 
  uVar9 = count * DAT_8001360c;  //0x0000CCCD
  uVar15 = uVar9 >> 0x13;        // count / 10

  if (uVar15 != 0)
  {
    puVar7 = (uint16 *)((int)buffer + offset * 2);
    puVar8 = DAT_80013610;                                //0x801AEF16  ten samples before
    puVar10 = (uint16 *)((int)puVar7 + -2);

    if ((uVar15 & 1) != 0)
    {
      puVar8 = DAT_80013610 + 10;
      *puVar8 = *(undefined2 *)puVar7;
      puVar10 = puVar7;
    }

    uVar17 = (uVar15 << 0xf) >> 0x10;

    while (uVar17 != 0)
    {
      puVar8[10] = *(undefined2 *)((int)puVar10 + 2);
      puVar10 = (uint16 *)((int)puVar10 + 4);
      uVar17 = uVar17 - 1 & 0xffff;
      puVar8 = puVar8 + 0x14;
      *puVar8 = *(undefined2 *)puVar10;
    }
  }

  iVar5 = DAT_80013614;   //0x66666667
  uVar17 = 0;

  if (0 < (int)(uVar15 - 1))
  {
    do
    {
      puVar11 = (ushort *)(DAT_80013618 + uVar17 * 0x14);  //801AEF2A  start of buffer
      uVar2 = *puVar11;        //sample 1
      uVar16 = puVar11[10];    //sample 2

      if (uVar2 < uVar16)
      {
        uVar1 = (uint)(ushort)(uVar16 - uVar2);   //Positive delta
        iVar13 = 1;
        sVar18 = 4;
        puVar11 = puVar11 + 1;  //sample 2

        //one tenth step????
        *puVar11 = ((short)(int)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x22) - (short)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x3f)) + uVar2;

        do
        {
          lVar3 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar13 + 2));  //3 tenths
          lVar4 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar13 + 1));  //2 tenths
          sVar18 = sVar18 + -1;
          puVar11[1] = ((short)(int)(lVar4 >> 0x22) - (short)(lVar4 >> 0x3f)) + uVar2;
          iVar13 = iVar13 + 2;
          puVar11 = puVar11 + 2;
          *puVar11 = ((short)(int)(lVar3 >> 0x22) - (short)(lVar3 >> 0x3f)) + uVar2;
        } while (sVar18 != 0);
      }
      else
      {
        uVar1 = (uint)(ushort)(uVar2 - uVar16);
        iVar13 = 1;
        sVar18 = 4;
        puVar11 = puVar11 + 1;
        *puVar11 = uVar2 - ((short)(int)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x22) - (short)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x3f));

        do
        {
          lVar3 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar13 + 2));
          lVar4 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar13 + 1));
          sVar18 = sVar18 + -1;
          puVar11[1] = uVar2 - ((short)(int)(lVar4 >> 0x22) - (short)(lVar4 >> 0x3f));
          iVar13 = iVar13 + 2;
          puVar11 = puVar11 + 2;
          *puVar11 = uVar2 - ((short)(int)(lVar3 >> 0x22) - (short)(lVar3 >> 0x3f));
        } while (sVar18 != 0);
      }

      uVar17 = uVar17 + 1 & 0xfffeffff;
    } while ((int)uVar17 < (int)(uVar15 - 1));
  }

  uVar17 = uVar15 - 1;

  if (0 < (int)uVar17)
  {
    puVar8 = DAT_80013620;     //0x801B8B60
    puVar12 = DAT_8001361c;    //0x801AEF20

    if ((uVar17 & 1) != 0)
    {
      puVar12 = DAT_8001361c + 10;
      puVar8 = DAT_80013620 + 10;
      *puVar8 = *puVar12;
    }

    uVar17 = uVar17 * 0x8000 >> 0x10;  // /2

    while (uVar17 != 0)
    {
      puVar8[10] = puVar12[10];
      puVar12 = puVar12 + 0x14;
      uVar17 = uVar17 - 1 & 0xffff;
      puVar8 = puVar8 + 0x14;
      *puVar8 = *puVar12;
    }
  }

  uVar17 = 0;

  if (0 < (int)(uVar15 - 2))
  {
    do
    {
      iVar13 = DAT_80013624 + uVar17 * 0x14;
      uVar2 = *(ushort *)(iVar13 + 10);
      uVar16 = *(ushort *)(iVar13 + 0x1e);

      if (uVar2 < uVar16)
      {
        uVar1 = (uint)(ushort)(uVar16 - uVar2);
        iVar14 = 1;
        sVar18 = 4;
        psVar19 = (short *)(iVar13 + 0xc);
        *psVar19 = ((short)(int)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x22) - (short)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x3f)) + uVar2;

        do
        {
          lVar3 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar14 + 1));
          lVar4 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar14 + 2));
          sVar18 = sVar18 + -1;
          psVar19[1] = ((short)(int)(lVar3 >> 0x22) - (short)(lVar3 >> 0x3f)) + uVar2;
          iVar14 = iVar14 + 2;
          psVar19 = psVar19 + 2;
          *psVar19 = ((short)(int)(lVar4 >> 0x22) - (short)(lVar4 >> 0x3f)) + uVar2;
        } while (sVar18 != 0);
      }
      else
      {
        uVar1 = (uint)(ushort)(uVar2 - uVar16);
        iVar14 = 1;
        sVar18 = 4;
        psVar19 = (short *)(iVar13 + 0xc);
        *psVar19 = uVar2 - ((short)(int)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x22) - (short)((longlong)iVar5 * (longlong)(int)uVar1 >> 0x3f));

        do
        {
          lVar3 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar14 + 1));
          lVar4 = (longlong)iVar5 * (longlong)(int)(uVar1 * (iVar14 + 2));
          sVar18 = sVar18 + -1;
          psVar19[1] = uVar2 - ((short)(int)(lVar3 >> 0x22) - (short)(lVar3 >> 0x3f));
          iVar14 = iVar14 + 2;
          psVar19 = psVar19 + 2;
          *psVar19 = uVar2 - ((short)(int)(lVar4 >> 0x22) - (short)(lVar4 >> 0x3f));
        } while (sVar18 != 0);
      }

      uVar17 = uVar17 + 1 & 0xfffeffff;
    } while ((int)uVar17 < (int)(uVar15 - 2));
  }

  uVar15 = count >> 1;

  if (count != 0)
  {
    uVar17 = uVar15;
    puVar10 = (uint16 *)((int)buffer + -2);
    puVar11 = DAT_80013628;
    puVar6 = DAT_8001362c;

    if ((count & 1) != 0)
    {
      puVar11 = DAT_80013628 + 1;
      puVar6 = DAT_8001362c + 1;
      *(short *)buffer = (short)((uint)*puVar11 + (uint)*puVar6 >> 1);
      puVar10 = buffer;
    }

    while (uVar17 != 0)
    {
      *(short *)((int)puVar10 + 2) = (short)((uint)puVar11[1] + (uint)puVar6[1] >> 1);
      *(short *)(uint16 *)((int)puVar10 + 4) = (short)((uint)puVar11[2] + (uint)puVar6[2] >> 1);
      uVar17 = uVar17 - 1;
      puVar10 = (uint16 *)((int)puVar10 + 4);
      puVar11 = puVar11 + 2;
      puVar6 = puVar6 + 2;
    }
  }

  uVar9 = uVar9 >> 0x12;
  uVar17 = uVar9 - 1;

  if (0 < (int)uVar17)
  {
    puVar12 = (undefined2 *)((int)buffer + -6);
    puVar8 = DAT_80013630;

    if ((uVar17 & 1) != 0)
    {
      puVar12 = (undefined2 *)((int)buffer + 4);
      puVar8 = DAT_80013630 + 5;
      *puVar8 = *puVar12;
    }

    uVar17 = uVar17 * 0x8000 >> 0x10;

    while (uVar17 != 0)
    {
      puVar8[5] = puVar12[5];
      puVar12 = puVar12 + 10;
      uVar17 = uVar17 - 1 & 0xffff;
      puVar8 = puVar8 + 10;
      *puVar8 = *puVar12;
    }
  }

  uVar17 = DAT_80013638;
  uVar9 = uVar9 - 2;

  if (0 < (int)uVar9)
  {
    uVar9 = uVar9 & 0xffff;
    puVar11 = DAT_80013634;

    do
    {
      uVar2 = *puVar11;
      uVar16 = puVar11[5];

      if (uVar2 < uVar16)
      {
        uVar16 = uVar16 - uVar2;
        puVar11[1] = uVar2 + (ushort)((uint)uVar16 * DAT_8001360c >> 0x12);
        puVar11[2] = (short)(uint)((ulonglong)uVar16 * 2 * (ulonglong)uVar17 >> 0x22) + uVar2;
        sVar18 = (short)(uint)((ulonglong)uVar16 * 4 * (ulonglong)uVar17 >> 0x22);
        puVar11[3] = (short)(uint)((ulonglong)((uint)uVar16 * 3) * (ulonglong)uVar17 >> 0x22) + uVar2;
      }
      else
      {
        uVar16 = uVar2 - uVar16;
        puVar11[1] = uVar2 - (ushort)((uint)uVar16 * DAT_8001360c >> 0x12);
        puVar11[2] = uVar2 - (short)(uint)((ulonglong)uVar16 * 2 * (ulonglong)uVar17 >> 0x22);
        sVar18 = -(short)(uint)((ulonglong)uVar16 * 4 * (ulonglong)uVar17 >> 0x22);
        puVar11[3] = uVar2 - (short)(uint)((ulonglong)((uint)uVar16 * 3) * (ulonglong)uVar17 >> 0x22
                                          );
      }

      puVar11[4] = uVar2 + sVar18;
      uVar9 = uVar9 - 1 & 0xffff;
      puVar11 = puVar11 + 5;
    } while (uVar9 != 0);
  }

  if (count != 0)
  {
    puVar10 = (uint16 *)((int)buffer + -2);
    puVar11 = DAT_8001362c;

    if ((count & 1) != 0)
    {
      puVar11 = DAT_8001362c + 1;
      *(short *)buffer = (short)((uint)*(ushort *)buffer + (uint)*puVar11 >> 1);
      puVar10 = buffer;
    }

    if (uVar15 != 0)
    {
      do
      {
        puVar6 = (ushort *)((int)puVar10 + 2);
        uVar15 = uVar15 - 1;
        puVar10 = (uint16 *)((int)puVar10 + 4);
        *puVar6 = (ushort)((uint)*puVar6 + (uint)puVar11[1] >> 1);
        puVar11 = puVar11 + 2;
        *(ushort *)puVar10 = (ushort)((uint)*puVar11 + (uint)*(ushort *)puVar10 >> 1);
      } while (uVar15 != 0);

      return;
    }

    return;
  }

  return;
}

//------------------------------------------------------------------------------------------------------------------------------------------------


This is the code for the 50nS/div up sampling I'm working on at the moment. More is done in this code then for the 250nS/div or 100nS/div, so a bit of mystery to solve.

The other two functions can still be improved upon by handling the data from the end instead of the beginning. They use three separate actions, one for making an interleaved copy of the samples, a second one to fill in the averages or steps and a third one to copy it back to the original buffer. Can all be done in one loop, but that is improvement for later.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 09, 2021, 06:08:31 pm
It is a mystery to me. I'm no expert on DSP and have no idea why it is done the way it is done. It is about the code in the previous post. There are errors in it, concerning the pointers usage, which I checked with trace output of my emulator.

But here is what I make of it in descriptive talk :)


Hope this makes any sense. My layman instinct tells me that it does not help on the signal and they could have done with what is done for the other two ranges. Just up sample with interpolation. (What I read about up sampling is insert zero's and run the samples through a filter to fill in the blanks, which might lead to the same result depending on the filter)

It might be that the errors are needed for special alignment of the sample ranges, but it still corrupts the first samples.

So anyone any thoughts on this :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 10, 2021, 11:44:04 am
I must say I'm a bit disappointed about the lack of feedback. I really hoped on some input about the up sampling issue  :(

But that aside, a fan of my work kindly donated a FNIRSI-1014D and it arrived today. Played with it a little and it is nice, but certainly not wow. They display things a bit nicer with some color shading.

Noticed some changes to the 1013D:

Have not opened it up yet, but think it uses the same front end as the 1013D. The sensitivity adjustment is the same. Relays clicking for the top 5 settings, but not for the lowest setting. My guess is they recycled the FPGA, sampling and trace display code form the 1013D. It at least behaves the same on change of time base setting.

Another project to play with once finished with the 1013D 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 10, 2021, 11:54:28 am
Yup, basically you're alone most of the time.
I also discovered that, I was expecting a more involved community but...  nope!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on August 10, 2021, 12:35:19 pm
I will will be more than happy to test any alpha/beta versions of firmware when you get so far.
But I do not know enough about scopes or low level programming to help you out during development...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 10, 2021, 07:57:42 pm
One small step forward, but far from finished and needs some checking of what is going on because it is not what it should be |O :-DD

Trace data displaying for the long time base settings (100mS/div and up) is implemented. Was quite the struggle to grasp the meaning of a part of the code. It turns out to be some signal rise speed detection.

Code: [Select]
void display_channel1_long_timebase_trace(void)
{
  undefined2 *puVar1;
  undefined *puVar2;
  int iVar3;
  uint uVar4;
  uint ystart;
  uint uVar5;
  uint yend;
  bool bVar6;
  bool bVar7;
 
  set_display_fg_color(DAT_80006890);
  puVar2 = PTR_DAT_80006894;
  uVar4 = (uint)*(ushort *)PTR_DAT_80006894;
  if (uVar4 == 0)
  {
    puVar1 = (undefined2 *)(PTR_DAT_80006894 + 0x16);

    *(undefined2 *)(PTR_DAT_80006894 + 2) = *puVar1;
    *(undefined2 *)(puVar2 + 6) = *puVar1;
  }

  yend = (uint)*(ushort *)(puVar2 + 0x16);
  ystart = (uint)*(ushort *)(puVar2 + 2);

  uVar5 = yend + 0xf;
  bVar7 = ystart <= uVar5;
  bVar6 = uVar5 == ystart;

  if (bVar7 && !bVar6)
  {
    uVar5 = ystart + 0xf;
  }

  if (bVar7 && !bVar6)
  {
    bVar7 = yend <= uVar5;
    bVar6 = uVar5 == yend;
  }

  if (!bVar7 || bVar6)
  {
    uVar5 = ystart + 0x14;
    bVar7 = uVar5 <= yend;
    bVar6 = yend == uVar5;

    if (!bVar7 || bVar6)
    {
      uVar5 = yend + 0x14;
    }

    if (!bVar7 || bVar6)
    {
      bVar7 = uVar5 <= ystart;
      bVar6 = ystart == uVar5;
    }

    if (bVar7 && !bVar6)
    {
      display_draw_line(uVar4 + 3,ystart,uVar4 + 3,yend);
      display_draw_line(*(ushort *)puVar2 + 3,*(ushort *)(puVar2 + 2) + 1,*(ushort *)puVar2 + 3,*(ushort *)(puVar2 + 0x16) + 1);
      goto LAB_80006828;
    }
  }
  else
  {
    yend = yend + ystart >> 1;
    *(short *)(puVar2 + 0x16) = (short)yend;
  }

  display_draw_line(uVar4 + 3,ystart,uVar4 + 4,yend);
  display_draw_line(*(ushort *)puVar2 + 3,*(ushort *)(puVar2 + 2) + 1,*(ushort *)puVar2 + 4,*(ushort *)(puVar2 + 0x16) + 1);

LAB_80006828:
  iVar3 = DAT_80006898;
  *(undefined2 *)(puVar2 + 6) = *(undefined2 *)(puVar2 + 2);
  *(undefined2 *)(puVar2 + 2) = *(undefined2 *)(puVar2 + 0x16);
  *(undefined2 *)(iVar3 + (uint)*(ushort *)puVar2 * 2) = *(undefined2 *)(puVar2 + 0x16);
  return;
}

At first I had to identify the functions called as being display_draw_line. Then it took a while to notice that the first two calls use the same x point. One reads what one wants to read :palm:
Also the bit with all the compares if one of the points plus 15 is less then the other and then the points plus 20, so I made test code of it and ran it through with a debugger.

Turns out that on the absolute difference a check is done to see if the delta is less then 15. If so take the average between the two points, if less then or equal to 20 use the points and draw them on consecutive x positions. Is it more then 20 draw the points on a single x position.

This is what I made of it.
Code: [Select]
        //Check on rise speed of the signal
        if(disp_ch1_y < disp_ch1_prev_y)
        {
          //previous bigger then current so subtract from it to get positive delta
          dy = disp_ch1_prev_y - disp_ch1_y;
        }
        else
        {
          //current bigger then previous so subtract from it to get positive delta
          dy = disp_ch1_y - disp_ch1_prev_y;
        }
       
        //Take action based on the delta
        if(dy < 15)
        {
          //Less then 15 apart slow the trace by stopping on the average of the two points
          disp_ch1_y = (disp_ch1_y + disp_ch1_prev_y) >> 1;
        }
        else if(dy > 20)
        {
          //Else if delta bigger then 20 draw on a single x position
          xpos2--;
        }

        //Draw the lines. When on a single x point it is a bit inefficient. Would be better to only draw one line and make it one longer for the double width
        display_draw_line(xpos1, disp_ch1_prev_y, xpos2, disp_ch1_y);
        display_draw_line(xpos1, disp_ch1_prev_y + 1, xpos2, disp_ch1_y + 1);

And the photo shows what the scope makes of it  :o
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 11, 2021, 09:02:08 am
Found the bug causing the drawing problem. Was in the draw line code. A what needed to be a singed result wasn't :o

Managed to get the emulator to display signals on the long time base settings and was able to find the problem that way :)

The images show the before and after the fix.

On the scope itself it does not work yet. Has to do with the writing of the trace offsets to the FPGA. At the moment the FPGA thinks both traces are placed at the top of the screen, and returns max values, meaning signal at the top of the screen. Only on large enough input signals it flips down.

So that is next on the to do list.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 11, 2021, 04:21:36 pm
Was a bit of a struggle with some fractional calculations and the need of 64 bit type casting, but the trace offset now works.

It is showing some sine waves, but there still is a problem with time. For the 100mS/div setting it is on it moves to slow, and the displayed waves are not correct. On channel one the input is 1Hz and on channel two it is 0.5Hz. Need to do some calculations and checking on the timer interrupt to find the root of this problem.

Next up is implement the changing of the time base setting, and the movement of the traces. Is part of the user interface I skipped because missing information that I gained now by implementing the long time base part of the trace handling.

It is one big puzzle with still many, many pieces to fit :(

Getting this bit to work was a booster of the spirits :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on August 12, 2021, 01:44:16 am
I must say I'm a bit disappointed about the lack of feedback. I really hoped on some input about the up sampling issue  :(


I missed the up sampling question. Would you mind repeating it or sending me a PM?

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2021, 05:45:32 pm
Found another blooper :-DD

For the long time base settings the max is 50S/div and the one below that, says on the display it is 20S/div, but the code and a stopwatch tell me it is actually 25S/div.

The problem I mentioned in my previous post was an oversight of me. Missed a goto in the Ghidra output that skipped over a 40mS delay call. Due to that delay it was not running on 100mS/div but 1,1S/div ???

Fixed it and it is running as needed now.

Working on the changing of the time base setting and hope to get that done soon.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on August 12, 2021, 06:00:54 pm
I'm feeding a 100 ns pulse at 1 MHz to CH1.  I have a 50 ohm terminator on CH2 and am using a 50 ohm thru on CH1.  Both traces look fine at 50 ns/div, but if I change to a faster or slower speed, there are bursts of a sine wave which appear on CH2.  But only at 5 V/div!

There is also a 100 mV jump on the dead CH2 trace at 200 mV/div at anything faster than 1 us/div.

I've spent about an hour studying the code from msg #950 and so far can't make any sense of it. It doesn't look like any DSP algorithm I can think of.  I'm going to try to compile and run it with some sample data to see if that helps me understand it.

Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2021, 06:09:39 pm
That is what I meant with the Chinese logic :-DD

Had a similar idea but needed a bit of success to stay on the project, so moved on to the long time base stuff, which is basically very slow sampling.

For the 100mS/div setting it means 10 samples per 4mS, where I have no idea on when and how fast the samples are taken. The code averages these 10 samples and shows them on the screen, spread over two pixels in time. So 50 pixels per division filled with 25 averaged  samples. For each setting above it just lengthens the sample loop, so 8mS for the next setting, 20mS for the one after that and so on to 2S for the 50S/div setting.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on August 12, 2021, 10:19:19 pm
Averaging over 10 samples applies a sin(x)/x filter in the frequency domain which has significant sidelobes.  A triangle weighting would make it sinc**2 which has much lower sidelobes above the first zero.  Essentially the average is a cheap and mediocre anti-alias filter.  If the samples had been bit shifted to apply a taper it would have been almost as cheap computationally.

Sadly, there are far too many DSOs which don't implement *any* anti-alias filtering when operating at display sample rates below the acquisition rate.  And people who claim this is good :-(

In my putzing with this I have come to the conclusion that the HW is *much* better than the SW.  With better software I think it would be very usable for HF radio work and low clock rate MCUs.  It's also a great test bed for developing DSO touchscreen UIs.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 13, 2021, 05:05:13 am
In my putzing with this I have come to the conclusion that the HW is *much* better than the SW.  With better software I think it would be very usable for HF radio work and low clock rate MCUs.  It's also a great test bed for developing DSO touchscreen UIs.

I don't now a lot about dsp, so will take your word for it about the "filtering".

But I agree with you about the hardware being better than the software. Also a big plus is the fact that the hardware is programmable. The question there is how much logic can be stowed away in it, and how fast can the bus between the MCU and the FPGA transfer data.

I like to see the work I'm doing as a stepping stone to something better. As written before, the code is by far no exact match to the original and I think it is already an improvement.

For instance the adjusting of the time base is made overly complex in the original code. When in stop mode they use a fractional computation followed by if's and switches to see if the new setting is within a plus or minus 3 step of the last active sampling rate. Had to go through the settings on the scope to find this logic behind it :-//

Also the original setup of the touch handling code is very unstructured. The way I did it can still be improved, but is already much cleaner than the original.

Again a step closer to the finish line, but still a long list to handle :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on August 13, 2021, 03:32:30 pm
I've been studying the code in msg #950 more and realized I need to know the hardware details, byte sex, ISA, memory map, etc.

Where can I find that info?

Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 13, 2021, 03:37:47 pm
Download the f1c100/200s datasheet. You can find it anywhere, also in my Drive folder.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 13, 2021, 03:52:48 pm
I've been studying the code in msg #950 more and realized I need to know the hardware details, byte sex, ISA, memory map, etc.

Where can I find that info?

Reg

Better yet everything you need is in the repository https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack)

You can find the reversed engineered schematics, the Ghidra archives, my reverse engineering work files, a bunch of test code, datasheets, etc.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 13, 2021, 07:02:55 pm
Implemented the changing of the time base setting. This works without problems down to 100nS/div. The switch to 50nS/div kills it, but this most likely has to do with the fact that the 50nS signal processing is only partially implemented :-DD

Worked through the code for moving the traces and the cursors and made my own spin of it. Implemented the trigger point position and the signal trace moving. Can not test the first since it needs the short time base trace display functionality :(

The signal traces can be moved, but the display flickers like crazy when that is done, so need to fix that with drawing in a separate buffer and then copy to the main display buffer to make it smoother.

Plan on making another, in my eyes, improvement. When in x-y mode display the signal center pointers are both on the left side, and can be moved with x and y movement on the display. X for channel 1 and Y for channel 2. My plan is to move the channel 1 pointer to the top to make it an actual X pointer. A fairly simple change.

But it is more and more starting to look and act like a scope :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rhb on August 13, 2021, 09:08:36 pm
The trace area is about 722 pixels wide so at 500 ns/div, every pixel is a sample.  The code properly interpolates 2:1 and 5:1, but fails at 10:1 or greater.

The proper trace interpolation operator is a minimum phase sin(x)/x function.  In seismic processing an 8 pt operator is normally used for plotting.  This puts the error at <0.1%.  For each of the output points you need  a table of coefficients which are then applied for each distinct offset in time from the samples.  Each output time slot has its own table.  The cost of a pixel is 8 multiply-add operations.  At 10 ns/div it's 5664 MACs for a full trace.

I had many conversations with @tom66 about this for his project.  I've also got plots and code somewhere.

BTW Much of the logic in the 50ns code is adding a sample to make the length even.

Now that I know what it does I can write it from scratch.  We need to figure out where it reads and writes.  Nothing else matters as I know the correct math.

Ideally it should store samples as read in an XY buffer of unsigned char as fast as the data can be transferred by the FPGA.  Each time a sample maps to a bin in the XY map, increment the unsigned char, and on every trace renormalize the buffer.  At 30 fps, perform the interpolation of that buffer to generate the screen.  This provides persistence and allows making color histogram displays of the signal variation.  I do not know of a single DSO that does this correctly.  That includes $20K list kit.

Aside from transferring data from the ADC, the FPGA is critical for trigger filtering and logic.  The display stuff can all be done quickly enough on the ARM.  However, it all depends on what resources are available.  Does the 1013D have any DDR?  I didn't see any in the schematics. The XY histogram buffer needs at least 256 kB.

Have Fun!
Reg
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 04:56:33 am
Hi Reg, this is useful information :-+

The only RAM in the system is the 32MB DDR plus some 72KB of SRAM that is in the F1C100s and the 270Kb in the FPGA. For the latter the question is how much can actually be used without the loss of functionality.

The system is performance limited by the DDR in the F1C100s though. Not sure about the bus width, but the clock is a factor 4 to 5 lower than the CPU clock. It has caches but these are not that big. The DDR is shared memory between the CPU and the LCD, so also a limiting factor

So overall nice but not great.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 14, 2021, 12:53:20 pm
Data width is only 16 bit... RAM clock is not linked to the cpu in any way, each one has it's own PLL.
Default is 156 MHZ (312MHz DDR effective rate), cpu clock 408MHz.
Usually you can get close to 700MHz without issues. The DDR limit is around 192MHz.
I thought the fnirsi had a F1c200s? Same thing with 64MB.
Doesn't the DDR also store the CPU program? (The linux kernel does that) Or does it fetch the cache from the spi flash directly?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 01:43:57 pm
Unfortunately it just has a F1C100s, so just the 32MB, and indeed it loads the program into the DDR, but the program is not that big, and my version will be even smaller.

About the clocks I know they have separate PLL's. I was stating that the clock frequency of the DDR is a factor 4 to 5 lower than the CPU clock, which on the max workable settings improves to about 3.7. With the double data rate in account one can say it is even less, but with only a bus width of 16 bits it basically half's again :(

Where did you get the information about the bus width? I tried to find info on the DRAM controller settings, but failed. Used source code from the sunxi factory for it but it does not provide a lot of insight in the working of it all.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 02:02:07 pm
Finished with the implementation of the moving of the traces, cursors and pointers.

Also made the change I wrote about a few posts back. Need to tweak the offsets when drawing the x-y traces though. It also moves in an opposite direction of the x pointer, so need to fix that too.

I will add a new folder in the binaries section of the repository with a compiled version of the code so far, plus the binary of the boot loader and instructions on how to get the scope up and running with it.

For the time base settings 50mS/div - 10nS/div it only displays the grid, pointers and cursors, which was needed to test the moving of them.

Getting the trace display for these time base settings working is the next step.

https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Binaries (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Binaries)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on August 14, 2021, 02:21:42 pm
A poll:
How many of the readers of this post want me to move the hacking updates to another thread?

If you do that then what would be left in this thread?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 02:26:07 pm
A poll:
How many of the readers of this post want me to move the hacking updates to another thread?

If you do that then what would be left in this thread?

Whow, you dug deep to get that one up :-DD

I guess nothing 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 14, 2021, 03:37:22 pm
Where did you get the information about the bus width? I tried to find info on the DRAM controller settings, but failed. Used source code from the sunxi factory for it but it does not provide a lot of insight in the working of it all.

Not sure actually. I think I saw that in a chinese forum.
Anyways, I made some benchmarks, stopping the TCON, so it doesn't used bandwidth.
CPU set to to 768MHz to reduce possible bottlenecks.

8GB memory copy:
dd if=/dev/zero of=/dev/null bs=1M count=8192

312MHz: 29.91s, 273.88MB/s
408MHz: 23.15s, 353.86MB/s
The performance increase is linear, so clearly the bottleneck here is the ram itself.
Being memory copy (read+write), the bandwidth would be 2x those numbers: 548 and 707MB/s

At 312MHz and 16bit bus, the theorical speed would be 624MB/s.
At 408MHz, 816MB/s.
The actual speeds are pretty close! Both benchmarks use 86-88%, with the performance drop caused by the timing signals overhead.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 04:01:54 pm
312MHz: 29.91s, 273.88MB/s
408MHz: 23.15s, 353.86MB/s
The performance increase is linear, so clearly the bottleneck here is the ram itself.
Being memory copy (read+write), the bandwidth would be 2x those numbers: 548 and 707MB/s

You mean CPU I guess. If the RAM is a bottleneck it would top of at some CPU speed.

No expert on Linux but does it actually read and write RAM when these devices are used?

The 16bit bus connecting to the RAM can run on yet another clock speed. AHB and APB bus have their own clocks. The documentation is not clear on where the DRAM is connected, but the DRAMC (controller) is connected to the AHB bus. So if it runs through that it has yet another bottleneck.

Very complex these ARM architectures. Nothing like a simple 6502 system with some ROM and RAM :)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 14, 2021, 04:16:00 pm
Nope, the ram. 312/408MHz was the DDR speed!
The tests were performed with the CPU running at 768MHz.
If at the same CPU speed, increasing the ram speed by 30% also increases throughput by 30%, the cpu isn't bottlenecking.
Otherwise it would't get much better with the extra speed.
AHB runs at 600MHz if I remember correctly.
These things can be seen in the CCU section of the user manual. All the PLLs are listed there with the default values.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 14, 2021, 04:33:30 pm
Right, that was not clear to me in your previous post that the 312MHz and 408MHz where RAM speeds. These numbers are much higher then the max you gave earlier for save performance.

In the scope code I'm working on the AHB and ABP buses are tuned down to 300MHz and 150MHz.

There is a lot I have to experiment with when done with the code reversal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 14, 2021, 04:37:31 pm
Because I'm talking about DDR speeds, not the ram speed. The ram was actually 156/204MHz.
To avoid more confusion, I put the real rates :D

I don't think you should slow down the bus where the DRAM is connected to. You're hurting the performance badly.
Anything else wanting to use at the same time will have to wait. At 600MHz bus and 312MHz ram, it's less likely to happen.
And if it happens, you know the ram will only use 50% at most.
The SRAM is also connected to the AHB. Not a good thing, you want it to be as fast as possible.

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1245554)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 15, 2021, 09:54:30 am
It is getting weirder :-//

When the calculated signal peak peak value is less then 20 or for the lowest volt per div setting 35 it is either overwritten with the average if there is a big enough dc component or the trace offset (center line). For the latter they increment or decrement it, once so many samples, depending on the value of a sample. This explains the small blips when no signal is connected to the scope :-DD

Took me a bit of time to figure this out. The code, also with what Ghidra made of it, is rather umpffff :palm:

Code: [Select]
void FUN_80006654(void)
{
  uint uVar1;
  uint uVar2;
  ushort *puVar3;
  uint uVar4;
  uint uVar5;
  ushort *unaff_r4;
  ushort *puVar6;
  int unaff_r5;
  int iVar7;
  ushort uVar8;
  uint uVar9;

  puVar6 = DAT_800067a0;                      //0x801AC04A   sample buffer
  uVar8 = *(ushort *)(DAT_80006798 + 0xec);   //0x801FA24C   channel 1 average

  uVar1 = (uint)uVar8;                        //again average

  uVar5 = 0;

  if (*(char *)(DAT_8000679c + 3) == '\x06')   //0x8019D5A0   channel 1 volt per div
  {
    uVar2 = 0x23;                              //Some minimum value???
  }
  else
  {
    uVar2 = 0x14;                              //Less when signal not doubled
  }

  uVar4 = DAT_800067a4;                        //0x000009C4     2500 number of samples

  if (*(byte *)(DAT_8000679c + 10) < 0x19)     //Time base less then 25 (50mS/div - 500nS/div)
  {
    uVar4 = DAT_800067a8;                      //000005DC       1500 number of samples
  }

  //Skip when signal is high enough
  if (uVar2 <= *(ushort *)(DAT_80006798 + 0xe8))      //signal peak peak
  {
    return;
  }

  //Channel screen offset
  // avg + minimum signal needed less then screen offset or screen offset plus minimum signal needed less then avg
  //Check if the center of the signal is outside the minimal signal band around the center line
  if ((uVar1 + uVar2 < (uint)*(ushort *)(DAT_8000679c + 6)) || (*(ushort *)(DAT_8000679c + 6) + uVar2 < uVar1))
  {
    //some dc component detection with small signal on it

    //Double compensation less then peakpeak
    if (uVar2 >> 1 < (uint)*(ushort *)(DAT_80006798 + 0xe8))  //This is nonsense. Only if signal peak peak is less then uVar2 it can get here!!
    {
      return;
    }

    if (uVar4 == 0)  //What the bullshit here. Is set to a fixed value in the above code!!!!
    {
      return;
    }

    //With full compiler optimisation it probably does not make a difference if the loop does only one sample at a time
    //Plus with the number of samples set above (1500 or 2500) it will always be even number

    puVar3 = DAT_800067a0 + -1;  //Point to 1 sample before buffer

    if ((uVar4 & 1) != 0)        //Odd number of samples to do
    {
      *DAT_800067a0 = uVar8;     //fill the buffer with avg value??
      puVar3 = puVar6;           //sample buffer
    }

    uVar4 = uVar4 >> 1;          //Half the count

    if (uVar4 == 0)              //How can it be zero when you set it to 2500 or 1500!!!!!!!!!
    {
      return;
    }

    do                            //Fill the buffer with average value
    {
      puVar3[1] = uVar8;
      uVar4 = uVar4 - 1;
      puVar3 = puVar3 + 2;
      *puVar3 = uVar8;
    } while (uVar4 != 0);

    return;
  }

  iVar7 = DAT_8000679c;           //Settings base 0x8019D5A0

  if (uVar4 == 0)                 //Again how can it be zero!!!!
  {
    puVar6 = unaff_r4;            //Some stack stuff restore for return. Ghidra nonsense
    iVar7 = unaff_r5;
  }

  uVar2 = 0;                     //Init

  if (uVar4 == 0)                //And again how can it be zero!!!!!!
  {
    return;
  }

  do
  {
    uVar9 = (uint)puVar6[uVar2];   //Sample buffer indexed, so get sample

    if (uVar1 <= uVar9 && uVar9 != uVar1)  //if average less or equal and it is not equal, so sample above average line or not
    {
      //above average line
      if (uVar5 < 0x15)   //starts on zero   so first samples are on offset
      {
LAB_80006738:
        uVar8 = *(ushort *)(iVar7 + 6);           //avg var is channel offset
      }
      else
      {
        uVar5 = 0;                                //Reset counter
        uVar8 = *(short *)(iVar7 + 6) + 1;        //avg var is offset + 1
      }
    }
    else
    {
      //below average line

      if (uVar1 <= uVar9)                         //Can only be equal since the other if takes the average less then samples
      {
        uVar8 = *(ushort *)(iVar7 + 6);              //avg var is channel offset
        uVar5 = uVar5 + 1 & 0xfffeffff;
      }
      else
      {
        if ((uVar5 < 0x15) || (uVar5 = 0, *(short *)(iVar7 + 6) == 0))  //The offset can't be zero since it is limitited between 7 and 395 but as safe guard checked on zero before subtract
          goto LAB_80006738;

        uVar8 = *(short *)(iVar7 + 6) - 1;
      }
    }

    puVar6[uVar2] = uVar8;                  //overwrite the sample
    uVar2 = uVar2 + 1 & 0xfffeffff;

    if (uVar4 <= uVar2)  //do all the samples
    {
      return;
    }

  } while( true );
}


I have implemented it in the new code, but might remove it once proved unnecessary.

Edit: Thinking about it, it looks like a squelch setup to suppress noise.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 16, 2021, 01:45:56 pm
It would be very interesting to see the actual code written by the developers and compare it to what Ghidra made of it.

For example is this bit compiler cleverness or written this way.

Ghidra output
Code: [Select]
if ((uint)((ulonglong)(uint)*(byte *)(iVar3 + 0xb) * (ulonglong)DAT_8001af94 >> 0x21) * -3 + (uint)*(byte *)(iVar3 + 0xb) == 0)
Translated to some variable name and used constant
Code: [Select]
if (((((ulonglong)backup * (ulonglong)0xAAAAAAAB) >> 0x21) * -3) + backup) == 0)
And my take on it
Code: [Select]
if((backup % 3) == 0)
Getting the short time base trace data capturing and handling reversed is quite the task. There are a lot of variables that still have no real meaning on what they are for and loads of code that do some processing on the data. Still progressing but it takes a lot of energy :(

Analyzing the output of Ghidra, searching what the value of a constant is, or which variable is pointed to. By now I know quite a bit of them by heart, but something like "*(char *)(iVar3 + 10)" is harder to read then "timeperdiv" or "*(char *)(iVar3 + 0x3a)" which is "runstate"

Guess it will take a couple of day's to get through this bit :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 16, 2021, 03:43:13 pm
Damn, that's almost ofuscated code!  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 16, 2021, 03:53:37 pm
Damn, that's almost ofuscated code!  :-DD

And that's throughout the whole code. So you can imagine the effort it takes to get things back to normal C code that works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 16, 2021, 05:33:42 pm
Found another error :-DD

When the scope is in stop mode it is possible to zoom in or out on the last sample buffer. They use the up sampling code for this. Only when one sampled in 100nS/div and then zooms in to 25nS/div actually gets 20nS/div :-//

Pictures are not so sharp, but one can see what I'm talking about.

The first image is the original signal. Channel 1 5MHz and channel 2 10MHz. (This is data already gone through factor 5 up sampling)
The second shows it zoomed to 50nS/div. This one is ok.
The third image shows it zoomed to 25nS/div :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 17, 2021, 02:22:36 pm
Managed to get signal on the display for the short time base settings.

It works somewhat ok from 500nS/div to 10mS/div. On 50mS/div and 20mS/div only the first half of the screen gets the input signal data and the other half is data from a previous sampling on 10mS/div setting. The 250nS/div down to 10nS/div gives the same trace as on 500nS/div.

Experimented a bit with the FPGA commands, but it seems they are all needed. Not calling the special ic to get the command for reading the trace data is needed. Without it the trace is all over the place.

Also, since I'm not processing the data the way the original code does it, and obtain a higher update rate that way, it is quite unstable.

More of the original code is needed to get it to work the way the original does. Knowing what I know now about the system I'm not sure if it is worth continuing on this road. Think it is time to move on to write new FPGA logic to really get some improvements.

This is a whole new ballgame and not something done in a short time. :(

Will continue with diving into SD card and USB handling first, since that is also needed for a fully working system.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 22, 2021, 10:14:03 am
Here's johnny >:D

Took a couple of day's of to recharge ye ol batteries.

Bought another tablet scope to be able to do side by side comparison and finally re-soldered the flash in the first one. The new one arrived yesterday and fortunately without defects 8)

Screwed the old one back together and started on the flash write code. Had to open it up again, because my boot to fel setup fails to work with the flash for reading it through fel. No idea why, but it just returns zero's. With the original boot to fel no such problem, so had to use that version to check if the flash was written. No such luck, so had to connect the Rigol MSO and check the signals. The CS line was not acting as intended. Miss-optimized things. Needed to wait until all the bytes are send before the code can continue. But that is fixed and working now.

Onto the next. The SD card stuff. Thought, lets use a bigger card with my fel boot on it and then have plenty of room to experiment with the card, but strangely enough it does not work when written to bigger cards, at least not for me. Smallest one after the 128MB I have is 4GB and even with the original fel boot it won't work |O

So I guess I will have to keep the scope opened up and switch cards to test stuff.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 23, 2021, 06:18:00 pm
Here's johnny >:D

Apparently my reference to the Shinning did not trigger anybody :-DD

But that aside, the SD card stuff is completely new to me and is going to take a bit of time.

Did manage to crasp a bit of the functionality and more or less matched parts of the code to the sunxi-mmc implementation in the u-boot code for the Allwinner chips. A lot of the debug texts can be found, and there is a function which I called uart_printf that probably is debug(char *str, ...) in the u-boot version. It also uses vararg, but I used the name with UART in it since it writes the string to the UART. (Never leaves the chip though since the UART GPIO is used for the connection with the FPGA)

Looked into SD card interfacing on the net and found the Arduino library, which can act as a guide line. Have to look for the file functions on top of the SD card functions.

The now identified function check_for_firmware_upgrade, which earlier in this thread I dismissed because it can overwrite the first 1000 bytes of the program area in the FLASH with zero's, checks if there is a file with either of these names on the SD card. "UTX-1013.bin", "FSI-1013.bin", "DAN-1013.bin" or "YPK-1013.bin", so there is a starting point for my search.

Noticed that these names have been found before in this thread. (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3144296/#msg3144296 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3144296/#msg3144296)) Further searches on the net for these file names did not lead anywhere :(

Again, the story continues 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 24, 2021, 01:19:55 pm
Think I found the source code used for the file system used in the scope.

http://elm-chan.org/fsw/ff/00index_e.html (http://elm-chan.org/fsw/ff/00index_e.html)

Because what are the odds of several functions showing the same things at the beginning, one of which in my book is a no no.

Code: [Select]
int FUN_800337c4(char **param_1,uchar *param_2,uint param_3)
{
  if (param_1 == (char **)0x0)
  {
    return 9;
  }

Code: [Select]
typedef enum
{
  FR_INVALID_OBJECT,      //(9) The file/directory object is invalid
} FRESULT;

FRESULT f_open (FIL* fp, const TCHAR* path, BYTE mode)
{
  if (!fp)
    return FR_INVALID_OBJECT;

Code: [Select]
uint FUN_80033b18(int param_1,int param_2,uint param_3,int *param_4)
{
  *param_4 = 0;
  uVar1 = FUN_800390e8(param_1,aiStack44);

Code: [Select]
FRESULT f_read (FIL* fp, void* buff, UINT btr, UINT* br)
{
  *br = 0;                                  //Clear read byte counter
  res = validate(&fp->obj, &fs); //Check validity of the file object

The no no is the writing to a pointer without making sure it is valid.
Removed parts of the code not needed for the comparison and cleaned it up a bit. The FatFs code is written in a style I very much dislike. Cluttered and hard to read.

But is makes live easier and all that needs to be done is figure out the low level stuff that is needed on the bottom end of the FatFs code.

Also have a better idea about the firmware upgrade setup. Not sure if it is true and think it could have been done much simpler.

The code reads the header of the firmware image file on the SD card and performs some checks. If found valid the first 1000 bytes of the flash where the program resides is cleared.
Then a reset is forced by the use of the watchdog timer. This triggers the SPL to start loading the code again, but it fails with the loading of the main program because the BROM header is no longer there.
As a result to that, it loads the other program we found in the flash. (When I tried it, some time back, this program set the scope in FEL mode.)
But my guess is that when the SD card holds a valid firmware file it loads that and performs the flash writing to fix the previously cleared part and, at the end of it, restarts the scope again.

When the system file is corrupt it shows this on the scope screen and goes into USB connect mode. This way one can correct the contents of the SD card.

Have not verified this and since there is no firmware file to be found for this device it is also not that simple to check.

It might open up an easy way to update scopes when new firmware has been created. But that still has a long road ahead.

Edit: Realized that for new FPGA content the device needs to be opened up, so in that case it is just as easy to use another method of loading the new code. :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on August 24, 2021, 01:25:03 pm
Think I found the source code used for the file system used in the scope.

When there is a will, there is a way. You continue to amaze me.  :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 24, 2021, 04:21:11 pm
Gave the firmware upload a try. Renamed the FSI-1014.bin file to FSI-1013.bin and loaded it onto the SD card of my test scope. Restarted it and it got stuck showing the FNIRSI startup bitmap. Not sure if the SPL is my own version or the original, so not sure why it did not started loading new firmware, even though it is for the other scope.

Read part of the FLASH that holds the main program and the first 1000 bytes are zero, so that actually works.

Re flashed the firmware via FEL and tried with a bitmap file renamed to FSI-1013.bin. This time I got the "system file damaged!!!" message.

This confirms part of my previous post. The found function is for upgrading the firmware, but it fails with the firmware for the 1014D.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 25, 2021, 10:32:06 am
The "no no" is probably optimized because the compiler saw that there was a valid pointer when calling the function.
FatFS is widely used in the embedded world, no surprises here :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 25, 2021, 12:52:17 pm
The "no no" is probably optimized because the compiler saw that there was a valid pointer when calling the function.
FatFS is widely used in the embedded world, no surprises here :)

Wrong. The function is called with 0 for that parameter, and it is also in the original source, that they don't check on the pointer being valid.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on August 25, 2021, 01:51:35 pm
You're right! f_open also does the same.
Well, be careful  :-DD.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 29, 2021, 02:11:25 pm
Not a lot of progress due to other business I have to attend to.

Today I found the functions that do the communication with the SD card. They seem to be based on the sunxi_mmc implementation, but are not an exact match. Improved on using Ghidra some more and inserted the structs used by the sunxi_mmc "send command" function. This makes things easier to read and understand.

Also identified a lot of the FatFs functions. These also are no exact match to the latest version and as there are quite a few revisions of it, it is hard to find the exact match. Also not really needed since it is about the functionality and not the exact same source.

Homing in on the code above the FatFs layer. On the SD card four files are used to maintain information about the picture and waveform files. Two of them are 400000 bytes in size and I think these hold the scope settings of the time the waveform or picture was taken. The other two are 2000 bytes in size. No idea yet as to what these are used for. The files are created when not on the card, so inserting a blank formatted SD card is no problem. The scope makes these files when needed. (Functions "load_selected_list_file" and "load_selected_system_file")

Uploaded a new Ghidra archive with the latest findings. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering))

It will take a while before I have working code for this all. A lot of functionality to re create :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 04, 2021, 09:54:10 am
Still working on the SD card stuff.

Getting an understanding of how things work but run into a question of why something is done.

In the scope code they use DMA when there are more then 64 bytes to transfer. Since they are not using interrupt to handle the transfer, for as far as I can see, it is making things more complex then needed, but that is not what it is about.

When using DMA they use some code to do something with the caches and I wonder why?
Code: [Select]
    uVar7 = (uint)data->data & 0xffffffe0;

    while (uVar7 <= ((uint)(data->data + data->blocks * data->blocksize) & 0xffffffe0))
    {
      coproc_moveto_Invalidate_Data_Cache_by_MVA(uVar7);
      coproc_moveto_Invalidate_Instruction_Cache_by_MVA(uVar7);
      uVar7 = uVar7 + 0x20;
    }

In assembly it is this
Code: [Select]
LAB_800370b8
        800370b8 3e 0f 07 ee     mcr        p15,0x0,r0,cr7,cr14,0x1
        800370bc 35 0f 07 ee     mcr        p15,0x0,r0,cr7,cr5,0x1
        800370c0 20 00 80 e2     add        r0,r0,#0x20
        800370c4 01 00 50 e1     cmp        r0,r1
        800370c8 fa ff ff 9a     bls        LAB_800370b8

They invalidate both the data and the instruction cache for 32 byte blocks. A pointer to where the data resides is send to the co-processor. This pointer is incremented with 32 after every iteration of the loop.

Anyone?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on September 04, 2021, 10:45:50 am
Anyone?

Sorry, can't help. Remember sometimes it's not the app programmers, but the guys that implemented the compiler...  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 04, 2021, 10:53:13 am
Anyone?

Sorry, can't help. Remember sometimes it's not the app programmers, but the guys that implemented the compiler...  :)

You are right, but if it is something of the compiler then it still has to make some sense :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on September 04, 2021, 06:59:57 pm
They invalidate both the data and the instruction cache for 32 byte blocks. A pointer to where the data resides is send to the co-processor. This pointer is incremented with 32 after every iteration of the loop.

Anyone?
I know nothing about this specific processor, but in one of the processors I worked with (STM32H7), you needed to invalidate the cache to ensure that the DMA transferred actual data and not stale data from the memory not yet updated from the cache to actual RAM. More here https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices

Maybe it's the same in your case?

P.S. big fan of the work you are doing, just lurking here unable to help, but always looking forward to your updates.  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 05, 2021, 05:30:59 am
Robca, thanks for your response.

The stuff about the H7 is very interesting, and I guess it also applies in this case. Still a bit weird that they also invalidate the I-Cache. For the data it makes sense.

For my version of the code I will only use the transfer by cpu method, because without using interrupts and still waiting for the card writing or reading to be finished there is no gain.

This SD card part is a big chunk of the total scope code, so once finished a lot more of the functions in Ghidra will be identified.

Still a long road ahead before there is a complete open source version for this scope :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on September 05, 2021, 11:11:25 am
Of course there's gain waitng for the dma witghout interrupt. The cpu must go through the loop each time, storing/increasing the pointers, fetching the data and moving it somewhere, so there're some instructions there.
DMA handles everything, so setting the DMA and waiting for the transfer to be done will be a lot faster when the transfer size increases.
Of course, there's a minimum transfer size, below which it'll take more time to setup the dma than doing it with cpu power.

Make some test. Ex. transfer a 64-byte block 100.000 times using cpu and dma, then start increasing the  block size, you'll see huge gains.

It heavily depends on the architecture, bus speed, congestion, dma configure cost... for example, just a quick test using a stm32, the dma was lower than cpu in transfer sizes below 256bytes.
For 64 byte transfers, DMA was almost 2x slower, so you must find the size below which dma is no longer efficient.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 05, 2021, 11:56:25 am
There may be gain when the SD card plus interface is fast enough. But I doubt that when the card is doing 24MB/s there will gain. In the original code they go up to 48MHz for the card clock if the card can handle it and to a 4 bit data bus. The transfer into the FIFO register is 32bits wide, so the overhead for the cpu to do the transfer won't be that high. The MMC-SD interface in the F1C100s is the limiting factor here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on September 05, 2021, 12:32:58 pm
This is complex and depends a lot on your application.
When reading from an external device that's much slower that your cpu, if you can do something else while fetching the data, it will boost the peformance noticeably.
Ex, if you could compute the FFT while fetching new data from the sd card.

If you're stuck until you get the data, it won't make any difference.
For copying ram to ram, it should be faster as the cpu doesn' have to access the bus to move the data.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 05, 2021, 12:40:52 pm
If you're stuck until you get the data, it won't make any difference.

And that was my point in the first place.

As stated before the goal is to get a working version that emulates the functionality of the original code. Big improvements are for a later stage.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on September 05, 2021, 01:01:29 pm
Also, if you read from the SD/spi/i2c device, usually you have to read one data at a time: start, wait for the flag, read the buffer, and repeat n times until filling the buffer.
I don't know if the f1C100s supports that, but DMA can often handle the peripheral, ex. you can set the SPI/I2C address and read 2KB in a single shot.
So in the end it'll be faster anyways.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 05, 2021, 06:40:09 pm
It took a bit of fiddling due to mismatching code, but the first part of the SD card works.

Low level initialization of the card is implemented and working. Without a card inserted the red "SD ERROR" text is displayed, with a card inserted it continues to display the scope trace :)

Had a hard time finding source code to go by so needed to reverse the mid level card layer from the original code, while I used the sunxi-mmc.c code from u-boot for the low level layer. This resulted in the response words not being in the right spot |O

Code used in the sunxi-mmc.c file looks like it swaps the response registers for long responses (136 bit)
Code: [Select]
if (cmd->resp_type & MMC_RSP_136)
  {
cmd->response[0] = readl(&priv->reg->resp3);
cmd->response[1] = readl(&priv->reg->resp2);
cmd->response[2] = readl(&priv->reg->resp1);
cmd->response[3] = readl(&priv->reg->resp0);

debug("mmc resp 0x%08x 0x%08x 0x%08x 0x%08x\n", cmd->response[3], cmd->response[2], cmd->response[1], cmd->response[0]);
}
  else
  {
cmd->response[0] = readl(&priv->reg->resp0);
debug("mmc resp 0x%08x\n", cmd->response[0]);
}

In the initialization code from the mid level layer a check is done to see if the card is ready. This was against the wrong bit, but did not gave problems until the publish rca command (cmd03) was send.
Code: [Select]
    //Send some initialization commands until the card is ready?????
    do
    {
      //Send application specific command follows command to the card
      command.cmdidx    = 55;
      command.cmdarg    = 0;
      command.resp_type = 5;
      sd_card_send_command(&command, 0);

      //Send host capacity support information command
      command.cmdidx    = 41;
      command.cmdarg    = 0x40FF8000;                      //Need to figure out these settings
      command.resp_type = 7;
      result = sd_card_send_command(&command, 0);
     
    //0 means still initializing 
    } while((command.response[3] & 0x80000000) == 0);

So I was a bit at a loss here and tried with displaying info on the screen to find the problem. Could not find it, and went through the Physical Layer Simplified Specification Version 8.00 to see what was going on. Was until I looked at the original send_command function of the scope that the mismatch occurred to me.
Code: [Select]
    cmd->response[0] = puVar6[8];
    cmd->response[1] = puVar6[9];

    if ((cmd->resp_type & 2) != 0)
    {
      cmd->response[2] = puVar6[10];
      cmd->response[3] = puVar6[11];
    }

After changing this in my version of the code it worked straight away :-DD

The SD card code that is around on the net did not provide a lot of help, because most of it is even less readable then what Ghidra made of it. :palm:
The STM32 version for arduino uses HAL and success in finding what that does. The linux code is similar, with all the driver layering. Did not look at the arduino spi version, but previous experience with arduino stuff did not make me happy either.

All this software is nice if you just want to make something with it on a dedicated target for it, but trying to learn from it jeeezzz.

So on to the next bit of the SD card code. Still lots more to do since it only does the card identification for now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 08, 2021, 09:54:58 am
Filled in the remainder of the initialization code and tested with a couple of different cards. The card information is retrieved and decoded.

Now match it all up to FatFs latest version and try to read and write some stuff to a card.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 11, 2021, 03:29:22 pm
Quote
Hello, is it me you're looking for?   8)

not a lot of progression due to other chores, lack of energy and thunderstorms :palm:

But today a good day and managed to get the FatFs module hooked in. Found the remainder of the functions that hook the FatFs functions to the actual disk layer. Still a lot of cleanup and reformatting to do, to make it more readable, and it might need a tweak on the configuration. The f_mount function is working though. Testing is a bit tedious since it requires swapping the SD card, so I think I will flash my test scope with the boot loader that starts FEL. That way I can leave the original SD card in the system and develop and test the remainder of the file stuff.

This means the saving and loading of the pictures and wave-forms. Also quite a bit of code, but with most of the FatFs functions identified it should go smooth :)

The SD card stuff might also be needed for the USB functionality since that routes it to the PC. Not sure how that is done, so yet another quest ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 13, 2021, 01:44:09 pm
There is a bit more to it then I hoped |O

Found what the four .sys on the SD card are used for, but need to plow through a lot of code to get to the nitty gritty.

The big files hold the thumbnails seen when the picture or waveform view is opened. (piclist.sys and wavelist.sys which are loaded with the load_selected_list_file function)

The smaller files hold file numbers in the order they are written. (pic_system.sys and wave_system.sys which are loaded with the load_selected_system_file function)

On a save 998 shorts are shifted up to the next slot freeing up the first slot for the new file number. To find the first free file number they try to open the files starting from 1.bmp or 1.wav up to 999.bmp or 999.wav. So if there are many files saved it will take longer to find a free file.

If all slots are used it looks like it will write over the last one. Still have to find the function that does the actual save, so nut sure if the file name will be 1000.bmp (1000.wav) or 999.bmp or 0.bmp.

Another weird bit is what they do when switched to a view mode. They save the current scope state, including the trace data, but on exit of a view mode they switch to auto trigger mode and restart the scope with the saved settings, overwriting the restored trace data, so they could have skipped that.

The whole system feels very much like a quick thrown together bit of software to get the device out on the market. They could have done with an expert code review to improve on the quality, but that probably is to expensive :-DD

Ah well back to the grindstone :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on September 13, 2021, 02:54:59 pm
but that probably is to expensive :-DD

Not so. You do that for them for free and without source code!  :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 13, 2021, 03:12:04 pm
You got me there :-DD

If they are reading this thread and use my findings they should consider making my life easier and fork over the sources 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 14, 2021, 08:43:10 am
Again a nice sample of the sloppy programming I run into.

In the function "handle_view_mode_touch()" they wait for touch to be released with the while loop, and then to make sure touch is released, they check it again in the "wait_for_touch_release()" function.
Code: [Select]
    if (uVar2 < 0x50)
    {
      cVar1 = *PTR_DAT_80022bb8;  //0x80192f02

      while (cVar1 != '\0')       //Wait for touch release
      {
        tp_i2c_read_status();
        cVar1 = *puVar3;
      }

      wait_for_touch_release();
      return 1;   //Return button touched
    }

Which also has to much code for the job. The first if is not needed since the do while does the same.
Code: [Select]
void wait_for_touch_release(void)
{
  undefined *puVar1;
 
  tp_i2c_read_status();

  puVar1 = PTR_DAT_8002b120;       //0x80192f02

  if (*PTR_DAT_8002b120 == '\0')   //0 means no touch
  {
    return;
  }

  do
  {
    tp_i2c_read_status();
  } while (*puVar1 != '\0');      //not 0 means touch

  return;
}

My version of the function that works perfectly in what I have written so far.
Code: [Select]
void tp_i2c_wait_for_touch_release(void)
{
  //Wait until touch is released
  while(havetouch)
  {
    //Read the touch panel status
    tp_i2c_read_status();
  }
}

To me this all means that they employ programmers who do not have the slightest idea of what they are doing :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on September 16, 2021, 12:04:28 am
If they opened the code and offered it as a platform similar to some of the phone projects there would be a lot of opportunities as display devices. I would really like a stand alone low frequency FFT analyzer. The current FFT in it is borderline useless. I suspect there are other special cases that do not need extended bandwidth.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 16, 2021, 05:42:28 am
If they opened the code and offered it as a platform similar to some of the phone projects there would be a lot of opportunities as display devices. I would really like a stand alone low frequency FFT analyzer. The current FFT in it is borderline useless. I suspect there are other special cases that do not need extended bandwidth.

I'm well on my way in opening it up. I have identified the FFT function in the Ghidra archive but dit not reverse it yet.

The semi reversed scope code will need a do over once all the parts have been done, because it is a bit messy due to the way it is coming together.

And I agree with you that it could make a nice audio frequency analyzer. The 8 bits is a bit low for good snr, but doing things like peak detection for the separate frequencies should be doable.

One problem with the current FPGA setup is to obtain a larger number of samples. So for higher resolution FFT the FPGA needs to be rewritten. Something I have on the agenda, but it will take time since that is a new playing field, even though I did FPGA stuff in the 1990's. The principle will be the same, but the capabilities are multiple.

Despite its limitations, all in all this scope is a nice play object :)

All my work can be found here: https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on September 18, 2021, 05:58:00 pm
Not sure if you know, but just in case: ARM has a highly optimized DSP library, including FFT (it's in the CMSIS). It's optimized for cores with native FP functionality but also for M0 and M3 cores without native FP

When I looked at it, even if the code didn't look super-optimized, I discovered that even a minor change would decrease performance, since the developers must have relied on compiler optimization and optimal registry usage and loop unrolling

When you get to looking at the FFT, I'm pretty sure that you will find the CMSIS implementation better than whatever the original code does  ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 19, 2021, 09:59:59 am
Finally some progress again.

after fixing where I f'ed up in FatFs, the loading of the .sys files is happening and the thumbnails are being displayed.

Had two issues with FatFs. Default configuration is set for dos file names and "pic_system.sys" or "wave_system.sys" does not comply with that. Due to this f_open failed with "FR_INVALID_NAME". Since it did open "piclist.sys" it was quickly clear I needed LFN support enabled.

After fixing that it hung on f_read. This took a bit longer to find. It did work with a read of 511 bytes, but not with 512. Tested my low level sd_card_read with multiple blocks and that worked without problems. Then I realized I cleaned up the FatFs code and fixed the no no I mentioned in a previous post. So I went back to the original and started to compare what I changed.

Turns out that I missed a continue that was being used in a for loop. That behaves differently for a while loop, and that is what I changed the code to. So fixed by changing the continue into a goto.


The original FatFs f_read code, where there is no check on the *br pointer not being NULL
Code: [Select]
/*-----------------------------------------------------------------------*/
/* Read File                                                             */
/*-----------------------------------------------------------------------*/

FRESULT f_read (
FIL* fp, /* Open file to be read */
void* buff, /* Data buffer to store the read data */
UINT btr, /* Number of bytes to read */
UINT* br /* Number of bytes read */
)
{
FRESULT res;
FATFS *fs;
DWORD clst;
LBA_t sect;
FSIZE_t remain;
UINT rcnt, cc, csect;
BYTE *rbuff = (BYTE*)buff;


*br = 0; /* Clear read byte counter */
res = validate(&fp->obj, &fs); /* Check validity of the file object */
if (res != FR_OK || (res = (FRESULT)fp->err) != FR_OK) LEAVE_FF(fs, res); /* Check validity */
if (!(fp->flag & FA_READ)) LEAVE_FF(fs, FR_DENIED); /* Check access mode */
remain = fp->obj.objsize - fp->fptr;
if (btr > remain) btr = (UINT)remain; /* Truncate btr by remaining bytes */

for ( ; btr > 0; btr -= rcnt, *br += rcnt, rbuff += rcnt, fp->fptr += rcnt) { /* Repeat until btr bytes read */
if (fp->fptr % SS(fs) == 0) { /* On the sector boundary? */
csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1)); /* Sector offset in the cluster */
if (csect == 0) { /* On the cluster boundary? */
if (fp->fptr == 0) { /* On the top of the file? */
clst = fp->obj.sclust; /* Follow cluster chain from the origin */
} else { /* Middle or end of the file */
#if FF_USE_FASTSEEK
if (fp->cltbl) {
clst = clmt_clust(fp, fp->fptr); /* Get cluster# from the CLMT */
} else
#endif
{
clst = get_fat(&fp->obj, fp->clust); /* Follow cluster chain on the FAT */
}
}
if (clst < 2) ABORT(fs, FR_INT_ERR);
if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
fp->clust = clst; /* Update current cluster */
}
sect = clst2sect(fs, fp->clust); /* Get current sector */
if (sect == 0) ABORT(fs, FR_INT_ERR);
sect += csect;
cc = btr / SS(fs); /* When remaining bytes >= sector size, */
if (cc > 0) { /* Read maximum contiguous sectors directly */
if (csect + cc > fs->csize) { /* Clip at cluster boundary */
cc = fs->csize - csect;
}
if (disk_read(fs->pdrv, rbuff, sect, cc) != RES_OK) ABORT(fs, FR_DISK_ERR);
#if !FF_FS_READONLY && FF_FS_MINIMIZE <= 2 /* Replace one of the read sectors with cached data if it contains a dirty sector */
#if FF_FS_TINY
if (fs->wflag && fs->winsect - sect < cc) {
memcpy(rbuff + ((fs->winsect - sect) * SS(fs)), fs->win, SS(fs));
}
#else
if ((fp->flag & FA_DIRTY) && fp->sect - sect < cc) {
memcpy(rbuff + ((fp->sect - sect) * SS(fs)), fp->buf, SS(fs));
}
#endif
#endif
rcnt = SS(fs) * cc; /* Number of bytes transferred */
continue;
}
#if !FF_FS_TINY
if (fp->sect != sect) { /* Load data sector if not in cache */
#if !FF_FS_READONLY
if (fp->flag & FA_DIRTY) { /* Write-back dirty sector cache */
if (disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR);
fp->flag &= (BYTE)~FA_DIRTY;
}
#endif
if (disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK) ABORT(fs, FR_DISK_ERR); /* Fill sector cache */
}
#endif
fp->sect = sect;
}
rcnt = SS(fs) - (UINT)fp->fptr % SS(fs); /* Number of bytes remains in the sector */
if (rcnt > btr) rcnt = btr; /* Clip it by btr if needed */
#if FF_FS_TINY
if (move_window(fs, fp->sect) != FR_OK) ABORT(fs, FR_DISK_ERR); /* Move sector window */
memcpy(rbuff, fs->win + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
#else
memcpy(rbuff, fp->buf + fp->fptr % SS(fs), rcnt); /* Extract partial sector */
#endif
}

LEAVE_FF(fs, FR_OK);
}


My version of the code
Code: [Select]
//----------------------------------------------------------------------------------------------------------------------------------
//Read File 
//
//Return:
//  A FRESULT value
//
//Input:
//  Pointer to the file structure
//  Buffer to store the read data
//  Number of bytes to read
//  Pointer to a varialble to return the number of bytes read in
//
//----------------------------------------------------------------------------------------------------------------------------------
FRESULT f_read(FIL* fp, void* buff, UINT btr, UINT* br)
{
  FRESULT res;
  FATFS *fs;
  DWORD clst;
  LBA_t sect;
  FSIZE_t remain;
  UINT rcnt, cc, csect;
  BYTE *rbuff = (BYTE*)buff;

  //Check if the input parameters are valid
  if(!fp || !buff)
    return(FR_INVALID_OBJECT);

  //Clear read byte counter when given
  if(br)
    *br = 0;

  //Check validity of the file object
  res = validate(&fp->obj, &fs);

  //Check validity
  if(res != FR_OK || (res = (FRESULT)fp->err) != FR_OK)
    LEAVE_FF(fs, res);

  //Check access mode
  if(!(fp->flag & FA_READ))
    LEAVE_FF(fs, FR_DENIED);

  //Calculate how many bytes are left in the file
  remain = fp->obj.objsize - fp->fptr;

  //Truncate btr by remaining bytes
  if(btr > remain)
    btr = (UINT)remain;

  //Repeat until btr bytes read
  while(btr > 0)
  {
    //On the sector boundary?
    if((fp->fptr % SS(fs)) == 0)
    {
      //Sector offset in the cluster
      csect = (UINT)(fp->fptr / SS(fs) & (fs->csize - 1));

      //On the cluster boundary?
      if(csect == 0)
      {
        //On the top of the file?
        if(fp->fptr == 0)
        {
          //Follow cluster chain from the origin
          clst = fp->obj.sclust;
        }
        //Middle or end of the file
        else
        {
#if FF_USE_FASTSEEK
          if(fp->cltbl)
          {
            //Get cluster# from the CLMT
            clst = clmt_clust(fp, fp->fptr);
          }
          else
#endif
          {
            //Follow cluster chain on the FAT
            clst = get_fat(&fp->obj, fp->clust);
          }
        }

        //cluster in wrong place??
        if(clst < 2)
          ABORT(fs, FR_INT_ERR);

        //Cluster out of range??
        if(clst == 0xFFFFFFFF)
          ABORT(fs, FR_DISK_ERR);

        //Update current cluster
        fp->clust = clst;
      }

      //Get current sector
      sect = clst2sect(fs, fp->clust);

      //Invalid sector??
      if(sect == 0)
        ABORT(fs, FR_INT_ERR);

      sect += csect;
      cc = btr / SS(fs);

      //When remaining bytes >= sector size,
      if(cc > 0)
      {
        //Read maximum contiguous sectors directly
        //Clip at cluster boundary
        if((csect + cc) > fs->csize)
        {
          cc = fs->csize - csect;
        }

        if(disk_read(fs->pdrv, rbuff, sect, cc) != RES_OK)
          ABORT(fs, FR_DISK_ERR);

#if !FF_FS_READONLY && FF_FS_MINIMIZE <= 2
//Replace one of the read sectors with cached data if it contains a dirty sector
#if FF_FS_TINY
        if(fs->wflag && ((fs->winsect - sect) < cc))
        {
          memcpy((rbuff + ((fs->winsect - sect) * SS(fs))), fs->win, SS(fs));
        }
#else
        if((fp->flag & FA_DIRTY) && ((fp->sect - sect) < cc))
        {
          memcpy((rbuff + ((fp->sect - sect) * SS(fs))), fp->buf, SS(fs));
        }
#endif
#endif
        //Number of bytes transferred
        rcnt = SS(fs) * cc;
       
        //Continue after update of counters and pointers. Original code uses for loop and continue
        goto read_update;
      }

#if !FF_FS_TINY
      //Load data sector if not in cache
      if(fp->sect != sect)
      {
#if !FF_FS_READONLY
        if(fp->flag & FA_DIRTY)
        {
          //Write-back dirty sector cache
          if(disk_write(fs->pdrv, fp->buf, fp->sect, 1) != RES_OK)
            ABORT(fs, FR_DISK_ERR);

          fp->flag &= (BYTE)~FA_DIRTY;
        }
#endif
        //Fill sector cache
        if(disk_read(fs->pdrv, fp->buf, sect, 1) != RES_OK)
          ABORT(fs, FR_DISK_ERR);
      }
#endif
      fp->sect = sect;
    }

    //Number of bytes remains in the sector
    rcnt = SS(fs) - (UINT)fp->fptr % SS(fs);

    //Clip it by btr if needed
    if(rcnt > btr)
      rcnt = btr;

#if FF_FS_TINY
    //Move sector window
    if(move_window(fs, fp->sect) != FR_OK)
      ABORT(fs, FR_DISK_ERR);

    //Extract partial sector
    memcpy(rbuff, (fs->win + (fp->fptr % SS(fs))), rcnt);
#else
    //Extract partial sector
    memcpy(rbuff, (fp->buf + (fp->fptr % SS(fs))), rcnt);
#endif

    //Update counters and pointers
read_update:   
    btr -= rcnt;
    rbuff += rcnt;
    fp->fptr += rcnt;

    //Return bytes read, only when variable is given
    if(br)
     *br += rcnt;
  }

  LEAVE_FF(fs, FR_OK);
}

//----------------------------------------------------------------------------------------------------------------------------------


Attached are two pictures of what my version shows. This is test code the scope starts with directly. Still have to hook it into the main menu and write the code for handling all the file actions.
Made some changes.

My code differs quite a bit from the original since that is so inefficient with a lot of unnecessary copying of data. It took quite a bit of time to work through all of it to get a proper understanding of what was going on.

My binary version of the code, which is far from finished, but already has a fair bit of the functionality of the original is now 183KB in size. The original binary is 1.6MB. Sure part of this is from not using the bitmaps, but still.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on September 19, 2021, 02:02:36 pm
Tnx for your effort I really appreciate it. Few days ago I was using my 1013D (for the second time since I got it) and I could not find how to change time scale.
I threw away user manual with packaging so I had to turn to youtube reviews to see how other do it... (tap on the left or right side of screen).   :palm:
My intuition told me to just pinch and zoom in horizontal or vertical direction to change desired scale, but no...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 19, 2021, 03:23:15 pm
Hi Frenky,

yes that part is not that intuitive. The touch panel is capable of multi touch, but implementing such a pinch feature takes some investigation. A simpler change would be to make a drop down menu for it.

But first step is to get a version of the code that mimics how the original works. That can then be improved upon, but for me the step after this first code reversal is to make my own FPGA implementation to improve on some other short comings.

For example, see if the pwm to control the screen brightness can be done on a higher frequency. This because the second scope I got has an even louder and very irritating beep when the brightness is turned down. |O

One change I have to make to the code I have now is add an item to the main menu, that allows for changing the orientation of the touch panel. I used the original binary via FEL a couple of days ago to setup some test pictures and waveforms, to discover, "Oh yes and shit, changed the touch panel on this scope because it was broken and needs the modified orientation"  :palm:

Otherwise it is not usable for anyone who has a standard version of the scope :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 20, 2021, 05:10:16 pm
I was looking at the code to display the pictures on the screen and found that they tried to speed things up.

When you need to save a picture that can be viewed on a computer, but also on your own system, the easiest solution would be to create a bitmap with your screen data and when it is displayed on your own system load it back onto the screen. (creating a .png could be better, but is more of a software effort)

They did it differently, created a bitmap header, copied in the scope settings and trace data and after that the bitmap is copied from the screen. When displayed on the own system it just reads back the settings and trace data and uses that to recreate the original screen.

The read back is faster since only 15000 bytes are read, but with the rest of the code being very inefficient it probably won't make a huge difference.

Where they messed up is that in the header the file size is wrong. Set to 0x000C5FF8 (811000) while the file is only 0x00C3500 (800000) bytes. Not a big problem, but they also use the special parameter ic to translate some parameter that is used as the offset to the pixel data. But this offset is not used when they copy in the pixel data, so there can be a problem there.

Why the images come out wrong on my system is still a bit of a mystery.

Edit: Found why the image goes wrong on my system. It expects the pixel array directly after the header. The offset in the header is ignored. Not sure what windows does with it, but both my linux machines (Mint 20 and Ubuntu 16) do it wrong. :palm:

Edit: Tried it on virtualbox running windows xp and that does display the image correctly, so it is linux bitmap handling that sucks.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 21, 2021, 03:39:57 pm
Analyzed the setup and trace data in the .bmp and .wav files. Even though they save and load 15000 bytes only 10000 are used.

The first 1000 bytes are used for the settings and measurements. They use shorts for everything, even if a setting is just a byte.
In the below code segment is the code Ghidra made of the first part of the save_system_setup function with my comments on what is what.

Code: [Select]
  //Data is saved as shorts.

  *(ushort *)buffer = (ushort)pbVar2[0x3a];                        //run mode

  *(ushort *)((int)buffer + 2) = (ushort)*pbVar2;                  //channel 1 enable
  *(ushort *)((int)buffer + 4) = (ushort)pbVar2[3];                //volts/div
  *(ushort *)((int)buffer + 6) = (ushort)pbVar2[4];                //fft enable
  *(ushort *)((int)buffer + 8) = (ushort)pbVar2[1];                //coupling
  *(ushort *)((int)buffer + 10) = (ushort)pbVar2[2];               //magnification

  *(ushort *)((int)buffer + 0xc) = (ushort)pbVar2[0xc];            //channel 2 enable
  *(ushort *)((int)buffer + 0xe) = (ushort)pbVar2[0xf];            //volt/div
  *(ushort *)((int)buffer + 0x10) = (ushort)pbVar2[0x10];          //fft enable
  *(ushort *)((int)buffer + 0x12) = (ushort)pbVar2[0xd];           //coupling
  *(ushort *)((int)buffer + 0x14) = (ushort)pbVar2[0xe];           //magnification

  *(ushort *)((int)buffer + 0x16) = (ushort)pbVar2[10];            //time base setting

  *(ushort *)((int)buffer + 0x18) = (ushort)pbVar2[0x16];          //move speed

  *(ushort *)((int)buffer + 0x1a) = (ushort)pbVar2[0x21];          //trigger mode
  *(ushort *)((int)buffer + 0x1c) = (ushort)pbVar2[0x22];          //trigger edge
  *(ushort *)((int)buffer + 0x1e) = (ushort)pbVar2[0x23];          //trigger channel

  *(ushort *)((int)buffer + 0x20) = (ushort)pbVar2[0x38];          //battery charge level. Is used to display the state of when picture or waveform was taken

  *(ushort *)((int)buffer + 0x22) = (ushort)pbVar2[0x42];          //right menu mode

  *(ushort *)((int)buffer + 0x24) = (ushort)pbVar2[0x18];          //triggerflag2
  *(ushort *)((int)buffer + 0x26) = (ushort)pbVar2[0x17];          //triggerflag1

  *(undefined2 *)((int)buffer + 0x28) = *(undefined2 *)(pbVar2 + 0x1a);  //disp_x_start.

  puVar10 = PTR_DAT_80002024;    //0x80192ece
  iVar21 = DAT_8000201c;         //0x80361378

  if (pbVar2[10] < 9)        //time base setting. Long time base values 50S - 100mS
  {
    sVar4 = *(short *)PTR_DAT_80002014 + -1;    //0x80192eaa  (disp_xpos)
  }
  else                       //short time base settings. 50mS - 10nS
  {
    sVar4 = *(short *)(pbVar2 + 0x1c);           //disp_sample_count
  }

  *(short *)((int)buffer + 0x2a) = sVar4;   //time base dependent save of sample count info


  iVar25 = DAT_80002020;                     //0x801FA24C  base address of measurement settings

  puVar30 = (ushort *)((int)buffer + 0x12e); //index into the buffer

  *(undefined2 *)((int)buffer + 0x2c) = *(undefined2 *)PTR_DAT_80002018;  //0x80192ec4  State flag for getting start+end in sample buffers???

  pbVar15 = (byte *)(iVar25 + -1);          //0x801FA24B

  sVar4 = 0xc;

  *(undefined2 *)((int)buffer + 0x2e) = *(undefined2 *)puVar10;              //0x80192ece
  *(undefined2 *)((int)buffer + 0x30) = *(undefined2 *)PTR_DAT_80002028;     //0x80192ebc
  *(undefined2 *)((int)buffer + 0x32) = *(undefined2 *)PTR_DAT_8000202c;     //0x80192ebe

  *(ushort *)((int)buffer + 0x34) = (ushort)pbVar2[0xb];                     //copy of time base settings
  *(ushort *)((int)buffer + 0x36) = (ushort)pbVar2[0x43];                    //view mode

  *(undefined2 *)((int)buffer + 0x50) = *(undefined2 *)(pbVar2 + 0x24);      //trigger pos on screen
  *(undefined2 *)((int)buffer + 0x52) = *(undefined2 *)(pbVar2 + 0x26);      //trigger level screen offset

  *(undefined2 *)((int)buffer + 0x54) = *(undefined2 *)(pbVar2 + 6);         //channel 1 trace offset

  *(undefined2 *)((int)buffer + 0x56) = *(undefined2 *)(pbVar2 + 0x12);      //channel 2 trace offset

  *(ushort *)((int)buffer + 0x78) = (ushort)*(byte *)(iVar21 + 2);           //screen brightness
  *(ushort *)((int)buffer + 0x7a) = (ushort)*(byte *)(iVar21 + 3);           //grid brightness
  *(ushort *)((int)buffer + 0x7c) = (ushort)*(byte *)(iVar21 + 4);           //always trigger 50%
  *(ushort *)((int)buffer + 0x7e) = (ushort)*(byte *)(iVar21 + 7);           //x-y display mode

                                                                             //measurements enable channel 1
  *(ushort *)((int)buffer + 0xa0) = (ushort)*(byte *)(iVar25 + 0x100);       //vmax
  *(ushort *)((int)buffer + 0xa2) = (ushort)*(byte *)(iVar25 + 0x112);       //vmin
  *(ushort *)((int)buffer + 0xa4) = (ushort)*(byte *)(iVar25 + 0x122);
  *(ushort *)((int)buffer + 0xa6) = (ushort)*(byte *)(iVar25 + 0x132);
  *(ushort *)((int)buffer + 0xa8) = (ushort)*(byte *)(iVar25 + 0x142);
  *(ushort *)((int)buffer + 0xaa) = (ushort)*(byte *)(iVar25 + 0x152);
  *(ushort *)((int)buffer + 0xac) = (ushort)*(byte *)(iVar25 + 0x162);
  *(ushort *)((int)buffer + 0xae) = (ushort)*(byte *)(iVar25 + 0x172);
  *(ushort *)((int)buffer + 0xb0) = (ushort)*(byte *)(iVar25 + 0x182);
  *(ushort *)((int)buffer + 0xb2) = (ushort)*(byte *)(iVar25 + 0x192);
  *(ushort *)((int)buffer + 0xb4) = (ushort)*(byte *)(iVar25 + 0x1a2);
  *(ushort *)((int)buffer + 0xb6) = (ushort)*(byte *)(iVar25 + 0x1b2);       //duty-

                                                                             //measurements enable channel 2
  *(ushort *)((int)buffer + 0xb8) = (ushort)*(byte *)(iVar25 + 0x1c2);       //vmax
  *(ushort *)((int)buffer + 0xba) = (ushort)*(byte *)(iVar25 + 0x1d2);
  *(ushort *)((int)buffer + 0xbc) = (ushort)*(byte *)(iVar25 + 0x1e2);
  *(ushort *)((int)buffer + 0xbe) = (ushort)*(byte *)(iVar25 + 0x1f2);
  *(ushort *)((int)buffer + 0xc0) = (ushort)*(byte *)(iVar25 + 0x202);
  *(ushort *)((int)buffer + 0xc2) = (ushort)*(byte *)(iVar25 + 0x212);
  *(ushort *)((int)buffer + 0xc4) = (ushort)*(byte *)(iVar25 + 0x232);
  *(ushort *)((int)buffer + 0xc6) = (ushort)*(byte *)(iVar25 + 0x242);
  *(ushort *)((int)buffer + 200) = (ushort)*(byte *)(iVar25 + 0x252);
  *(ushort *)((int)buffer + 0xca) = (ushort)*(byte *)(iVar25 + 0x262);
  *(ushort *)((int)buffer + 0xcc) = (ushort)*(byte *)(iVar25 + 0x272);
  *(ushort *)((int)buffer + 0xce) = (ushort)*(byte *)(iVar25 + 0x282);        //duty-

//Channel 1 measured values????
  *(short *)((int)buffer + 0xd0) = (short)((uint)*(undefined4 *)(iVar25 + 0x104) >> 0x10);
  *(short *)((int)buffer + 0xd2) = (short)*(undefined4 *)(iVar25 + 0x104);
  *(short *)((int)buffer + 0xd4) = (short)((uint)*(undefined4 *)(iVar25 + 0x114) >> 0x10);
  *(short *)((int)buffer + 0xd6) = (short)*(undefined4 *)(iVar25 + 0x114);
  *(short *)((int)buffer + 0xd8) = (short)((uint)*(undefined4 *)(iVar25 + 0x124) >> 0x10);
  *(short *)((int)buffer + 0xda) = (short)*(undefined4 *)(iVar25 + 0x124);
  *(short *)((int)buffer + 0xdc) = (short)((uint)*(undefined4 *)(iVar25 + 0x134) >> 0x10);
  *(short *)((int)buffer + 0xde) = (short)*(undefined4 *)(iVar25 + 0x134);
  *(short *)((int)buffer + 0xe0) = (short)((uint)*(undefined4 *)(iVar25 + 0x144) >> 0x10);
  *(short *)((int)buffer + 0xe2) = (short)*(undefined4 *)(iVar25 + 0x144);
  *(short *)((int)buffer + 0xe4) = (short)((uint)*(undefined4 *)(iVar25 + 0x154) >> 0x10);
  *(short *)((int)buffer + 0xe6) = (short)*(undefined4 *)(iVar25 + 0x154);
  *(short *)((int)buffer + 0xe8) = (short)((uint)*(undefined4 *)(iVar25 + 0x164) >> 0x10);
  *(short *)((int)buffer + 0xea) = (short)*(undefined4 *)(iVar25 + 0x164);
  *(short *)((int)buffer + 0xec) = (short)((uint)*(undefined4 *)(iVar25 + 0x174) >> 0x10);
  *(short *)((int)buffer + 0xee) = (short)*(undefined4 *)(iVar25 + 0x174);
  *(short *)((int)buffer + 0xf0) = (short)((uint)*(undefined4 *)(iVar25 + 0x184) >> 0x10);
  *(short *)((int)buffer + 0xf2) = (short)*(undefined4 *)(iVar25 + 0x184);
  *(short *)((int)buffer + 0xf4) = (short)((uint)*(undefined4 *)(iVar25 + 0x194) >> 0x10);
  *(short *)((int)buffer + 0xf6) = (short)*(undefined4 *)(iVar25 + 0x194);
  *(short *)((int)buffer + 0xf8) = (short)((uint)*(undefined4 *)(iVar25 + 0x1a4) >> 0x10);
  *(short *)((int)buffer + 0xfa) = (short)*(undefined4 *)(iVar25 + 0x1a4);
  *(short *)((int)buffer + 0xfc) = (short)((uint)*(undefined4 *)(iVar25 + 0x1b4) >> 0x10);
  *(short *)((int)buffer + 0xfe) = (short)*(undefined4 *)(iVar25 + 0x1b4);


//Channel 2 measured values????
  *(short *)((int)buffer + 0x100) = (short)((uint)*(undefined4 *)(iVar25 + 0x1c4) >> 0x10);
  *(short *)((int)buffer + 0x102) = (short)*(undefined4 *)(iVar25 + 0x1c4);
  *(short *)((int)buffer + 0x104) = (short)((uint)*(undefined4 *)(iVar25 + 0x1d4) >> 0x10);
  *(short *)((int)buffer + 0x106) = (short)*(undefined4 *)(iVar25 + 0x1d4);
  *(short *)((int)buffer + 0x108) = (short)((uint)*(undefined4 *)(iVar25 + 0x1e4) >> 0x10);
  *(short *)((int)buffer + 0x10a) = (short)*(undefined4 *)(iVar25 + 0x1e4);
  *(short *)((int)buffer + 0x10c) = (short)((uint)*(undefined4 *)(iVar25 + 500) >> 0x10);
  *(short *)((int)buffer + 0x10e) = (short)*(undefined4 *)(iVar25 + 500);
  *(short *)((int)buffer + 0x110) = (short)((uint)*(undefined4 *)(iVar25 + 0x204) >> 0x10);
  *(short *)((int)buffer + 0x112) = (short)*(undefined4 *)(iVar25 + 0x204);
  *(short *)((int)buffer + 0x114) = (short)((uint)*(undefined4 *)(iVar25 + 0x214) >> 0x10);
  *(short *)((int)buffer + 0x116) = (short)*(undefined4 *)(iVar25 + 0x214);
  *(short *)((int)buffer + 0x118) = (short)((uint)*(undefined4 *)(iVar25 + 0x234) >> 0x10);
  *(short *)((int)buffer + 0x11a) = (short)*(undefined4 *)(iVar25 + 0x234);
  *(short *)((int)buffer + 0x11c) = (short)((uint)*(undefined4 *)(iVar25 + 0x244) >> 0x10);
  *(short *)((int)buffer + 0x11e) = (short)*(undefined4 *)(iVar25 + 0x244);
  *(short *)((int)buffer + 0x120) = (short)((uint)*(undefined4 *)(iVar25 + 0x254) >> 0x10);
  *(short *)((int)buffer + 0x122) = (short)*(undefined4 *)(iVar25 + 0x254);
  *(short *)((int)buffer + 0x124) = (short)((uint)*(undefined4 *)(iVar25 + 0x264) >> 0x10);
  *(short *)((int)buffer + 0x126) = (short)*(undefined4 *)(iVar25 + 0x264);
  *(short *)((int)buffer + 0x128) = (short)((uint)*(undefined4 *)(iVar25 + 0x274) >> 0x10);
  *(short *)((int)buffer + 0x12a) = (short)*(undefined4 *)(iVar25 + 0x274);
  *(short *)((int)buffer + 300) = (short)((uint)*(undefined4 *)(iVar25 + 0x284) >> 0x10);
  *(short *)((int)buffer + 0x12e) = (short)*(undefined4 *)(iVar25 + 0x284);

      //Copy 12 * 2 values. This is the list of enabled measurements to show them on the display
  do  //puVar30 = (ushort *)((int)buffer + 0x12e);
  {
    sVar4 = sVar4 + -1;
    puVar30[1] = (ushort)pbVar15[1];    //Initial pVar15 = //0x801FA24B
    pbVar15 = pbVar15 + 2;
    puVar30 = puVar30 + 2;
    *puVar30 = (ushort)*pbVar15;
  } while (sVar4 != 0);

  *(ushort *)((int)buffer + 400) = (ushort)pbVar2[0x39];                      //charging indicator
  *(ushort *)((int)buffer + 0x192) = (ushort)pbVar2[0x38];                    //battery charge level

  *(undefined2 *)((int)buffer + 0x194) = *(undefined2 *)PTR_DAT_80002030;     //0x80192ec6
  *(undefined2 *)((int)buffer + 0x196) = *(undefined2 *)PTR_DAT_80002034;     //0x80192ec8


After the settings is the trace data. This is processed data from the last sample buffers (channel1tracebuffer4 and channel2tracebuffer4 in my code) and display data from buffers where the scope saves the y coordinate of every sample displayed. (channel1ypoints and channel2ypoints in my code)

The buffers are little endian shorts (LSB, MSB)

From the settings two items are used to display the trace data.

There are still settings that have no clear meaning.

Already started with the loading part of the code and skip a lot of memory copy the original code does. Just read the data in separate chunks into the needed buffers instead of reading all the data into a big buffer and then copy it to where it needs to be.

But to fully implement the picture and waveform view I have to finish the code for trace displaying, because that is also used when viewing items.

So it is circle back to that part of the code before finishing the view bit.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 23, 2021, 08:01:15 am
Found another oversight / error. :-DD

For waveform view the state of the measurements are ignored. This means that when the waveform view is selected and an item is opened the measurements enabled will be the ones enabled before opening the waveform view, and not the ones that where enabled at the time of the waveform capture.

Not a big deal, but why :-//

In the code there is a specific "if" to check which view type is selected. For picture view the states are loaded, for waveform not. The measured values on the other hand are loaded for both types.

In my version I will load the states for both types.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on September 23, 2021, 11:51:35 am
Sounds like the programmer tried to include a useful feature, but made a mistake in implementation.
As there was probably no formal specification for the functionality, the tester (if there was one) didn't know what to test and thus didn't spot the implementation error.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 23, 2021, 01:22:41 pm
Big chance there was no formal tester to check it all.

There are many faults in this code, that could easily be the result of missing formal specifications.

Another one I detected while testing the functionality of the view modes, is that when the power is turned off while the scope is in a view mode the settings in the flash are corrupted. Guess they forgot to add an "if" statement there. :-DD

The most obvious sign of this is that the traces are shifted to other positions on the screen. Mostly towards the bottom.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 25, 2021, 01:38:53 pm
Bummer, things grounded to a halt. |O

Was working on the delete functionality of the view items and discovered things in FatFs are not working, and I have no idea what is wrong.

At first I thought it might be the not yet initializing of the BSS data, but after implementing that it still fails.

Despite the FF_FS_READONLY define being set to 0 to make a read/write file system, it won't write to a file, create a file or even delete a file.

Selecting a file for reading and then reading from it works without problems. Reverted back to the original unmodified code, but no dice. Problem remains.

I have to see if I can create an emulation project on my linux machine to test the FatFs code and try to find the problem. :box:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 25, 2021, 03:19:04 pm
Many many posts ago, in a galaxy far far away :) someone questioned me writing in this thread. I responded it helped me, and I'll be darned it did.

After writing the previous post it hit me I did not try doing a file delete at startup. Did try a f_open with a create. So in the startup code direct after the f_mount call I added a f_unlink and I noticed it took longer to start, but I did not get an error on the delete. The file was still on the SD card. Hmmm, so I looked at the SD card layer and noticed I again made a copy, paste, not modify error.  :palm:

I wrote the read function first and copied that for the write function, but forgot to change the data type from SD_DATA_READ to SD_DATA_WRITE. And that's all folks as the well known comics say.

It does what it needs to do now.

Wasted good part of the day on this, but that is the price you pay for making stupid mistakes |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on September 25, 2021, 03:38:47 pm
Perseverance!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 25, 2021, 03:55:49 pm
Perseverance!

That's what you need for doing something like this :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on September 25, 2021, 08:28:29 pm
Glad you worked it out.  I was going to suggest a corrupt SD card.
I've encountered embedded FAT code (elm-chan maybe) that could read files fine, but will fail to write when there was some corruption.
Obviously there is no embedded chkdsk/fsck type functionality, so you have to run that on a PC to fix things.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on September 25, 2021, 08:38:13 pm
That's what you need for doing something like this :-+
And a lot of time, or to be a very smart cat so you have 7 lives for fixing that crappy chinesium thing  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 05:42:33 am
Glad you worked it out.  I was going to suggest a corrupt SD card.
I've encountered embedded FAT code (elm-chan maybe) that could read files fine, but will fail to write when there was some corruption.
Obviously there is no embedded chkdsk/fsck type functionality, so you have to run that on a PC to fix things.

I knew the card was fine, since with the original code it was able to create new pictures, and I also tested creating a file on the card with my PC. That slowed testing things down also, loading the software to the scope, run it, take the card out, insert in the PC, check if file was written, etc. Needed to copy the files to my main disk to be able to open with wxHexeditor, since that refuses to open a file on a disk mounted in the media folder. This is some Linux problem.

But it is fixed and a lot of the functionality is implemented now. Unfortunately I had to quit early yesterday due to a thunderstorm passing by. Today I hope to get the remainder of the view part implemented and see if I can get the save picture and waveform in there too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 10:09:19 am
Perseverance!

And a lot of time

It takes a lot of skills, perseverance and time to do something like this.

What started as a relative simple fix of my new touch panel having reversed coordinates, became quite the undertaking of reversing the code.

Discovered a lot of crap in the original code, so decided to make my own interpretation of it, but still based on parts of the original code and functionality.

One has to have a good understanding of programming on a low level, and programming what so ever, to be able to do stuff like this. A lot of the time it is very frustrating, looking at output of Ghidra and trying to get an understanding of what some variable is for. Also seeing through what a compiler did to get to the assembly code is not easy.

I read somewhere in this forum that most of the time it is easier and faster to just write your own code then to reverse engineer it, and that is certainly true. Did that for the display part of the code, and also did that for other parts once I saw the logic behind things.

For others who are thinking of doing something like this be prepared to invest a lot of time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on September 26, 2021, 10:18:32 am
For others who are thinking of doing something like this be prepared to invest a lot of time.

Plenty of knowledge also of what a scope should be doing - You forgot this part! :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 02:25:19 pm
Question to all:

What is preferred in case of a file error (create, open, read or write)

The original scope code does not do any of this. In the save picture function when a file create fails it tries it again and if that fails it tries one more time and does not check on that failing and continues with writing to the file :palm: It does not do harm but the user is not aware of anything going wrong.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ledtester on September 26, 2021, 03:26:02 pm
I would vote for #2... but you could also make it configurable.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on September 26, 2021, 03:27:49 pm
I'm for temporary. Notification is a must.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 03:29:04 pm
I would vote for #2... but you could also make it configurable.

That is a good idea. I also lean towards #2, but with your idea it can be both ways :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on September 26, 2021, 03:36:47 pm
I assume that at least initially you will be using the card to log not only software functions but save waveforms I can see you getting multiple confirms in a row. A configuration file would be excellent.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 03:43:06 pm
Confirmation would only be in case of an error.

If it succeeds it will display this for only half a second, just like the scope does it now.

But I already made a note in the code to add an option of notification confirmation on or off :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on September 26, 2021, 03:52:38 pm
So if you made a settings change (I assume it's saved to the sd card) would it generate the same messages?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 04:00:33 pm
So if you made a settings change (I assume it's saved to the sd card) would it generate the same messages?

Good one, but the settings are saved in the flash on power down. Could also fail, but by then the power is gone and no way of showing a message any more.

The option is only for the confirmation of the notification. The notification itself will always be displayed, but with confirmation disabled it will only show for half a second. It will only be in case of an error, which under normal conditions won't happen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 04:34:07 pm
Already implemented :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 26, 2021, 06:58:22 pm
f___ |O

things where going so good, but I ran into a new strange problem :-//

This time I think it really is a FatFs thing. Instead of writing the picture file in a single blob I chopped it into chunks to avoid a lot of memory copies. Also using the same function to write the waveform file, which works without problems.

Here is the part of the code doing it all.
Code: [Select]
  //Open the new file. On failure signal this and quit
  result = f_open(&viewfp, viewfilename, FA_CREATE_NEW | FA_WRITE);

  //Check if file opened without problems
  if(result == FR_OK)
  {
    //For pictures the bitmap header needs to be written
    if(type == VIEW_TYPE_PICTURE)
    {
      //Write the bitmap header
      result = f_write(&viewfp, bmpheader, sizeof(bmpheader), 0);
    }

    //Check if still ok to proceed
    if(result == FR_OK)
    {
      //Save the settings for the trace portion of the data and write them to the file
      scope_prepare_setup_for_file();

      //Write the setup data to the file
      if((result = f_write(&viewfp, viewfilesetupdata, sizeof(viewfilesetupdata), 0)) == FR_OK)
      {
        //Write the trace data to the file
        //Save the channel 1 sample data
        if((result = f_write(&viewfp, (uint8 *)channel1tracebuffer4, 3000, 0)) == FR_OK)
        {
          //Save the channel 2 sample data
          if((result = f_write(&viewfp, (uint8 *)channel2tracebuffer4, 3000, 0)) == FR_OK)
          {
            //Save the channel 1 display data
            if((result = f_write(&viewfp, (uint8 *)channel1ypoints, 1500, 0)) == FR_OK)
            {
              //Save the channel 2 display data
              if((result = f_write(&viewfp, (uint8 *)channel2ypoints, 1500, 0)) == FR_OK)
              {
                //Finish with an empty blob of data to reach the needed file size
                //Clear part of the thumbnail data for this. Is reloaded anyway so does not matter
                memset((uint8 *)viewthumbnaildata, 0, 5000);
               
                //Save it to the file
                if((result = f_write(&viewfp, (uint8 *)viewthumbnaildata, 5000, 0)) == FR_OK)
                {
                  //For pictures extra code is needed to write the pixel data to the file
                  if(type == VIEW_TYPE_PICTURE)
                  {
                    //Write the pixel data
                    result = f_write(&viewfp, (uint8 *)maindisplaybuffer, PICTURE_DATA_SIZE, 0);
                  }
                }
              }
            }
          }
        }
      }
    }

    //Close the file
    f_close(&viewfp);

    //Check if all went well
    if(result == FR_OK)
    {
      //Show the saved successful message
      scope_display_file_status_message(MESSAGE_SAVE_SUCCESSFUL);
    }
    else
    {
      //Signal unable to write to the file
      scope_display_file_status_message(MESSAGE_FILE_WRITE_FAILED);
    }
  }
  else
  {
    //Signal unable to create the file
    scope_display_file_status_message(MESSAGE_FILE_OPEN_FAILED);
  }

For a waveform file the bitmap header and pixel array is not written, and the file looks good. It is 15000 bytes long and I can see the channel 1 trace data. The settings part looks good to. The other bits are zero, because the code to fill that is not implemented yet. (Only channel 1 is partially done)

For the picture it writes the bitmap header, and it seems to write part of the settings. The file is only 512 bytes long, but I can see that the bitmap header is correct and the first bit of the settings data is also there and correct.

When I skip the writing of the 70 byte header (commented out the first f_write) it works without problems, and the resulting file then contains the pixel data. (last f_write)

So it looks like writing less then a sector and then write more data fails somehow.

I will try a work around for now, where I combine the first two writes and hope that solves it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 27, 2021, 06:15:11 am
A light bulb appeared this early morning :)  (no emoticon for this :-//)

The SD card interface needs the data to be 32 bits aligned, since the FIFO works with 32 bits data. So the problem was caused by the bitmap header being 70 bytes, which is not a multiple of 32 bits. This lead to the second write becoming misaligned and thus failed.

The original code did have code for this but I dismissed it as being a bit of bullshit. They allocated a buffer 512 times the original buffer filled that with the data from the buffer, but for this they used memcpy with the size not being the original size but the size times 512. So reading outside the original buffer. The disk_read function is the same so writes outside the original buffer. :horse:

Code: [Select]
int disk_write(int pdrv,byte *buff,int sector,uint count)

{
  uint *buffer;
  int iVar1;
  uint unaff_r4;
 
  switch(pdrv)
  {
  case 0:
    if (((uint)buff & 3) == 0) {
      iVar1 = sd_card_write(0,sector,count,buff);
      if (iVar1 == 0) {
        return 0;
      }
    }
    else {
      buffer = malloc(count << 9);
      if (buffer != NULL) {
        memcpy(buffer,buff,count << 9);
        iVar1 = sd_card_write(0,sector,count,(byte *)buffer);
        free(buffer);
        return (uint)(iVar1 != 0);
      }
    }
    unaff_r4 = 1;
    break;

  case 1:
  case 2:
  case 3:
  case 4:
    break;

  default:
    unaff_r4 = 4;
  }
  return unaff_r4;
}

int disk_read(int pdrv,byte *buff,int sector,uint count)

{
  uint *buffer;
  int iVar1;
 
  if (pdrv == 0)
  {
    if (((uint)buff & 3) == 0)
    {
      iVar1 = sd_card_read(0,sector,count,buff);

      if (iVar1 == 0)
      {
        return 0;
      }
    }
    else
    {
      buffer = malloc(count << 9);

      if (buffer != NULL)
      {
        iVar1 = sd_card_read(0,sector,count,(byte *)buffer);

        memcpy(buff,buffer,count << 9);

        free(buffer);

        return (uint)(iVar1 != 0);
      }
    }

    count = 1;
  }

  return count;
}

I thought to have it covered with making sure the input buffers to FatFs were 32 bits aligned. :palm:

Rewrote the SD card code to be able to handle whatever aligned data. Most optimum is 32 bits aligned of course. For 16 bit it has to do 2 reads or writes and for 8 bits 4 reads or writes per 32 bits FIFO access.

So the problem is solved and the saving of the files works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 27, 2021, 03:57:37 pm
:blah: Also seeing through what a compiler did to get to the assembly code is not easy.

Here is an example of what I meant with the above about compiler tricks

Code: [Select]
  uVar4 = DAT_800253b8;    //0x38E38E39
  puVar7 = DAT_800253c8;   //0x801C3748  channel 1 trace on screen buffer  channel1ypoints[-1]

  lVar1 = (longlong)(int)uVar4 * (longlong)(int)((puVar7[1] - 0x2e) * 10);
  *(char *)(iVar2 + dataindex + 0x14 + (iVar6 >> 2)) = ((char)(int)(lVar1 >> 0x23) - (char)(lVar1 >> 0x3f)) + '\x05';

In this piece of code the y coordinate is reduced by a factor of 3.61666 and then gets 5 added to it.

Translated to decimal numbers: ((954437177 * ((y - 46) * 10)) / 34359738368) + 5
This results in 434 being reduced to 125 (Max y = 480 - 46 = 434)

The first line does the multiplications and the second line does the divide. (lVar1 >> 0x23) The subtract with the msb is probably for adjusting when result became negative.

So what line of C code results to this pseudo code?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 28, 2021, 11:20:58 am
I made a list of what is done and what still needs to be implemented, which is still quite a bit :palm:

Implemented so far

Still to do

So still a lot of work ahead of me.

First edit to flag battery charge monitoring done on 28th of September 2021 at 18:56:41
Second edit to flag power off interrupt done on 28th of September 2021 at 21:00:00

Edit: These two where reasonable small parts to implement. Battery code was already investigated, so not a lot of work and the power off interrupt part was only investigating four fairly small and simple functions.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 01, 2021, 10:33:33 am
Unfortunately not able to work on the project all the time :(

But today again time for it. Analyzed the settings in the flash memory and found out I'm still not done with finding the variables :o

They restore data to a point in memory I have not found the code for that makes use of the data. I think it is some calibration data. The rest of the settings are known :)

This is the function that copies the data loaded from flash address 0x001FD000 to the actual settings
Code: [Select]
void restore_config_data(uint *address)  //0x8035344E

{
  undefined2 uVar1;
  undefined *puVar2;
  int iVar3;
  int iVar4;
  undefined2 *puVar5;
  uint *puVar6;
  int iVar7;
  undefined *puVar8;
 
  puVar5 = DAT_80027a1c;    //0x802F18B0
  iVar4 = DAT_80027a18;     //0x801FA24C    base of measurement settings
  iVar3 = DAT_80027a14;     //0x80361378    base of settings like screen brightness
  puVar2 = DAT_80027a10;    //0x8019D5A0    base of scope settings

  puVar6 = address + 0x53;
  puVar8 = (undefined *)(iVar4 + -1);
  iVar7 = 0xc;

  //                                                                               bytes
  puVar2[0] = *(undefined *)address;                    //channel 1 enable         0x8035344E   0
  puVar2[3] = *(undefined *)((int)address + 2);         //          volts/div      0x80353450   1
  puVar2[4] = *(undefined *)(address + 1);              //          fft enable     0x80353452   2
  puVar2[1] = *(undefined *)((int)address + 6);         //          coupling       0x80353454   3
  puVar2[2] = *(undefined *)(address + 2);              //          magnification  0x80353456   4

  //                                                                               bytes
  puVar2[0xc] = *(undefined *)((int)address + 10);      //channel 2 enable         0x80353458   5
  puVar2[0xf] = *(undefined *)(address + 3);            //          volts/div      0x8035345A   6
  puVar2[0x10] = *(undefined *)((int)address + 0xe);    //          fft enable     0x8035345C   7
  puVar2[0xd] = *(undefined *)(address + 4);            //          coupling       0x8035345E   8
  puVar2[0xe] = *(undefined *)((int)address + 0x12);    //          magnification  0x80353460   9

  //                                                                               byte
  puVar2[10] = *(undefined *)(address + 5);             //time base                0x80353462   10

  //                                                                               byte
  puVar2[0x16] = *(undefined *)((int)address + 0x16);   //move speed               0x80353464   11

  //                                                                               bytes
  puVar2[0x21] = *(undefined *)(address + 6);           //trigger mode             0x80353466   12
  puVar2[0x22] = *(undefined *)((int)address + 0x1a);   //trigger edge             0x80353468   13
  puVar2[0x23] = *(undefined *)(address + 7);           //trigger channel          0x8035346A   14

  //                                                                               byte
  puVar2[0x42] = *(undefined *)((int)address + 0x1e);   //right menu state         0x8035346C   15


  //                                                                                    shorts
  *(undefined2 *)(puVar2 + 0x24) = *(undefined2 *)(address + 0x14);                   //0x8035349E   trigger position on screen    40
  *(undefined2 *)(puVar2 + 0x26) = *(undefined2 *)((int)address + 0x52);              //0x803534A0   trigger level screen offset   41

  //                                                                                    shorts
  *(undefined2 *)(puVar2 + 6) = *(undefined2 *)(address + 0x15);                      //0x803534A2   channel 1 screen offset       42
  *(undefined2 *)(puVar2 + 0x12) = *(undefined2 *)((int)address + 0x56);              //0x803534A4   channel 2 screen offset       43

  //                                                                                    bytes
  *(undefined *)(iVar3 + 2) = *(undefined *)(address + 0x1e);                         //0x803534C6   screen brightness             60
  *(undefined *)(iVar3 + 3) = *(undefined *)((int)address + 0x7a);                    //0x803534C8   grid brightness               61
  *(undefined *)(iVar3 + 4) = *(undefined *)(address + 0x1f);                         //0x803534CA   always 50% trigger            62
  *(undefined *)(iVar3 + 7) = *(undefined *)((int)address + 0x7e);                    //0x803534CC   xy display mode               63

  //Measurement settings
  //Channel 1 enable 12 items                                                           bytes
  *(undefined *)(iVar4 + 0x100) = *(undefined *)(address + 0x28);                     //0x803534EE   Vmax          80
  *(undefined *)(iVar4 + 0x112) = *(undefined *)((int)address + 0xa2);                //0x803534F0   Vmin          81
  *(undefined *)(iVar4 + 0x122) = *(undefined *)(address + 0x29);                     //0x803534F2   Vavg          82
  *(undefined *)(iVar4 + 0x132) = *(undefined *)((int)address + 0xa6);                //0x803534F4   Vrms          83
  *(undefined *)(iVar4 + 0x142) = *(undefined *)(address + 0x2a);                     //0x803534F6   Vpp           84
  *(undefined *)(iVar4 + 0x152) = *(undefined *)((int)address + 0xaa);                //0x803534F8   Vp            85
  *(undefined *)(iVar4 + 0x162) = *(undefined *)(address + 0x2b);                     //0x803534FA   Freq          86
  *(undefined *)(iVar4 + 0x172) = *(undefined *)((int)address + 0xae);                //0x803534FC   Cycle         87
  *(undefined *)(iVar4 + 0x182) = *(undefined *)(address + 0x2c);                     //0x803534FE   Tim+          88
  *(undefined *)(iVar4 + 0x192) = *(undefined *)((int)address + 0xb2);                //0x80353500   Tim-          89
  *(undefined *)(iVar4 + 0x1a2) = *(undefined *)(address + 0x2d);                     //0x80353502   Duty+         90
  *(undefined *)(iVar4 + 0x1b2) = *(undefined *)((int)address + 0xb6);                //0x80353504   Duty-         91

  //Channel 2 enable 12 items                                                           bytes
  *(undefined *)(iVar4 + 0x1c2) = *(undefined *)(address + 0x2e);                     //0x80353506   Vmax          92
  *(undefined *)(iVar4 + 0x1d2) = *(undefined *)((int)address + 0xba);                //0x80353508   Vmin          93
  *(undefined *)(iVar4 + 0x1e2) = *(undefined *)(address + 0x2f);                     //0x8035350A   Vavg          94
  *(undefined *)(iVar4 + 0x1f2) = *(undefined *)((int)address + 0xbe);                //0x8035350C   Vrms          95
  *(undefined *)(iVar4 + 0x202) = *(undefined *)(address + 0x30);                     //0x8035350E   Vpp           96
  *(undefined *)(iVar4 + 0x212) = *(undefined *)((int)address + 0xc2);                //0x80353510   Vp            97
  *(undefined *)(iVar4 + 0x232) = *(undefined *)(address + 0x31);                     //0x80353512   Freq          98
  *(undefined *)(iVar4 + 0x242) = *(undefined *)((int)address + 0xc6);                //0x80353514   Cycle         99
  *(undefined *)(iVar4 + 0x252) = *(undefined *)(address + 0x32);                     //0x80353516   Tim+         100
  *(undefined *)(iVar4 + 0x262) = *(undefined *)((int)address + 0xca);                //0x80353518   Tim-         101
  *(undefined *)(iVar4 + 0x272) = *(undefined *)(address + 0x33);                     //0x8035351A   Duty+        102
  *(undefined *)(iVar4 + 0x282) = *(undefined *)((int)address + 0xce);                //0x8035351C   Duty-        103

  //Channel 1 calibration data                                                          shorts
  puVar5[0] = *(undefined2 *)(address + 0x3c);                                        //0x802F18B0 = 0x8035353E  channel1_calibration_factor    120
  puVar5[1] = *(undefined2 *)((int)address + 0xf2);                                   //0x802F18B2 = 0x80353540  channel1_calibration_data[0]
  puVar5[2] = *(undefined2 *)(address + 0x3d);                                        //0x802F18B4 = 0x80353542
  puVar5[3] = *(undefined2 *)((int)address + 0xf6);                                   //0x802F18B6 = 0x80353544
  puVar5[4] = *(undefined2 *)(address + 0x3e);                                        //0x802F18B8 = 0x80353546
  puVar5[5] = *(undefined2 *)((int)address + 0xfa);                                   //0x802F18BA = 0x80353548
  puVar5[6] = *(undefined2 *)(address + 0x3f);                                        //0x802F18BC = 0x8035354A  channel1_calibration_data[5] (needs to be copied into [6]!!)

  //Channel 2 calibration data                                                          shorts
  puVar5[7] = *(undefined2 *)((int)address + 0xfe);                                   //0x802F18BE = 0x8035354C  channel2_calibration_factor    127
  puVar5[8] = *(undefined2 *)(address + 0x40);                                        //0x802F18C0 = 0x8035354E  channel2_calibration_data[0]
  puVar5[9] = *(undefined2 *)((int)address + 0x102);                                  //0x802F18C2 = 0x80353550
  puVar5[10] = *(undefined2 *)(address + 0x41);                                       //0x802F18C4 = 0x80353552
  puVar5[0xb] = *(undefined2 *)((int)address + 0x106);                                //0x802F18C6 = 0x80353554
  puVar5[0xc] = *(undefined2 *)(address + 0x42);                                      //0x802F18C8 = 0x80353556
  puVar5[0xd] = *(undefined2 *)((int)address + 0x10a);                                //0x802F18CA = 0x80353558  channel2_calibration_data[5]   133


  //Some other calibration data that still needs to be investigated
  //                                                                                    shorts
  puVar5[0xe] = *(undefined2 *)(address + 0x43);                                      //0x802F18CC = 0x8035355A   134
  puVar5[0xf] = *(undefined2 *)((int)address + 0x10e);                                //0x802F18CE = 0x8035355C
  puVar5[0x10] = *(undefined2 *)(address + 0x44);                                     //0x802F18D0 = 0x8035355E
  puVar5[0x11] = *(undefined2 *)((int)address + 0x112);                               //0x802F18D2 = 0x80353560


  //                                                                                    bytes
  *(undefined *)(puVar5 + 0x12) = *(undefined *)(address + 0x45);                     //0x802F18D4 = 0x80353562
  *(undefined *)((int)puVar5 + 0x25) = *(undefined *)((int)address + 0x116);          //0x802F18D5 = 0x80353564
  *(undefined *)(puVar5 + 0x13) = *(undefined *)(address + 0x46);                     //0x802F18D6 = 0x80353566
  *(undefined *)((int)puVar5 + 0x27) = *(undefined *)((int)address + 0x11a);          //0x802F18D7 = 0x80353568
  *(undefined *)(puVar5 + 0x14) = *(undefined *)(address + 0x47);                     //0x802F18D8 = 0x8035356A
  *(undefined *)((int)puVar5 + 0x29) = *(undefined *)((int)address + 0x11e);          //0x802F18D9 = 0x8035356C

  //                                                                                    shorts
  puVar5[0x15] = *(undefined2 *)(address + 0x48);                                     //0x802F18DA = 0x8035356E
  puVar5[0x16] = *(undefined2 *)((int)address + 0x122);                               //0x802F18DC = 0x80353570
  puVar5[0x17] = *(undefined2 *)(address + 0x49);                                     //0x802F18DE = 0x80353572
  puVar5[0x18] = *(undefined2 *)((int)address + 0x126);                               //0x802F18E0 = 0x80353574
  puVar5[0x19] = *(undefined2 *)(address + 0x4a);                                     //0x802F18E2 = 0x80353576
  puVar5[0x1a] = *(undefined2 *)((int)address + 0x12a);                               //0x802F18E4 = 0x80353578

  //                                                                                    bytes
  *(undefined *)(puVar5 + 0x1b) = *(undefined *)(address + 0x4b);                     //0x802F18E6 = 0x8035357A
  *(undefined *)((int)puVar5 + 0x37) = *(undefined *)((int)address + 0x12e);          //0x802F18E7 = 0x8035357C
  *(undefined *)(puVar5 + 0x1c) = *(undefined *)(address + 0x4c);                     //0x802F18E8 = 0x8035357E
  *(undefined *)((int)puVar5 + 0x39) = *(undefined *)((int)address + 0x132);          //0x802F18E9 = 0x80353580
  *(undefined *)(puVar5 + 0x1d) = *(undefined *)(address + 0x4d);                     //0x802F18EA = 0x80353582
  *(undefined *)((int)puVar5 + 0x3b) = *(undefined *)((int)address + 0x136);          //0x802F18EB = 0x80353584

  //                                                                                    shorts
  puVar5[0x1e] = *(undefined2 *)(address + 0x4e);                                     //0x802F18EC = 0x80353586
  puVar5[0x1f] = *(undefined2 *)((int)address + 0x13a);                               //0x802F18EE = 0x80353588
  puVar5[0x20] = *(undefined2 *)(address + 0x4f);                                     //0x802F18F0 = 0x8035358A
  puVar5[0x21] = *(undefined2 *)((int)address + 0x13e);                               //0x802F18F2 = 0x8035358C
  puVar5[0x22] = *(undefined2 *)(address + 0x50);                                     //0x802F18F4 = 0x8035358E

  uVar1 = *(undefined2 *)((int)address + 0x142);                                      //             0x80353590

  //                                                                                    short
  puVar5[0x23] = uVar1;                                                               //0x802F18F6 = 0x80353590  time cursor enable??? for what



  //                                                                                    byte
  *(char *)(iVar4 + 0x292) = (char)uVar1;                                             //0x801FA4DE = 0x80353590  time cursor enable       161

  //                                                                                    shorts
  *(undefined2 *)(iVar4 + 0x294) = *(undefined2 *)(address + 0x51);                   //0x801FA4E0 = 0x80353592  time cursor 1 position   162
  *(undefined2 *)(iVar4 + 0x296) = *(undefined2 *)((int)address + 0x146);             //0x801FA4E2 = 0x80353594  time cursor 2 position   163

  //                                                                                    byte
  *(undefined *)(iVar4 + 0x29a) = *(undefined *)(address + 0x52);                     //0x801FA4E6 = 0x80353596  volt cursor enable       164

  //                                                                                    shorts
  *(undefined2 *)(iVar4 + 0x29c) = *(undefined2 *)((int)address + 0x14a);             //0x801FA4E8 = 0x80353598  volt cursor 1 position   165
  *(undefined2 *)(iVar4 + 0x29e) = *(undefined2 *)(address + 0x53);                   //0x801FA4EA = 0x8035359A  volt cursor 2 position   166


  //12 items times 2
  //Load and store bytes
  //Source start      0x8035359C
  //Destination start 0x801FA24C
  //This is the list of enabled measurement items in the order of displaying
  do {
    iVar7 = iVar7 + -1;
    puVar8[1] = *(undefined *)((int)puVar6 + 2);
    puVar6 = puVar6 + 1;
    puVar8 = puVar8 + 2;
    *puVar8 = *(undefined *)puVar6;
  } while (iVar7 != 0);


  //System OK flag (0x1432)                                                             short
  *(undefined2 *)(puVar2 + 0x44) = *(undefined2 *)(address + 100);                    //0x8019D5E4 = 803535DE
  return;
}


This is my version of it
Code: [Select]
void scope_restore_config_data(void)
{
  uint32  channel;
  uint32  index;
  uint16 *ptr;
 
  //Restore the channel 1 settings
  scopesettings.channel1.enable        = settingsworkbuffer[0];
  scopesettings.channel1.coupling      = settingsworkbuffer[3];
  scopesettings.channel1.magnification = settingsworkbuffer[4];
  scopesettings.channel1.voltperdiv    = settingsworkbuffer[1];
  scopesettings.channel1.fftenable     = settingsworkbuffer[2];
  scopesettings.channel1.traceoffset   = settingsworkbuffer[42];

  //Restore the channel 2 settings
  scopesettings.channel2.enable        = settingsworkbuffer[5];
  scopesettings.channel2.coupling      = settingsworkbuffer[8];
  scopesettings.channel2.magnification = settingsworkbuffer[9];
  scopesettings.channel2.voltperdiv    = settingsworkbuffer[6];
  scopesettings.channel2.fftenable     = settingsworkbuffer[7];
  scopesettings.channel2.traceoffset   = settingsworkbuffer[43];
 
  //Restore trigger settings
  scopesettings.triggermode     = settingsworkbuffer[12];
  scopesettings.triggeredge     = settingsworkbuffer[13];
  scopesettings.triggerchannel  = settingsworkbuffer[14];
  scopesettings.triggerposition = settingsworkbuffer[40];
  scopesettings.triggeroffset   = settingsworkbuffer[41];
 
  //Restore the time base
  scopesettings.timeperdiv = settingsworkbuffer[10];

  //Restore the move speed
  scopesettings.movespeed = settingsworkbuffer[11];
 
  //Restore the right menu state
  scopesettings.rightmenustate = settingsworkbuffer[15];
 
  //Restore screen brightness, grid brightness, always 50% trigger and xy display mode
  scopesettings.screenbrightness = settingsworkbuffer[60];
  scopesettings.gridbrightness   = settingsworkbuffer[61];
  scopesettings.alwaystrigger50  = settingsworkbuffer[62];
  scopesettings.xymodedisplay    = settingsworkbuffer[63];
 
  //Restore the time cursor settings
  scopesettings.timecursorsenable   = settingsworkbuffer[161];
  scopesettings.timecursor1position = settingsworkbuffer[162];
  scopesettings.timecursor2position = settingsworkbuffer[163];
 
  //Restore the volt cursor settings
  scopesettings.voltcursorsenable   = settingsworkbuffer[164];
  scopesettings.voltcursor1position = settingsworkbuffer[165];
  scopesettings.voltcursor2position = settingsworkbuffer[166];

 
  //Point to the first measurement enable setting
  ptr = &settingsworkbuffer[80];
 
  //Restore the measurements enable states
  for(channel=0;channel<2;channel++)
  {
    //12 measurements per channel
    for(index=0;index<12;index++)
    {
      //Copy the current measurement state and point to the next one
      scopesettings.measuresstate[channel][index] = *ptr++;
    }
  }
 
  //Restore the calibration data
  channel1_calibration_factor = settingsworkbuffer[120];
  channel2_calibration_factor = settingsworkbuffer[127];

  //Point to the first channel calibration value
  ptr = &settingsworkbuffer[121];
 
  //Copy the saved values to the working set
  for(index=0;index<6;index++,ptr++)
  {
    //Copy the data for both channels
    channel1_calibration_data[index] = ptr[0];
    channel2_calibration_data[index] = ptr[7];
  }

  //The last entry is a copy of the fore last value
  //Different from the original code where they use a switch statement instead of an array index for getting the data
  channel1_calibration_data[6] = settingsworkbuffer[126];
  channel2_calibration_data[6] = settingsworkbuffer[133];

  //Need the system ok flag  (settingsworkbuffer[200])
 
 
}


Need to implement the counter part of it for writing to the flash and need to hook it in to the main code for testing.

When that is done it is back to analyzing and reversing code again, since all the remaining items on the to do list are still like mars. Only touched on the surface :-DD

Edit: Stupid me keeps making the copy, paste not modify errors. Forgot to change the scopesettings.channel1. to  scopesettings.channel2. :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 01, 2021, 01:57:40 pm
Settings loading and saving to flash is implemented and working. Added the new notification confirmation setting to it.

Here are the updated lists

Implemented so far

Still to do
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 01, 2021, 04:27:42 pm
How funny  :-DD the code for displaying the cursor measurements, which is an absolute horror :palm: can display up to GHz.

Edit: Playing with the cursor on my still original scope shows a max of 5.00GHz when the two cursors touch each other and the time per div is 10nS. Which is of course correct, but still the code they wrote for it is shit.

Code: [Select]
        if (uVar9 == 1000)
        {
LAB_80010258:
          local_80 = '1';
          local_7f = 'G';
          local_7e = 'H';
          local_7d = 'z';
          local_7c = 0;
          goto LAB_80010394;
        }

I'm not going to reverse that code |O

For the curious people out there, the output of Ghidra for this function is here: https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Software%20reverse%20engineering/C%20analysis/Main%20loop/trace%20data%20processing/scope_display_cursor_measurements.c (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Software%20reverse%20engineering/C%20analysis/Main%20loop/trace%20data%20processing/scope_display_cursor_measurements.c)

Will write my own and save time and code size. :)

Edit: there is also an error in it when both channels are disabled and the volt cursor is on. See the lower left corner in the picture. "V1 = 201V" should not be there
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 02, 2021, 11:40:21 am
Cursor measurements done.

Way simpler code then the original code. Just a case of use your brain and some functions 8)

Code: [Select]
typedef struct tagTimeCalcData          TIMECALCDATA,         *PTIMECALCDATA;
typedef struct tagVoltCalcData          VOLTCALCDATA,         *PVOLTCALCDATA;

struct tagTimeCalcData
{
  uint32 mul_factor;
  uint8  time_scale;
  uint8  freq_scale;
};

struct tagVoltCalcData
{
  uint32 mul_factor;
  uint8  volt_scale;
};

const TIMECALCDATA time_calc_data[21] =
{
  {    100, 3, 3 },         // 50mS/div
  {  40000, 2, 4 },         // 20mS/div
  {  20000, 2, 4 },         // 10mS/div
  {  10000, 2, 4 },         //  5mS/div
  {   4000, 2, 4 },         //  2mS/div
  {   2000, 2, 4 },         //  1mS/div
  {   1000, 2, 4 },         //500uS/div
  {    400, 2, 4 },         //200uS/div
  {    200, 2, 4 },         //100uS/div
  {    100, 2, 4 },         // 50uS/div
  {  40000, 1, 5 },         // 20uS/div
  {  20000, 1, 5 },         // 10uS/div
  {  10000, 1, 5 },         //  5uS/div
  {   4000, 1, 5 },         //  2uS/div
  {   2000, 1, 5 },         //  1uS/div
  {   1000, 1, 5 },         //500nS/div
  {    500, 1, 5 },         //250nS/div
  {    200, 1, 5 },         //100nS/div
  {    100, 1, 5 },         // 50nS/div
  {  50000, 0, 6 },         // 25nS/div
  {  20000, 0, 6 }          // 10nS/div
};

const VOLTCALCDATA volt_calc_data[3][7] =
{
  { {  10000, 3 },  {  5000, 3 }, {  2000, 3 }, {  1000, 3 }, {  400, 3 }, {  200, 3 }, {  100, 3 } },
  { { 100000, 3 },  { 50000, 3 }, { 20000, 3 }, { 10000, 3 }, { 4000, 3 }, { 2000, 3 }, { 1000, 3 } },
  { {   1000, 4 },  {   500, 4 }, {   200, 4 }, {   100, 4 }, {   40, 4 }, {   20, 4 }, {   10, 4 } }
};

const char *magnitude_scaler[8] = { "p", "n", "u", "m", "", "K", "M", "G"};

void scope_display_cursor_measurements(void)
{
  uint32 height = 5;
  uint32 ch1ypos = 52;
  uint32 ch2ypos = 52;
  uint32 delta;
  char   displaytext[10];
 
  //Check if need to do anything here
  if(scopesettings.timecursorsenable || (scopesettings.voltcursorsenable && (scopesettings.channel1.enable || scopesettings.channel2.enable)))
  {
    //Check if time cursor is enabled
    if(scopesettings.timecursorsenable)
    {
      //Add height for two text lines
      height += 32;
     
      //Shift the voltage text positions down
      ch1ypos += 32;
      ch2ypos += 32;
    }
   
    //Check if volt cursor is enabled
    if(scopesettings.voltcursorsenable)
    {
      //Check if channel 1 is enabled
      if(scopesettings.channel1.enable)
      {
        //Add height for one text line
        height += 16;
       
        //Shift the channel 2 voltage text down
        ch2ypos += 16;
      }
     
      //Check if channel 2 is enabled
      if(scopesettings.channel2.enable)
      {
        //Add height for one text line
        height += 16;
      }
    }
 
    //Set gray background for the cursor measurements
    display_set_fg_color(0x00404040);

    //Draw rounded rectangle depending on what is enabled.
    display_fill_rounded_rect(5, 49, 102, height, 2);

    //Use white text and font_0
    display_set_fg_color(0x00FFFFFF);
    display_set_font(&font_0);
   
    //Check if time cursor is enabled
    if(scopesettings.timecursorsenable)
    {
      //Time texts are always on the top two lines

      //Get the time delta based on the cursor positions
      delta = scopesettings.timecursor2position - scopesettings.timecursor1position;
     
      //Get the time calculation data for this time base setting. Only for the short time bases so take of the first 9
      PTIMECALCDATA tcd = (PTIMECALCDATA)&time_calc_data[scopesettings.timeperdiv - 9];
     
      //For the time multiply with the scaling factor and display based on the time scale
      delta *= tcd->mul_factor;
     
      //Format the time for displaying
      scope_print_value(displaytext, delta, tcd->time_scale, "T ", "S");
      display_text(10, 52, displaytext);
     
      //Calculate the frequency for this time. Need to adjust for stay within 32 bits
      delta /= 10;
      delta = 1000000000/ delta;
     
      //Format the frequency for displaying
      scope_print_value(displaytext, delta, tcd->freq_scale, "F ", "Hz");
      display_text(10, 68, displaytext);
    }
   
    //Check if volt cursor is enabled
    if(scopesettings.voltcursorsenable)
    {
      PVOLTCALCDATA vcd;
      uint32        volts;
     
      //Get the volts delta based on the cursor positions
      delta = scopesettings.voltcursor2position - scopesettings.voltcursor1position;
     
      //Check if channel 1 is enabled
      if(scopesettings.channel1.enable)
      {
        //Calculate the voltage based on the channel 1 settings
        vcd = (PVOLTCALCDATA)&volt_calc_data[scopesettings.channel1.magnification][scopesettings.channel1.voltperdiv];
       
        //Multiply with the scaling factor for the channel 1 settings
        volts = delta * vcd->mul_factor;
       
        //Channel 1 text has a variable position
        //Format the voltage for displaying
        scope_print_value(displaytext, volts, vcd->volt_scale, "V1 ", "V");
        display_text(10, ch1ypos, displaytext);
      }
     
      //Check if channel 2 is enabled
      if(scopesettings.channel2.enable)
      {
        //Calculate the voltage based on the channel 2 settings
        vcd = (PVOLTCALCDATA)&volt_calc_data[scopesettings.channel2.magnification][scopesettings.channel2.voltperdiv];
       
        //Multiply with the scaling factor for the channel 2 settings
        volts = delta * vcd->mul_factor;
       
        //Channel 2 text has a variable position
        //Format the voltage for displaying
        scope_print_value(displaytext, volts, vcd->volt_scale, "V2 ", "V");
        display_text(10, ch2ypos, displaytext);
      }
    }
  }
}

//----------------------------------------------------------------------------------------------------------------------------------
//Simple non optimized function for string copy that returns the position of the terminator
//----------------------------------------------------------------------------------------------------------------------------------
char *strcpy(char *dst, const char *src)
{
  while(*src)
  {
    *dst++ = *src++;
  }
 
  //Terminate the copy
  *dst = 0;
 
  return(dst);
}

//----------------------------------------------------------------------------------------------------------------------------------

void scope_print_value(char *buffer, uint32 value, uint32 scale, char *header, char *sign)
{
  //Copy the header into the string buffer
  buffer = strcpy(buffer, header);

  //Need to find the magnitude scale for the input
  //The calculations are based on fixed point
  while(value >= 100000)
  {
    //Skip to the next magnitude
    scale++;
   
    //Bring the value in range
    value /= 1000;
  }

  //Format the remainder for displaying. Only 3 digits are allowed to be displayed
  if(value < 1000)
  {
    //Less then 1000 means x.yy
    buffer = scope_print_decimal(buffer, value, 2);
  }
  else if(value < 10000)
  {
    //More then 1000 but less then 10000 means xx.y
    value /= 10;
    buffer = scope_print_decimal(buffer, value, 1);
  }
  else
  {
    //More then 10000 and less then 100000 means xxx
    value /= 100;
    buffer = scope_print_decimal(buffer, value, 0);
  }

  //Make sure scale is not out of range
  if(scale > 7)
  {
    scale = 7;
  }
 
  //Add the magnitude scaler
  buffer = strcpy(buffer, magnitude_scaler[scale]);
 
  //Add the type of measurement sign
  strcpy(buffer, sign);
}

//----------------------------------------------------------------------------------------------------------------------------------

char *scope_print_decimal(char *buffer, uint32 value, uint32 decimals)
{
  char    b[12];
  uint32  i = 12;   //Start beyond the array since the index is pre decremented
  uint32  s;

  //For value 0 no need to do the work
  if(value == 0)
  {
    //Value is zero so just set 0 character
    b[--i] = '0';
  }
  else
  {
    //Process the digits
    while(value)
    {
      //Set current digit to decreased index
      b[--i] = (value % 10) + '0';

      //Check if decimal point needs to be placed
      if(i == 12 - decimals)
      {
        //If so put it in
        b[--i] = '.';
      }
     
      //Take of the current digit
      value /= 10;
    }
  }

  //Determine the size of the string
  s = 12 - i;
 
  //Copy to the buffer
  memcpy(buffer, &b[i], s);
 
  //terminate the string
  buffer[s] = 0;
 
  //Return the position of the terminator to allow appending
  return(&buffer[s]);
}


Tried using assembly versions of strcpy and strlen, but for some reason it did not work on the target. No problem under linux with the standard library functions, so I wrote my own strcpy, that returns a pointer to the end of the destination string instead of the beginning.

Checked it with different settings and cursor positions and it looks good.

So on to the next bit.

Implemented so far

Still to do
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 03, 2021, 10:39:01 am
Returned to the trace data processing, even though I wrote earlier I would skip it and write my own FPGA implementation.

To get a first working version of this open scope firmware, and have people test it, it is easier to stick with the original FPGA for now.

So I dove into the 25 and 10nS/div code. There are two functions per channel doing the work. Had to revert to my emulator to get to the bottom of the first function because the Ghidra output did not make it clear on what is being done.

This is the untouched C output
Code: [Select]
void scope_pre_process_ch1_25ns_data(void)
{
  undefined2 uVar1;
  int iVar2;
  int iVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  uint *puVar7;
  uint **ppuVar8;
  uint **ppuVar9;
  byte *pbVar10;
  undefined2 *puVar11;
  uint uVar12;
  uint uVar13;
  byte bVar14;
  uint uVar15;
  int iVar16;
  short *psVar17;
  byte bVar18;
  undefined2 uVar19;
  uint *puVar20;
  uint *puVar21;
  uint uVar22;
  uint uVar23;
  uint uVar24;
  bool bVar25;
  bool bVar26;
 
  puVar7 = DAT_8000470c;
  puVar21 = DAT_80004708;
  iVar16 = 0x2e8;
  *(undefined2 *)((int)DAT_8000470c + 2) = *(undefined2 *)DAT_80004708;
  uVar19 = *(undefined2 *)((int)puVar21 + 2);
  puVar11 = (undefined2 *)((int)puVar7 + 2);
  do {
    uVar1 = *(undefined2 *)(puVar21 + 1);
    puVar11[2] = uVar19;
    uVar19 = *(undefined2 *)((int)puVar21 + 6);
    iVar16 = iVar16 + -1;
    puVar11 = puVar11 + 4;
    *puVar11 = uVar1;
    iVar3 = DAT_8000471c;
    iVar2 = DAT_80004718;
    puVar21 = puVar21 + 1;
  } while (iVar16 != 0);
  *(undefined2 *)(DAT_80004714 + 2) = *DAT_80004710;
  uVar15 = DAT_80004720;
  uVar12 = 0;
  if (*(short *)(iVar2 + 0x1c) == 0) {
    do {
      uVar13 = (uint)*(ushort *)(iVar3 + uVar12 * 2);
      if (*(ushort *)(iVar2 + 0x1e) < uVar13) {
        puVar21 = (uint *)(uVar13 - *(ushort *)(iVar2 + 0x1e));
        *(short *)(puVar7 + uVar12) = (short)puVar21;
      }
      else {
        puVar21 = puVar7 + uVar12;
        *(undefined2 *)puVar21 = 0;
      }
      uVar12 = uVar12 + 1 & 0xfffeffff;
    } while (uVar12 < uVar15);
  }
  else {
    do {
      psVar17 = (short *)(iVar3 + uVar12 * 2);
      puVar21 = puVar7 + uVar12;
      uVar12 = uVar12 + 2 & 0xfffeffff;
      *(short *)puVar21 = *psVar17 + *(short *)(iVar2 + 0x1e);
      *(short *)(puVar21 + 1) = psVar17[1] + *(short *)(iVar2 + 0x1e);
    } while (uVar12 < uVar15);
  }
  uVar12 = DAT_80004724;
  puVar5 = DAT_80004708;
  puVar7 = DAT_8000470c;
  if (3 < DAT_80004724) {
    puVar20 = (uint *)((uint)DAT_80004708 & 3);
    uVar13 = DAT_80004724;
    puVar21 = puVar20;
    if (puVar20 != NULL) {
      bVar14 = *(byte *)DAT_8000470c;
      puVar6 = (uint *)((int)DAT_8000470c + 1);
      if (puVar20 < (uint *)0x3) {
        puVar6 = (uint *)((int)DAT_8000470c + 2);
        puVar21 = (uint *)(uint)*(byte *)(uint *)((int)DAT_8000470c + 1);
      }
      puVar4 = (uint *)((int)DAT_80004708 + 1);
      *(byte *)DAT_80004708 = bVar14;
      puVar7 = puVar6;
      if (puVar20 < (uint *)0x2) {
        puVar7 = (uint *)((int)puVar6 + 1);
        bVar14 = *(byte *)puVar6;
      }
      puVar6 = puVar4;
      if (puVar20 < (uint *)0x3) {
        puVar6 = (uint *)((int)puVar5 + 2);
        *(byte *)puVar4 = (byte)puVar21;
      }
      uVar13 = (int)puVar20 + (uVar12 - 4);
      puVar5 = puVar6;
      if (puVar20 < (uint *)0x2) {
        puVar5 = (uint *)((int)puVar6 + 1);
        *(byte *)puVar6 = bVar14;
      }
    }
    uVar15 = (uint)puVar7 & 3;
    if (uVar15 == 0) {
      while (uVar12 = uVar13 - 0x20, 0x1f < uVar13) {
        uVar15 = puVar7[1];
        uVar13 = puVar7[2];
        uVar22 = puVar7[3];
        *puVar5 = *puVar7;
        puVar5[1] = uVar15;
        puVar5[2] = uVar13;
        puVar5[3] = uVar22;
        uVar15 = puVar7[4];
        uVar13 = puVar7[5];
        uVar22 = puVar7[6];
        uVar23 = puVar7[7];
        puVar7 = puVar7 + 8;
        puVar5[4] = uVar15;
        puVar5[5] = uVar13;
        puVar5[6] = uVar22;
        puVar5[7] = uVar23;
        puVar5 = puVar5 + 8;
        uVar13 = uVar12;
      }
      if ((bool)((byte)(uVar12 >> 4) & 1)) {
        uVar15 = *puVar7;
        uVar22 = puVar7[1];
        uVar23 = puVar7[2];
        uVar24 = puVar7[3];
        puVar7 = puVar7 + 4;
        *puVar5 = uVar15;
        puVar5[1] = uVar22;
        puVar5[2] = uVar23;
        puVar5[3] = uVar24;
        puVar5 = puVar5 + 4;
      }
      if ((int)(uVar13 << 0x1c) < 0) {
        uVar15 = *puVar7;
        uVar22 = puVar7[1];
        puVar7 = puVar7 + 2;
        *puVar5 = uVar15;
        puVar5[1] = uVar22;
        puVar5 = puVar5 + 2;
      }
      puVar20 = puVar5;
      puVar21 = puVar7;
      if ((bool)((byte)(uVar12 >> 2) & 1)) {
        puVar21 = puVar7 + 1;
        uVar15 = *puVar7;
        puVar20 = puVar5 + 1;
        *puVar5 = uVar15;
      }
      uVar19 = (undefined2)uVar15;
      if ((uVar12 & 3) != 0) {
        bVar26 = (bool)((byte)(uVar12 >> 1) & 1);
        uVar13 = uVar13 << 0x1f;
        bVar25 = (int)uVar13 < 0;
        puVar7 = puVar21;
        if (bVar26) {
          puVar7 = (uint *)((int)puVar21 + 2);
          uVar19 = *(undefined2 *)puVar21;
        }
        if (bVar25) {
          uVar13 = (uint)*(byte *)puVar7;
        }
        puVar21 = puVar20;
        if (bVar26) {
          puVar21 = (uint *)((int)puVar20 + 2);
          *(undefined2 *)puVar20 = uVar19;
        }
        if (bVar25) {
          *(byte *)puVar21 = (byte)uVar13;
        }
        return;
      }
      return;
    }
    uVar12 = uVar13 - 4;
    if (3 < uVar13) {
      ppuVar8 = (uint **)((int)puVar7 - uVar15);
      puVar21 = *ppuVar8;
      puVar7 = puVar5;
      if (uVar15 == 2) {
        do {
          ppuVar9 = ppuVar8;
          uVar15 = (uint)puVar21 >> 0x10;
          ppuVar8 = ppuVar9 + 1;
          puVar21 = *ppuVar8;
          bVar25 = 3 < uVar12;
          uVar12 = uVar12 - 4;
          uVar15 = uVar15 | (int)puVar21 << 0x10;
          puVar5 = puVar7 + 1;
          *puVar7 = uVar15;
          puVar7 = puVar5;
        } while (bVar25);
        puVar7 = (uint *)((int)ppuVar9 + 6);
      }
      else {
        if (uVar15 < 3) {
          do {
            ppuVar9 = ppuVar8;
            uVar15 = (uint)puVar21 >> 8;
            ppuVar8 = ppuVar9 + 1;
            puVar21 = *ppuVar8;
            bVar25 = 3 < uVar12;
            uVar12 = uVar12 - 4;
            uVar15 = uVar15 | (int)puVar21 << 0x18;
            puVar5 = puVar7 + 1;
            *puVar7 = uVar15;
            puVar7 = puVar5;
          } while (bVar25);
          puVar7 = (uint *)((int)ppuVar9 + 5);
        }
        else {
          do {
            ppuVar9 = ppuVar8;
            uVar15 = (uint)puVar21 >> 0x18;
            ppuVar8 = ppuVar9 + 1;
            puVar21 = *ppuVar8;
            bVar25 = 3 < uVar12;
            uVar12 = uVar12 - 4;
            uVar15 = uVar15 | (int)puVar21 << 8;
            puVar5 = puVar7 + 1;
            *puVar7 = uVar15;
            puVar7 = puVar5;
          } while (bVar25);
          puVar7 = (uint *)((int)ppuVar9 + 7);
        }
      }
    }
  }
  bVar18 = (byte)puVar21;
  bVar14 = (byte)uVar15;
  bVar26 = (bool)((byte)(uVar12 >> 1) & 1);
  uVar12 = uVar12 << 0x1f;
  bVar25 = (int)uVar12 < 0;
  if (bVar26) {
    pbVar10 = (byte *)((int)puVar7 + 1);
    bVar14 = *(byte *)puVar7;
    puVar7 = (uint *)((int)puVar7 + 2);
    bVar18 = *pbVar10;
  }
  if (bVar25) {
    uVar12 = (uint)*(byte *)puVar7;
  }
  if (bVar26) {
    pbVar10 = (byte *)((int)puVar5 + 1);
    *(byte *)puVar5 = bVar14;
    puVar5 = (uint *)((int)puVar5 + 2);
    *pbVar10 = bVar18;
  }
  if (bVar25) {
    *(byte *)puVar5 = (byte)uVar12;
  }
  return;
}


And this is the assembly, which tells a bit more, but still tough to figure out.
Code: [Select]
                             **************************************************************
                             *                          FUNCTION                          *
                             **************************************************************
                             void __stdcall scope_pre_process_ch1_25ns_data(void)
             void              <VOID>         <RETURN>
             undefined4        Stack[-0x18]:4 local_18                                XREF[2]:     80004614(W),
                                                                                                   800046b0(*) 
                             scope_pre_process_ch1_25ns_data                 XREF[1]:     scope_get_short_timebase_data:80
        8000460c e0 03 2d e9     stmdb      sp!,{r5 r6 r7 r8 r9}
        80004610 f0 20 9f e5     ldr        r2,[DAT_80004708]                                = 8019D5EAh
        80004614 04 40 2d e5     str        r4,[sp,#local_18]!
        80004618 b0 c0 d2 e1     ldrh       r12,[r2,#0x0]=>DAT_8019d5ea
        8000461c e8 00 9f e5     ldr        r0,[DAT_8000470c]                                = 801AEF2Ah
        80004620 ba 3f a0 e3     mov        r3,#0x2e8
        80004624 b2 c0 c0 e1     strh       r12,[r0,#0x2]=>DAT_801aef2c
        80004628 b2 c0 d2 e1     ldrh       r12,[r2,#0x2]=>DAT_8019d5ec
        8000462c 02 10 80 e2     add        r1,r0,#0x2
                             LAB_80004630                                    XREF[1]:     80004644(j) 
        80004630 b4 40 f2 e1     ldrh       r4,[r2,#0x4]!=>DAT_8019d5ee
        80004634 b4 c0 c1 e1     strh       r12,[r1,#0x4]=>DAT_801aef30
        80004638 b2 c0 d2 e1     ldrh       r12,[r2,#0x2]=>DAT_8019d5f0
        8000463c 01 30 53 e2     subs       r3,r3,#0x1
        80004640 b8 40 e1 e1     strh       r4,[r1,#0x8]!=>DAT_801aef34
        80004644 f9 ff ff 1a     bne        LAB_80004630
        80004648 c0 10 9f e5     ldr        r1,[DAT_80004710]                                = 8019E18Ch
        8000464c c0 c0 9f e5     ldr        r12,[DAT_80004714]                               = 801B066Eh
        80004650 b0 10 d1 e1     ldrh       r1,[r1,#0x0]=>DAT_8019e18c
        80004654 bc 20 9f e5     ldr        r2,[DAT_80004718]                                = 802F18B0h
        80004658 bc 50 9f e5     ldr        r5,[DAT_8000471c]                                = 8019ED5Ah
        8000465c b2 10 cc e1     strh       r1,[r12,#0x2]=>DAT_801b0670
        80004660 bc 11 d2 e1     ldrh       r1,[r2,#0x1c]=>DAT_802f18cc
        80004664 b4 30 9f e5     ldr        r3,[DAT_80004720]                                = 000005D2h
        80004668 00 00 51 e3     cmp        r1,#0x0
        8000466c 00 10 a0 e3     mov        r1,#0x0
        80004670 00 40 a0 03     moveq      r4,#0x0
        80004674 13 00 00 0a     beq        LAB_800046c8
                             LAB_80004678                                    XREF[1]:     800046ac(j) 
        80004678 be 71 d2 e1     ldrh       r7,[r2,#0x1e]=>DAT_802f18ce
        8000467c 02 60 81 e2     add        r6,r1,#0x2
        80004680 81 40 85 e0     add        r4,r5,r1, lsl #0x1
        80004684 b0 80 d4 e1     ldrh       r8,[r4,#0x0]=>DAT_8019ed5a
        80004688 01 c1 80 e0     add        r12,r0,r1, lsl #0x2
        8000468c 01 18 c6 e3     bic        r1,r6,#0x10000
        80004690 07 60 88 e0     add        r6,r8,r7
        80004694 b0 60 cc e1     strh       r6,[r12,#0x0]=>DAT_801aef2a
        80004698 b2 40 d4 e1     ldrh       r4,[r4,#0x2]=>DAT_8019ed5c
        8000469c be 61 d2 e1     ldrh       r6,[r2,#0x1e]=>DAT_802f18ce
        800046a0 03 00 51 e1     cmp        r1,r3
        800046a4 06 40 84 e0     add        r4,r4,r6
        800046a8 b4 40 cc e1     strh       r4,[r12,#0x4]=>DAT_801aef2e
        800046ac f1 ff ff 3a     bcc        LAB_80004678
                             LAB_800046b0                                    XREF[1]:     80004704(j) 
        800046b0 f0 01 bd e8     ldmia      sp!,{r4 r5 r6 r7 r8}=>local_18
        800046b4 68 20 9f e5     ldr        r2,[DAT_80004724]                                = 000016A8h
        800046b8 4c 10 9f e5     ldr        r1,[DAT_8000470c]                                = 801AEF2Ah
        800046bc 44 00 9f e5     ldr        r0,[DAT_80004708]                                = 8019D5EAh
        800046c0 04 90 9d e4     ldr        r9,[sp],#0x4
        800046c4 e4 ef ff ea     b          memcpy
                             LAB_800046c8                                    XREF[2]:     80004674(j), 80004700(j) 
        800046c8 81 c0 85 e0     add        r12,r5,r1, lsl #0x1
        800046cc b0 c0 dc e1     ldrh       r12,[r12,#0x0]=>DAT_8019ed5a
        800046d0 be 61 d2 e1     ldrh       r6,[r2,#0x1e]=>DAT_802f18ce
        800046d4 0c 00 56 e1     cmp        r6,r12
        800046d8 01 c1 80 20     addcs      r12,r0,r1, lsl #0x2
        800046dc b0 40 cc 21     strhcs     r4,[r12,#0x0]
        800046e0 03 00 00 2a     bcs        LAB_800046f4
        800046e4 be 61 d2 e1     ldrh       r6,[r2,#0x1e]=>DAT_802f18ce
        800046e8 01 71 80 e0     add        r7,r0,r1, lsl #0x2
        800046ec 06 c0 4c e0     sub        r12,r12,r6
        800046f0 b0 c0 c7 e1     strh       r12,[r7,#0x0]=>DAT_801aef2a
                             LAB_800046f4                                    XREF[1]:     800046e0(j) 
        800046f4 01 10 81 e2     add        r1,r1,#0x1
        800046f8 01 18 c1 e3     bic        r1,r1,#0x10000
        800046fc 03 00 51 e1     cmp        r1,r3
        80004700 f0 ff ff 3a     bcc        LAB_800046c8
        80004704 e9 ff ff ea     b          LAB_800046b0


This is my commented take on it.
Code: [Select]
void scope_pre_process_ch1_25ns_data(void)
{
  undefined2 uVar1;
  int iVar2;
  int iVar3;
  uint *puVar4;
  uint *puVar5;
  uint *puVar6;
  uint *puVar7;
  uint **ppuVar8;
  uint **ppuVar9;
  byte *pbVar10;
  undefined2 *puVar11;
  uint uVar12;
  uint uVar13;
  byte bVar14;
  uint uVar15;
  int iVar16;
  short *psVar17;
  byte bVar18;
  undefined2 uVar19;
  uint *puVar20;
  uint *puVar21;
  uint uVar22;
  uint uVar23;
  uint uVar24;
  bool bVar25;
  bool bVar26;
 
  puVar7 = DAT_8000470c;    //0x801AEF2A    = temptracebuffer1 + 4
  puVar21 = DAT_80004708;   //0x8019D5EA    = channel1tracebuffer1  (1500 samples from most likely adc1)
  iVar16 = 0x2e8;           //744

  //Copy a short from buffer1 to buffer2
  *(undefined2 *)((int)DAT_8000470c + 2) = *(undefined2 *)DAT_80004708;       //0x801aef2c = 0x8019d5ea

  uVar19 = *(undefined2 *)((int)puVar21 + 2);  //Get data from 0x8019d5ec
  puVar11 = (undefined2 *)((int)puVar7 + 2);   //point to next item in the temp buffer

  //Copy data from sample buffer to temp buffer while skipping a sample in the temp buffer. (Make room for another sample???)
  do
  {
    uVar1 = *(undefined2 *)(puVar21 + 1);          //0x8019d5ee
    puVar11[2] = uVar19;                           //0x801aef30  = 0x8019d5ec skip one item
    uVar19 = *(undefined2 *)((int)puVar21 + 6);    //0x8019d5f0
    iVar16 = iVar16 + -1;
    puVar11 = puVar11 + 4;
    *puVar11 = uVar1;                              //0x801aef34  = 0x8019d5ee
    puVar21 = puVar21 + 1;
  } while (iVar16 != 0);

  //Last copies done
  //0x0x801B0668 = 0x8019E18A
  //0x0x801B066C = 0x8019E18C

  iVar3 = DAT_8000471c;    //0x8019ED5A   channel1tracebuffer2  (1500 samples from most likely adc2)
  iVar2 = DAT_80004718;    //0x802F18B0   Calibration data


  *(undefined2 *)(DAT_80004714 + 2) = *DAT_80004710;         //0x801B0670 = 0x8019E18C
  uVar15 = DAT_80004720;                                     //0x000005D2 = 1490
  uVar12 = 0;

  if (*(short *)(iVar2 + 0x1c) == 0)   //0x802f18cc  Either 1 or 0 based on some calibration action
  {
    //Trace data showed this to be zero on my scope, so this loop is done
    do
    {
      uVar13 = (uint)*(ushort *)(iVar3 + uVar12 * 2);    //First sample from 0x8019ed5a

      if (*(ushort *)(iVar2 + 0x1e) < uVar13)      //0x802f18ce also some calibration data  (3 on my scope)
      {
        puVar21 = (uint *)(uVar13 - *(ushort *)(iVar2 + 0x1e));
        *(short *)(puVar7 + uVar12) = (short)puVar21;                  //puVar7 = temp trace buffer
      }
      else
      {
        puVar21 = puVar7 + uVar12;
        *(undefined2 *)puVar21 = 0;
      }

      uVar12 = uVar12 + 1 & 0xfffeffff;
    } while (uVar12 < uVar15);

    //Trace shows this
    //First samples
    //0x801AEF2A = 0x8019ED5A
    //0x801AEF2E = 0x8019ED5C
    //0x801AEF32 = 0x8019ED5E

    //Last samples
    //0x801B066A = 0x8019F8FA
    //0x801B066E = 0x8019F8FC
  }
  else
  {
    do
    {  //two samples at a time, but I miss the interleaving???? Maybe buffers or pointers defined as 32 bit items
      psVar17 = (short *)(iVar3 + uVar12 * 2);
      puVar21 = puVar7 + uVar12;
      uVar12 = uVar12 + 2 & 0xfffeffff;
      *(short *)puVar21 = *psVar17 + *(short *)(iVar2 + 0x1e);
      *(short *)(puVar21 + 1) = psVar17[1] + *(short *)(iVar2 + 0x1e);
    } while (uVar12 < uVar15);

    //Trace shows this
    //First samples
    //0x801AEF2A = 0x8019ED5A
    //0x801AEF2E = 0x8019ED5C
    //0x801AEF32 = 0x8019ED5E
    //0x801AEF36 = 0x8019ED60

    //Last samples
    //0x801B0662 = 0x8019F8F6
    //0x801B0666 = 0x8019F8F8
    //0x801B066A = 0x8019F8FA
    //0x801B066E = 0x8019F8FC

  }

  //DAT_80004724;   //0x000016A8   5800 bytes
  //DAT_80004708;   //0x8019D5EA   first buffer  destination
  //DAT_8000470c;   //0x801AEF2A   temp buffer   source
  //Copy the temp buffer back to the first trace buffer
  memcpy(DAT_80004708, DAT_8000470c, DAT_80004724);
}


It does confirm my thoughts on why they read a second buffer of 1500 bytes from the FPGA when in 25 or 10nS/Div setting. For the other time base settings they only sample using a single ADC. For the lowest two settings they also use the second ADC, but instead of having the FPGA do the interleaving of the two samples, they do it in the CPU.

That is all this first function does. Interleave the samples of the two reads. Only on the second set of data they do some calibration based action. In the code there is a check on a flag, if zero they use a subtract of a calibration value, if one they add the value. They probably measure the difference between the two ADC's and the flag is set based on which one is lower then the other.

This flag and value are determined in the calibration procedure and stored in the settings. This concerns the first four of the unknown calibration values found earlier. (2 per channel. Flag and value)

For this to make sense the two ADC's in one package have to have a possible mismatch. Need to look at the specifications.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 04, 2021, 09:28:39 am
I'm back on the part of the code I wrote about on page 39 post 950.

It is becoming a little bit clearer and managed to write a bit cleaner code that handles the data from the top reducing the number of data copies being made, but still fail to see the logic behind it.

The below code only does the first part of what the original code does. It interpolates the samples without copying the data to another buffer. (Tested this on my Linux machine)

Code: [Select]
void scope_up_sample_x_10(uint16 * buffer, uint32 count)
{
  register uint32  cnt, idx;
  register uint16 *sptr;
  register uint16 *dptr;
  register int32   sample1, sample2;
  register int32   delta;
 
  //Only do one tenth of the samples
  cnt = count / 10;
 
  //For the source point to the last sample to use
  sptr = &buffer[cnt];
 
  //For the destination point to the last result sample
  dptr = &buffer[count];
 
  //Get the first sample to use
  sample1 = *sptr--;
 
  //Process all the needed samples
  while(cnt)
  {
    //Store the first sample
    *dptr-- = sample1;
   
    //Get the second sample
    sample2 = *sptr--;
   
    //Fill in the in between samples
    //The original code uses a different approach
    //Get the samples shifted up for fractional calculations 10.22 bits
    sample1 <<= 22;
   
    //Calculate a delta step between the samples
    delta = (sample1 - (sample2 << 22)) / 10;
   
    for(idx=0;idx<9;idx++)
    {
      //Calculate the next sample with fixed point calculation
      //Since the direction is from last sample to first sample the step needs to be taken off
      sample1 -= delta;
     
      //Store the decimal part of it
      *dptr-- = sample1 >> 22;
    }
   
    //Save the second sample as the first sample
    sample1 = sample2;
   
    //One set of samples done
    cnt--;
  }
}

The same code with different offsets and another destination buffer can do the second interpolation, and it might even be possible to do the averaging in the same loop and again keep it all in one buffer, but to get an understanding I think I will have to keep it separate for now and have the output displayed as a trace on a screen.

So yet write some test software first to get to the bottom of it all.

Need to figure it out since this function is also used in the 25 and 10nS/div data processing.

So break out the popcorn and sit back, again :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 04, 2021, 12:00:46 pm
Faster than the flash :-DD

The first averaging of the interpolated samples shows a slight filtering activity. Used a saw-tooth like signal as input. The picture clearly shows the factor 10 up sampling.

The yellow trace is the original data generated with the code below.
Code: [Select]
  uint32 i;

  for(i=0;i<1500;i++)
  {
    samples1[i] = (i * 10) % 200;
  }


The blueish trace is the factor 10 interpolation of original signal. The red trace shows the 5 samples shifted factor 10 interpolated interpolation :) The green trace shows the averaging of these two signals.

Edit: copied in the full function I used for the test
Code: [Select]
void scope_up_sample_x_10(uint32 count)
{
  register uint32  cnt, idx;
  register uint16 *sptr;
  register uint16 *sptr2;
  register uint16 *dptr;
  register int32   sample1, sample2;
  register int32   delta;
 
  //Only do one tenth of the samples
  cnt = count / 10;
 
  //For the source point to the last sample to use
  sptr = &samples1[cnt];
 
  //For the destination point to the last result sample
  dptr = &samples2[count];
 
  //Get the first sample to use
  sample1 = *sptr--;
 
  //Process all the needed samples
  while(cnt)
  {
    //Store the first sample
    *dptr-- = sample1;
   
    //Get the second sample
    sample2 = *sptr--;
   
    //Fill in the in between samples
    //The original code uses a different approach
    //Get the samples shifted up for fractional calculations 10.22 bits
    sample1 <<= 22;
   
    //Calculate a delta step between the samples
    delta = (sample1 - (sample2 << 22)) / 10;
   
    for(idx=0;idx<9;idx++)
    {
      //Calculate the next sample with fixed point calculation
      //Since the direction is from last sample to first sample the step needs to be taken off
      sample1 -= delta;
     
      //Store the decimal part of it
      *dptr-- = sample1 >> 22;
    }
   
    //Save the second sample as the first sample
    sample1 = sample2;
   
    //One set of samples done
    cnt--;
   
    //In here for debugging
    if(cnt == 1)
    {
      sample2 = 20;
    }
  }
 
  //These newly interpolated samples need to be averaged with the first set, which might be possible to do in the single run directly back into the original buffer
 
  //Create a second interpolated set of data based on the interpolated samples
  //Only do one tenth of the samples minus one since the data is shifted
  cnt = (count / 10) - 1;

  //For the source point to the last sample to use
  sptr = &samples2[count - 5];
 
  //For the destination point to the last result sample in a temp buffer
  //Also on shifted sample to end where needed
  dptr = &samples3[count - 5];
 
  //Get the first sample to use and skip ten samples
  sample1 = *sptr;
  sptr -= 10;
 
  //Process all the needed samples
  while(cnt)
  {
    //Store the first sample
    *dptr-- = sample1;
   
    //Get the second sample and skip ten samples
    sample2 = *sptr;
    sptr -= 10;
   
    //Fill in the in between samples
    //Get the samples shifted up for fractional calculations 10.22 bits
    sample1 <<= 22;
   
    //Calculate a delta step between the samples
    delta = (sample1 - (sample2 << 22)) / 10;
   
    for(idx=0;idx<9;idx++)
    {
      //Calculate the next sample with fixed point calculation
      //Since the direction is from last sample to first sample the step needs to be taken off
      sample1 -= delta;
     
      //Store the decimal part of it
      *dptr-- = sample1 >> 22;
    }
   
    //Save the second sample as the first sample
    sample1 = sample2;
   
    //One set of samples done
    cnt--;
   
    //In here for debugging
    if(cnt == 1)
    {
      sample2 = 20;
    }
  }
 
  //Store the last sample
  *dptr = sample1;
 
 
  //Average these two sets
  cnt = count;
  sptr  = samples2;
  sptr2 = samples3;

  dptr = samples4;
 
  while(cnt)
  {
    *dptr++ = (*sptr + *sptr2) / 2;
   
    sptr++;
    sptr2++;
   
    cnt--;
  }
 
 
  //The last step is a 5 time up sampling of the processed data and averaging that with the processed data
  //Only do one fifth of the samples
  cnt = (count / 5) - 1;
 
  //For the source point to the last sample to use
  //Takes the second sample as last input
  sptr = &samples4[count - 8];
 
  //For the destination point to the last result sample
  dptr = &samples5[count];
 
  //Get the first sample to use
  sample1 = *sptr--;
 
  //Process all the needed samples
  while(cnt)
  {
    //Store the first sample
    *dptr-- = sample1;
   
    //Get the second sample and skip 5 samples
    sample2 = *sptr;
    sptr -= 5;
   
    //Fill in the in between samples
    //The original code uses a different approach
    //Get the samples shifted up for fractional calculations 10.22 bits
    sample1 <<= 22;
   
    //Calculate a delta step between the samples
    delta = (sample1 - (sample2 << 22)) / 5;
   
    for(idx=0;idx<4;idx++)
    {
      //Calculate the next sample with fixed point calculation
      //Since the direction is from last sample to first sample the step needs to be taken off
      sample1 -= delta;
     
      //Store the decimal part of it
      *dptr-- = sample1 >> 22;
    }
   
    //Save the second sample as the first sample
    sample1 = sample2;
   
    //One set of samples done
    cnt--;
   
    //In here for debugging
    if(cnt == 1)
    {
      sample2 = 20;
    }
  }
 
  //Store the last sample
  *dptr = sample1;
 
  //Average these two sets
  cnt = count;
  sptr  = samples4;
  sptr2 = samples5;

  dptr = samples6;
 
  while(cnt)
  {
    *dptr++ = (*sptr + *sptr2) / 2;
   
    sptr++;
    sptr2++;
   
    cnt--;
  }
}


In the original code they process the data with yet another step. For this they use a 5 time up sampled set of samples, but for this I have to figure out the starting points of the data being used. I think that phase shifting the signals will make a big difference in what it does.

Edit: Tried both shifting on the source as well as destination of the second interpolation and that results in the green trace being flattened on either top or bottom depending on the shift being below or above the middle sample.

Near the start and the end of the traces it can bee seen that there are missing samples due to the 5 sample offset.

Edit: The additional step does not do much. The blue and cyan traces show the steps. Blue is a newly interpolated version of the green. Starting on the second sample, take every 5th sample and use linear interpolation to fill in the gap. The cyan trace is the average of the green and the blue trace. A simple IIR filter will probably do this in a single loop.

Edit: Extra picture with square wave input
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on October 05, 2021, 01:09:57 am
Do you think that the original programmer took off half way through?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 10, 2021, 02:19:54 pm
Oooeeeh tremors and withdrawal symptoms after 5 days of EEVBLOG addiction rehab :o

Nah, just kidding, visited family in the Netherlands :)

Well one thing is for sure, the programmers that worked on this are not the smartest ones. Had time to reflect on it and it can be thought of as some sort of convolution, but not a very good one.

There are better and easier ways to filter the data into what is needed.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 12, 2021, 11:31:23 am
Horror |O

Again I landed in some "why" code. For the two lowest time per div settings (25nS/div and 10nS/div) they made code that can follow two paths:

I'm looking at the function I, for now, named "scope_process_ch1_25ns_data()". It is quite the puzzle to figure out what is done for the first option. It uses 5 different functions to process each sample. On forehand it determines min, max and average value. Uses the average to determine rising edges in the signal and then it becomes a mystery :-//

Code: [Select]
void scope_process_ch1_25ns_data(void)
{
  ushort uVar1;
  longlong lVar2;
  longlong lVar3;
  undefined2 uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  ushort *puVar8;
  int iVar9;
  uint16 *puVar10;
  ushort *puVar11;
  undefined2 *puVar12;
  ushort uVar13;
  short *psVar14;
  int iVar15;
  ushort uVar16;
  short sVar17;
  uint uVar18;
  uint uVar19;
  undefined4 uVar20;
  uint16 *puVar21;
  int iVar22;
  uint16 *puVar23;
  undefined2 *puVar24;
  undefined8 uVar25;
  undefined8 uVar26;
  undefined8 uVar27;
  undefined8 uVar28;
  undefined8 uVar29;
  undefined8 uVar30;
 
  uVar19 = DAT_80006504;                              //0x000009C4   2500
  iVar22 = DAT_80006500;                              //0x8019D5A0   settings base
  uVar7 = 0;
  puVar8 = (ushort *)((int)DAT_800064f0 + 200);       //0x8019D5EA   sample buffer + 200 (100 samples in)  (&channel1tracebuffer1[100])
  uVar20 = 0;
  iVar9 = DAT_800064f8;                               //0x0000056E   1390
  uVar18 = DAT_800064f4;                              //0x0000FFFF   65535

  //Loop through 1390 samples
  //Start on 0x8019D6B2 (100 samples into the buffer)
  do
  {
    uVar5 = (uint)*puVar8;  //Get the sample
    puVar8 = puVar8 + 1;

    //Determine max value
    if (uVar7 < uVar5)
    {
      uVar7 = uVar5;
    }

    //Determine min value
    if (uVar5 < uVar18)
    {
      uVar18 = uVar5;
    }

    iVar9 = iVar9 + -1;
  } while (iVar9 != 0);
 
  puVar21 = (uint16 *)(uVar7 + uVar18 >> 1);           //Average between min and max

  uVar5 = 0;

  puVar8 = (ushort *)((int)DAT_800064f0 + 0x14);       //                   &channel1tracebuffer1[10]
  iVar9 = DAT_800064fc;                                //0x000005C8         1480
  puVar23 = DAT_800064f0;                              //0x8019D5EA         channel1tracebuffer1


  //Determine if there is high frequency signal in the buffer (more then 320 rising edges)
  //Loop through 1480 samples
  //Start on 0x8019D5FE
  do
  {
    puVar10 = (uint16 *)(uint)*puVar8;            //Get sample

    if (puVar10 < puVar21)                        //Check sample against average
    {
      puVar23 = (uint16 *)(uint)puVar8[1];        //Below average then get the next sample too
    }


    //Need to figure this out on what it is counting

    //first sample below average and second sample above average or second sample above or equal to average
    //Count the rising edges in the buffer discriminating on a single bit
    //The first part of the if is abundant
    if ((puVar10 < puVar21 && puVar21 < puVar23) || ((puVar10 < puVar21 && (puVar21 <= (uint16 *)(uint)puVar8[1]))))
    {
      uVar5 = uVar5 + 1 & 0xfffeffff;   //Count the number of samples that comply to what???
    }

    iVar9 = iVar9 + -1;       //one sample done
    puVar8 = puVar8 + 1;      //select next sample
  } while (iVar9 != 0);

/*
                             LAB_80006320                                    XREF[1]:     80006358(j) 
        80006320 b0 30 d0 e1     ldrh       r3,[r0,#0x0]=>DAT_8019d5fe       ;get a sample
        80006324 01 00 53 e1     cmp        r3,r1                            ;compare it to the average
        80006328 b2 c0 d0 31     ldrhcc     r12,[r0,#0x2]=>DAT_8019d600      ;if below average get the next sample
        8000632c 0c 00 51 31     cmpcc      r1,r12                           ;and compare the average with it
        80006330 04 00 00 3a     bcc        LAB_80006348                     ;average below then jump to count
        80006334 03 00 51 e1     cmp        r1,r3                            ;compare average with first sample again
        80006338 04 00 00 9a     bls        LAB_80006350                     ;average less then jump
        8000633c b2 30 d0 e1     ldrh       r3,[r0,#0x2]=>DAT_8019d600       ;get the next sanmple
        80006340 03 00 51 e1     cmp        r1,r3                            ;compare the average with it
        80006344 01 00 00 8a     bhi        LAB_80006350                     ;average higher then jump
                             LAB_80006348                                    XREF[1]:     80006330(j) 
        80006348 01 30 84 e2     add        r3,r4,#0x1                       ;increment the counter
        8000634c 01 48 c3 e3     bic        r4,r3,#0x10000
                             LAB_80006350                                    XREF[2]:     80006338(j), 80006344(j) 
        80006350 01 20 52 e2     subs       r2,r2,#0x1                       ;one sample set done
        80006354 02 00 80 e2     add        r0=>DAT_8019d600,r0,#0x2         ;point to next sample
        80006358 f0 ff ff 1a     bne        LAB_80006320                     ;repeat until done
*/

  //If more then 320 samples comply do this next bit. This means high frequency signal or noise
  //This is the case in the emulator with the given input (alternates on every sample between 0x6D and 0xB0 or 0x90)
  if (0x140 < uVar5)
  {
    uVar6 = get_timer_ticks();
    puVar21 = DAT_800064f0;                            //0x8019D5EA         channel1tracebuffer1

    if (*(char *)(iVar22 + 10) == '\x1c')              //time base = 25nS/div
    {
      uVar20 = 0x14;
    }

    if (*(char *)(iVar22 + 10) == '\x1d')              //time base = 10nS/div
    {
      uVar20 = 0x32;
    }

    iVar9 = 0;

    //y + (((y * 2863311531) / 8589934592) * -3)
    //2863311531 / 8589934592 ~ 1/3 so the rounding of error leads to a modulo 3
    //Is indeed %3 based on the timer ticks. What is the use of it. Some sort of random number input????
    uVar25 = FUN_800397d0(uVar6 + (uint)((ulonglong)uVar6 * (ulonglong)DAT_80006508 >> 0x21) * -3);   //do some calc on the timer ticks???

    uVar26 = FUN_800397d0(uVar18);                          //min value
    uVar27 = FUN_800397d0((uVar7 - uVar18 & 0xffff) >> 1);  //max minus min value / 2
    uVar28 = FUN_800397d0(uVar5);                           //number of complying??? samples
    uVar29 = FUN_800397d0(uVar20);                          //Time base dependent input

    uVar29 = FUN_800393ec(DAT_8000650c,DAT_80006510,(int)uVar29,(int)((ulonglong)uVar29 >> 0x20));

    //Process 2500 samples???
    do
    {
      uVar30 = FUN_8003979c(iVar9);

      uVar30 = FUN_80039890((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),(int)uVar29,(int)((ulonglong)uVar29 >> 0x20));

      FUN_80039890((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),(int)uVar28,(int)((ulonglong)uVar28 >> 0x20));

      uVar30 = FUN_80036000();

      uVar30 = FUN_8003926c((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),0,DAT_80006514);

      uVar30 = FUN_80039890((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),(int)uVar27,(int)((ulonglong)uVar27 >> 0x20));

      uVar30 = FUN_8003926c((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),(int)uVar26,(int)((ulonglong)uVar26 >> 0x20));

      FUN_8003926c((int)uVar30,(int)((ulonglong)uVar30 >> 0x20),(int)uVar25,(int)((ulonglong)uVar25 >> 0x20));

      uVar4 = FUN_8003972c();

      *(undefined2 *)puVar21 = uVar4;

      uVar19 = uVar19 - 1 & 0xffff;             //one sample done
      iVar9 = iVar9 + 1;                        //next index
      puVar21 = (uint16 *)((int)puVar21 + 2);   //point to next buffer entry
    } while (uVar19 != 0);

    return;
  }

  if (*(char *)(DAT_80006500 + 10) == '\x1c')   //0x8019D5AA is time base setting 28 = 25nS/div
  {
    //With 5nS per sample this up sampling leads to 25nS/div. Every tenth pixel is 5nS, so 50 pixels is 25nS
    scope_up_sample_x_10(DAT_800064f0,0,DAT_80006504);
  }

  puVar21 = DAT_800064f0;

  //From here on down is for 10nS/div time base setting. Most likely it is the up sampling needed to go from 5nS per sample
  //to 10nS/div. With 50 pixels per div each pixel is 200pS, so need up sampling x_25
  if (*(char *)(iVar22 + 10) == '\x1d')
  {
    puVar8 = (ushort *)(uVar19 * DAT_80013e70 + 0xa3d7 >> 0x14);

    if (puVar8 != NULL)
    {
      puVar11 = DAT_80013e74;
      puVar23 = (uint16 *)((int)DAT_800064f0 + -2);

      if (((uint)puVar8 & 1) != 0)
      {
        puVar11 = DAT_80013e74 + 0x19;
        *puVar11 = *(ushort *)DAT_800064f0;
        puVar23 = puVar21;
      }

      uVar7 = (uint)((int)puVar8 << 0xf) >> 0x10;

      while (uVar7 != 0)
      {
        puVar11[0x19] = *(ushort *)((int)puVar23 + 2);
        puVar23 = (uint16 *)((int)puVar23 + 4);
        uVar7 = uVar7 - 1 & 0xffff;
        puVar11 = puVar11 + 0x32;
        *puVar11 = *(ushort *)puVar23;
      }
    }

    iVar22 = DAT_80013e78;
    uVar7 = 0;

    if (0 < (int)((int)puVar8 - 1U))
    {
      do {
        puVar11 = (ushort *)(DAT_80013e7c + uVar7 * 0x32);
        uVar1 = *puVar11;
        uVar13 = puVar11[0x19];
        sVar17 = 0xc;
        if (uVar1 < uVar13) {
          uVar16 = uVar13 - uVar1;
        }
        else {
          uVar16 = uVar1 - uVar13;
        }
        iVar9 = 0;
        uVar18 = (uint)uVar16;
        if (uVar1 < uVar13) {
          do {
            lVar2 = (longlong)iVar22 * (longlong)(int)(uVar18 * (iVar9 + 2));
            lVar3 = (longlong)iVar22 * (longlong)(int)(uVar18 * (iVar9 + 1));
            sVar17 = sVar17 + -1;
            puVar11[1] = ((short)(int)(lVar3 >> 0x23) - (short)(lVar3 >> 0x3f)) + uVar1;
            iVar9 = iVar9 + 2;
            puVar11 = puVar11 + 2;
            *puVar11 = ((short)(int)(lVar2 >> 0x23) - (short)(lVar2 >> 0x3f)) + uVar1;
          } while (sVar17 != 0);
        }
        else {
          do {
            lVar2 = (longlong)iVar22 * (longlong)(int)(uVar18 * (iVar9 + 2));
            lVar3 = (longlong)iVar22 * (longlong)(int)(uVar18 * (iVar9 + 1));
            sVar17 = sVar17 + -1;
            puVar11[1] = uVar1 - ((short)(int)(lVar3 >> 0x23) - (short)(lVar3 >> 0x3f));
            iVar9 = iVar9 + 2;
            puVar11 = puVar11 + 2;
            *puVar11 = uVar1 - ((short)(int)(lVar2 >> 0x23) - (short)(lVar2 >> 0x3f));
          } while (sVar17 != 0);
        }
        uVar7 = uVar7 + 1 & 0xfffeffff;
      } while ((int)uVar7 < (int)((int)puVar8 - 1U));
    }

    uVar7 = (int)puVar8 - 1;
    if (0 < (int)uVar7)
    {
      puVar12 = DAT_80013e84;
      puVar24 = DAT_80013e80;

      if ((uVar7 & 1) != 0)
      {
        puVar24 = DAT_80013e80 + 0x19;
        puVar12 = DAT_80013e84 + 0x19;
        *puVar12 = *puVar24;
      }

      uVar7 = uVar7 * 0x8000 >> 0x10;

      while (uVar7 != 0)
      {
        puVar12[0x19] = puVar24[0x19];
        puVar24 = puVar24 + 0x32;
        uVar7 = uVar7 - 1 & 0xffff;
        puVar12 = puVar12 + 0x32;
        *puVar12 = *puVar24;
      }
    }

    uVar7 = 0;
    puVar11 = puVar8 + -1;

    if (0 < (int)puVar11)
    {
      do
      {
        iVar9 = DAT_80013e88 + uVar7 * 0x32;
        uVar1 = *(ushort *)(iVar9 + 0x18);
        uVar13 = *(ushort *)(iVar9 + 0x4a);

        if (uVar1 < uVar13)
        {
          psVar14 = (short *)(iVar9 + 0x18);
          iVar9 = 0;
          sVar17 = 0xc;

          do
          {
            lVar2 = (longlong)iVar22 * (longlong)(int)((uint)(ushort)(uVar13 - uVar1) * (iVar9 + 1));
            lVar3 = (longlong)iVar22 * (longlong)(int)((uint)(ushort)(uVar13 - uVar1) * (iVar9 + 2));
            sVar17 = sVar17 + -1;
            psVar14[1] = ((short)(int)(lVar2 >> 0x23) - (short)(lVar2 >> 0x3f)) + uVar1;
            iVar9 = iVar9 + 2;
            psVar14 = psVar14 + 2;
            *psVar14 = ((short)(int)(lVar3 >> 0x23) - (short)(lVar3 >> 0x3f)) + uVar1;
          } while (sVar17 != 0);
        }
        else
        {
          psVar14 = (short *)(iVar9 + 0x18);
          iVar9 = 0;
          sVar17 = 0xc;

          do
          {
            lVar2 = (longlong)iVar22 * (longlong)(int)((uint)(ushort)(uVar1 - uVar13) * (iVar9 + 1));
            lVar3 = (longlong)iVar22 * (longlong)(int)((uint)(ushort)(uVar1 - uVar13) * (iVar9 + 2));
            sVar17 = sVar17 + -1;
            psVar14[1] = uVar1 - ((short)(int)(lVar2 >> 0x23) - (short)(lVar2 >> 0x3f));
            iVar9 = iVar9 + 2;
            psVar14 = psVar14 + 2;
            *psVar14 = uVar1 - ((short)(int)(lVar3 >> 0x23) - (short)(lVar3 >> 0x3f));
          } while (sVar17 != 0);
        }

        puVar8 = (ushort *)(uVar7 + 1);
        uVar7 = (uint)puVar8 & 0xfffeffff;
      } while ((int)uVar7 < (int)puVar11);
    }

    uVar7 = uVar19 >> 1;

    if (uVar19 != 0)
    {
      uVar18 = uVar7;
      puVar11 = DAT_80013e90;
      puVar8 = DAT_80013e8c;
      puVar23 = (uint16 *)((int)puVar21 + -2);

      if ((uVar19 & 1) != 0)
      {
        puVar8 = DAT_80013e8c + 1;
        puVar11 = DAT_80013e90 + 1;
        *(short *)puVar21 = (short)((uint)*puVar8 + (uint)*puVar11 >> 1);
        puVar23 = puVar21;
      }

      while (uVar18 != 0)
      {
        *(short *)((int)puVar23 + 2) = (short)((uint)puVar8[1] + (uint)puVar11[1] >> 1);
        *(short *)(uint16 *)((int)puVar23 + 4) = (short)((uint)puVar11[2] + (uint)puVar8[2] >> 1);
        uVar18 = uVar18 - 1;
        puVar11 = puVar11 + 2;
        puVar8 = puVar8 + 2;
        puVar23 = (uint16 *)((int)puVar23 + 4);
      }
    }

    uVar5 = uVar19 * DAT_80013e94;
    uVar18 = uVar5 >> 0x13;
    uVar6 = uVar18 - 1;

    if (0 < (int)uVar6)
    {
      puVar11 = (ushort *)((int)puVar21 + -0xc);
      puVar8 = DAT_80013e98;

      if ((uVar6 & 1) != 0)
      {
        puVar11 = (ushort *)((int)puVar21 + 0xc);
        puVar8 = DAT_80013e98 + 0xc;
        *puVar8 = *puVar11;
      }

      uVar6 = uVar6 * 0x8000 >> 0x10;

      while (uVar6 != 0)
      {
        puVar8[0xc] = puVar11[0xc];
        puVar11 = puVar11 + 0x18;
        uVar6 = uVar6 - 1 & 0xffff;
        puVar8 = puVar8 + 0x18;
        *puVar8 = *puVar11;
      }
    }
    iVar22 = uVar18 - 2;

    if (0 < iVar22)
    {
      puVar8 = DAT_80013e9c;
    }

    uVar18 = 0;

    if (0 < iVar22)
    {
      do
      {
        iVar9 = DAT_80013e88 + uVar18 * 0x18;
        uVar1 = *(ushort *)(iVar9 + 0xc);
        uVar13 = *(ushort *)(iVar9 + 0x24);

        if (uVar1 < uVar13)
        {
          uVar6 = (uint)(ushort)(uVar13 - uVar1);
          iVar15 = 1;
          sVar17 = 5;
          psVar14 = (short *)(iVar9 + 0xe);
          *psVar14 = ((short)(int)((longlong)(int)puVar8 * (longlong)(int)uVar6 >> 0x21) - (short)((longlong)(int)puVar8 * (longlong)(int)uVar6 >> 0x3f)) + uVar1;

          do
          {
            lVar2 = (longlong)(int)puVar8 * (longlong)(int)(uVar6 * (iVar15 + 1));
            lVar3 = (longlong)(int)puVar8 * (longlong)(int)(uVar6 * (iVar15 + 2));
            sVar17 = sVar17 + -1;
            psVar14[1] = ((short)(int)(lVar2 >> 0x21) - (short)(lVar2 >> 0x3f)) + uVar1;
            iVar15 = iVar15 + 2;
            psVar14 = psVar14 + 2;
            *psVar14 = ((short)(int)(lVar3 >> 0x21) - (short)(lVar3 >> 0x3f)) + uVar1;
          } while (sVar17 != 0);
        }
        else
        {
          uVar6 = (uint)(ushort)(uVar1 - uVar13);
          iVar15 = 1;
          sVar17 = 5;
          psVar14 = (short *)(iVar9 + 0xe);
          *psVar14 = uVar1 - ((short)(int)((longlong)(int)puVar8 * (longlong)(int)uVar6 >> 0x21) - (short)((longlong)(int)puVar8 * (longlong)(int)uVar6 >> 0x3f));

          do
          {
            lVar2 = (longlong)(int)puVar8 * (longlong)(int)(uVar6 * (iVar15 + 1));
            lVar3 = (longlong)(int)puVar8 * (longlong)(int)(uVar6 * (iVar15 + 2));
            sVar17 = sVar17 + -1;
            psVar14[1] = uVar1 - ((short)(int)(lVar2 >> 0x21) - (short)(lVar2 >> 0x3f));
            iVar15 = iVar15 + 2;
            psVar14 = psVar14 + 2;
            *psVar14 = uVar1 - ((short)(int)(lVar3 >> 0x21) - (short)(lVar3 >> 0x3f));
          } while (sVar17 != 0);
        }

        uVar18 = uVar18 + 1 & 0xfffeffff;
      } while ((int)uVar18 < iVar22);
    }

    if (uVar19 != 0)
    {
      uVar18 = uVar7;
      puVar23 = (uint16 *)((int)puVar21 + -2);
      puVar8 = DAT_80013e90;

      if ((uVar19 & 1) != 0)
      {
        puVar8 = DAT_80013e90 + 1;
        *(short *)puVar21 = (short)((uint)*(ushort *)puVar21 + (uint)*puVar8 >> 1);
        puVar23 = puVar21;
      }

      while (uVar18 != 0)
      {
        puVar10 = (uint16 *)((int)puVar23 + 4);
        *(ushort *)((int)puVar23 + 2) = (ushort)((uint)*(ushort *)((int)puVar23 + 2) + (uint)puVar8[1] >> 1);
        *(ushort *)puVar10 = (ushort)((uint)puVar8[2] + (uint)*(ushort *)puVar10 >> 1);
        uVar18 = uVar18 - 1;
        puVar23 = puVar10;
        puVar8 = puVar8 + 2;
      }
    }

    uVar5 = uVar5 >> 0x12;
    uVar18 = uVar5 - 1;

    if (0 < (int)uVar18)
    {
      puVar11 = (ushort *)((int)puVar21 + -6);
      puVar8 = DAT_80013ea0;

      if ((uVar18 & 1) != 0)
      {
        puVar11 = (ushort *)((int)puVar21 + 6);
        puVar8 = DAT_80013ea0 + 6;
        *puVar8 = *puVar11;
      }

      uVar18 = uVar18 * 0x8000 >> 0x10;

      while (uVar18 != 0)
      {
        puVar8[6] = puVar11[6];
        puVar11 = puVar11 + 0xc;
        uVar18 = uVar18 - 1 & 0xffff;
        puVar8 = puVar8 + 0xc;
        *puVar8 = *puVar11;
      }
    }

    uVar18 = DAT_80013ea8;
    uVar5 = uVar5 - 2;

    if (0 < (int)uVar5)
    {
      uVar5 = uVar5 & 0xffff;
      puVar8 = DAT_80013ea4;

      do
      {
        uVar1 = *puVar8;
        uVar13 = puVar8[6];

        if (uVar1 < uVar13)
        {
          uVar13 = uVar13 - uVar1;
          uVar6 = (uint)uVar13;
          puVar8[1] = uVar1 + (ushort)(uVar6 * DAT_80013e94 >> 0x12);
          puVar8[2] = uVar1 + (short)(uint)((ulonglong)uVar13 * 2 * (ulonglong)uVar18 >> 0x22);
          puVar8[3] = uVar1 + (short)(uint)((ulonglong)(uVar6 * 3) * (ulonglong)uVar18 >> 0x22);
          puVar8[4] = uVar1 + (short)(uint)((ulonglong)uVar13 * 4 * (ulonglong)uVar18 >> 0x22);
          puVar8[5] = uVar1 + (short)(uint)((ulonglong)(uVar6 * 5) * (ulonglong)uVar18 >> 0x22);
        }
        else
        {
          uVar13 = uVar1 - uVar13;
          uVar6 = (uint)uVar13;
          puVar8[1] = uVar1 - (ushort)(uVar6 * DAT_80013e94 >> 0x12);
          puVar8[2] = uVar1 - (short)(uint)((ulonglong)uVar13 * 2 * (ulonglong)uVar18 >> 0x22);
          puVar8[3] = uVar1 - (short)(uint)((ulonglong)(uVar6 * 3) * (ulonglong)uVar18 >> 0x22);
          puVar8[4] = uVar1 - (short)(uint)((ulonglong)uVar13 * 4 * (ulonglong)uVar18 >> 0x22);
          puVar8[5] = uVar1 - (short)(uint)((ulonglong)(uVar6 * 5) * (ulonglong)uVar18 >> 0x22);
        }

        uVar5 = uVar5 - 1 & 0xffff;
        puVar8 = puVar8 + 6;
      } while (uVar5 != 0);
    }

    if (uVar19 != 0)
    {
      puVar23 = (uint16 *)((int)puVar21 + -2);
      puVar8 = DAT_80013e90;

      if ((uVar19 & 1) != 0)
      {
        puVar8 = DAT_80013e90 + 1;
        *(short *)puVar21 = (short)((uint)*(ushort *)puVar21 + (uint)*puVar8 >> 1);
        puVar23 = puVar21;
      }

      if (uVar7 != 0)
      {
        do
        {
          puVar11 = (ushort *)((int)puVar23 + 2);
          uVar7 = uVar7 - 1;
          puVar23 = (uint16 *)((int)puVar23 + 4);
          *puVar11 = (ushort)((uint)*puVar11 + (uint)puVar8[1] >> 1);
          puVar8 = puVar8 + 2;
          *(ushort *)puVar23 = (ushort)((uint)*(ushort *)puVar23 + (uint)*puVar8 >> 1);
        } while (uVar7 != 0);

        return;
      }

      return;

    }

    return;
  }

  return;
}


So more grinding of the brain gears needs to be done :o
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 12, 2021, 01:15:29 pm
Just a question or suggestion nut sure...  ;D
If code looks strange why not just skip it and try to make it your way. You might save some time?
If at later times you find out that your code indeed needs some more work you can get back to that part and improve it?

I am also a developer (mostly C# + t-sql) and I often have to fix other people mistakes.
But it's usually faster to just do part of the code (or sql procedure) from scratch than trying to get into the brains of someone who had little knowledge and was just trying to get the job done...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 12, 2021, 01:40:28 pm
Just a question or suggestion nut sure...  ;D
If code looks strange why not just skip it and try to make it your way. You might save some time?
If at later times you find out that your code indeed needs some more work you can get back to that part and improve it?

I am also a developer (mostly C# + t-sql) and I often have to fix other people mistakes.
But it's usually faster to just do part of the code (or sql procedure) from scratch than trying to get into the brains of someone who had little knowledge and was just trying to get the job done...

That is true if the intention of the code is clear, and I have done that with other parts of this project.

I'm still figuring out what the sample data needs for proper representation on the screen. The long time base was simple, but for these short time base settings the question is where is the trigger point and how do they determine the screen offset, etc.

Since the FPGA is a black box the information has to come from the code.

Another problem with this system is the lack of, or hard to find information about the peripherals in the MCU. So for the USB interface for instance it is searching the web and reverse the original code to get to a working interface.

I have other project ideas using the lichee nano, which uses the same MCU, so this project is an investment in future use :)

I am also a developer (mostly C# + t-sql) and I often have to fix other people mistakes.

With C# this is or was the case with just the tools themself  :-DD

I have done my share of programming with vbscript and the likes and had to think of many workaround to get things working due to a bug in the interpreter or compiler.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 12, 2021, 01:52:22 pm
Quote
With C# this is or was the case with just the tools themself
True true. But it pays the bills... ;)

Anyhow I really enjoy your quest into implementing better software for this scope. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 13, 2021, 11:01:33 am
The second possible processing for the 10nS/div setting is indeed 25 times up sampling. The algorithm is basically the same as for the times 10 up sampling but they added an extra round of interpolating and averaging, which does not add that big a difference in the result.

It is funny to see the inconsistencies in coding, so either the programmer was a bit sloppy or it is done by more than one programmer. In bits of the code memcpy is used to copy data from one buffer to another while in other bits of code a do while loop is used.

Also interesting is that they tried to be clever by saving on loop iterations doing two the same actions in a single loop, but real cleverness would have been integrating multiple steps in one. They use a loop to split the samples creating gaps in between. Then a second loop to fill in the gaps with linear interpolated data. This can be done in a single loop when starting from the end of the buffer. They repeat this for the second interpolated trace and then use an extra loop to do the averaging. Again a single loop can be used to accomplish this.

Have to give them credit that the algorithm used provides a frequency independent rounding of the edges. Tried to use a simple IIR filter (exponential moving average type) but this is frequency dependent and asymmetrical, so not the solution.

Attached pictures show the times 25 up sampling.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 15, 2021, 01:53:40 pm
To keep things interesting for me I decided to look into the firmware updating.

Reversed the code of the other program (located at address 0x6000) in the flash and it confirms what I thought. It is the code for updating the flash. The input file needs to hold the startup image plus the new firmware code.

The file content is read into memory and written to the flash starting from address 0x13000, which is where the startup image resides. The data is written in 65535 (0xFFFF) byte sized blocks and it does 30 blocks no matter what.

The data is read back from the flash and some checks are performed, and when erroneous the first 1000 bytes of the main program are written again with wrong data. (The start of the bitmap, so I think they forgot to do a memory clear before writing)

On success the firmware upgrade file is deleted and the scope restarts. (Need to check this since it calls one more function at the end I did not yet looked into)

I believe it also displays a progress bar, but I still have to decipher that function ;)

Due to all the knowledge gathered with the reversal of the main program it was an easy job to identify the different functions.

Still have to check on the checks they perform and figure out what a bit of code is for to be able to make my own upgrade file.

Before writing to the flash 12 bytes are copied from location 0x5000 0x14000* in the file data and the source bytes are cleared erased (0xFF). After writing to the flash these 12 bytes are written to the flash at address 0x27000 (start of the main program), but the flash is not erased before this writing.

When I'm done with the investigation I will upload the Ghidra backup as well as my work files to the repository.

Edit: *The C output showed "DAT_80000f40 + 0x5000" while the assembler shows "add  r1,r5,#0x14000"  :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 15, 2021, 05:11:46 pm
Decoded the check system.

At the end of the update file 9 32 bit values are expected. These values hold location dependent bit counts and a sum of all the bytes in the file minus the last 72 bytes.

The check code goes through all the bytes read from the flash, and checks if a bit is set. If so it adds the current byte index to the counter for the particular bit.

For the FNIRSI-1014D this seems to be the same. See attached picture for the last bytes of a firmware update file.

This means I have to write a program that takes the bitmap binary and the firmware binary and appends them into a single file, calculate the check codes and add these to the file. Also take care of the other extra thing they do to make it work and see if my second scope can be updated to new firmware, and also restored to the original code. :-//

Edit: The special thing turns out to be bull shit. Before writing to the flash they copy the first 12 bytes of the main program to a buffer on stack and set them to 0xFF (erased) in the original buffer. The they write the original buffer to flash, and when that is done they write the 12 bytes to the start of the main program :-DD

For this to work with my version of the code, I first have to get the USB working, so I will be working on that next.

It is going back and forth a bit, but I need that to keep at it. The reversal of the short time base code is very tiresome  ::)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on October 15, 2021, 05:41:12 pm
Sounds like the bitmap of the screen is being used when troubleshooting. Change the colour of a pixel or put up some text so you can see if a function call worked or whatever. Then just leave it in rather than write three more line of code to clean up the mess.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 15, 2021, 05:51:36 pm
Check my edit of the previous post.

They put the bitmap in to be able to show a firmware version number, at least that is what I read in the readme included with the last FNIRSI-1014D firmware update :-DD

Sometimes I'm to hasty with posting :palm: so discovered to late that the Ghidra C output shows wrong stuff.

Code: [Select]
  memcpy(auStack104,DAT_80000f40 + 0x5000,0xc);
  memset((uint)(puVar6 + 0x5000),0xc,0xff);

Code: [Select]
        80000dcc 05 19 85 e2     add        r1,r5,#0x14000
        80000dd0 92 0f 8d e2     add        r0,sp,#0x248
        80000dd4 5d fd ff eb     bl         memcpy                                           longlong memcpy(void * dest, voi
        80000dd8 ff 20 a0 e3     mov        r2,#0xff
        80000ddc 0c 10 a0 e3     mov        r1,#0xc
        80000de0 05 09 85 e2     add        r0,r5,#0x14000
        80000de4 a7 fd ff eb     bl         memset                                           void memset(uint address, uint c
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on October 15, 2021, 06:51:13 pm
Well....... at least a documented reason.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 16, 2021, 12:33:49 pm
Bummer, managed to make a firmware update file for the 1013D and it did write to the flash, but when it started up again it went into the hardware check mode. Not a problem per se but I can't get it past the touch panel check |O

So need to open up my new scope and boot it to FEL to restore things.

It at least proofed that the check code generation I wrote works :)

Added it to the flashfilepacker project I wrote earlier to allow testing in my emulator. It is in the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/flashfilepacker (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/flashfilepacker)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 17, 2021, 09:42:15 am
I have been a bit of an over enthusiastic idiot. |O Did not make a backup of the flash of my new scope before testing the update file I made.

It turns out there are different versions of the touch panel out there. Even though it is a GT911 it does not have the loose cable the others have. It also has only 2MB instead of 4MB flash, so I had to trim the readout of the flash of my other scope to be able to program the new scope. But with both versions (original and modified touch panel orientation) it fails the touch panel check, and it also refuses to start the scope code even though the check bytes in the flash are what they should be.

Tested it with my version of the scope code and that runs, but shows that the touch panel orientation is different and also still on 1024x600 while my software expects 800x480.

If any of you out there has this version of the scope (On the front it has FNIRSI instead of TABLET) and is willing to extract the firmware from the flash that would be great.

Simplest way to do this is to take a max 2GB micro sd card and load the start with FEL program on it, stick it in the scope and run the sunxi-fel tool to read the flash with:

Code: [Select]
sudo ./sunxi-fel -p spiflash-read 0 2097152 w25q16_new_scope.bin

The sunxi-fel tool and boot program can be found in the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/sunxi_stuff (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/sunxi_stuff)

This needs further investigation to allow for new firmware to be distributed. Have to add a menu option to be able to get the touch panel adjusted. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 17, 2021, 05:28:28 pm
Is it my internet or is EEVBLOG having problems.  :-// The last couple of days it takes longer to load a page or start a new post. To get to this one it first timed out and needed a reload to get it open again.

Still investigating the new scope issue. For some reason it insists on running the hardware checks even though the check code is set, so I nopped the two function calls to just skip them. This worked and the normal scope display appears, but I think it is slightly shifted to the right. The id on the lcd cable is different, so I guess it also has a different display, which needs some tuning of the parameters.

The touch panel takes and remembers the given configuration, but neither of the two I have work the way it should. Need to write some test code to find the correct configuration for this one.

It is starting to look like the 1014D update scenario. FNIRSI supplies two different firmware files to cope with the different displays :-DD

See this post for more about that
https://www.eevblog.com/forum/testgear/new-bench-scope-fnirsi-1014d-7-1gsas/msg3577705/#msg3577705 (https://www.eevblog.com/forum/testgear/new-bench-scope-fnirsi-1014d-7-1gsas/msg3577705/#msg3577705)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 09:01:58 am
I have version with FNIRSI sticker and protruding BNC connectors.
But you will have to give me more specific instructions on how to do it.
How to prepare SD card. What to do when it boots from SD card etc... And I am a total linux noob. I can follow instructions but that is it... :P

For me it would be easier to use some kind of hardware to read memory out.
I have just recently updated firmware of cheap DPS3005 to much better firmware with ST-LINK V2: https://profimaxblog.ru/dps_fw_flashing/
I know also how to read (and modifiy) memory of multimeter Uni-t ut210e with arduino...

So if any of this options are useful I can do it...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 09:15:21 am
Not sure if the one with the protruding BNC's uses the same touch panel, but worth a try. Good exercise for when the new firmware is ready :)

Do you have a spare computer you can install linux mint on? It is very simple and many info on how to do it can be found on the net.

Once you have this up and running it is also simple to just follow the commands I will give.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 09:22:34 am
I already have a computer with linux Mint on it. :) (I a linux noob but I still get sick of Windows from time to time...)
So my quess would be:
Put 2GB sd card into laptop. (Should I format it to fat32?)
Try to find out if sdcard is mounted to /dev/sd
If it is mounted correctly then run:
sudo dd if=fel-sdboot.sunxi of=/dev/sdc bs=1024 seek=8

Put SD card into scope and power it on.
Then connect scope though usb to laptop.

Now run command sudo ./sunxi-fel -p spiflash-read 0 2097152 w25q16_new_scope.bin in terminal and cross fingers ?

Please correct any wrong steps.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 09:27:59 am
No need to format the SD card, just stick it in and check with this where it sits:

Open a terminal with ctrl + alt + t and type

lsblk

This will list the block devices.

Then run the command sudo dd if=fel-sdboot.sunxi of=/dev/sdc bs=1024 seek=8 whit the correct /dev/ for of=

For the rest yes.

To see if the scope is in FEL mode use either "lsusb" or sudo ./sunxi-fel version

Edit: "lsusb" should show "Bus 001 Device 008: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode"
Edit: "sudo ./sunxi-fel version" should show "AWUSBFEX soc=00001663(F1C100s) 00000001 ver=0001 44 08 scratchpad=00007e00 00000000 00000000"
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 09:35:41 am
OK tnx, I'll try. I will let you know how it went in the evening when kids go to bed and I can work on my stuff...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 11:56:41 am
Touch panel configuration, that is what it is all about :palm:

Looked at the touch panel a bit closer and found that this version uses the GT911 with sens0 - sens11 going to the glass panel, so 2 more lines then the other touch panel. Also found that it uses drv0 - drv10 and drv12 - drv21 for a total of 21 driver lines going to the glass. This is 5 more then the other one. (Uses drv0 - drv6 and drv15 - drv23)

I also own a waveshare stm32h7 kit with a 7 inch display and touch panel. This one has all the sensor and driver lines connected, so I read the configuration to see what the settings are for that one.

Based on this I made a test configuration for the mystery (new) one, but it did not do the trick. It does improve a bit, but still not what it needs to be.

This complicates things for making a firmware update. Have to think of some solution where just after a firmware update the user has to calibrate the touch panel and possibly the  display and store the correct settings in the flash. On the next power on this calibration should no longer appear. Adding a menu item for this is not a real option because the menu might not be reachable with a wrong touch panel setup.

Maybe read the touch panel configuration first and use it create the needed configuration. My version of the touch is based on 800x480 resolution instead of 1024x600 so coming from original code the configuration needs to be updated.

So yet another item on the to do list |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 02:19:04 pm
Made some pictures of the touch panel pcb's.

The first one is of the new scopes touch panel with the 12 sensor and 21 driver lines. The second one is of the broken touch panel of my first scope. This one uses 10 sensor and 16 driver lines.

Managed to make a working configuration after further study of the manual. It is not only the sensor and driver coupling that needs to be set but also the number of drivers and sensors :)

It works, but not sure if the remainder of the settings are fully correct, so still like to get my hands on the proper configuration for this touch panel.

For @Frenky, check if your touch panel has the same number of sensor and drive lines like my new one, otherwise there is no gain in getting your firmware. (other then the safeguard for your own system and the experience gained 8))
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 05:53:06 pm
I searched everywhere in my house but I do not have 2GB microsd card. I have some regular size SD cards but no converter...
In the scope was 8GB already installed. Could it work with 8GB?

Anyway here is photo of IC on small flex pcb:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1301513;image)
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1301519;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 06:00:44 pm
And on the big flex cable there is no IC on top or bottom side:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1301525;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 06:12:21 pm
I have tried it with bigger cards and it does not work with FEL boot. I use 128MB cards. Next one up, I have lying around, is 4GB and that fails.

Your touch panel is an old version one so unfortunately not the one I need.

If you are up for testing new firmware when ready it will be helpful to get a smaller micro sd card.

Managed to fix my new scope by patching the configuration data with the touch panel configuration I created and tested with my version of the code. Still would like to get the original firmware to compare the touch panel configuration, but not a big deal.

On to the next challenge in the project. USB!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 06:16:28 pm
And on the big flex cable there is no IC on top or bottom side:

That is correct. Is just for the LCD, which does not do the touch. Interesting to see the part number of it though. Different from both my versions.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on October 18, 2021, 06:21:55 pm
Good to see you got it working again. I will try to find online 2GB microsd card to have it at hand when you have beta firmware ready. ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 18, 2021, 06:28:50 pm
Here they still seem to provide from small to larger micro sd cards

The 128MB will work for sure.

https://nl.aliexpress.com/item/1005002618854916.html (https://nl.aliexpress.com/item/1005002618854916.html)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 19, 2021, 02:57:33 pm
After an hour or so trying to get an eclipse project for the F1C100s USB, I found on the net, to compile in my netbeans environment, I can see some light in the Allwinner USB darkness.

Documentation for the USB interface in the F1C100s seems to be nonexistent  |O The programmers manual for it only gives the base address of the registers and a very brief insight in what it is capable of :-//

Luckily the sunxi folk wrote drivers for it, and that is what the project I found is based on, so I have a listing of the registers. Based on this information, I found a block of code in the Ghidra disassembly of the scope firmware that makes use of these addresses. Now I have to see if it matches the sunxi code, and find the device descriptor data.

I have some experience with USB on the STM32F103, for which I wrote a bare metal driver, so at least some idea on what I'm doing :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 20, 2021, 08:25:19 am
Is it my internet or is EEVBLOG having problems.  :-// The last couple of days it takes longer to load a page or start a new post. To get to this one it first timed out and needed a reload to get it open again.

Turns out it was a problem at my provider. Received an email of them yesterday announcing they where going to service things from 23:00 to 6:00 to resolve some problems. This morning I discovered they only made it worse :palm:

Internet was up, but the only page I could reach was the login page of the provider itself. No other pages could be reached for as far as I tried.

Now it is still wonky, but the EEVblog is reachable :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 20, 2021, 04:08:08 pm
I'm in luck :)

They did use the sunxi code to make the USB device. Already matched a lot of the functions. Still to be done is the interrupt handler where a connection with the SD card has to be made. This is not in the eclipse project I found and mentioned earlier, so have to search the FNIRSI code to figure that out.

But there is a good starting point now, and hopefully it will be reversed soon.

When the USB stuff is working I will write a proper solution for the touch panel variations. To safeguard systems I'm thinking of saving the original configuration to a file on the SD card. This way there is a backup in case of problems. Unfortunately I don't see a solution for safeguarding the original firmware without opening the scope and make use of FEL boot or de-soldering the flash chip.

One option that springs to mind is a version of linux on an SD card, that reads the flash to a file on the SD card. I have tested running linux from a 4GB SD card, so the size limit for FEL is not an issue then.

Maybe this is something somebody can try to whip up, as I have already enough to do on getting the thing reversed :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 22, 2021, 09:03:50 am
Found most of the things needed for the reversal of the USB part.

The descriptors turned out to be in the packed data that is unpacked on system startup. They did not clean up the USB code to just be for the mass storage device, so HID, CDC and UVC descriptors are also in there. Not used but there are checks in the code that are a waist of cpu cycles and code space.

One benefit of them being lazy is that the debug strings are still in the code, which made matching with the sunxi source easier to do :)

Did a search in the Ghidra output to see how many unidentified functions (FUN_8...) are left in there. Still 378 of the 804 functions reported when exporting to C code. :o
I thought I touched more of it all, but I did skip the display library, so quite a bit of functions can be in there.

Also looked at the size of the code without the bitmaps. Still almost 600KB. My version at the moment is 200KB. With what still needs to be implemented it will grow a bit, but not by that much. 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 22, 2021, 05:12:39 pm
Worked the USB code in to the scope project and cleaned it up a bit (removed the debug prints, since there is no usable uart to send them to) and it compiles.

Implemented the part of the user interface to enable the USB connection and tested that.

Next step is to actually use the USB code. Want to test it first with a CH340 descriptor set and just return received data to see if that works. When that is working change it to the mass storage descriptors and figure out what is needed to get that working. I do have an example project for a STM32H7 mcu, so can peek there.

Funny thing is that the FNIRSI scope uses the STM32 vendor id for its mass storage device :-DD

Edit: Why is the image not being showed on the "attachimg=1" location? I used the "Inline full-size image" option.

[attachimg=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on October 22, 2021, 06:14:55 pm
Edit: Why is the image not being showed on the "attachimg=1" location? I used the "Inline full-size image" option.

Once the FNIRSI is done you can have a peek at the webserver code here in EEVBLOG...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 22, 2021, 06:53:25 pm
Once the FNIRSI is done you can have a peek at the webserver code here in EEVBLOG...

No thanks, done that and been there  |O

Embedded programming is more my thing now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wormey on October 23, 2021, 06:57:49 am
I may have one of the model you're looking for.  It has the recessed BNCs, a wide cable with chip on top going to the display, and an 8GB microSD.  And it has the FNIRSI logo on the front.
If there's more identification you need, tell me what to look for.
If this is sufficient, point me to instructions to get the data you need.
Steve
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 23, 2021, 08:10:20 am
Welcome to the forum :)

Can you post a close up picture of the touch panel ic like @Frenky did on the previous page?

I can then see if the touch panel matches my version. If so I will guide you through getting the firmware out.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wormey on October 23, 2021, 07:05:15 pm
I see now the chip is not on the big cable.  (I was up late last night.)
How is this?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 23, 2021, 07:36:00 pm
Unfortunately not the same as in mine. It only has 10 sens lines and 16 driver lines connected.

So this seems to be the more common one.

Not a big deal since I got mine working again.

Once I have the USB part working, I'm going to look into a better setup for the touch panel configuration, where it uses the original configuration and only make a change to the resolution as needed. This way the orientation should remain correct.

Also have been thinking about safeguarding the original firmware. Won't try the linux way, but maybe write my own SD card boot that copies both the touch panel configuration as well as the firmware (complete flash) to the SD card, and have USB mass storage enabled so it can easily be copied to a computer.

On the USB front I got the CH340 device, I'm coding as a test case, to be recognized by the host, but the scope freezes, so something is wrong. But I will get there ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wormey on October 23, 2021, 07:54:55 pm
OK.  I have enjoyed reading your posts, and had hoped to be able to contribute something back, but oh, well....

What with all the errors I have read about in the FNIRSI software, I'm looking forward to being able to install something that works better.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: zildan on October 27, 2021, 01:21:59 pm
Is good?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 27, 2021, 04:31:13 pm
Unfortunately also the more standard 10x16 touch panel. :(

Most likely mine is from a fairly new production run. I bought it this august, so if anyone has bought one after that time there is a bigger change on having the same one.

Still fiddling with the USB. Haven't had a lot of time for it, but once that is done I will try to make a peace of code that, if possible, can be written to the SD card via the scope software and after a reboot makes a copy of the touch panel configuration and the firmware. This way there is no need to open up the scope :)

Some experimenting is needed for this 8)

Mine has no detachable cable. See the picture below.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jchd on October 29, 2021, 04:00:32 am
Here's my version.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jchd on October 29, 2021, 04:03:46 am
The chip on cable.
Second picture with another setting.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jchd on October 29, 2021, 04:07:03 am
Markings on cable even if you probably figured that out already!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 29, 2021, 05:48:26 am
Hi jchd, welcome to the forum.

Yours is also the 16x10 version.

As can be seen on the picture it has the sens0-sens9 connected on the left side of the chip (on your picture). To be the same with mine it needs sens0-sens11 connected.

For the driver lines there is a gap between the used lines. The common one has drv0-drv6 and drv15-drv23 connected. Mine has drv0-drv10 and drv12-drv21 connected.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jchd on October 29, 2021, 10:44:45 am
I bought it from the FNIRSI shop on 09/09/21. Of course it's branded "FNIRSI".

There are sooo many differing cables... Isn't that surprising?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 29, 2021, 11:13:36 am
I guess it all depends on their, or their production company, purchase and stock policy. With the shortage caused by covid they might have to source from different suppliers and use what they can get. Still have to check the LCD of the new one to see if it is shifted to the right a little. I noticed this when I got the hardware check for the touch panel. This shows four squares in the corners, and I could see that the right squares where shifted to the right onto the left side of the screen.

The different shops on AliExpress probably also have their own stock of complete devices, so you never know what you get :-//

Bought mine here: https://nl.aliexpress.com/item/1005002081018518.html (https://nl.aliexpress.com/item/1005002081018518.html)

Now more expensive then what I paid for it :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 29, 2021, 11:32:06 am
Still struggling with the USB code. I found a comment of the sunxi club that the interface is based on the "MENTOR GRAPHICS MUSBMHDRC USB 2.0 MULTI-POINT DUAL-ROLE CONTROLLER". Got the manual of the net and started going through whilst comparing the code to it. It does help a bit :)

Also using wireshark to monitor the USB communication and fixed some issues with the CH340 device clone I'm using as test code. I can now open the serial device with cutecom, but the scope still hangs in the USB connect screen. Does not respond to touch anymore :palm:

I'm now looking at the code in the actual scope and it shows the usual standard of not understanding or laziness. At some part they removed the code for the other possible devices, but in other parts they did not and just added a bit to get the mass storage device to work.

For instance, in the setup phase the host queries the device for information. This can be either for standard, class or vendor specific data. For the mass storage device a query for the number of LUN's is done. This is a class query (0xFE). But instead of removing the HID class queries they added the 0xFE one :-//

Cleanup is needed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 29, 2021, 12:51:25 pm
Why oh why do I keep making these stupid copy, paste not modify errors. :-//

Copied the setup_interrupt function call from the timer code, but forgot to change the IRQ number. |O

With this the USB interrupt was called every millisecond instead of on the actual USB interrupts. Since this is fast enough for the USB interface to be handled that part worked.
But for the rest of the system the timer delay is killed since the timer handler is replaced with the USB handler. This most likely caused the system not to return to the normal state when touched in the ON/OFF field of the USB connect screen :palm:

Code: [Select]
  //Setup the interrupt for the USB interface
  setup_interrupt(TMR0_IRQ_NUM, usb_irq_handle, 0);

Now set with the correct irq number it works like a charm :-DD

Code: [Select]
  //Setup the interrupt for the USB interface
  setup_interrupt(USB_IRQ_NUM, usb_irq_handle, 0);

So it now is a case of converting it to a mass storage device and clean things up.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jchd on October 29, 2021, 01:21:42 pm
Mine got shipped from Czech source/stock.

Yeah, zero-COVID policies in S-E Asia + repeated confinements in industrial areas caused breaks in stocks of everything. In electronics, this first showed for high-value components but I now see more and more "small" components out of stock for up to 12 months. This will probably affect almost every business, electronics being so ubiquitous.

Anyway, thanks for putting so much time and efforts to fix this device.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 02, 2021, 01:32:41 pm
On and off working on the mass storage code. Found the tinyusb implementation which gives a nice base to work from. Reversing the original code is not a real option. It is full with strange bits that do not stroke with the specifications. For instance a check is done on length not being 31 and if so a debug command says valid CBW, which is strange since a command block wrapper has to be 31 bytes. :-//

In the mean time I tried using the scope to do measurements on a defective guitar amplifier (A Marshall MG-100FX), but for that it is absolute useless. In the power stage the supply voltage is plus and minus 45V, whilst control signals are in the range of 200mV or lower. With a 10x probe (needed for the 45V to not destroy the scope) the 500mV/div is to high to see some meaningful signal. Switched to the Hantek DSO2D10 with which I was able to determine the positive side of the power stage was not getting signal. Without a schematic very tricky to find the problem, but close inspection showed a hole in an opamp. Not sure about further defects and don't have any smd opamps in stock so shelved for later.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 03, 2021, 03:24:34 pm
Managed to get at least file read to work (very crude implementation without error checking) but it is very slow compared to the original one. Need to figure out if this is caused by the USB handling or the SD card reading.

Since high speed USB with bulk endpoints works with 512 bytes and the SD card sector size is also that I made my implementation such that it only reads one sector per USB IN transaction, and I think that the original code reads all the requested sectors in one swoop to a big buffer. So I have to try that and see if it makes a difference.

Monitored the transfer for both with wireshark and the difference is significant. >2.3S versus <0.1S

This is a capture from the original scope. Second column is the time indication.
Code: [Select]
1423 18.279385 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c660, Len: 240)
1424 18.279399 1.18.1 host USB 64 URB_BULK out
1425 18.279435 host 1.18.1 USB 64 URB_BULK in
1426 18.290936 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1427 18.290982 host 1.18.1 USB 64 URB_BULK in
1428 18.291015 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1429 18.291098 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c750, Len: 16)
1430 18.291145 1.18.1 host USB 64 URB_BULK out
1431 18.291180 host 1.18.1 USB 64 URB_BULK in
1432 18.292487 1.18.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1433 18.292525 host 1.18.1 USB 64 URB_BULK in
1434 18.292562 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1435 18.292895 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c760, Len: 240)
1436 18.292906 1.18.1 host USB 64 URB_BULK out
1437 18.292946 host 1.18.1 USB 64 URB_BULK in
1440 18.304417 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1441 18.304462 host 1.18.1 USB 64 URB_BULK in
1442 18.304477 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1443 18.304554 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c850, Len: 16)
1444 18.304563 1.18.1 host USB 64 URB_BULK out
1445 18.304569 host 1.18.1 USB 64 URB_BULK in
1446 18.305946 1.18.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1447 18.305979 host 1.18.1 USB 64 URB_BULK in
1448 18.306014 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1449 18.306096 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c860, Len: 240)
1450 18.306106 1.18.1 host USB 64 URB_BULK out
1451 18.306145 host 1.18.1 USB 64 URB_BULK in
1452 18.317644 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1453 18.317676 host 1.18.1 USB 64 URB_BULK in
1454 18.317685 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1455 18.317752 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c950, Len: 16)
1456 18.317800 1.18.1 host USB 64 URB_BULK out
1457 18.317844 host 1.18.1 USB 64 URB_BULK in
1458 18.319139 1.18.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1459 18.319173 host 1.18.1 USB 64 URB_BULK in
1460 18.319211 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1461 18.319297 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000c960, Len: 240)
1462 18.319307 1.18.1 host USB 64 URB_BULK out
1463 18.319345 host 1.18.1 USB 64 URB_BULK in
1464 18.330856 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1465 18.330911 host 1.18.1 USB 64 URB_BULK in
1466 18.330948 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1467 18.331002 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000ca50, Len: 16)
1468 18.331022 1.18.1 host USB 64 URB_BULK out
1469 18.331026 host 1.18.1 USB 64 URB_BULK in
1470 18.332387 1.18.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1471 18.332393 host 1.18.1 USB 64 URB_BULK in
1472 18.332460 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1473 18.332477 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000ca60, Len: 240)
1474 18.332528 1.18.1 host USB 64 URB_BULK out
1475 18.332533 host 1.18.1 USB 64 URB_BULK in
1476 18.344028 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1477 18.344086 host 1.18.1 USB 64 URB_BULK in
1478 18.344133 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1479 18.344189 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000cb50, Len: 16)
1480 18.344214 1.18.1 host USB 64 URB_BULK out
1481 18.344248 host 1.18.1 USB 64 URB_BULK in
1482 18.345597 1.18.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1483 18.345604 host 1.18.1 USB 64 URB_BULK in
1484 18.345659 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1485 18.345727 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000cb60, Len: 240)
1486 18.345738 1.18.1 host USB 64 URB_BULK out
1487 18.345792 host 1.18.1 USB 64 URB_BULK in
1488 18.357253 1.18.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1489 18.357300 host 1.18.1 USB 64 URB_BULK in
1490 18.357307 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1491 18.357363 host 1.18.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x0000cc50, Len: 43)
1492 18.357373 1.18.1 host USB 64 URB_BULK out
1493 18.357427 host 1.18.1 USB 64 URB_BULK in
1494 18.359918 1.18.1 host USBMS 22080 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1495 18.359929 host 1.18.1 USB 64 URB_BULK in
1496 18.359955 1.18.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)


This is a capture from my code
Code: [Select]
1473 37.161925 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000110c0, Len: 240)
1474 37.161974 1.17.1 host USB 64 URB_BULK out
1475 37.162023 host 1.17.1 USB 64 URB_BULK in
1478 37.518151 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1479 37.518224 host 1.17.1 USB 64 URB_BULK in
1480 37.518299 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1481 37.518440 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000111b0, Len: 16)
1482 37.518488 1.17.1 host USB 64 URB_BULK out
1483 37.518542 host 1.17.1 USB 64 URB_BULK in
1484 37.546236 1.17.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1485 37.546310 host 1.17.1 USB 64 URB_BULK in
1486 37.546372 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1487 37.547731 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000111c0, Len: 240)
1488 37.547798 1.17.1 host USB 64 URB_BULK out
1489 37.547857 host 1.17.1 USB 64 URB_BULK in
1490 37.904446 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1491 37.904558 host 1.17.1 USB 64 URB_BULK in
1492 37.904623 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1493 37.904795 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000112b0, Len: 16)
1494 37.904831 1.17.1 host USB 64 URB_BULK out
1495 37.904851 host 1.17.1 USB 64 URB_BULK in
1496 37.932611 1.17.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1497 37.932640 host 1.17.1 USB 64 URB_BULK in
1498 37.932652 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1499 37.932763 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000112c0, Len: 240)
1500 37.932820 1.17.1 host USB 64 URB_BULK out
1501 37.932877 host 1.17.1 USB 64 URB_BULK in
1520 38.289367 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1521 38.289441 host 1.17.1 USB 64 URB_BULK in
1522 38.289468 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1523 38.289631 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000113b0, Len: 16)
1524 38.289645 1.17.1 host USB 64 URB_BULK out
1525 38.289657 host 1.17.1 USB 64 URB_BULK in
1532 38.317430 1.17.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1533 38.317488 host 1.17.1 USB 64 URB_BULK in
1534 38.317502 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1535 38.317612 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000113c0, Len: 240)
1536 38.317626 1.17.1 host USB 64 URB_BULK out
1537 38.317638 host 1.17.1 USB 64 URB_BULK in
1628 38.674216 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1629 38.674310 host 1.17.1 USB 64 URB_BULK in
1630 38.674337 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1631 38.674464 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000114b0, Len: 16)
1632 38.674479 1.17.1 host USB 64 URB_BULK out
1633 38.674502 host 1.17.1 USB 64 URB_BULK in
1640 38.702252 1.17.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1641 38.702326 host 1.17.1 USB 64 URB_BULK in
1642 38.702341 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1643 38.702457 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000114c0, Len: 240)
1644 38.702472 1.17.1 host USB 64 URB_BULK out
1645 38.702484 host 1.17.1 USB 64 URB_BULK in
1722 39.059089 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1723 39.059195 host 1.17.1 USB 64 URB_BULK in
1724 39.059258 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1725 39.059427 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000115b0, Len: 16)
1726 39.059463 1.17.1 host USB 64 URB_BULK out
1727 39.059474 host 1.17.1 USB 64 URB_BULK in
1730 39.087230 1.17.1 host USBMS 8256 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1731 39.087261 host 1.17.1 USB 64 URB_BULK in
1732 39.087272 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1733 39.087376 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000115c0, Len: 240)
1734 39.087398 1.17.1 host USB 64 URB_BULK out
1735 39.087412 host 1.17.1 USB 64 URB_BULK in
1736 39.443931 1.17.1 host USBMS 122944 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1737 39.444045 host 1.17.1 USB 64 URB_BULK in
1738 39.444121 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)
1739 39.444293 host 1.17.1 USBMS 95 SCSI: Test Unit Ready LUN: 0x00
1740 39.444317 1.17.1 host USB 64 URB_BULK out
1741 39.444327 host 1.17.1 USB 64 URB_BULK in
1742 39.444362 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Test Unit Ready) (Good)
1743 39.444519 host 1.17.1 USBMS 95 SCSI: Read(10) LUN: 0x00 (LBA: 0x000116b0, Len: 10)
1744 39.444543 1.17.1 host USB 64 URB_BULK out
1745 39.444553 host 1.17.1 USB 64 URB_BULK in
1746 39.461909 1.17.1 host USBMS 5184 SCSI: Data In LUN: 0x00 (Read(10) Response Data)
1747 39.461939 host 1.17.1 USB 64 URB_BULK in
1748 39.461950 1.17.1 host USBMS 77 SCSI: Response LUN: 0x00 (Read(10)) (Good)


So they got one thing right :) but when I open an image from this mass storage device the scope hangs, so on the other hand they messed something up :-DD

My version still needs the write command implemented to be able to un-mount the drive when it needs a write back. At least there is progress again.

Edit: Modified the code to read from the SD card into a bigger buffer and it is the solution for the speed. It shows the same speed as the original. So quite a lot of overhead in reading a single sector from the SD card. With the USB mass storage only active when enabled by the user and blocking the rest of the scope code, allows for using the 400000 byte buffer the code has for loading the thumbnail files when viewing pictures or wave files on the scope itself. :) My version does not hang, at least with the code I have working now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 04, 2021, 12:22:56 pm
The write command is now also implemented. During testing I noticed that the host sends commands to allow or prevent removal of the device, so I'm thinking about implementing this in the code with visual feedback like a lock symbol if the host won't allow release of the device.

Needs to be robust in the sense that when the cable is disconnected the scope won't hang in this mode and releases it self back to the scope mode. This is not the case on the original. It needs a power cycle to be brought back to live |O

My implementation is very crude and lacks a lot of checks, so there is still work to be done on it. Like to do a complete re write of the whole USB code, since it is full of crap. Much easier now I have a working code base and knowledge about the working of it all.

It did survive several tests with writing a file, un-mounting, mounting again, deleting the file, etc. So very promising.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 05, 2021, 02:45:04 pm
I have been playing with SD cards a bit, to look into making a firmware and touch panel configuration backup utility and found that my SD card implementation has some problem. To not screw up the original SD card I wanted to use one of the 4GB cards I have lying around, but it did not work with them. Tried with a shrunk image of the original card written to the 4GB card, but no dice. It does work with the original code, so it is back to the drawing board for that.

Also looked into the booting from a SD card, which the F1C100s is capable of, and it is the first device tested when booting. I noticed that a linux image I made does boot without problems even when written to bigger cards. Tried the FEL boot with the original 8GB card in the scope (even used the scope to dd the image to, which works) and it started in FEL mode no problem what so ever, so I'm stumped as to were it failed with the 4GB cards before :-//

The boot process is described here: https://linux-sunxi.org/Bootable_SD_card (https://linux-sunxi.org/Bootable_SD_card)
When there is a valid EGON or TOC0 signature at byte address 0x2000 it will boot from it.

This opens up an easy route to get things done without opening the scope.

Thinking of the following steps:

This way it is also possible to add a check on the touch panel config to see if it fits my new scope :) Easy to show a message on the screen alerting this is the case and ask to have it posted here on the forum 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 07, 2021, 05:15:15 pm
The USB re write is coming along nicely 8)

Managed to get rid of several unneeded memcpy's and cleaned up the complete end point 0 handling. Since it is bare metal programming I'm making it mass storage dedicated, but with the amount of commentary in the code it is easy to change it for other USB devices.

Next up is the end point handling for the mass storage data. Converting what I have is not that much, but it still needs the adding of the error checking. When done the amount of code needed, I suspect will be near half of what I had first. After the first working version it was about 15KB for the USB, and now with the additional cleaned up code it is about 20KB, because the old code is also still in there. So the new code is about 5KB.

Did a small step at a time conversion, with in between testing to make sure it kept working. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 08, 2021, 01:43:43 pm
Done with the first step of the USB re-write. Encountered some tricky things of the USB peripheral, like the order in which some bits are set or cleared make a world of difference between working and not working and sometimes a bit random working.

Cleaned up the repository where the source code resides. (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope))
Removed the original USB source files. Left are four new files that handle the USB mass storage device.

Still work to be done on the error checking in the mass storage class, and improve the data handling of its out end point, which for now still uses a memcpy to move the data from the receive buffer to the SCSI buffer. Can be done without it, by direct copying from the FIFO into the target buffer. Easier to tackle now the other stuff is out of the way.

Improved on the USB FIFO reading and writing to be buffer alignment independent. The original code only works when it is 32 bit aligned.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 09, 2021, 05:13:50 pm
Quite a while back I wrote about I wanted to use my own startup image on the scope, and today I wrote the code for it. It is not a bitmap that is loaded, but display code that is run to make the image. :)

The attached picture is a bit fuzzy, but it is on my test scope, which still has the protective film on the acrylic panel I made for it to repair the broken glass.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: KubaSO on November 09, 2021, 09:18:12 pm
I usually compile with O2. The speed increase is noticeable.
Why does the optimization break the touchscreen?

The touch panel delay routine was an empty for loop. This is removed by the compiler when optimization is set to 1 or higher. Changed it to an assembly loop and now it works with optimization level O2.

The speed of the sliding in of the menu's is much better now. There will still be room for improvement, but the first goal is to get working code that mimics the scope.

And that is coming along, but still a lot of work. Put in the code for changing the screen brightness. It uses special functionality of the FPGA, for which I reversed the code a while back but did not test it until now. Happy to say that it works.

That's normal. Modern C and C++ programming does not admit the concept of a delay loop. The compiler removes code that has no observable side effects, and time wasted is not a side effect in C/C++.

Code compiled without optimization is junk. It's only useful for debugging with a debugger actually running on the target. It has no other uses.

So basically forget about building stuff without optimizations. You'll be fighting performance windmills most of the time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 10, 2021, 04:36:56 pm
The firmware backup is taking shape.

The touch panel configuration is already being saved and I made the layout of the remainder of the screen.

It also shows the FLASH manufacturer and the id, based upon which it decides to backup either 2MB or 4MB. 2MB is the minimum size since the original firmware is 1.6MB, and I don't think there are scopes with 8MB FLASH chips, and even if there are it is not a big deal.

When the backup is finished it attaches to the computer as a mass storage device and allows for copying the files.

In case of the special touch panel being detected it will show some messages. Might even blink them :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 10, 2021, 07:33:24 pm
Finished the backup part of the backup-er and made a video of it.

https://youtu.be/h-tdKPDocHI (https://youtu.be/h-tdKPDocHI)

Next is to make a bootloader for it and a combined package that can be written to the SD card of a scope.

Waiting for a bunch of new SD cards I ordered from Aliexpress to do further testing on the SD card code.

Doing this bit of code showed me that the bulk of the scope code is made up of the FatFs, SD card, USB interface and display library. This fairly simple backup program is 147KB against the scope program being 211KB as it stands now. Removed a couple of the fonts, and the icons, but that took of only 16KB or so. The statemachine (user interface) and scope functions is about 50KB of code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ledtester on November 11, 2021, 02:08:10 am
Oh, and all this time I thought the "pc" in  "pcprogrammer" stood for "personal computer"  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 11, 2021, 02:57:12 pm
Very frustrating this boot loader stuff :o

When I load my original boot loader to the SD card starting on sector 16 and turn on the scope it boots the original scope code from flash without problems, so starting from SD card works.

But when I try the boot loader I wrote for loading from the SD card it fails big time. Tested the code, adapted for running in DRAM, by loading it to DRAM via my special FEL boot (which is in the FLASH) and that loads the firmware backup code from the SD card and starts it, so I know the code it self is OK.

Figure it has to do with the timer interrupt needed for the SD card implementation, but testing this theory is not easy. With FEL only very small programs can be loaded and tested in the startup RAM. The boot loader is 17KB and that is to big to load. FEL fails when I try. |O Have to write it to the SD card to test it. Bit of a pain in the bum :palm:

The problem lies in the fact that the code is loaded to address 0x00000000, which is where the vectors are. It should be fine to overwrite the first bit of the code since it is only the loading of the stack pointers. The code to copy the vectors follows after that, so should not be a problem :-//

Guess I will look at the SD code and see if I can get it working without the timer interrupt, and hopefully that solves it.

Oh, and all this time I thought the "pc" in  "pcprogrammer" stood for "personal computer"  :-DD

Yes that is the fun part of my initials 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 11, 2021, 08:03:57 pm
Took quite a bit of fiddling and get past an oversight to get it working.

The oversight was, that in the project I originally created, I made all kind of modifications to test things, and I forgot to remove a while(1); near the beginning of the code, so it never reached the new SD card code. Found that one when I inspected the code in Ghidra :palm: Falls under one sees what one wants to see. :-DD

Removed it et voila it did the trick. The SD card code for this boot loader no longer uses the timer ticks for the max timeout timing. Changed to a variable being decremented and if it gets to zero before the card interface is done it is a time out. It worked in the DRAM based project, so I had high hopes. Justified apart from the stupid oversight. :)

Do have another weird problem. The firmware backup program uses nice rounded rectangles for the progress bars, and as can be seen in the video it works when I load the program via the FEL utility. However when it is loaded from the SD card they are f-ed up |O

(http://[attachimg=1])

So a bit more research to be done.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pickle9000 on November 12, 2021, 05:03:32 am
I am so bad for that.  :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 09:12:42 am
I found the problem with the rounded rectangles, but do not have a solution for it due to lack of knowledge.

It has to do with the linker and the size it calculates. For the BROM header at the start of the program the size of the complete program has to be set. This means the code (.text) and the preset data (.data). Had problems with this before and thought to have solved it with adding read only data (.rodata) which seems to live in a separate segment in my tools.

Just read an article online that data declared constant ends up in the .text segment, but that does not seem to be the case here.

With the below shown linker script the sine table is placed at the end of the file, but the __program_size falls short with about 1KB. That is why it works when I load the program with FEL. All the data is loaded to memory, but when it is loaded from the SD card it does not load the last kilo byte and that screws up the sine table and with it the rounded rectangles.

When I add the size of .bss it returns the full size of the created file, but that also entails uninitialized data that is not needed to be copied. Tried with adding the size of .rodata, but that gives an error (undefined section `.rodata' referenced in expression)

This means doing a bit more research :(

Code: [Select]
MEMORY
{
  ram  : org = 0x7FFFFFE0, len = 32M
}

SECTIONS
{
  . = ORIGIN(ram);
  .text :
  {
    build/Debug/GNU_ARM-Linux/start.o (.text)
    *(.text);
  } >ram

  .data :
  {
    *(.data);
    *(.rodata);
  } >ram

  BSS_START = .;
  .bss :
  {
    *(.bss);
  } >ram
  BSS_END = .;

  __program_size = SIZEOF(.text) + SIZEOF(.data);
}
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 10:41:38 am
Fixed it. Modified the linker script and now it returns a value that equals the actual size of the file it creates.

Code: [Select]
MEMORY
{
  ram  : org = 0x7FFFFFE0, len = 32M
}

SECTIONS
{
  . = ORIGIN(ram);
  PRGM_START = .;
  .text :
  {
    build/Debug/GNU_ARM-Linux/start.o (.text)
    *(.text);
  } >ram

  .data :
  {
    *(.data);
    *(.rodata);
  } >ram
  PRGM_END = .;

  BSS_START = .;
  .bss :
  {
    *(.bss);
  } >ram
  BSS_END = .;
}

__program_size = PRGM_END - PRGM_START;

Tried the code on my new scope and it resulted in opening it up again |O

The SD card had a, to my understanding valid but uncommon partition setup. The partition started at sector 32 leaving only 16KB for boot data. Since the BROM boot loader expects the loader to be at sector 16 it only left 8KB, which is less then half the bootloader, let alone the full firmware backup package.

No actual damage done, but the scope started with "SD ERROR", so had to take the card out and reformat it.

This means that anyone willing to use this tool does so under its own responsibility!!

In case something goes wrong it means opening up the scope and fix the problem. In that case a SD card reader/writer is needed.

In my next post I will provide the package and instructions to make it all work.

Tested the steps I'm providing on my new scope and it worked without problems. (After the first test that is  :-DD)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 11:58:00 am
Here is the tool plus the steps to make it work.

!! I take no responsibility if anything goes wrong !!

Steps for making the FNIRSI-1013D firmware backup on a Linux machine:

When the scope showed the "!! special touch panel detected !!" message please upload the "FNIRSI_1013D_tp_config.bin" file in this thread.

If your scope uses a smaller or bigger SD card be warned that this is not tested yet. Only 8GB cards have been tested.

See the attached image for info on the sd card sectors. Screen cap from gparted.

Remove the .txt extension from the firmware backup package file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 03:03:23 pm
There is a problem with the firmware backup made with the backup tool.

The check bytes do not match what they should be, and unfortunately after correcting them with the tool I made for it earlier it still fails when loaded on the scope. |O

In itself not a problem, but it means that restoring the scope to its original state after trying my open source version is a bit trickier.

Have to open up my new scope again >:( to see if I can find why it failed in restoring the firmware and restore it via FEL.

Need to compare what is in the backup with what it should be to be sure the backup is correct.

To be continued :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 06:03:59 pm
Fixed the check data calculation and I'm onto the why my new scope is not doing a firmware backup. :)

By the looks of it, I unintended changed the boot loader in the FLASH of it since the first try of loading new firmware. There are so many flash backups on my computer from different tests that when I had to fix the touch panel problem of the new scope I probably used a file that has my own version of the boot loader in it. This one does not have the start of the other executable in it, so no firmware update being done.

There is a size difference between the different boot loaders, so that way I was able to tell them apart.

This means there is a good change the firmware backup file made with the correct firmware backup package (attached below) does what it needs to do.

To test it I first have to put the right boot loader in my new scope :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 12, 2021, 06:43:46 pm
Ah well enough crap for today, both mine as the Chinese type :-DD

It was indeed the boot loader, but with the original one in there it started the writing of the flash, but it keeps doing it over and over. It looks like it fails the check at the end of the firmware update and then resets. In the flash the brom header of the main program is not written (12 bytes the program skips at first and needs to fill them in later).

Or judging by the way it fades at the end and then restarts, it could also be the result of the watchdog still running and the flash program running to long :wtf:

But all this experimenting gave me an idea for easier testing or even running the open source code. Just make a SD card package for it and load it that way. Also easy to get rid off again. Just clear sector 16 on the SD card and it is gone.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 13, 2021, 01:16:23 pm
Did not check the firmware update any further and instead continued the "run from SD card" idea.

It makes use of a two stage boot loader setup. The first boot loader loads the startup screen program from the SD card and starts it. This startup screen program puts my startup image on the screen and then loads the main program from the SD card and starts it.

Made the projects and code for it and tested it on my test scope. Worked in the first try :clap:

To be able to test it on my new scope I first have to change the touch panel code to use the original configuration. When that is done it can be tested by others whom are willing to test the user interface part. The actual scope functionality still needs a lot of work.

Loading it is easy once the SD card is the way it should be. Partition starting on sector 2048, to allow the scope package on the card without interfering with the partition. (See a couple of posts back, with the red warnings  :-DD)
Code: [Select]
//Connect the scope to the computer and enable USB
//Un-mount the partition
sudo umount /dev/sdc1

//Load the package
sudo dd if=fnirsi_1013d.bin of=/dev/sdc bs=1024 seek=8

Removing it is also easy
Code: [Select]
//Connect the scope to the computer and enable USB
//Un-mount the partition
sudo umount /dev/sdc1

//Un-load the package
sudo dd if=/dev/zero of=/dev/sdc bs=1024 seek=8 count=1

This setup does not interfere with the FLASH, so normally no risk on having to open up the scope. Bricking it is near impossible :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 13, 2021, 05:23:14 pm
And here is the test package :)

It does not modify the touch panel configuration, but instead it reads it and calculates scalars based on the set x and y max values. Tested it on both my scopes and did not have any problems.

It reads the scope configuration from FLASH, but it does not write it on power down, so the FLASH is left unmodified.

I did notice that on my new scope the startup screen looks iffy, which strengthens my believe that it is a different display. So some more work on that front, but the live scope screen itself looks ok.

It also writes the touch panel configuration to the SD card, and when left on there, it only does this once. (file: FNIRSI_1013D_tp_config.bin)

As I wrote before it is basically impossible to brick this scope, and in case something goes wrong all that is needed is a screwdriver and a SD card reader/writer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2021, 12:13:54 pm
Received a couple of the SD cards today, and I tested them in the scope with my software version.

I ordered 1GB, 2GB, 4GB, 8GB and 16GB. Still waiting on the 4GB and 8GB.

The 1GB and 2GB are FAT16 formatted and this did not give any problems, but they need re partitioning to allow the new firmware to be loaded on to it. The 1GB starts on sector 16 and the 2GB on sector 32. Needs to be at least sector 800, but the more standard 1MB (sector 2048) allows for expansion.

The 16GB card is FAT32 formatted and also works without problems. The partition on that card starts beyond the needed 2048 free sectors, so no problem there.

For people with smaller cards in their scopes, they will, most likely, have to re partition their SD cards.

As there are different types of cards out there, it is no guarantee it will work with all cards. The ones I got are marked HC class 10

More testing when the other cards arrive.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2021, 02:53:33 pm
Tried my firmware backup on the 1014D and noticed a problem with the flash reading, which I also saw on my new scope.

In hind sight, this also explains why the new scope failed to bypass the hardware check when I restored it with the firmware of the old scope. The first byte read is zero due to the clock being on the edge.

Checked the boot loader of the 1014D against the one on the old 1013D and noticed the clock setting for the SPI being different. I remember doing tests with this clock speed while I was reversing the SPI code, and it seemed to work fine on the one but highest clock setting. Lowered it one more click and tested it on the new scope, and the things that failed on the higher clock work without problem now.

So one more issue put to bed 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 16, 2021, 09:38:52 am
Learning more about the display control stuff.

Reversed the 1014D software down to the display initialization and found only two differences, which have to do with the horizontal and vertical back porch.
Need to test the found values to see if they do the trick.

Only looked at the code I extracted from my scope. Not the latest firmware found on the FNIRSI site.

Also noticed that the SPI clock setting is much lower in the 1014D. ((AHB clock / 12) versus (AHB clock / 4)) In my code it is now (AHB clock / 6)

Reversing the 1014D code in Ghidra looks easy for a large part of it. Just look at the 1013D code and copy the function names. But the rest of it is for later. Need to finish the 1013D first.

Edit: Just changing these two values did not make a difference, so more research is needed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 16, 2021, 10:25:24 am
Updated to do list

Implemented so far:

Still to do:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fraser on November 16, 2021, 11:08:22 am
Pcprogrammer,

I just wanted to congratulate you on your work to date. You are clearly committed to this project and achieving steady progress. I have seen many similar projects started and then the development work trails off as the software coder loses interest or discovers other projects to code for that are more interesting.

I do not own one of these scopes but was considering the purchase of one some time ago as a basic tablet DSO. I ended up buying a ‘used’ MICSIG ATO1102 automotive DSO as it was ‘as new’ and the right price. I still read your posts though as it is good to see the project progress. I hope you continue your work and achieve the end result that you have worked hard for  :-+

Fraser
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on November 16, 2021, 11:19:08 am
He's a resilient inspiration.  :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 16, 2021, 02:02:21 pm
Back on the signal processing, which still needs a lot of work :(

I have implemented the up sampling routines basically based on the original code, but there is a big difference between the original and what I made.

For 250nS/div and 100nS/div it is fine, since that is only interpolating between the samples. None of the filtering done on the 50nS-10nS/div settings. On 50nS and 25nS/div with a 10MHz sine wave input my versions look like shit |O

On 10nS/div it is not that bad.

Still have to get the triggering right, which will skip the samples at the beginning so it might look better that way.

In the original code, on 25 or 10nS/div, there is some artificial signal generation done when the input frequency is higher then some value. I skipped that bit of code because it is a real pain in the bum to reverse, and does not do a scope justice. You want to see the actual signal, not something an engineer thinks it should be. Sure it looks good, but helps you nothing when there is trouble.

My version is also very restless, which might be caused by the faster code. To many screen updates and reads from the FPGA causing problems.

This means still a lot of research to get things more or less right.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 16, 2021, 04:09:03 pm
I'm wondering if any of the 4 7 9 11 down loaders of the scope test firmware has tried it yet.

Would be nice to hear what the results are and what needs to be looked at. I know there are still a couple of issues in there.

Edit: I just looked back and noticed it has been downloaded some more :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: simba15 on November 16, 2021, 09:03:57 pm
Very cool project!

I hope you are able to resolve some of the issues with this scope.  It seems like a very nice product to use (large screen) but the issues with the measurements leave lots to be desired.

That's where you came in! You clearly look like you may be able to resolve these!

Your progress makes me want to buy one to assist you with the user feedback of the firmware.

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 17, 2021, 10:25:31 am
Becoming more and more convinced the original short time base trace data processing is not worth the effort of full reversal, I'm going to take another route in making better software, for as far as the FPGA programming allows.

With the FatFs and USB mass storage implemented it is possible to create sample files and copy them to the computer. The idea is to write a bunch (50 or more) consecutive signal captures (raw sample data) to a buffer and when the count is reached write them to a file. Need to do this for the different sampling speeds the FPGA supports. E.g. for 10 and 25 nS/div it uses the same 5nS sampling. For 50 to 500 nS/div it uses 10nS sampling. (Actually the data written to the FPGA is the same for 10nS - 500nS, but for the two lowest the second ADC data is also read. Not sure if this second set is always available.)

This way I can look at the data on the computer and decide on what processing is needed to show a good signal representation.

Another thing I thought of, is there a way to re-program the FPGA connected FLASH chip without opening up the scope. The Intel/Altera Cyclone IV does provide support for it, but I doubt the FNIRSI engineers made provisions for it in their FPGA design. Did not find any clue in the software to suggest there is a command that allows writing new FPGA programming, which is a pity.

Since there is more support from the manufacturer for the 1014D it might be that it supports this. The firmware updater program is different, at least a binary compare shows a lot of changes, but I have not looked at that in Ghidra.

The 1014D code is certainly inconsistent :palm: In the boot loader they write one byte of data for the screen brightness, while in some parts of the main program they still write two bytes (the 0xEA60), but the function to set the screen brightness writes only one byte and does not use the translation chip anymore :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 17, 2021, 02:57:39 pm
First investigation shows a good signal for the 25nS capture.

On the first try I saved the separate buffers loaded from the FPGA, and after that I modified it to save the interleaved buffer. Both signals show the input is a sine wave (10MHz), where the separate buffers show as double frequency on my test screen. The interleaved signal has a slight error in the first couple of samples, but not noticeable.

It is only in the first 4 samples, but I see it in all the captures I made. (The first two samples of the separate buffers are always the same)

Code: [Select]
0x76 0x8B 0x76 0x8B 0xA0 0xB9 0xD0 0xDE 0xEC 0xF0 0xEE 0xE4 0xCF 0xC1 0xA6 0x91
0x7C 0x6B 0x60 0x59 0x5D 0x67 0x76 0x8A 0xA1 0xB9 0xD0 0xDD 0xEC 0xF1 0xEE 0xE4
0xD0 0xC1 0xA7 0x90 0x7C 0x6B 0x60 0x59 0x5D 0x68 0x77 0x8A 0xA1 0xB9 0xD0 0xDE

Have to make more captures with different input signals to see what the scope returns.

Also need to figure out where the trigger point is and how the trace offset system they made works.

One thing is for sure, this is more fun to do then trying to reverse the crap code they wrote.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 17, 2021, 07:53:44 pm
Verified a finding by comparing the two scope versions next to each other.

Made a video of it: https://youtu.be/SApQPL3pDvc (https://youtu.be/SApQPL3pDvc)

I wrote before that the scope makes up its own signal when the input frequency is above some value. Did calculations on it, and determined it is more then 43.3MHz This can be seen in the video near the end. I start at 80MHz, which it does measure, so hats of for that, but the amplitude is faked. My version next to it shows a much smaller signal. There only the up sampling is done.

When I lower the frequency the signal on both gets bigger and I have to lower the sensitivity. After that I start fiddling around the 43MHz. When I switch to 44MHz you can see the signal strength increase :-DD (Near 0:49 into the video) This is not the case on my version.

Found an error in my x10 up sampling, which was causing the 50 and 25nS setting to be crap.

The reason my version is unstable has to do with the fact that I display from the start of the buffer without regard for the trigger point. That still needs research.

Also sorry for the crappy quality of the video. Don't have the equipment for doing professional work. :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 18, 2021, 10:07:15 pm
Hi everyone!

... I wrote before that the scope makes up its own signal when the input frequency is above some value. Did calculations on it, and determined it is more then 43.3MHz This can be seen in the video near the end. I start at 80MHz, which it does measure, so hats of for that, but the amplitude is faked. My version next to it shows a much smaller signal. There only the up sampling is done.
When I lower the frequency the signal on both gets bigger and I have to lower the sensitivity. After that I start fiddling around the 43MHz. When I switch to 44MHz you can see the signal strength increase :-DD (Near 0:49 into the video) This is not the case on my version. ...

This "trick" has also been noticed in one of previous reviews:
https://www.ixbt.com/live/instruments/obzor-dvuhkanalnogo-oscillografa-fnirsi-1013d-s-7-dyuymovym-sensornym-ekranom-igrushka-kotoraya-sovsem-ne-igrushka.html (https://www.ixbt.com/live/instruments/obzor-dvuhkanalnogo-oscillografa-fnirsi-1013d-s-7-dyuymovym-sensornym-ekranom-igrushka-kotoraya-sovsem-ne-igrushka.html)

Quote
A detailed study of the origin of such a suspicious smoothness of the oscillogram showed that at sweeps of 10 ns / div. and 25 ns / div. when the frequency of the input signal goes from 43.3 MHz to 43.4 MHz, the oscilloscope begins to turn any signal into the purest sine!

But in my case neither this or other accuracy/bandwidth/sample-rate related issues seem to be the most disturbing.

Not sure if this may be dependent on my particular device which may of course have some kind of "personal" manufacturing faults, but anyway - periodically the scope just freezes at random intervals and stops reacting to actual input signals, usually this happens with simultaneous turning to orange background color of one of menu buttons CTRL/V+/V- (the latter two cases usually then lead to respective change of V/div setting by the scope itself even without me doing anything at that time), also I've noticed that attempt to modify "T" settings menu leads after some random pause to "T" button background turning violet while background area to the right of it (where actual triggering settings are displayed) turns white at the same time and signal display also freezes, then after some ~10 seconds "T" menu opens again by itself (!) and sometimes disappears after a while but sometimes not and still needs tapping on "T" to close it, frequently just to repeat the same strange cycle again.

Tapping some button to "wake up" the scope seems to always work (i.e. the scope stops reacting to input signals and freezes the last view but still reacts to control actions) but it's really difficult to use the device when "activating" it every few seconds sometimes becomes necessary, the more that I still haven't noticed any "rules" for such behavior which retains the same random manner even regardless of whether any signals (which could provoke some response of device) are applied to scope inputs or not.

So my questions regarding this are the following:
- has anyone experienced similar behavior of this scope?
- any idea what could cause it (apart of specific hardware fault in my particular device)?
- what orange background color of CTRL/V+/V- buttons and violet/white background colors of "T" menu area could mean?
(seems like the latter color change should rather be implemented by device design than be a result of some accidental fault - regrettably, I couldn't find anything mentioned about this in manual)

Also by the way, for pcprogrammer and all others who could be working on device improvement - maybe it is possible to implement some "error messaging" service into control system of this scope as by default there seem to be too much cases when seemingly unclear and unpredictable behavior is caused by device not reporting anything about its internal actual state and actions - which so remain unknown to a user.

The device I'm using is a never model which was ordered about a month ago from Aliexpress warehouse in Europe and is one of the last units from previous party i.e. before recent price increase.

And, in all aforementioned cases of input signal freezing the scope still keeps displaying "run" as an actual state, while trigger setting still remains in "auto" mode (in which sudden display freezing is best noticeable and most inadequate).

Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 06:35:59 am
Hi Ultimator, and welcome to the forum.

Your problem with the scope, to my opinion, has to do with the touch panel. The turning orange of the "buttons" means they are being touched. Same as for the trigger (T) menu changing color. When the scope is touched it also freezes the signals on the screen.

This could easily mean that the touch panel has a hardware problem or reacts to some interference due to sensitivity settings.

Could you run my firmware backup program I posted on the previous page? Take the new one. When you follow the steps given in the post with the red warnings you will be fine. Upload the files here on the forum and I can take a look at the touch panel settings to see if it differs from "normal"

Also try to make a video of the behavior and open a dispute on Aliexpress, even though the 15 days might be over. Use the chat function to get them to open a dispute for you. It is not how the scope should behave and thus makes it a defective device.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 08:55:32 am
Based on new findings, I decided to stop reverse engineering the crap and start writing new code.

The FPGA hardware offers samples from both ADC's for all ranges giving 3000 samples per channel for the 10mS - 10nS/div settings and 1500 samples for the 50mS and 20mS/div settings. Based on what I reversed so far they assume the trigger to be in the middle of the buffer, which is done by looking if there is the needed transition. (Rising or falling)

This gives room for a far simpler displaying of the trace data, without all the "special" handling done in the original, but requires a rewrite of a fair bit of the code. The waveform and picture view needs to be changed, which will also be an improvement :)

I will also change the time base setup. Going to make a user select-able sample rate and move the time/div select to a drop down menu. In a later stage I might look into touch gesture for zoom functionality.

Also thinking about dropping the roll mode time base settings. On this scope I do not see a use case for the >200mS/div modes, but might be wrong. Have to see what is doable on the lowest sample rates with only 1500 samples.

With the save to file setup I made it is possible to do the testing on the computer, which makes it a lot easier.

The story continues again :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 06:10:00 pm
Working on a scope simulator now. Based on the emulator, but without the arm core emulation. It runs the scope code compiled for the x86-64 cpu.

Already working to some extend. It draws the scope screen and it is possible to "touch" the screen with the mouse. The user interface works. Menus can be opened, cursors can be moved etc. This part uses the same code as what runs on the scope.

Need to implement the peripherals with stub functions to make signal acquisition, parameter loading and saving, file handling etc. work. This makes it usable for the new development. Testing and debugging becomes very easy this way.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 19, 2021, 06:15:26 pm
... The turning orange of the "buttons" means they are being touched. Same as for the trigger (T) menu changing color. When the scope is touched it also freezes the signals on the screen.
Oh, of course. I haven't noticed this because I cover buttons with my finger while touching them and I didn't pay attention what's happening there under. :-[

This could easily mean that the touch panel has a hardware problem or reacts to some interference due to sensitivity settings.
However, freezing isn't always related to scope considering menu button being touched and so altering button color - it frequently freezes without any visible changes on the screen, likely this needs some more investigation.

Could you run my firmware backup program I posted on the previous page? Take the new one. When you follow the steps given in the post with the red warnings you will be fine. Upload the files here on the forum and I can take a look at the touch panel settings to see if it differs from "normal"
As far as I understand from your referred post, the proposed method implies using Linux as PC OS while all my machines are Windows at this moment, so it seems not so straightforward in my case, nevertheless what's the easiest workaround?

Also try to make a video of the behavior and open a dispute on Aliexpress, even though the 15 days might be over. Use the chat function to get them to open a dispute for you. It is not how the scope should behave and thus makes it a defective device.
I checked product page once again and yes it has some warranty statement in description so maybe it's worth following your proposal, I just want to collect more exhaustive data as it's still appearing, yesterday more-less normal work of the device was present after it has been on for a few hours, today after switching it on I've noticed some more strange things apart of those already mentioned - such as partial display of input signal, when left side of the screen displays close to reality, while from center and to the right some garbled-frozen mix is displayed.
Interestingly the actual miss-behavior of the device is clearly dependent on activation of menu buttons (tapping some button always alters the actual visible fault to something different, usually the correct functioning is being restored for a while) so these problems seem to be at least partially software-related.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 06:30:13 pm
Hi Ultimator,

It has been a long time ago since I used windows for anything else but gaming :), so I can't offer an easy solution there. If there is an easy way on windows to write raw data to a disk sector then that is the way to go. For the program to work it needs to be loaded to sector 16 going up. 512 bytes per sector

For checking if the touch panel is the sole cause of your problems, open up the scope and disconnect the touch panel cable. Small 6 pin connector near the bigger display connector. Many pictures in this thread showing the inside.

The scope freezes where ever the touch panel is touched. So no button needs to be active.

If the freezing keeps happening it is safe to say there is an other problem :-//

No matter which seller, if you bought it on Aliexpress they can force the restitution if they decide in your favor.

Edit: It is possible to run linux from an usb stick. As long as dd is available on the stick it will work without wrecking your windows machine, as long as you make sure the drive you target is the correct one. Look for live linux on google or so. (https://www.linuxliveusb.com/ (https://www.linuxliveusb.com/))
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 19, 2021, 08:08:19 pm
For checking if the touch panel is the sole cause of your problems, open up the scope and disconnect the touch panel cable. Small 6 pin connector near the bigger display connector. Many pictures in this thread showing the inside.
Yes I've seen this. ;)

The scope freezes where ever the touch panel is touched. So no button needs to be active.
If the freezing keeps happening it is safe to say there is an other problem :-//
I still should say that if freezing won't happen without touch-screen this still shouldn't strictly mean its pure hardware problem, may also be wrong software reaction to panel signals - not actually happening while disconnected.

No matter which seller, if you bought it on Aliexpress they can force the restitution if they decide in your favor.
The problem is that after 15-day period there's no more option to "open dispute" thus involving Aliexpress, the only option now seems to be contacting particular seller, what I've already done and waiting for response.
(correct me if I'm wrong)

Edit: It is possible to run linux from an usb stick. As long as dd is available on the stick it will work without wrecking your windows machine, as long as you make sure the drive you target is the correct one. Look for live linux on google or so. (https://www.linuxliveusb.com/ (https://www.linuxliveusb.com/))
Ok, I'll see this option on occasion.

The latest recently found "partial display" fault can be seen on this screenshot:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 08:21:52 pm
No matter which seller, if you bought it on Aliexpress they can force the restitution if they decide in your favor.
The problem is that after 15-day period there's no more option to "open dispute" thus involving Aliexpress, the only option now seems to be contacting particular seller, what I've already done and waiting for response.
(correct me if I'm wrong)

You should start a chat session with the Aliexpress robot eve and insist on getting a human on the line. Might take a while, but it will help. Explain your problem and mention that you have proof. Best to have your video ready. Insist on them opening a dispute for you. I have done this a couple of times and with success. One time even after months of the protection period running out.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2021, 08:31:02 pm
Concerning your trace looking weird, I have no explanation for that :-//  That is one strange looking signal. What is the source you are measuring?

But still, opening the scope up and disconnecting the touch panel and do measurements without it will give a better insight in the problem. Without it, it is very unlikely that there will be touch detected. It needs a specific response on the I2C bus, even though it is bit banged, to decide there is touch.

If it removes the problems you will have to replace the touch panel. Not an easy task but doable. Lots of info about that in the thread too.

Signing off for today :=\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 19, 2021, 08:37:46 pm
You should start a chat session with the Aliexpress robot eve and insist on getting a human on the line. Might take a while, but it will help. Explain your problem and mention that you have proof. Best to have your video ready. Insist on them opening a dispute for you. I have done this a couple of times and with success. One time even after months of the protection period running out.
Ok, I'll try this option if I won't succeed with the seller.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 19, 2021, 09:10:21 pm
Concerning your trace looking weird, I have no explanation for that :-//  That is one strange looking signal. What is the source you are measuring?
I'm as usually just touching the probe tip with my hand, so it's the common inside-building 50Hz interference on the screen. ;D

But still, opening the scope up and disconnecting the touch panel and do measurements without it will give a better insight in the problem. Without it, it is very unlikely that there will be touch detected. It needs a specific response on the I2C bus, even though it is bit banged, to decide there is touch.
Of course I'll also try this. But my notice was that if there's say wrong software reaction to correct panel signals, the former may not happen while the latter remains disconnected.
There are ate least two things backing this option:
 - touching the "frozen" button always corrects the situation (while if there was panel failure falsely imitating respective touch signal, there should rather be no reaction to actual touch of the same button),
 - freezing frequently happens without any visible menu button alteration (while in case alike "bad panel - good software" it should be always followed by altered menu button color as the "legal" cause of freezing).

If it removes the problems you will have to replace the touch panel. Not an easy task but doable. Lots of info about that in the thread too.
With all existing and awaiting problems it seems that just getting one more such scope could become best option overall - for both cross-diagnostic and cross-repair purposes, the only concern being as it's already clear - its already compromised reliability.  :-\ 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 05:40:44 am
You should start a chat session with the Aliexpress robot eve and insist on getting a human on the line. Might take a while, but it will help. Explain your problem and mention that you have proof. Best to have your video ready. Insist on them opening a dispute for you. I have done this a couple of times and with success. One time even after months of the protection period running out.
Ok, I'll try this option if I won't succeed with the seller.

I would not wait. The seller will not offer you anything since there is no dispute. Delaying it their game.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 06:30:25 am
Concerning your trace looking weird, I have no explanation for that :-//  That is one strange looking signal. What is the source you are measuring?
I'm as usually just touching the probe tip with my hand, so it's the common inside-building 50Hz interference on the screen. ;D
Ah ha, 50Hz signal a like. Think it is better to use the calibration signal to do a more proper diagnosis.

But still, opening the scope up and disconnecting the touch panel and do measurements without it will give a better insight in the problem. Without it, it is very unlikely that there will be touch detected. It needs a specific response on the I2C bus, even though it is bit banged, to decide there is touch.
Of course I'll also try this. But my notice was that if there's say wrong software reaction to correct panel signals, the former may not happen while the latter remains disconnected.
There are ate least two things backing this option:
 - touching the "frozen" button always corrects the situation (while if there was panel failure falsely imitating respective touch signal, there should rather be no reaction to actual touch of the same button),
 - freezing frequently happens without any visible menu button alteration (while in case alike "bad panel - good software" it should be always followed by altered menu button color as the "legal" cause of freezing).
The idea of bad software is less likely. To my opinion a fallen over bit won't show such behavior. Since I reversed the whole user interface part of the software, I can explain all the freezing behavior, except the weird signal stopping and re-starting on a later location on the screen. The two problems might not be related.

There is a video of someone who had a similar "touch" problem and he claims to have solved it with a 470 ohm resistor on the "miso" line. Since it is I2C there is no "miso" line, but the design of this part of the scope is crap, so that resistor might do the trick. There is a capacitor between the SDA and the SCL line to overcome a problem with glitches. I have tested various scenarios, like removing the capacitor, other resistor values, bigger capacitor, while measuring the signals with an other scope. I could see the glitches. Since it is bit banged it does not filter like a proper I2C interface. https://www.youtube.com/watch?v=eI9S_68guQQ (https://www.youtube.com/watch?v=eI9S_68guQQ) In the video he now uses my reversed schematic :-DD and writes about a resistor on the reset line. In the text description of the video he write "miso" line because that it what a possible use of the MCU pin is. :-// On the board it is on the capacitor at the SCL line.

My explanation for the behavior he was seeing is that when the MCU reads the status register of the touch panel, the bit signaling touch is flipped, and then when it reads the coordinates it gets the last coordinates touched. In your case it might be reading a prolonged false being touch status. The scope waits for the touch to be released before continuing.

If it removes the problems you will have to replace the touch panel. Not an easy task but doable. Lots of info about that in the thread too.
With all existing and awaiting problems it seems that just getting one more such scope could become best option overall - for both cross-diagnostic and cross-repair purposes, the only concern being as it's already clear - its already compromised reliability.  :-\

Sure that is an option, but I would then consider buying a Hantek DSO2C10 and upgrade that to a DSO2D15. A better scope with more options and not that much more expensive. Lots of info about it on this forum.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 08:38:40 am
Hi Ultimator,

It would be interesting to see if your problem with the touch panel also occurs with my version of the software. The whole user interface part works the same, and there is trace display on channel one.

I wrote my own I2C bit banging and like to believe it is better than the original 8)

The procedure to get it running is the same as the firmware backup program, so in your case a bit of a problem.

The package is also on page 45 of this thread.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: jemangedeslolos on November 20, 2021, 09:19:02 am
Hello Ultimator,

I had problems with this scope (I have one of the first models with the old box).
Sometimes it didn't want to start at all or crashed.
It was due to bad soldering on the FPGA.
I re-worked it with good solder and the right amount of flux ( ;))
I cleaned everything with IPA and now it now works like a charm.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 09:22:33 am
Hello Ultimator,

I had problems with this scope (I have one of the first models with the old box).
Sometimes it didn't want to start at all or crashed.
It was due to bad soldering on the FPGA.
I re-worked it with good solder and the right amount of flux ( ;))
I cleaned everything with IPA and now it now works like a charm.

That might be possible for the strange signal behavior, but not the freezing and buttons changing color. That is definitely touch panel behavior.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 20, 2021, 10:22:55 am
I would not wait. The seller will not offer you anything since there is no dispute. Delaying it their game.
It's just a usual expression of politeness valid for for a few days while awaiting for seller response - as most sellers don't welcome customers raising disputes in advance of contacting them personally first.
And on the other hand, some additional fault-related evidence could appear in this time with my device - in case if what I do already have would be discarded.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 20, 2021, 11:33:03 am
Ah ha, 50Hz signal a like. Think it is better to use the calibration signal to do a more proper diagnosis.
Rather not in this particular case, as my goal was to expose freezing in auto mode when display update shouldn't stop even with unstable input signal - which so is more suitable to provoke this fault.

The idea of bad software is less likely. To my opinion a fallen over bit won't show such behavior. Since I reversed the whole user interface part of the software, I can explain all the freezing behavior, except the weird signal stopping and re-starting on a later location on the screen. The two problems might not be related.
It's a subject for further investigation, in addition to testing the touch panel and RC values on its bus.

My explanation for the behavior he was seeing is that when the MCU reads the status register of the touch panel, the bit signaling touch is flipped, and then when it reads the coordinates it gets the last coordinates touched. In your case it might be reading a prolonged false being touch status. The scope waits for the touch to be released before continuing.
It's still unclear for me what causes freezing when there's no altering-color indication of some button seemingly still being touched.   

Sure that is an option, but I would then consider buying a Hantek DSO2C10 and upgrade that to a DSO2D15. A better scope with more options and not that much more expensive. Lots of info about it on this forum.
No wonder that many full-size benchtop scopes are more capable even regarding their higher cost, but the very idea behind 1013D is it's unique field-portable-full-screeen form-factor - also being the reason of my interest in this device.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 20, 2021, 11:40:31 am
Hello Ultimator,

I had problems with this scope (I have one of the first models with the old box).
Sometimes it didn't want to start at all or crashed.
It was due to bad soldering on the FPGA.
I re-worked it with good solder and the right amount of flux ( ;))
I cleaned everything with IPA and now it now works like a charm.
I'll check for assembly-related issues when testing touch panel, but in case of partial display fault it's strange that signal crops frequently do happen in highly synchronized manner at exactly the same position on the screen as in my previous screenshot. This can hardly be explained by bad soldering of IC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 20, 2021, 11:42:17 am
Hi Ultimator,

It would be interesting to see if your problem with the touch panel also occurs with my version of the software. The whole user interface part works the same, and there is trace display on channel one.

I wrote my own I2C bit banging and like to believe it is better than the original 8)

The procedure to get it running is the same as the firmware backup program, so in your case a bit of a problem.

The package is also on page 45 of this thread.
This is also on "to do" list, just slightly further.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 11:45:24 am
My explanation for the behavior he was seeing is that when the MCU reads the status register of the touch panel, the bit signaling touch is flipped, and then when it reads the coordinates it gets the last coordinates touched. In your case it might be reading a prolonged false being touch status. The scope waits for the touch to be released before continuing.
It's still unclear for me what causes freezing when there's no altering-color indication of some button seemingly still being touched.   

Touch, no matter where on the screen, freezes the display. It is how the software is. The moment it sees touch it looks at the coordinates and decides what to do with it, but only does it after touch is released, or there is movement. (Trace offset, cursors, etc.) But as long as there is touch the updating of the signal stops. You can see this when in roll mode (100mS/div and up). Touch the screen and the updating stops.

Sure that is an option, but I would then consider buying a Hantek DSO2C10 and upgrade that to a DSO2D15. A better scope with more options and not that much more expensive. Lots of info about it on this forum.
No wonder that many full-size benchtop scopes are more capable even regarding their higher cost, but the very idea behind 1013D is it's unique field-portable-full-screeen form-factor - also being the reason of my interest in this device.

For me it was the small size that made me buy it :) The fact that it arrived with a defective touch screen led me to where we are now. Almost reverse engineered software :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 12:25:07 pm
I found this link with several options for DD on windows. https://superuser.com/questions/839502/windows-equivalent-for-dd (https://superuser.com/questions/839502/windows-equivalent-for-dd) Maybe of help for windows users wanting to use what I make :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 20, 2021, 05:52:01 pm
Fixed two issues that where bugging me |O


Also worked on the simulator, which now shows signals coming from the files I made on the real scope. Needs more work to make it a real simulator of the original FPGA, which for a part is still guessing what is in this black box. :-//

They made such an idiotic system, where they set the trace offset in the FPGA, which then shifts it's result based on that. But then they do so much calculations in the MCU that this bit, they offloaded to the FPGA, fades in comparison :-DD It would have been so much easier if they just returned the 8 bit ADC data as is and did the trace offset handling in the MCU.

An other problem is the number of faulty captures coming through. I can see them in the captures, but have not analyzed them yet. It is clearly visible when the scope just runs that some captures are very high frequency garbage. Not sure if this can be avoided by sending FPGA commands in a different order. On the original these mishaps are less frequent, but they are there.  :wtf:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: geoffCohen on November 21, 2021, 01:36:09 am
I’ve had my 1013D for a week –

Firstly, thankx to pcprogrammer for his fantastic work on the 1013D – it definitely needs a few improvments.

Anyway, here are my initial thoughts about the 1013D

The 1013D has MAJOR problems with calibration, with seemingly DUMB decisions made at FNIRSI

* Calibration is OK with a X1 probe and is just within 5%, HOWEVER, with a X10 probe, there’s a large 10% error - and it’s the same with both the FNIRSI probes and 350Mhz Tektronix probes. This is a major bug, apparently because FNIRSI didn’t know the input impedance of their own DSO – and it’s a bug that could be easily fixed in the software, by reducing the gain in X10 mode – however, as a quick KLUDGE, I soldered some 10M resistors across the BNC inputs &  GND, which makes X10 accurate to 2% - pic attached.

* The calibration is apparently derived from an internal 3V reference (also used by the1KHz squarewave output) – when tested with an accurate 3.00V input – the 1013D always read this 5% high (as 3.15) – so having a way to adjust overall calibration/gain down 5% for X1 and 10% for X10 would make this DSO much more accurate, and for zero cost too, I have no idea why FNIRSI didn’t do this !!!

* a minor annoyance – my probes didn’t have a yellow color coding ring – a few minutes with one of my 3D printers fixed this. I also made some stickon probe clips – pics & stl files attached

* I also don’t like the stand much – It’s floppy and the angle is completely wrong for me – as a quick kludge I glued on a couple of wedges to make it a bit better, with an improved stand design as a priority item in my 3D design queue.


Good
The 1013D is, by far, the easiest, most user friendly CRO/DSO I have ever used, and I’ve run Electronics workshops at the Australian National Uni with top of the line equipment.

Bad
After some (admittedly quick) testing, it looks like FNIRSI added an extra 0 to the bandwidth – the 1013D seems good up to 10MHz, much beyond that and it’s not great, but as a DC-10MHz DSO it’s great value and fun to use too – it just needs that calibration adjustment added to be really great.

=========================
Thankx
Geoff Cohen

https://www.thingiverse.com/geoff_cohen/designs (https://www.thingiverse.com/geoff_cohen/designs)
https://diyodemag.com/education/exploring_3d_3d_printed_gears_part_1 (https://diyodemag.com/education/exploring_3d_3d_printed_gears_part_1)
https://diyodemag.com/projects/paused_prints_arduino-based_filament_runout_sensor (https://diyodemag.com/projects/paused_prints_arduino-based_filament_runout_sensor)
https://diyodemag.com/projects/fixing_firmware_updating_firmware_on_the_arduino_bootloader_part_2 (https://diyodemag.com/projects/fixing_firmware_updating_firmware_on_the_arduino_bootloader_part_2)






Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 21, 2021, 05:49:57 am
Hi Geoff, and welcome to the forum.

The calibration is a good point. Have not looked at it and it will go on the list of things to do for improvement. Is indeed not a big deal to tackle in the software, but will require user aid, and separate steps in the software to do a x1 and a x10 and perhaps a x100 calibration.

I'm not sure, but what is in the original now is just zero measurement and ADC difference (2 interleaved ADC's per channel) calibration.

My work so far at least solves some of the hang issues, like with the USB connection. The original code hangs the scope with almost any PC action, where mine, tested so far, seems rock steady.

My motto is, less code, less room for error :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 21, 2021, 10:47:05 am
Added the ability to step through the sample files and buffers to the signal analyzer (just a simple display program) and looked at all the 1050 captures I made. Found a couple of errors, but the most common one is that one of the capture buffers has no signal, and it is always the main buffer they use for all the time base settings.

This is something I can filter upon :palm:

An other thing, not really an error is that for the 100uS/div setting they capture less samples at the correct speed, making the top so many samples unusable.

A third error I only saw once was in the 5mS/div setting captures. Half the buffers are sampled at a different rate.

See the attached images for what I found.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 21, 2021, 06:02:27 pm
Started on the new path.

Implemented the modification of the top menu bar and made a screen capture with an error in the signal capture on the display. :-DD

Added the ACQ (acquisition) button to allow the setting of the sample frequency and the time per div via a menu, and no longer with the tapping on the left or right of the screen.
Have to see if it needs to be bound to some rules or left completely free in respect to the relation between the two settings.

Quite a bit of work ahead to make it work with the new idea I have, but with the testing now on the PC it is much easier to do.

I will add a new directory to the repository for the last version of the original based code, which will remain unfinished and use the current directory to hold the new code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 21, 2021, 07:26:04 pm
What do you think, is this a genuine Altera Cyclone IV?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 21, 2021, 08:11:44 pm
On early pictures I have seen in this thread, or a video from Dave the chip had its original markings, which showed it to be a EP4CE6E22C8N.

The picture even is in my repository  8)

https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Pictures/Old%20version/Main_board_old_system_large.jpg (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Pictures/Old%20version/Main_board_old_system_large.jpg)

Don't think they will have abandoned it, but who knows if it is a clone. Not sure but I think @tv84 looked at the bitstream files and got some info out of it. This is somewhere in this thread :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on November 21, 2021, 08:24:11 pm
RE cloning software for windows. I used this for years to clone Linux images on windows: https://selfimage.en.softonic.com/  Its old and abandoned but works. Like dd the requirements have not changed much for an imaging program.  I have used Rufus but I think Rufus is too Windows focused for this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ultimator on November 22, 2021, 01:39:05 am
Touch, no matter where on the screen, freezes the display. It is how the software is. The moment it sees touch it looks at the coordinates and decides what to do with it, but only does it after touch is released, or there is movement. (Trace offset, cursors, etc.) But as long as there is touch the updating of the signal stops. You can see this when in roll mode (100mS/div and up). Touch the screen and the updating stops.
In other words when display freezes without visible altering some menu button color - this likely means that false touch is still being detected but in area where there are no menu buttons, so this aspect can be considered logically explained.
However the partial display phenomena still needs remains unclear.

For me it was the small size that made me buy it :) The fact that it arrived with a defective touch screen led me to where we are now. Almost reverse engineered software :-DD
Who could know in advance that finally it will appear cheaper to buy "expensive" branded alternative. I seem to be closing to this too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 22, 2021, 05:25:59 am
Correct about the touch, but indeed the other phenomena is not explained by it. That is why I suggested it could be two unrelated issues.

There are similar but more expensive alternatives for sure. The micsig brand has, to my understanding and not experience, better tablet scopes.

The funny thing for me was that I bought it for my hobby and then it became my hobby :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: geoffCohen on November 22, 2021, 07:56:20 am
Can I put in a request to KEEP the Tap Left/Right method to change the timebase - I find this an extremely easy way to change timebase up/down - WITHOUT having to click away at menu's. Annoying menu's (especially for trigger settings), was the main reason I didn't get a Hantek, I found setting my (borrowed) DSO5102P annoyingly tedious
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 22, 2021, 08:19:23 am
Can I put in a request to KEEP the Tap Left/Right method to change the timebase - I find this an extremely easy way to change timebase up/down - WITHOUT having to click away at menu's. Annoying menu's (especially for trigger settings), was the main reason I didn't get a Hantek, I found setting my (borrowed) DSO5102P annoyingly tedious

In itself an easy thing to keep, but needs some thought on sample frequency setting, because I think it has to change with it at some point. Since there is so little sample memory it only stretches so far in the time per div settings.

My new idea also scraps the roll mode time per div settings.(50S/div - 100mS/div) Trying to fit 100mS/div and 200mS/div into the normal sampling setup, but it depends on if it is possible to get a couple consecutive buffers on the lowest sample frequency. (2KHz) One buffer offers only 0.75S worth of samples and with 14 divisions a full screen at 200mS/div needs 2.8S so almost 4 buffers.

This roll mode is already working in what I made so far, so not to difficult to incorporate it as a separate mode, but for me there is no use case, so only on request it will make it in :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: geoffCohen on November 22, 2021, 08:43:53 am
Guess I'll have to bit the bullet, and crank up a Linux system on a spare laptop - which version do you recommend. FYI - I've been a programmer for many, many years - microprocessor/Database/3D (OpenSCAD), with most using some flavor of C - but all Windows based. Now I'd like to be able to play with your emulator/1013D code, even possibly contribute something to the project.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 22, 2021, 09:11:07 am
I'm using Linux Mint 20, which I like over the Ubuntu version. Take the light weight version XFCE if your computer is not that powerful.

For development I use Netbeans 8.2. Not sure about the status of C development in newer releases. Have not looked at that for a long time. You need to setup the gnu arm compiler to make it all work.

The projects I'm using for development now are the "Scope_Signal_Handling_Development" and the "fnirsi_1013d_scope" which are both to be found in the repository. This is a simulator with stub functions for the FPGA and other hardware related stuff, and makes it possible to debug the code on the PC directly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 22, 2021, 09:48:03 am
A couple of handy linux instructions to set things up

Code: [Select]
ctrl + alt + t to open a terminal window

sudo apt-get update                 #Load latest package list
sudo apt-get upgrade                #Upgrade what is needed to latest version

sudo apt-get autoclean              #Clean the package list
sudo apt-get autoremove             #Remove no longer needed packages


sudo chmod +x netbeans-8.2-cpp-linux-x64.sh    #Change the execution flag for this file
sudo ./netbeans-8.2-cpp-linux-x64.sh           #run this file to instal netbeans

sudo apt-get install gcc make build-essential  #install all the needed tools for making and building code
sudo apt-get install gcc-arm-none-eabi         #install the gnu arm compiler tools (needed for compiling the scope project for the real target)

Seems the netbeans package is not easy to find anymore. I have it here, but github won't allow it due to it being to big. (114MB) If you need it drop me a PM.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 22, 2021, 12:39:09 pm
Implemented the new menu and as per request left the tapping on the left or right side of the screen in there.

It still needs logic to show possible combinations, but I have to see what these are. Also need to change the FPGA controlling based on the new settings.

Having both options makes it easy to make a big change with three touches (open menu, select setting, close menu)

Let me know what the thoughts are about the new menu ???
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 23, 2021, 09:00:21 am
@PCprogrammer: It has been mentioned before: you are investing a lot of time and attention to improve this little box. Really awesome!

I am trying to follow along and so far I got your experimental firmware working on the box. It looks promising.

Now you invite users to give their thoughts about the new Acquisition menu, So OK, FWIW:

The indication of the sample rate in the top menu bar of the screen is very nice, I think.

I can understand why you call acquisition rate a frequency, but maybe the more usual expression 'sample rate' is called for here, like 200MSa/s or 50kSa/s. So better name it 'Sample Rate' at the top block. And why not use the correct lowercase 's' for seconds in the 'Time per Division' choices block?

Maybe you can add an indication of the resulting 'Samples per Division' somewhere, at the bottom of this foldout?.

A new item on the ACQ menu might be the choice of sample 'processing': to display the sample dots, linear interpolation or whatever approximation is possible with the processor. Or, maybe a choice of averaging 1, 2, 4, .., many.

Regards,
Maurits

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 23, 2021, 09:33:07 am
Hi Maurits,

thanks for the feedback. I will rework the menu based on it.

I am trying to follow along and so far I got your experimental firmware working on the box. It looks promising.

This is good to hear. Did you have any problems with the SD card format, or did the partition already start on a high enough sector?

And why not use the correct lowercase 's' for seconds in the 'Time per Division' choices block?

The capitol S is in the original and I just copied that as is :-DD Already changed it in the source :-+

Maybe you can add an indication of the resulting 'Samples per Division' somewhere, at the bottom of this foldout?.

I'm working on determining this at the moment. Making a spread sheet with all the possible sample rates and time per division settings to determine what is useful. For instance, when using the highest sample rate and 5us/div there are not enough samples for a full screen. Only 21% of the screen can be filled. The question is if this has any use and if it is better to limit the settings to only 1us/div on which it has enough samples for a full screen?

This boundary shifts with the lowering of the sample rate. At a certain point it makes not a lot of sense to switch to the smaller time per division settings. It will only be a straight line from one side of the screen to the other.

Something to think about. Input is welcome :)

The math is not difficult when floating point is used. As the MCU does not support it, no floating point co-processor, I like to avoid this so have to work it into fixed point math.

A new item on the ACQ menu might be the choice of sample 'processing': to display the sample dots, linear interpolation or whatever approximation is possible with the processor. Or, maybe a choice of averaging 1, 2, 4, .., many.

This is something for later on the list. Like to get trace display working as is first. Have been thinking about it though.

Hope to get something working today
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 23, 2021, 12:15:23 pm

Did you have any problems with the SD card format, or did the partition already start on a high enough sector?


The smallest micro SD the local 'Expert' shop has available was 16GB. I dd'ed your test firmware on it and copied the standard files as well. Swapped the card with the original (8GB) one in the box. It simply worked!! I did not do any re-partitioning.

I'm working on determining this at the moment. Making a spread sheet with all the possible sample rates and time per division settings to determine what is useful. For instance, when using the highest sample rate and 5us/div there are not enough samples for a full screen. Only 21% of the screen can be filled. The question is if this has any use and if it is better to limit the settings to only 1us/div on which it has enough samples for a full screen?

This boundary shifts with the lowering of the sample rate. At a certain point it makes not a lot of sense to switch to the smaller time per division settings. It will only be a straight line from one side of the screen to the other.

Something to think about. Input is welcome :)

Some kicking in open doors(Dutch expression): At a rate of 200MSa/s maximum there is a sample available every 5ns. With memory length 3000 bytes that fills in 15us. The screen uses about 50 pixels per division. When using two samples per pixel this would represent 500ns/div and 30 (-15 to + 15 as seen from the mid trigger point) screen divisions. For slower timings the sample rate must be decreased, potentially giving longer (time) record length. For faster timings less samples per division are available. Going further down in time per division equivalent time sampling for repetitive signals has to be used to get a meaningful result. Maybe processing the results of several acquisitions in a frame buffer. Sounds easy but what about triggering?

As it is with the original firmware isn't the box trying to use equivalent time sampling at the shorter times per division to make the claim for 1GSa/s? As it looks to me when observing the behavior it looks more like the box is generating its own signal synchronizing it with incoming samples and so avoiding the trigger issue.

For now you are aiming to get straight forward real-time sampling going. I'll be happy to try-out any further results of your work.

Regards,
Maurits
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 23, 2021, 12:46:05 pm
Quote
Some kicking in open doors(Dutch expression):

I'm Dutch so understood :-DD

Don't think the original box does actual equivalent time sampling. Way to complex for them, since they can't even interleave the samples of the two ADC's per channel in the FPGA.
They went out of there way to make a "smooth" product, but in doing so made it basically crap. It looks nice, but it is so full of rubbish, like actually generating a sine signal based on the measured min, max voltage and the frequency. To make it special they throw in the timerticks % 3.

The rest of the code is so full of memcpy from one buffer to another for who knows what. This is where I left of. Could not take it anymore.

The triggering is also an issue. For the 10ns - 10ms/div it is done in the FPGA, but there is no feedback about where in the sample buffer the trigger is. The software looks at 10 samples in the middle of the buffer to see if there is a trigger there. If not then I don't know. Have to see how it is going to work with what I'm making now.

Trying to make it work over the complete range of settings, which means only one sample on the screen for a lot of settings, or the ability to scroll through then when more available. Choose this setup to allow for variable zoom later on.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 23, 2021, 12:52:49 pm
Did you have any problems with the SD card format, or did the partition already start on a high enough sector?

The smallest micro SD the local 'Expert' shop has available was 16GB. I dd'ed your test firmware on it and copied the standard files as well. Swapped the card with the original (8GB) one in the box. It simply worked!! I did not do any re-partitioning.

Ah you went down the opening the box route :)

It is possible to get it done without opening it up. Just use the scope as the card interface via it's USB connection. Tried that on both my scopes without problems. (After the first failures that is :-DD)

Received the last SD cards yesterday. Did not test these with the scope yet, but will be interesting to see if the 8GB cards I ordered are going to work. The PC shows them as 250GB cards, and I was able to write to them, at least some 300MB files. :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 23, 2021, 06:03:22 pm
Managed to get something working. I checked out how to use soft floating point and tried it in my code. It works and the speed is very good. Dropped a lot of unneeded code, but need to improve and finish what I made so far. Is just an early proof of concept :-DD

Based on the sample rate and the time per div the signal is scaled on the fly. No separate routine with copying and interpolating. The interpolation is done by the display draw line function :) Just a straight line between the two sample points.

Made another video of how it looks now. Again not great quality, but it shows what is needed.

https://youtu.be/88QXE-WfLAo (https://youtu.be/88QXE-WfLAo)

Still need to add the trigger point location and correct display location of it based on the top trigger pointer and lots of other stuff to finish it, but it is a step in the right direction.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 24, 2021, 06:19:09 pm
Making progress. Cleaned up quite a bit and added the second channel acquisition.

Unfortunately it is still very unstable in the triggering. Did add code to detect the trigger point, which looks to be working when debugged on the computer. Also when there are few samples to work with it does get pointy, so the displaying algorithm needs improvement.

Need to do a bit more cleanup on the code I wrote today to, at least, get rid of my work comments. :-DD Tend to add a lot of stuff like "I need to add a bit here and this needs to be changed", during development.

With this new acquisition and displaying setup, the save and view picture or waveform code needs to be rewritten. Was not pleased with it anyway, so not a big deal, but it takes a bit of time.

In the attached pictures, channel 1 (yellow) has a 10MHz sine at the input, where channel 2 (cyan) has a 20MHz sine at the input. The second picture shows the traces shifted to the right, to show the trigger position setting is working :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ledtester on November 24, 2021, 06:50:06 pm
Regarding the display algorithm... I know that pro scopes use "sin x/x" interpolation (but that's about all I know!):

https://edadocs.software.keysight.com/kkbopen/how-does-sin-x-x-sinc-interpolation-work-616372293.html

so maybe that's something to look into.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 24, 2021, 09:09:55 pm
@pcprogrammer: Concerning the trigger point I have a question about your pictures. I can't see the trigger level setting working. The trigger setup is channel 1, falling edge. The level of the falling edge of the signal in channel 1 right below indicator 'H' is not equal to the selected trigger level at indicator 'T'. So I presume triggering is not working yet?
In the second picture the whole signal pattern is shifted right, together with indicator 'H'. OK, was that what you wanted to show? But I think that the horizontal position of the trigger point has no relation with the trigger setting. It simply shifts the 'picture' left and right, as observed with my box:

What follows here is my -speculative- view of how triggering is working. It appears that the trigger point is always at the center of the processed data. After a single capture when you select a slower time base it shows that the total initial capture was equivalent to 30 divisions length. The trigger point is always in the middle of the capture, irrespective the trigger setting, level or horizontal position. To me it looks as if the FPGA is storing about half a capture worth of samples, then arms a digital comparator with the required trigger level. From the point where the comparator trips another half length capture is sampled. Together with the correct number of samples from the trigger point backwards it completes the acquisition.
One would expect to see the processor loading the trigger parameters in the FPGA. However, I didn't find any trigger level commands in the decoded processor to FPGA data stream you captured. Or maybe these are not recognized yet? Or is it done with the command '0x0E' that you called the 'Trigger time / div' setting in your FPGA explained file? 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 25, 2021, 05:41:24 am
Hi Maurits,

I also spotted that the trigger level is of in relation to the trigger position indicator. It actually works but I might have missed some level correction in my code. The problem is that the FPGA implementation is also crap, which makes it very hard to create code that works properly. The trigger level command for the FPGA is 0x17, which takes one byte of data. Contrary to trace offset being handled in the FPGA, the trigger position is not. For as far as I found, there is no command that sets this in the FPGA.

My new code assumes that the trigger point is in the middle of the buffer and does, just as the original, a check to find the actual transition point based on the edge direction and the level within 10 samples. (starting at center point -  5) This found position is what the trigger position indicator is located at. Moving the trigger position indicator moves the signal display based on that same point, bringing more samples in at the left or the right depending on the direction. Since I stopped trying to figure out how the original code does it, I have to experiment with things to make it work properly.

The FPGA captures you mention are made in the beginning of the project on my emulator and I have never updated them after discovering more about how it works during the reverse engineering of the code. The code of the test software you had running on your box tells a better story. The scope_get_short_timebase_data function (scope_functions.c) shows what needs to be done for channel 1 to get the data. Also look at the functions in fpga_control.c . These show a lot about the meaning of the commands.

At some point a new FPGA programming needs to be made. With proper ADC interleaving before trigger detection and longer sample buffers. The FPGA has 270Kbits of ram to work with. Should be possible to use more of it then the 3000 samples per channel it gives now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 25, 2021, 11:39:38 am
There are still several issues with it but this version has both channels working with the new sample rate setting system.

Tapping on the screen will change both the sample rate and the time per div based on the current time per div. (Only in run mode) When the menu is used the sample rate setting makes the change in the FPGA but leaves the time per div setting on the display unchanged. In the time per div part the viable settings for the current sample rate are displayed with a white text. The settings that show less then a full screen, or only a straight line due to the fact only two samples can be used are shown in a grey color.

When stopped it is possible to change the zoom by tapping on the screen. The sample rate will remain as is, until the scope is started again.

The trigger level does work, but the relation with the trigger position might not be correct. On my development scope (the old one) it looks to match for channel 2 but not for channel 1. So might be a calibration issue. Needs further research.

The view and save item part has not been modified yet, so that bit of the system is useless. USB works and can be used to remove the firmware again. (Zero out sector 16 on the SD card)

Will also upload the source as is now to the https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Test%20code/fnirsi_1013d_scope) folder.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 25, 2021, 01:00:55 pm
@pcprogrammer:

Thanks for answering my questions, it confirms the limited view of the inner workings I have so far. Horizontal position of the trigger indicator 'H' is processed by the MCU.

Unfortunately one answer leeds to more questions, so, continuing the brain storm for a bit:

The fact that the original software has to look for the actual trigger point in the buffer of samples, near the midpoint, suggests that the FPGA is not registering this as some pointer value, to be read by the MCU. On the other hand, per definition the trigger point has to be the mid point. Maybe this looking for the trigger in these ten samples you mentioned is done to eliminate jitter caused by noise. Comparing samples with a previous trace and averaging?

The functions in your file fpga_control.c are clear to me. Where the so called parameter IC comes into play is still to be found? Are all captured data processed by this chip before being read by the MCU? In that case is it some kind of look-up table to speed up calculations? That is not clear to me from the FPGA captures.

I certainly agree that writing your own FPGA functions is appealing here. Although difficult when debugging is not available on the actual hardware. Next step is designing a new PCB with... (add your wish list).

Just found your new test firmware...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 25, 2021, 02:12:08 pm
Hi Maurits,

I have not found any comparing with previous samples or averaging with them in the code I looked at so far. There is definitely a lot more code but it took to much energy to continue reversing it. So it might be that there is such a thing going on. The actual trigger point determination is also something I did not find either. After reading the first ADC sample buffer there is a routine that scans the 10 center samples and sets a flag, but how this flag is used did not become clear to me.

About the special so called parameter ic (named it so because I thought it was a storage for the settings at first) is more like a translation ic, but does have a relation with the working of the FPGA sample gathering. How is also not clear to me, but to have the FPGA return valid samples for channel 1, it does require the 0x0C parameter with the active trigger channel id to be send to the parameter ic. It returns the command to read the samples from the FPGA. I have not tried to confirm the returned command value yet, but captures made of the communication with this ic showed it returning 0x20. For channel 2 it is 0x0D, which seems to return 0x22.

In the beginning I did try to read the data without this call to the ic, but it does not work.

For reading the second adc samples it does not require this, but have not tried reading them without first reading the first adc samples.

The problem with making a new FPGA programming is the loading it to the scopes out there. You have to open up your scope and attach a programmer to the flash connected to the FPGA. The scope needs to be on to be able to read this flash, at least that is my experience. So most like the same applies for programming.

That is why I have been trying to make something based on the hardware as is now.

Redesigning the total hardware is a bit out there :) Of course it can be done, but it becomes expensive real fast and where does it end.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 25, 2021, 05:09:28 pm
Added the x-y mode displaying and while comparing it with the original I noticed some behavior what made me think that @morris6 might be on to something with the averaging of the sample buffers. While switching between the lowest time per div settings (50 - 10ns/div) it is best noticeable. With 4MHz sine wave applied to both channels, and some phase shift between them the display takes some time to change. At these time per div settings the scope also does a lot of processing for the up sampling. This slows updating down. So might explain the weird. :palm:

See the video I made. https://youtu.be/dGSvxxPtG20 (https://youtu.be/dGSvxxPtG20)

The picture shows a circle made with my firmware. When running it is also very unstable showing lots of erroneous captures.

Have to think about improvements, or just bite the bullet and switch to designing new FPGA programming.

Will see after it sinks in ;)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 26, 2021, 09:21:28 pm
Hi Peter,

The problem with making a new FPGA programming is the loading it to the scopes out there. You have to open up your scope and attach a programmer to the flash connected to the FPGA. The scope needs to be on to be able to read this flash, at least that is my experience. So most like the same applies for programming.

That is why I have been trying to make something based on the hardware as is now.
Sure, I do agree with that view. Loading another FPGA content is a delicate business, avoiding to damage anything. And maybe it isn't needed to improve the box's behavior. The original firmware seems not too shabby getting the 'wiggly lines' on the screen.

So, I have loaded the new experimental firmware on the card and tried it out and of course I have some observations and questions:

I like the sample rate indication in the menu line, that is nice information.

The battery charging icon, the arrow, points to the right, to the bottom of the battery symbol. My first thought was: the battery is discharching. Maybe point the arrow to the left to indicate that battery level is increasing.

About the ACQ menu: When selecting a sample rate in the upper block the available gray - white indication in the lower block does not change. Only after selecting a gray or white item in the time per division block the gray - white indication changes according the earlier selected sample rate.

The trigger levels on both traces are about right, from time base 10 ms / div. up to 500ns / div. The 50% button is not active? On the highest speeds trigger is way of. On the slowest time base settings roll mode is not implemented yet, and the trigger level indicator is still showing.

Now about the signals on the screen: The new firmware, like the previous one causes flashing interruptions of the traces, combined with wild excursions. They occur at irregular intervals of about several seconds, irregular, Like missing a heart beat. More noticeable on the higher speeds. This needs to be solved somehow.

Comparing this new firmware with the original one it is obvious that the original firmware does average a few captures. This can be observed by using the single mode. In single mode the original firmware shows a trace with noise while this noise is filtered out when running in normal or auto. It is averaged out by averaging at least two or more captured traces.*) Your new firmware does not do any averaging (as yet) and so the trace in auto or normal mode shows the noise the same as single mode. And it makes the trigger point 'jittery'.

*) This same effect is noticeable on my Hameg when variating the number of averages of the trace.

So it seems the original firmware uses averaging. Now I start speculating:.... Most probably this is done by the FPGA, even at the same time as capturing a new trace. Maybe some of the memory blocks are used for this purpose, storing intermediate results. Together with the use of the secret IC, it makes me wonder:... can't you use the capture functions as they are in the original firmware?. The original firmware is OKish here. Only the shortest time / div settings are producing nonsense. Here it is better just to show the user what is captured and maybe try to do real equivalent time sampling...? With fixed 50% trigger level?

I have a lot of respect for your efforts, but since it is unpractical to change the FPGA programming I think the best thing is to use it as it was designed. When the original capture stuff is working in your firmware you have already achieved a lot. And there is more coming.. I hope.

Regards,
Maurits
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on November 26, 2021, 10:50:42 pm
Hello everyone.
I have an oscilloscope with the inscription FNIRSI on the front panel. Extracted the firmware.
When installing a new firmware, the image is shifted up and to the left.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 05:15:05 am
Hello everyone.
I have an oscilloscope with the inscription FNIRSI on the front panel. Extracted the firmware.
When installing a new firmware, the image is shifted up and to the left.

How interesting. Your box seems to have yet another display that looks like one on the 1014D.

Did you use my firmware backup program, or opened up the box and used a programmer to read the flash, or did you go the FEL way?
No indication if yours has the special touch panel?

The display issue is not a big problem. Will have a look at your back-upped firmware to see what the needed settings are.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 06:09:33 am
Hi Maurits,

first of all, thanks for testing. It is nice to get some feedback.

Loading another FPGA content is a delicate business, avoiding to damage anything. And maybe it isn't needed to improve the box's behavior. The original firmware seems not too shabby getting the 'wiggly lines' on the screen.

The fact that the original software is able to provide a nice stable display, does not mean it is good. It shows it takes a lot of effort to fix the crap the FPGA delivers. :-DD
Sure more of an effort can be made to fix what is wrong, but not fixing the core will always leave us with a problematic scope. Not saying I'm not doing the fixing in the code, but will do it based on experimenting and not further digging in the original code.

The battery charging icon, the arrow, points to the right, to the bottom of the battery symbol. My first thought was: the battery is discharching. Maybe point the arrow to the left to indicate that battery level is increasing.

This is something I spotted the first time I plugged in the original scope, but it did not bother me that much that it made me change it. I'm surprised you did not spot the unstable behavior of the battery charge indication itself :) It is on the list of things to look at.

About the ACQ menu: When selecting a sample rate in the upper block the available gray - white indication in the lower block does not change. Only after selecting a gray or white item in the time per division block the gray - white indication changes according the earlier selected sample rate.

I have to check if I fixed this after the release or that what I changed does not do the trick. Noticed it myself too at some point ;) Will check this.

The trigger levels on both traces are about right, from time base 10 ms / div. up to 500ns / div. The 50% button is not active? On the highest speeds trigger is way of. On the slowest time base settings roll mode is not implemented yet, and the trigger level indicator is still showing.

Nope the 50% is not implemented yet. The intention is to fully discard the roll mode and have the 200 and 100ms/div settings work the same as the other settings. Sure the update time will be slow, so have to see how it pans out.

Now about the signals on the screen: The new firmware, like the previous one causes flashing interruptions of the traces, combined with wild excursions. They occur at irregular intervals of about several seconds, irregular, Like missing a heart beat. More noticeable on the higher speeds. This needs to be solved somehow.

Comparing this new firmware with the original one it is obvious that the original firmware does average a few captures. This can be observed by using the single mode. In single mode the original firmware shows a trace with noise while this noise is filtered out when running in normal or auto. It is averaged out by averaging at least two or more captured traces.*) Your new firmware does not do any averaging (as yet) and so the trace in auto or normal mode shows the noise the same as single mode. And it makes the trigger point 'jittery'.

*) This same effect is noticeable on my Hameg when variating the number of averages of the trace.

Nice observation. Have to run some test on this to see what this does. About the trigger, to get a more stable reading I guess it is necessary to decide on the correct trigger point after the averaging. Feels a bit artificial.

I have made a scope and FFT spectrum analyzer two years ago, based on a 100KHz 16 bit ADC. Did not use averaging for the scope and did the trigger on the PC. Looked rather nice and fairly stable compared to what is seen here. So to my opinion it should be possible to get good results with proper FPGA programming. But that is for a later stage.

So it seems the original firmware uses averaging. Now I start speculating:.... Most probably this is done by the FPGA, even at the same time as capturing a new trace. Maybe some of the memory blocks are used for this purpose, storing intermediate results. Together with the use of the secret IC, it makes me wonder:... can't you use the capture functions as they are in the original firmware?. The original firmware is OKish here. Only the shortest time / div settings are producing nonsense. Here it is better just to show the user what is captured and maybe try to do real equivalent time sampling...? With fixed 50% trigger level?

I agree with you on the fact that the original uses averaging to get the stable display. But it is definitely not done in the FPGA nor the secret IC. I'm using basically the same code as the original to get the sample data, at least in my first effort to recreate the original code. For the new version I did more optimization by moving code to avoid copying data from one location to another. The FPGA commands are still the same though.

On wards from the point where I left off in the code reversal, no FPGA commands are called for as far as I could see. It is just a lot of code with memcpy's and what ever. Based on what I have seen in the code I did reverse it is very likely that this is where the averaging is done. For the up sampling they where also not able to do multiple actions in one loop, so why should that be different for the averaging :-//

I have a lot of respect for your efforts, but since it is unpractical to change the FPGA programming I think the best thing is to use it as it was designed. When the original capture stuff is working in your firmware you have already achieved a lot. And there is more coming.. I hope.

I agree that it is best to try to get it running with what is available. Frustrating though |O

At the moment I'm working on the simulator. Going to add a signal generator and emulate the FPGA behavior, including the random error behavior as far as possible. This way it hopefully will be easier to write code to make the scope work better, and get things done faster.

It is a bit of a pain in the bum to have to load the code to the scope for every test, even though it is directly to DRAM, it is still turn the scope off, turn it back on again, run the sunxi-fel command on the PC, test things on the scope, etc.

Lots of work ahead.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 07:13:23 am
Hi Maurits,

such a big post (yours and mine :-DD) that I missed this one

Here it is better just to show the user what is captured and maybe try to do real equivalent time sampling...?

"Real" equivalent time sampling can't, for as far as I know, be done in software. It needs phase shifting of the sample clock in the hardware. To do this on this scope (200MSa/s real time sample rate) the clock needs to be shifted 5 times to get to 1GSa/s. So sample a 5th of the buffer on phase 0, then shift 1ns and sample the next 1/5th for phase 1 and so on. As you stated yourself before, it only works on repetitive signals.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 08:53:38 am
Hi @Alex62,

forgot to welcome you to the forum, so welcome :)

Hello everyone.
I have an oscilloscope with the inscription FNIRSI on the front panel. Extracted the firmware.
When installing a new firmware, the image is shifted up and to the left.

I looked at your firmware and found the needed values for your version. (I hope) With this adapted version, on my test scope the display shifts the other way, so should be ok.

Hope you are willing to test it.

Regards,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 09:58:45 am
Hi Maurits,

About the ACQ menu: When selecting a sample rate in the upper block the available gray - white indication in the lower block does not change. Only after selecting a gray or white item in the time per division block the gray - white indication changes according the earlier selected sample rate.

I checked this and it was indeed after the release that I fixed it. :)

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 27, 2021, 12:52:01 pm
Hi Maurits,

especially for you :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on November 27, 2021, 02:12:54 pm
Hi Maurits,

especially for you :)
Hi Peter,

Yes.., looks better this way, got my own symbol now in a Chinese oscilloscope..., thanks.

Regards,
Maurits
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on November 27, 2021, 06:44:48 pm
Hi,
@pcprogrammer
Saved the firmware using sunxi-fel.
There is also one saved using your backup program.
Checked the firmware everything is OK.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 30, 2021, 12:23:38 pm
It took a bit of time, but the signal generator front panel is finished. Next up is to implement the user interface and signal generation. Hook it all into the scope simulator FPGA handling and the real development can continue.

Will be another couple of days.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 02, 2021, 09:42:19 am
Progress is a bit slow, but filled in the signal display. Next up is making it possible to change the settings.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on December 02, 2021, 11:38:16 am
This looks great. Your effort is really appreciated.  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 05, 2021, 09:36:12 am
Don't think I threw in the towel ???

Due to my fibromyalgia / chronic fatigue syndrome acting up more the last week it is harder to focus and things slow down. This happens from time to time. Still working on it and the user interface of the signal generator is coming along. So bear with me, it will be finished at some point :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on December 05, 2021, 12:04:25 pm
@frenky didn't mean to imply you stopped, just that your ongoing effort is much appreciated...which it is :-+

I don't have one of these scopes but it's interesting to follow along. Thanks for all the updates.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 05, 2021, 02:53:35 pm
That was not the why behind my post. It was to explain why it is taking longer to finish this bit of the project and that may have made people think that I stopped.

Which is not the case.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on December 05, 2021, 04:24:42 pm
I was just wondering ...

We know this thing tops out at about 20MHz bandwidth. Would it be worth modding it with a capacitor to limit the input to around that frequency and help it keep things together at higher frequencies? (ie. not show rubbish on screen)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 05, 2021, 05:35:31 pm
I don't think that will help. The crap is in the FPGA even if the input is a pure sine below the 20MHz. Less frequent but still there. The only way to really improve this thing is to redesign the front end and the FPGA programming. And then still for a proper signal representation it needs to be kept below 40MHz since it only has a max of 200MSa/s per channel.

Not a bad thing because 40MHz is good for many hobby projects.

With redesigning the front end I mean calculate new values for the resistors and capacitors to give it a better sensitivity range and raise the low pass filter point to suite the 40MHz if possible. Have the software do more range scaling and sacrifice one or two bits in resolution. Accept it to never be a precise instrument to do spot on measurements.

But first of all getting an open source firmware working on it as is, is the first hurdle to take. Getting close, but still a lot to do.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: btidey on December 06, 2021, 12:18:12 pm
I am really looking forward to replacing the stock firmware with the results of your hard work.

I previously used a DSO203 which really benefited by using the open source firmware; much better than the stock version.

When I need extra sensitivity issue I use a battery powered home built front end 2 channel pre-amp. One channel based on OPA355 (x10) has a bandwidth of ~ 15MHz and the other (transistor based) for audio type work, is switchable x10, x100 with a bandwidth ~5MHz.

Thanks for your skill and efforts on this.
 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 06, 2021, 12:44:55 pm
@btidey, your welcome.

And your idea of an external amplifier is also a solution to crank up the sensitivity.  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 06, 2021, 09:44:54 pm
What do you think, is this a genuine Altera Cyclone IV?
The part number found in the programming stream by tv84 is 0x020F1, that checks with the IDCODE for EP4CE6 (Cyclone IV Device Handbook, Volume 1, table 10-2).

How about a JTAG connection? A 10 pin IDG header and a few wires later: As expected, Quartus IDE programmer (USB Blaster) does not recognize this as an Altera (Intel) EP4CE6. The JTAG Chain Debugger does find a device: UNKNOWN_18006C31.

Before going into OpenOCD to try a connection over JTAG with the FPGA I connected  with Flashrom program to the FPGA Flash part. On my board that is a Zbit ZB25VQ80. Connecting with the Flashrom program failed, unknown chip. But, it found a manufacturer and part ID. I updated the flashrom flashchip.c and -.h files with this chips info and now at least reading the chip worked. For comparison the file is attached.

Next is comparing the content of this flash with the bit stream of the flash for the real Altera Cyclone IV...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on December 06, 2021, 10:08:42 pm
The part number found in the programming stream by tv84 is 0x020F1, that checks with the IDCODE for EP4CE6 (Cyclone IV Device Handbook, Volume 1, table 10-2).

Just an estimate as I'm not 100% sure about those bits decoding. I think it can go up to 0x024F1. But... it is my best shot.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 07, 2021, 05:35:48 am
@morris6,

interesting findings. Are you going to try to reverse the FPGA? Or is it just to see what the part is?

The fact that you were able to connect a jtag device to it at least shows the pin out looks to be the same. Can you put up some pictures of how you connected the jtag header?

Did you look at what you read from the FLASH and compared it to the readout I made? I know there are different versions floating around. Mine was uncompressed.

Edit: did the compare here, and the files are the same.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 07, 2021, 01:47:28 pm
Well, that's nice. At least it looks like the clone FPGA is in fact a copy of the real thing, in as much the one in the older Fnirsi-1013D is the real thing..!? Most probably a development for the original Altera (Intel) FPGA will work on the Chinese clone.

Reversing the FPGA? AFAIK that is impossible.

Now I have to figure out how to get OpenOCD talking to the clone, since Quartus is not. Or maybe Quartus can be tricked?

Results so far with OpenOCD, calling the chip "sesame":
Code: [Select]

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Info : No lowlevel driver configured, will try them all
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: sesame.tap tap/device found: 0x18006c31 (mfg: 0x618 (<unknown>), part: 0x8006, ver: 0x1)
Error: sesame.tap: IR capture error; saw 0x3ff not 0x1
Warn : Bypassing JTAG setup events due to errors
Warn : gdb services need one or more targets defined


It comes up with the same chip identifier as Quartus IDE programmer, and also sees a manufacturer. Have to look further to get the chip config file for openocd working. OpenOCD is all new stuff for me.

Attached some pictures of front- and backside of my board with JTAG and ICSP connectors. I added also a RESET jumper and jumpers to freeze the FPGA nCONFIG (low) and nCE (high).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 07, 2021, 02:11:44 pm
Hi Maurits,

nicely done :) Your in luck it is not a multi-layer board, otherwise drilling through might have wrecked something.

Reversing the FPGA is not impossible, but granted it is very hard and time consuming to do. There are some claims on the net of people who done this with the Altera cyclone IV devices, but I did not find any software to do it. My take on it would be to first identify the bit-stream parts for the pins by making test files with different settings and see what changes. Then expand this for the lookup tables etc. A hell of a job, and time probably better spend in creating something new from the ground up.

Still on the user interface of the signal generator. Will see how far things get done today.

The waveform select works and the frequency and phase buttons are starting to work.  8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on December 07, 2021, 04:32:50 pm
I didn't know there were clones of the EP4CE6 - is that fact or rumour?

Genuine EP4CE6 share the same die as the next up in the range EP4CE10 and have the same IDCODE.
So you can program a EP4CE6 as if it were a EP4CE10 and get the benefit of a bit more logic.
However, your CE6 might be a CE10 reject so you can't really depend on it if distributing bitstreams.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 08, 2021, 05:11:37 am
About the clones of the EP4CE6 who knows. In time I will look at mine too see what it's responses are.

The fact that the EP4CE6 and the EP4CE10 are basically the same is interesting. You are right that it can't be depended on for distributing new programming, but experimenting with it will be fun. It offers room for bigger sample buffers.

Any idea on how it can be tested to see if it offers the full EP4CE10 capabilities?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on December 08, 2021, 11:30:27 am
Any idea on how it can be tested to see if it offers the full EP4CE10 capabilities?

No, that would be quite a task, testing every configuration bit and its hardware.
But my feeling is you would be unlucky if you found a CE6 that didn't work as a CE10 ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 08, 2021, 01:35:29 pm
Uploaded the simulator code to the repository. The signal generator user interface is not completely done, but far enough to continue with the signal generation and scope FPGA emulation part.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 08, 2021, 09:32:43 pm
About the clone FPGA that is not "seen" by the Quartus programmer.

Further googling examples of programming Altera devices with OpenOCD learned me that I have to use a .svf file for programming. So going into Quartus to make something to try it. Then program the chip over JTAG. Expected to be "Harmless", after re-powering the scope the test stuff is gone... As a first experiment I propose a "Blinkenlichtchen" on an unused FPGA pin. So some more hardware adaptation to do.

Results so far with OpenOCD, still calling the chip "sesame":
Code: [Select]

Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Warn : Adapter driver 'usb_blaster' did not declare which transports it allows; assuming legacy JTAG-only
Info : only one transport option; autoselect 'jtag'
Warn : sesame.tap: nonstandard IR value
Info : No lowlevel driver configured, will try them all
Info : usb blaster interface using libftdi
Info : This adapter doesn't support configurable speed
Info : JTAG tap: sesame.tap tap/device found: 0x18006c31 (mfg: 0x618 (<unknown>), part: 0x8006, ver: 0x1)
Warn : gdb services need one or more targets defined
   TapName             Enabled  IdCode     Expected   IrLen IrCap IrMask
-- ------------------- -------- ---------- ---------- ----- ----- ------
 0 sesame.tap             Y     0x18006c31 0x18006c31    10 0x03  0x03
open("project.svf"): No such file or directory
svf svf [-tap device.tap] <file> [quiet] [nil] [progress] [ignore_error]
xsvf (tapname|'plain') filename ['virt2'] ['quiet']


To be clear, no project.svf file was present in the attempt above.
For your entertainment and inspection a Zip of the configuration files for OpenOCD I'm using. These are in a directory 'OpenOCD' from where openocd is called. It looks for the default openocd.cfg and executes that. It loads the adapter driver from /usr/share/openocd/scripts/interface/...whatever.cfg. In my case a clone usb-blaster. And then opens my 'sesame.cfg' as target.

To be continued...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 09, 2021, 01:40:44 pm
The signal generator is working, at least on channel one a signal is coming through :)

There is no trigger or proper scaling yet. Need to implement more code in the FPGA stub functions to handle all the settings the scope does and based on that implement some trigger logic.

Why the second channel is only showing this small ripple I don't know yet.

But yet another step has been taken.

Edit: the signal generators second channel was set to 100MHz, which the scope can't measure |O Lowered it and now the scope shows signal :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 09, 2021, 04:26:56 pm
While working on the FPGA emulation I was wondering about the two commands the MCU waits on for a 1 to be returned.

0x05 which is checked twice in a row and 0x0A which is checked a bit later in the process but still before the reading of the sample data. During the latter the user can interrupt the waiting with touch, which is not the case when waiting on the 0x05 command.

My first thoughts on this were, could the 0x05 be for waiting on trigger and the 0x0A for capture buffer filled, but this would lead to a freeze of the scope in normal or single trigger mode, which it does not.

So it looks like the 0x0A is the wait for triggered command. The question is then what is the use of the 0x05 command?

Anyone any thoughts on this?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 10, 2021, 09:58:47 am
Sorry for this late reaction, I was fighting with Quartus. It feels like the program changed since the last time I used it for some De0-nano exercise, building a video driver for a TFT display.
About the FPGA commands: Since freezing the system is not acceptable the 0x05 command will be something that is certain to terminate. Maybe a reset of a capture cycle, clearing counters and or memory?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 10, 2021, 10:08:16 am
Think you are right about that. The more I work on it the more it becomes clear what a crap it is. Trying to get the signal offset on screen to work, but to get it spot on is not that clear cut. Have something working which will do for now, so next up is emulate trigger behavior.

So Maurits, if your are thinking of making a new FPGA programming that would be a great help. The software can be much simpler with a better FPGA setup :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 10, 2021, 11:47:28 am
Well, first things first. Get programming the sesame Cy"clone"IV working. Yesterday I fumbled some LED's on the board with a 74LVC00 driver connected to some unused pins (114 and 115) of the FPGA. I also have now a working visual CONF-DONE indication. I could have used the pins of the relay's for my experimental programming, but the extra led's can have some debug function later.

To be continued...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 11, 2021, 10:08:37 am
Improved the simulator signal generation and it is now working reasonably well. Still an issue with the two signals missing a fixed phase relation so even when on the same frequency the not triggered on signal keeps scrolling.

Also found that I did not wrote the selected trigger mode to the FPGA in the scope code I had so far. Fixed that, so normal and single are possible options now.

Noticed that with this test setup the triggering is not very stable. Part of it will be my emulation of it, but on the actual scope hardware it was not so stable either. Well at least there is a tool to do development on.

The latest code is uploaded to the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 11, 2021, 12:17:30 pm
I noticed a strange behavior on channel 2 on both the real hardware as on the simulator and wonder if it has to do with calibration values or something else.

Can someone try this on their hardware. I tested it with a 5MHz sine on channel 1 and a 10Mhz sine on channel 2 and it happens when the signal on channel 2 goes below the bottom of the screen. Instead of a straight line it shows a ripple. This does not happen on channel 1, at least not on my systems. (It happens on other frequencies too)

See the picture for how it looks here on the simulator.

Attached is the latest build of the scope code as it is now. Just load it on the SD card as explained on page 45 of this thread.

Edit: Added a version with the shifted display and the somewhat fix for the ripple.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 11, 2021, 03:04:03 pm
It is indeed caused by the calibration for the difference between the two ADC's. On the original firmware this phenomenon is also seen in the 25ns and 10ns per div settings, but only when the second ADC gives a lower reading then the first ADC and thus needs a positive compensation. When the first ADC returns 0, the second one also returns 0, but the compensation in the software is added, making it a ripple. In my test scope the compensation is 7, and after signal adjusting for the current volt per div setting it is cranked up to 12. This is quite the step on the display.

Since in my firmware both ADC's are used for all ranges it shows this all the time when the signal is near the bottom.

Fixed it with a check on only compensating when the sample is above zero, but probably needs checking on the other ADC output to only compensate when that value is high enough.

Things would have been so much simpler if the original developers did not make these weird design decisions. The whole trace offset should have been kept in the software domain.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on December 11, 2021, 03:24:52 pm
CH1 is a 5 MHz meander, CH2 is a 10 MHz sine.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 11, 2021, 08:58:33 pm
Testing your new firmware on my box: Same thing. What makes me wonder is that this triangles on the bottom edge are only visible on the blue channel trace. And co-incide with the sampling rate, one triangle has a base of 2 x 5 ns: 10 ns. And.. while the traces are jittering left to right the triangles remain in place.

Now with slower signals, like 500 kHz and 1 MHz the traces look 'fuzzy'. And where the blue trace touches the bottom edge a nice zig-zag pattern is displayed.

At slower time base setting, like 1us/div the blue trace, nearing the bottom edge, sometimes flattens out about have a division above the bottom edge. Is this because only one adc per channel is used, no interleaving?

When the cause of the fuzzyness of the traces is 'not proper calibration / equality' of both adc in the channel, as a faint triangle pattern is visible in both traces, why is number 1 channel not giving the same pattern when the signal reaches the bottom?

In my opinion when the trace reaches the edge of the diplay area the trace should simply disappear. The trace along the edge of the display area can be interpreted wrongly as a valid signal. Maybe show an arrow near the trace indicator on the left edge to indicate over-limit?

About the FPGA: loading a new program with OpenOCD fails at 95% progress, something in the settings is not correct yet....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 12, 2021, 06:01:01 am
Hi Maurits,

as can be seen on  Alex62 his box it has to do with the calibration between the two ADC's used for a single channel. In his box it is channel 1 that has this problem. Only happens when the compensation value is positive. You are right that a more proper way of handling this would be limiting the signal to allow it to stay within reach of this calibration value. This means that for both ADC's the signal needs to be cutoff  below the calibration value.

This is something that needs to be incorporated in the FPGA.

To bad the programming of it is still problematic. Have you considered just making a ROM image of your bitstream and write it to the FLASH and test if it works that way?

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 12, 2021, 07:41:23 am
Hallo Peter,

This calibration issue is difficult for me to grasp at the moment. The per channel interleaved adc's should give equal results, otherwise noise is produced. But how one channel influences the other here..?

Later last evening I got programming the FPGA working, although my prepared test was not running. OpenOCD's svf programmer reported 0 faults and my CONF-DONE indicater changed from red to green. Issue is, how I see it now, the clone usb-blaster. It always runs full speed, 25 MHz or so. When I added the -d switch on the command line for troubleshooting it worked. The process is then slowed down because OpenOCD has to spew 'everything' to the terminal.

To be continued..
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 12, 2021, 10:14:24 am
Hi Maurits,

good to hear you were able to program the FPGA, but it not doing what you thought is a bummer. Keep trying :-+

Due to mismatch in the ADC chip it is possible that the two conversions are slightly of. When grounded the input should be stable and the same on both inputs, so if there then is a difference between the readings of the two ADC's, there is a need to compensate for it, because otherwise that would give noise in the interleaved data. To adjust for this the reading of one of the ADC's needs to be adjusted with the measured difference. This can be either positive or negative depending on how they differ from each other. (An other option is to make it meet in the middle, so compensate both ADC's)

When it is negative the software, as it is now, just keeps it on zero when the reading is below the compensation value. This does not lead to the ripple. When it is positive the software always added the value, giving problems near the bottom. The other ADC will be zero later then the one that is compensated, and when that happens the compensation starts to make the ripple. In my case: ADC1 = 0, ADC2 = 0 + 7, ADC1 = 0, ADC2 = 0 + 7, etc.

It is not that the one scope channel is influencing the other scope channel. Each scope channel has two ADC's connected to it.

It should not be to hard to solve this in hardware, but I do have to think about a good solution.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 12, 2021, 01:03:18 pm
Started with the reversal of the baseline calibration code to get a better understanding about the working of the FPGA. A lot of what is done is the same as for the short time base acquisition but I did notice a difference. In the normal acquisition the FPGA command 0x0F is written with a 0 before the capture process and a 1 after the command 0x0A signals there was a trigger or a full buffer. At the start of the calibration process the command 0x0F is written with a 1.

This leads me to think the 0x0F command signals the usage of the trigger logic. For the calibration there is no signal so no need to wait for a trigger.

It is a big chunk of code, so it will take some time to dig through it all.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 12, 2021, 06:51:45 pm
I pulled the Rigol out the cupboard to do some measurements on the FNIRSI, because I kept wondering about this trace offset that is done in the FPGA. It turns out it uses PWM to shift the other inputs on the ADC's.

When reverse engineering the schematic I did notice connections from the FPGA to the analog side of the ADC's, which I named ADC_OFFSET, but figured this was for some zero offset on the channels. It uses PWM on a 25KHz square wave signal (To phrase George Clooney, what else  :-DD) to make an offset voltage. This PWM is controlled with the movement of the trace on the display. So now I know why it needs to be set in the FPGA, and also that it offers room to do it differently.

Calibrate the signal when grounded or not connected to mid ADC range and keep it on that. Do the trace displacement on screen fully in software.

Also measured another thing I was wondering about. Is the clock of the ADC's always on 100MHz or does it change when the time base is changed. Turns out it lowers the clock on the ADC's. With my firmware, when set to 200KSA/s the clock on the ADC's is 100KHz. So no FPGA DSP implementation to prevent aliasing. (Which we already knew |O)

As to be expected, the calibration code is also full of crappy code. The first bit I checked is for the trace offset calibration, so I now have some insight in the values used.

Well the story continues :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on December 13, 2021, 05:45:02 am
However if you move the trace at the input of the ADC you can use All of the ADC for the active signal. If you move on screen you need to have 2X screen height info to not run out of screen. With an 8 bit ADC you have 256 levels to work with. I think the screen probably has 256 vertical pixels if not 480 vertical pixels. If you use software to move the display you quickly need some good software to interpolate or at least hide the reduced resolution. Maybe this is why the DSO's I've used do not have a vertical zoom, nothing to show there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 13, 2021, 06:21:33 am
Sure, shifting the input signal this way allows for the full ADC range to be on the display. As it is now it already does a fractional multiplication to match the volt per division setting. But that being said, I have noticed that, when switching between sensitivity settings, the center alignment is often of, with the line either above or below the indicator. This can, to my opinion, be avoided with proper zero adjustment per volt per div setting.

Something to experiment with.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: x86guru on December 13, 2021, 09:08:50 pm
They need a better name. "FNIRSI" how does one pronounce that?

I think it might be an acronym?

F - Fictional
N - Non-triggering
I - Imaginary
R - Real-time
S - Sampling
I - Instrument
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 14, 2021, 05:49:13 am
They need a better name. "FNIRSI" how does one pronounce that?

I think it might be an acronym?

F - Fictional
N - Non-triggering
I - Imaginary
R - Real-time
S - Sampling
I - Instrument
Good one  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 14, 2021, 10:29:59 am
Worked through the calibration code. Was not to complex and basically does two tasks.

The code can be reduced, but may need changes based upon how I'm going to do the trace offset on the screen. Also need some experimenting with the system since it is using a call to the special ic. Command 0x12, which does some magic on two values found for the trace offset calibration.

Uploaded my work files and the updated Ghidra archive to the repository: https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering (https://github.com/pecostm32/FNIRSI-1013D-Hack/tree/main/Software%20reverse%20engineering)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on December 14, 2021, 11:09:36 am
I don't know what the circuit for this FNIRSI is like, but normally having the ability to apply a dc offset in the analog domain is an important characteristic (https://www.picotech.com/library/application-note/using-analog-offset-to-maximize-oscilloscope-resolution) of any scope. It's not just to move the trace up and down on the screen. It's main purpose is to allow the input amplifiers to function over a wider input range when in dc coupling mode and when the input signal has substantial dc offset, that would otherwise cause input amplifier saturation. Without that feature, the only option for the user would be ac coupling mode, which would be inadequate where there is low frequency signal of interest with large dc offset. I would advise to keep the pwm offset adjustment in the analog domain.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 14, 2021, 11:42:46 am
Hi voltsandjolts,

thanks for this info. The problem with this hardware is that the DC offset is not on the front end circuitry and therefore does not help in amplifier saturation. It is on the "negative" input of the ADC, so the signal is already through the amplifier before any shifting is done.

So in this case it only allows for the whole 256 bits of the ADC to still be on the screen when the trace is moved to either the top or the bottom. If this is useful on this scope, I don't know. One thing is for sure, it needs improvement to keep the center of the trace on the center pointer, because that is not always the case.

At the moment looking into the auto setup code, so more digging through the original code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: voltsandjolts on December 14, 2021, 11:59:40 am
The problem with this hardware is that the DC offset is not on the front end circuitry and therefore does not help in amplifier saturation. It is on the "negative" input of the ADC, so the signal is already through the amplifier before any shifting is done.

 :(

Ahh, just found your schematic (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Schematics/Scope_Analog_Input.png). Oh well, it is what it is.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 15, 2021, 01:29:37 pm
While going through the auto setup and 50% trigger code I stumbled upon a possible option for improvement in the lower sample frequency ranges.

For the original long time base settings (50s/div - 100ms/div) the scope uses FPGA commands 0x24 and 0x26 for the two channels and reads 10 samples per time element and averages these. It turns out these 10 samples are not mandatory, because in the auto setup function it only reads 1 sample per channel in a variable timed loop. It reads 1000 samples and the interval between each sample increases.

I have to experiment with this, but it might provide a way to do timer based sampling and triggering in the software. It is hopefully possible to do 100KSa/s or maybe 500KSa/s this way with a large enough buffer to hold ~3s worth of samples. It then becomes a possibility to do a better FFT for audio signals.

Also a better implementation of a roll mode belongs to the possibilities.

So back to the drawing board and see what time brings :)

Edit:  Just hooked the Rigol to the ADC clock to see what it does.  :( Unfortunately the clock frequency for the long time base settings seems to be fixed to 50KSa/s. Still an option to improve on the 2ms/div to 200ms/div with trigger and longer sample buffers, but for audio not good enough.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 16, 2021, 06:36:58 pm
Coded and tested the trace offset calibration and ran into the problem that channel 2 came out OK, but channel 1 failed. Since it uses the special IC with parameter 0x12 to get some data I could not get it right on my simulator, so I wrote a bit of test code to write the results of the calls to the special IC to a file. It turns out it uses signed integers for the calculations, which was not clear from the Ghidra output.

Modified my code to also use signed integers and now it works like a charm, except for the same problem as the original. It is not consistent throughout the sensitivity settings.

I'm going to write a bit more test code to get a better insight into the special IC. With FatFS running it is now very simple to accomplish this.

I'm also updating both the scope projects (the original and the new code) with this, so it is still an option to finish the original reversal.

Still need to do the interleaving ADC compensation calibration and when that is done I will update the repository.

Attached the file with the output of the special IC data returned for parameter 0x12. Below is the code used to make it.

Code: [Select]
  //Data read out special IC
  if(f_open(&viewfp, "special_ic_data.txt", FA_CREATE_NEW | FA_WRITE) == FR_OK)
  {
    uint32 offset;
    uint32 offset1;
    uint32 offset2;
    int8   valuestring[100];
    int8  *ptr;
   
    int8 headerstring[] = "low,high,result\n";

    f_write(&viewfp, headerstring, sizeof(headerstring) - 1, 0);

    for(offset1=200;offset1<=1500;offset1+=50)
    {
      for(offset2=1500;offset2>=200;offset2-=50)
      {
        offset = fpga_read_parameter_ic(0x12, (offset1 & 0x0000FFFF) | (offset2 << 16));

        ptr = scope_print_decimal(valuestring, offset1, 0);
        *ptr++ = ',';
       
        ptr = scope_print_decimal(ptr, offset2, 0);
        *ptr++ = ',';
       
        ptr = scope_print_decimal(ptr, offset, 0);
        *ptr++ = '\n';

        f_write(&viewfp, valuestring, ptr - valuestring, 0);
      }
    }

    //Close the file to finish the write
    f_close(&viewfp);

    //Show the saved successful message
    scope_display_file_status_message(MESSAGE_SAVE_SUCCESSFUL, 1);
  }
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 17, 2021, 09:49:47 am
Discovered I made an error in my version of the code to communicate with the special IC. When input bytes are not used the original code set them to dedicated values. This is also in my code, but instead of doing it based on the actual input value it also changed in between zero bytes.

Corrected it and the output of the special IC for parameter 0x12 now makes more sense :-DD

It was this
Code: [Select]
  //Load the data bytes with the value
  parameter_buffer[3] = (uint8)(value >> 24);
  parameter_buffer[4] = (uint8)(value >> 16);
  parameter_buffer[5] = (uint8)(value >> 8);
  parameter_buffer[6] = (uint8)(value);

  //Check if MSB is actually used
  if(parameter_buffer[3] == 0x00)
  {
    //Set the MSB to a fixed value if not used
    parameter_buffer[3] = 0x69;
   
    //Take one of the length
    length--;
  }

  //Check if MLSB is actually used
  if(parameter_buffer[4] == 0x00)
  {
    //Set the MLSB to a fixed value if not used
    parameter_buffer[4] = 0x96;

    //Take one of the length
    length--;
  }

  //Check if LMSB is actually used
  if(parameter_buffer[5] == 0x00)
  {
    //Set the LMSB to a fixed value if not used
    parameter_buffer[5] = 0x99;

    //Take one of the length
    length--;
  }

And changed it to this
Code: [Select]
  //Load the data bytes with the value
  parameter_buffer[3] = (uint8)(value >> 24);
  parameter_buffer[4] = (uint8)(value >> 16);
  parameter_buffer[5] = (uint8)(value >> 8);
  parameter_buffer[6] = (uint8)(value);

  //Check if MSB is actually used
  if(parameter_buffer[3] == 0x00)
  {
    //Set the MSB to a fixed value if not used
    parameter_buffer[3] = 0x69;
   
    //Take one of the length
    length--;

    //When MSB is not used check if MLSB is actually used
    if(parameter_buffer[4] == 0x00)
    {
      //Set the MLSB to a fixed value if not used
      parameter_buffer[4] = 0x96;

      //Take one of the length
      length--;

      //When MSB and MLSB are not used check if LMSB is actually used
      if(parameter_buffer[5] == 0x00)
      {
        //Set the LMSB to a fixed value if not used
        parameter_buffer[5] = 0x99;

        //Take one of the length
        length--;
      }
    }
  }

It looks like the IC subtracts the two input values and multiplies the result with 100. It is still prone to error though. Some values are zero in one readout, but the correct value in the next.

If possible I would like to avoid using this special IC, but earlier tests showed it to be needed. Will do more tests on it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 17, 2021, 01:29:39 pm
Some findings and thoughts about the FPGA:

The earlier 1013D scopes contain an Altera EP4CE6E22. Later ones have an unidentified type that was considered a clone of the Altera one. First findings after connecting with JTAG: the IDCODE doesn't match. OK, tried some configuration with a simple program with OpenOCD. Didn't work. As a last resort I considered uploading the simple program to the flash rom of the FPGA. Before doing this I checked the contents of this flash once more: The contents is too short for a real Altera EP4CE6. Only 282866 bytes, 2.262.928 bits, where EP4CE6 expects 368011 bytes, 2.944.088 bits.

The conclusion is: the unknown FPGA is not a clone but some other FPGA chip..? For now my re-programming experiments end here.

Maybe someone has an idea about what actual FPGA chip the later model scope contains?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 17, 2021, 01:49:44 pm
Hi Maurits,

that is a disappointment. Maybe it is possible to find some information based on the jtag id you got from the device.

When it is some proprietary FPGA the chance of getting the programming software for it is very slim.

Well then we just have to do with what it is. My experiments are giving me some new insights. Before reading the sample data the command 0x1F needs to be written with some 16 bit data. This can't be random or fixed. When not sending the command the readout becomes very unstable and weird. When set to a fixed number the signal won't trigger. So it looks like some trigger point select in the buffer. Needs further investigation.

I uploaded the new calibration code to the repository. Also incorporated it in the simulator.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 17, 2021, 06:02:47 pm
I looked back in the thread to find the postings of tv84 about e FPGA. These are on page 25 and 27. It looks like he did not check the header of the uncompressed version, but only made an image showing the bit patterns.

The compressed version has the cyclone iv device id.

I don't know how the header is arranged, but looking at the bytes I do see the jtag id morris6 found.

FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
CC 55 AA 33 F0 00 00 06 18 00 6C 31 0B B7 C2 00 00 06 D1 00 05 00 E9 93 C3 00 00 06 D7 B0 4B B0
AF F0 C7 00 00 06 04 33 01 01 A6 53 C8 00 00 06 00 00 04 80 98 88 C1 00 00 06 00 1C 00 00 92 0D
C4 00 00 06 02 00 00 20 6B 60 F1 00 00 04 00 00 78 AF EC F0 04 33 00 00 B0 00 00 00 00 00 02 C0


Does this indeed mean they changed the design and selected another FPGA?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 18, 2021, 06:14:03 pm
Turns out the root of a lot of the scopes problems are caused by that special IC connected to the FPGA.

I don't know why earlier testing failed, when I used the FPGA commands for reading the samples directly, without the translation via the special IC, but I changed the code to do it without them and now it works. Also removed the translation of the volt/div setting via this IC, and that solves the occasional zeroing of the traces.

On earlier tests I could see the traces flash as a straight line on the bottom of the scope once in a while.

The tests I ran today showed that at random the readings form the special IC fail. The software then returns a zero, and when multiplying with this value the result is zero :-DD

Also found that the brightness translation is based on a simple formula: (brightness * 560) + 4000.

Another finding is that the FPGA command 0x0D is used for setting the sample clock. For the long time base settings in the original code this is always set with 2000, which seems to be equal to 50KSa/s. For the other time base settings the values go from 99999999, 39999999, 19999999, ..... 99, 39, 19, 9, 3, 1, 0, ... 0.
The zero value is for 200MSa/s.

This means it should be possible to select a higher clock for software/timer based sampling. But this needs to be tested.

The last thing I have to look into regarding this special IC is parameter 0x11. This is used for reading the sample data and has to do with the trigger point. Failure at this point will result in the trigger point not being on the correct spot, so I would like to get rid of this translation too, but it is a bit harder to determine the range of the input values, since it is read from the FPGA after a trigger has been detected.

So a bit more testing and researching to do.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 18, 2021, 07:32:16 pm
Investigation done. Had already noticed what it did in earlier investigations, but had forgotten about it :palm: Testing verified the earlier observation is indeed correct.

The special IC just shifts the input data 4 bits to the right and adds 2.

So here are two new test versions. One for the standard display and one for the shifted display. It still is a bit wobbly, but much better then before. Disconnecting the USB cable also helps :-DD

The baseline calibration is working, but the values are not saved to the FLASH.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 19, 2021, 05:09:52 pm
Trying to figure which FPGA FNIRSI could have used. The jtag IDCODE (18006C31) morris6 found does not help a bit. I wonder how many new players there are on the FPGA field. Found Anlogic and their Eagle series might fit the bill. But as per usual with the Chinese stuff not a lot of documentation can be found.

The Eagle-4 and Eagle-10 seem to be available in 144 TQFP package, but can't find the pin out for it  :palm:

Someone an idea on this?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AW on December 19, 2021, 08:54:41 pm
Hi :) Maybe this one?

AL3A Datasheet (https://www.semiee.com/file/Source10/Anlogic-AL3A10BG256.pdf)

AL3S Datasheet v1.6 (https://datasheet.lcsc.com/szlcsc/An-Road-Shanghai-Info-Tech-AL3S10LG144_C183192.pdf), v2.0 (http://www.anlogic.com/Private/Files/20190611135026194%E2%88%AEDS101_AL3S10_Datasheet_CN.pdf)

openFPGALoader (https://github.com/Icenowy/openFPGALoader)

DevBoard (https://aliexpress.ru/item/1005003437340807.html?item_id=1005003437340807&sku_id=12000025788954803&spm=a2g2w.productlist.0.0.1ee03422YS21kG)

'Alternative'  ;D  (https://www.yoycart.com/Product/658759346592/)


Or CPLD ELF-series? Like this:

EF1A Datasheet (https://datasheet.lcsc.com/lcsc/1811151640_Anlogic-EF1A300LG100_C134203.pdf)


ChiTu L board v3 (EF2L)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on December 20, 2021, 06:54:31 am
I have also found this:
https://github.com/mmicko/prjtang/blob/master/docs/architecture/bitstream_format.rst (https://github.com/mmicko/prjtang/blob/master/docs/architecture/bitstream_format.rst)

Family : AL3
FRAMES:1075 BYTES_PER_FRAME:257 (2056 bits) BYTES_PER_MEM_FRAME:1152 (9216 bits)

(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1354388;image)

And this:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1354394;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on December 20, 2021, 07:02:21 am
This pdf seems to contain instructions on programming "AL3A10LG144C7":
https://justanotherelectronicsblog.com/wp-content/uploads/2018/11/TD_User_Guide_V4.2_english.pdf (https://justanotherelectronicsblog.com/wp-content/uploads/2018/11/TD_User_Guide_V4.2_english.pdf)

And it contains this pinout:
(https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/?action=dlattach;attach=1354406;image)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 20, 2021, 07:12:09 am
Thanks to _AW and frenky :-+

I looked at the pin out in the datasheet _AW provided a link to, and it matches the Cyclone IV pin out, and with frenky finding the match for the jtag idcode makes it a match.

Not sure if the IDE found here can be used to make designs for it: http://dl.sipeed.com/shareURL/TANG/Premier/IDE (http://dl.sipeed.com/shareURL/TANG/Premier/IDE)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 20, 2021, 08:26:29 am
Another extra - ordinary challenge. And polishing your Mandarin(?) language skills.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 20, 2021, 08:42:39 am
The TD_5.0.3_28716_NL_Linux.zip file from http://dl.sipeed.com/shareURL/TANG/Premier/IDE (http://dl.sipeed.com/shareURL/TANG/Premier/IDE) does contain an architecture folder with files for the al3 series, so it looks like it should be possible to make designs with this software for this device.

Also a question if the provided license files cover this.

Have to see what it looks like, or is morris6 his post implying the user interface is in Chinese (Mandarin?) :-DD

Edit1: The software on linux is in English and needs to be started with ./td -gui
Edit2: The manual frenky supplied shows that the TD application can convert Quartus projects if the device is pin compatible. Should then be easy enough to get started by converting a simple Quartes design :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 20, 2021, 12:58:06 pm

Edit1: The software on linux is in English and needs to be started with ./td -gui
Edit2: The manual frenky supplied shows that the TD application can convert Quartus projects if the device is pin compatible. Should then be easy enough to get started by converting a simple Quartes design :)

Let's see if I can find my way in this new environment. And then try to upload to the JTAG. But first have a look at the manual before everything fails.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 20, 2021, 09:48:20 pm
First experience with TD IDE:

The English manual is for version 4.2, the version downloaded by me was 5.0.3 and there are some differences. Main one is the generate .svf output file is missing as far as I can see.

The .bin file that is generated in a first try-out attempt, to flash the flash, has the same length and structure as the original flash content. So that looks good. Uploading to the actual Flash ROM is for a later day.

Once more, a big thank-you to forum members _AW and frenky for pointing it out.

Edit: You also need to download the Anlogic_20220130.lic file, rename to Anlogic.lic and move it to the lic folder of your TD environment.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 21, 2021, 08:51:20 am
On the site with the TD program zip, there are two older versions. TD1812 is version 4.3 and TD1909 is version 4.6. Maybe these versions still offer the possible missing options, like Quartus conversion.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 21, 2021, 04:24:25 pm
Have to share this :-DD

How often can you do the same to get to what you need.

Code: [Select]
      pcVar16[10] = (char)uVar10;   //Start on 10mns/div
      set_fpga_trigger_timebase();
      get_short_timebase_data();    //Uses the normal capture system to get the samples and calculate min, max, etc.

      if (pcVar16[0x23] == '\0')    //Trigger channel
      {
        calculate_ch1_min_max_avg();
        iVar12 = DAT_8000278c;          //0x801AC04A   channel 1 buffer 4
      }
      else
      {
        calculate_ch2_min_max_avg();
        iVar12 = DAT_80002788;          //0x801AD7BA   channel 2 buffer 4
      }

      uVar13 = 0;
      puVar20 = (ushort *)(iVar12 + 0x14);
      uVar18 = 0;                       //max value
      uVar19 = uVar5;                   //0x0000FFFF  min value
      iVar11 = iVar4;

      //Determine min and max value
      do
      {
        uVar17 = (uint)*puVar20;   //Active channel sample buffer
        puVar20 = puVar20 + 1;

        if (uVar18 < uVar17)   //Get max
        {
          uVar18 = uVar17;
        }

        if (uVar17 < uVar19)   //Get min
        {
          uVar19 = uVar17;
        }

        iVar11 = iVar11 + -1;
      } while (iVar11 != 0);

      uVar15 = 10;
      uVar17 = uVar18 - uVar19 & 0xffff;                            //vpp
      *(short *)(pcVar16 + 0x26) = (short)(uVar18 + uVar19 >> 1);   //center value for trigger level 50%

This is part of the code to set the time base in the auto set routine. It calls the get_short_timebase_data() function to sample the data. Within this function, depending on the enabled channels,  the functions calculate_ch1_min_max_avg() and calculate_ch2_min_max_avg() are called. And what did the programmer do after the call of this function, based on the current trigger channel, he calls one of these functions again. But that is not it. No we are not going to use the calculated data, we are going to determine them again, but now in our own "walk through the samples" loop.

So the answer is three :-DD

I have to say that this auto set function tops the lot in how not to do things.

Still have to check on how they decide which time base setting to use, and how it can be improved upon.

Once that is done I need to fill in the measurements and FFT bit. Rework the picture and waveform view bit and look into improving the signal representation with either select-able averaging or some sinc function.

The story keeps on going :popcorn:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 22, 2021, 09:55:10 pm
About TD IDE version 4.3:

The Anlogic_20220130.lic file is also valid here, rename to Anlogic.lic and move it to the lic folder of the TD environment.

Quartus project .qpf conversion is possible, however it doesn't recognize Quartus .bdf board file, more or less as expected. It wants one or more HDL's as input. Pin planning is converted to the TD .adc format.

For now working with version 5:

.svf file generation: point 8.6 of the Chinese manual that comes with the package: Tools => Device Chain. After "Add"ing your .bit file an option box appears: Create SVF. On second attempt an "al-devicechain" folder was created in my work directory that contained the resulting .svf. With the .svf creation there is an option to "verify"...!

My setup with OpenOCD and USB-Blaster is failing for now. A pity, no sigar!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 23, 2021, 10:21:26 am
To get the auto set functionality working I did some tests that were not so successful :( I decided it is time to clean up the code first and then write a more proper auto set function, and also tackle the zero offset calibration.

Leading up to this cleanup I tried one other thing with the new found knowledge of the system. I discovered that the FPGA command 0x0D is for setting the sample rate and allows for lower rates then the 2KSa/s found earlier, so for the 100ms/div and 200ms/div settings I tested with 1000Sa/s and 500Sa/s, and these work. This makes it a bit easier to get a first release of the new firmware done.

Added the two sample rate settings to the menu.

For the sample rates 5KSa/s - 500Sa/s I believe the trigger system is not functioning, because it is not keeping the signal in its place, so have to work on that too. In the original the top and right trigger pointers are not shown when 20ms/div or 50ms/div are selected.

Next couple of day's will go into the cleanup and re-write of the sample functions to allow for easier and better implementation of the calibration and auto set functionality.

The picture shows a 1Hz sine on channel 1 and a 2Hz sine on channel 2 at 1KSa/s and 100ms/div.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 25, 2021, 09:55:19 am
About reprogramming the AL3A10 FPGA:

Since I would like to save the original FPGA configuration data in the flash rom, I was looking for another JTAG setup, other than the USB-Blaster that has a very high speed, it is ready in 0.2 seconds..! The TD IDE is using an Anlogic programmer with clock speed selection. The Anlogic Github page has the design:

url=https://github.com/AnlogicInfo/anlogic-usbjtag (https://github.com/AnlogicInfo/anlogic-usbjtag)

And also on the website of Anlogic Google found an AL3A Demo board, schematics and demo projects.

http://www.anlogic.com/down.aspx?Id=14&TypeId=14&fid=t14:14:14 (http://www.anlogic.com/down.aspx?Id=14&TypeId=14&fid=t14:14:14)

This programmer is based on a STM32F103 chip. However, it doesn't have a level translator for the 2.5 volt programming that the Fnirsi board uses. Next week I will receive a "Blue pill" STM32F103. Thinking of adding a 74LVC125 to the design.

Something is funny about the Anlogic programmer schematic. It looks like they are combining some pins of the MCU to create the TCK,TMS,TDI and TDO signals, also a SPI_CS is going from one pin to another, both schematics show this. It's also visible on the picture of the Demo circuit board. Pins are used with pullup activated..? Or are some resistors "not placed"?

I tried the design on a F103 demo board I had in my junkbox. After installing the Anlogic USB driver, this board was recognized by the TD IDE. But that board contains other stuff on some of the pins. Guess what..? It didn't work. So some patience is needed before I can continue my experiments with a Blue pill instead.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 27, 2021, 05:37:00 pm
I have been working on the cleanup and had a version with calibration, 50% trigger and the settings on the SD card instead of the FLASH, to make it more a stand alone firmware, free from the original code, but I'm still not happy with the result.

There is seemingly to much noise in the traces of which I'm not sure if it is actual noise or the difference between the two ADC's not being handled correctly. On the simulator the traces look spot on, so the logic seems to be correct. But simulator is not real hardware ::)

Also looked deeper into the auto set and have ideas on how to improve this. Noticed on the original box that when the input frequency is below ~10Hz (for sure at 1Hz and 5Hz) it fails in getting the sensitivity setting correct. Have to sample at different sample rates to come to a proper sensitivity setting. This makes the process possibly longer, but only if the system is not sure about the readings. By using the frequency of the input signal, which is going to be determined within the sample reading loop, the correct sample rate can be set.

So it keeps being a work in progress :popcorn:

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on December 28, 2021, 01:11:38 pm
About the AL3A10 FPGA:

Finally some progress. A fresh Blue-Pill board flashed with Anlogic's "Flash.bin" gets recognized by the TD IDE. Connecting this to my improvised JTAG connector with an 74LVC125 level translator in between makes it possible to re-configure the FPGA. Configuration takes a few seconds and is succeeding where my earlier trials with OpenOCD and a USB-Blaster were failing.

To load your .bit file via JTAG in the TD IDE:
- open download function
- click 'refresh' to find your chip
- select your .bit file
- click 'run'

To load an .svf file in the TD IDE:
- open Tools => device chain
- click your target in the chain to detect it
- click 'program svf'
- browse to your svf file
- click 'program'

Comparing this setup to the schematic I found earlier: maybe this was part of a more extensive programmer that contained other functions. The second set of signals is not needed for JTAG. For now this setup is working for me.

Attached a schematic of my setup and, for your convenience a copy of Anlogic's "Flash.bin" (renamed to .txt to be able to post here).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 28, 2021, 03:33:40 pm
I did some testing on the calibration stuff. Made a capture of several sample buffers for varying volt per division and DC offset settings and noticed that on my second channel the difference between the two ADC's is bad. At max a difference of 11. For channel 1 this is only 2.

It also varies with the level of the offset. When the offset is on the low limit found in the original software (200) there is no difference. The inputs will be out of range. The same for the upper limit (1500). Changing the sensitivity does not make a big difference. Just a single bit. But over the working range of the DC offset it varies from minimum 6 to maximum 11.

So might have to settle on some average between these limits.

Still need to run some tests on the different sample rates to see what happens then. A bit strange is that it looks like the original code is doing the difference measurement with the DC offset on 200. This is what my version does and that possibly explains why it fails.

Attached pictures are made with a mod of my signal analyzer code. It allows me to step through the different sample buffers with the arrow keys.

Tests like these provide a better insight in the working of the hardware. Some other tests I need to do are to figure out how the trigger point determination works and if it is possible to get proper trigger on the 200ms/div to 20ms/div settings.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 28, 2021, 03:43:46 pm
Maybe some of the people interested can do a capture to provide more data. Attached is the package that makes a file on startup.

It creates a 1.8MB file called calibration_data.bin.

Can be copied from the SD card by using the scopes USB connection mode.

The second attachment is the linux program I used to look at the captured data. The calibration_data.bin file needs to be in the same directory. Remove the .txt extensions

The source code for this program will be uploaded to the repository after dinner and the dishes :).

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AW on December 29, 2021, 12:02:33 am
"Attached is the package that makes a file on startup."

how to, pls)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 29, 2021, 05:48:58 am
Hi _AW,

first of all welcome to the forum.

The procedure to load the test package onto your scope is described on page 45 and more specific this message: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689)

The full set of step is only needed once. When the SD card has been prepared it only takes the umount and the dd command to load a new package. (Steps 7 and 12)

See this message: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3809966/#msg3809966 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3809966/#msg3809966) for more details on how to load and unload after the SD card has been prepared.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ded on December 29, 2021, 05:07:23 pm
Hello pcprogrammer,
thank you for your excellent work.
I read along very interested, but unfortunately can not contribute much.
Therefore, I have now taken the opportunity and provide you with the calibration data.

Unfortunately the evaluation program does not work with me (Ubuntu 20.04).
Code: [Select]
X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  73 (X_GetImage)
  Serial number of failed request:  20
  Current serial number in output stream:  20

Greetings ded
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 29, 2021, 05:38:54 pm
Hi ded,

welcome on the forum, and thanks for the uploading the data.

The error message the program on ubuntu gave probably has to do with the size of the display. I'm working on a system with two 2560x1440 displays and when I try to use X_GetImage with sizes that are bigger then a single display I get the same error.

I will check the data you provided.

Thanks,
Peter

Edit: Yours is not as bad as mine. The second channel is also worse then the first, but the max I noticed is -7 and min -5. Channel 1 has 3 and 1.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AW on December 30, 2021, 04:34:32 am
Hi pcprogrammer. Thank you!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 30, 2021, 10:26:20 am
Hi _AW,

thanks for the data. And with this we have a winner :-DD

Your scope has the touch panel with the extra scan lines. So your flash backup can give some insight what is done there.

The calibration data of your scope also shows the second channel having a higher difference between the two ADC's, so might this point to a problem in the PCB design.

Min and max for channel 2 are 6 and 13, but the 6 is only near the top. For the wider range the lowest is 10. Channel 1 has -1 to -3.

Thanks again,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on December 30, 2021, 01:30:56 pm
Hi, my data.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 30, 2021, 02:22:43 pm
Hi Alex62,

thanks for the data. Yours is a bit better. Channel 2 also a bigger difference then channel 1, and the latter a bit bigger then the other data so far.

Channel 1 min, max: 3, 6
Channel 2 min, max: 6, 8

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on December 30, 2021, 05:48:29 pm
My data is attached.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 31, 2021, 09:24:23 am
Hi frenky,

thanks for the upload.

In your scope channel 2 also has a bigger difference then channel 1.

Channel 1 min, max: 0, -2
Channel 2 min, max: -1, -6

Based on the data seen so far it looks like a single compensation value is not good enough. Have to do some more tests with external applied DC voltages, to check if this spread is then also seen. If so full translation tables might be needed. For the 6 input ranges (the 50mV one is software zoom) and 4 ADC's it means 6KB, which is no problem in the DRAM nor the SD card. The problem is that I also noticed that it differs with a change of the sample rate. There are 18 of these, which would make 90KB. Not a problem space wise, but calibration will then take quite a while.

Another experiment showed that with the lower sample rates (for 200ms/div - 20ms/div) it is possible to have the FPGA return 1500 instead of 750 samples per ADC. Capturing a buffer doubles in time, but for me that is ok. Also noticed the command 0x14 returning data that might be usable to have the signal look triggered.

Needs more testing to have the top pointer match the right trigger level pointer. One thing is for sure, I'm getting to know the system better and better :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on December 31, 2021, 12:38:08 pm
I look forward to seeing any new development. :)

Can you please tell me something...
Yesterday I have put your .bin file that made calibration data file...
Do I have to flash my scope again with your firmware so that new code that generates calibration file does not run every time I turn on scope?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 31, 2021, 02:47:51 pm
Hi frenky,

all you have to do is this

Code: [Select]
//Connect the scope to the computer and enable USB  (MENU -> USB Connection)
//Un-mount the partition. Make sure the scope is connected to /dev/sdc. Can be checked with lsblk command.
sudo umount /dev/sdc1

//Un-load the package
sudo dd if=/dev/zero of=/dev/sdc bs=1024 seek=8 count=1

A while back I found the option to load the new firmware from the SD card and leave the FLASH as is. The next test release will store it's settings also on the SD card, making it completely free from the original firmware. Also easy with updates. Just write the new package to the SD card with these commands.

This also applies for loading a previous version of my firmware. Soon I will add version info to the main menu.
Code: [Select]
//Connect the scope to the computer and enable USB (MENU -> USB Connection)
//Un-mount the partition. Make sure the scope is connected to /dev/sdc. Can be checked with lsblk command.
sudo umount /dev/sdc1

//Load the package
sudo dd if=fnirsi_1013d.bin of=/dev/sdc bs=1024 seek=8


And when not happy with the way it works remove it again with the first set of commands.

Edit: I did not read your post correctly. The answer is yes, to get rid of the writing of the calibration file at startup load a version that does not do this.

For now I wish, everybody a good ending of the year and a happy 2022.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 02, 2022, 01:54:13 pm
I made a new version with different calibration.

It is now no longer using the DC offset like the original to move the traces on the screen. The plan is to add a DC offset setting to the channel menu. Setting this will then move the trace on the screen, but not the trace center pointer. This allows for full ADC range to be on the display when wanted.

Also changed the sample rate and time base settings to be able to get bigger buffers and triggering on the 200ms/div - 20ms/div setting. For it to trigger "stable" it seems to need a couple of periods of the signal. Have to do more research on this point. On 200ms/div - 50ms/div it takes a while to refresh.

The settings are read from the SD card, and when not there, it uses a default set. On power off it writes the settings to the SD card.

Still not to happy with the ADC difference compensation, so like to hear feedback from you testers.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 02, 2022, 05:06:03 pm
To overcome the multiple firmware versions for the different displays I made a change to the boot loader and the display configuration.

On the SD card sector 710 can hold a display configuration for the different displays. When not there the firmware will use the default setting, but when it is there and valid it will use that setting.

For the people with a shifted display in their scope it is only loading this configuration file to the SD card and every new firmware will make use of it and display at the correct position.

Need to fix a couple of other mistakes before a new release. Noticed that the calibration data is still reset with default test settings. |O

But that is for another day. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on January 03, 2022, 12:22:53 pm
Hello.
100 Khz synchronization on video.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 04, 2022, 01:04:06 pm
Here is a new version.

Fixed the issue Alex62 found. The trigger level in the FPGA is now conform the level on the display. Added something the original lacks. When switching between the two channels in the trigger menu, the trigger level pointer stays where it was, unless the auto 50% trigger is enabled. In my version it moves to the selected channel. Still have to improve here on volt per div selected, to make the trigger level actual volts related.

Also modified the calibration code to do less relay switching. Previous version selected a sample rate setting and went through the 6 sensitivity settings to do the sampling and then do the next sample rate. Swapped these two, to do the different sample rate readings on a sensitivity setting and when both are done select the next sensitivity.

Due to how the hardware works, it is not perfect, and almost impossible to get it to be perfect. It turns out that changing the other channel sensitivity changes the input center level. Might be a power supply issue and related to the changing load when a relay is switched on or off.

Going to leave it at what it is and move onto the next bit of the code. Auto set.

This new package is based on the display mod I posted about earlier. The people with shifted displays need to put the display configuration on the SD card.

Code: [Select]
//Setup the scopes USB connection
//See where the device is connected and use that in the below commands. Mine always pops up at /dev/sdc
//This is needed for dd to work properly
sudo umount /dev/sdc1

//This puts the config data in sector 710
sudo dd if=shifted_display_config_sector.bin of=/dev/sdc bs=1024 seek=355

The configuration data consists of two 32 bit markers, the two 32 bit settings, two 32 bit markers and a simple 32 bit checksum. When changing the settings it is needed to re calculate the checksum, by just adding all the 32 bit values. The data order is LSB first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on January 04, 2022, 01:17:01 pm
The data order is LSB first.

Nitpicking Peter: LSB or little endian?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 04, 2022, 01:49:02 pm
The data order is LSB first.

Nitpicking Peter: LSB or little endian?

Least significant byte first, mark the big letter B, is little endian according to wikipedia, so to be specific, yes it is little endian. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 05, 2022, 07:28:58 pm
Ran into a bit of a snag.

Coded frequency calculation and it works reasonably well on the simulator, and also on the settings up to 500ns/div on the real hardware, but it goes sour when going up to the 200ns/div - 5ns/div settings. According to the time cursors the frequency is correct when the cursors are positioned on the zero crossings, but the by code determined frequency is to low. And goes down with every next time per div setting.

This means I have to figure out what the hardware does on these time per div settings.

For the auto set function it does not matter, because on the 200MSa/s - 500ns/div setting it is possible to determine frequency from ~70KHz up, so with a single measurement it can do a large part of the ranging.

But it still has to wait until this snag is solved :palm:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: m3vuv on January 06, 2022, 08:32:11 am
In a not at all bandwidth related exercise I tested the 1013D's battery life.

It ran continuously for 6 h 45 m while monitoring two phases of a 4-phase stepper motor being accelerated and cycled clockwise/anticlockwise over a 270° sweep, pulse frequencies 7 to 44 Hz...

Pretty damned good, first thing I've tested that bettered the claimed spec. It took a 3½ hours to recharge at 1.8 A tapering to 0.3 A over the last ½ hour...

Aligns with what I have found.

Turn it on, forget that it is still running, go back two hours later, still plenty of power.  Would be a good in-the-field device if they could improve the UI and accuracy.  (Still limited by triggering options, capture depth, etc. – so not going to replace a 'real' portable 'scope for some applications.)

Plug it in to a PC or what have you, and it's fully charged very quickly.
Talking of chineese user interfaces,i have a hp 54503A scope,the on off/power switch is at the rear and not on the front panel,total ass to have to reach over the workbench to even turn it on! WTF!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 07, 2022, 02:02:53 pm
Managed to resolve the snag with the frequency computation and code an auto setup routine.

It works well in the simulator, but with the changed DC offset setup, it needs to check if there is a DC offset in the signal, and if so switch to AC mode. I still have to implement this. This also means I have to modify the simulator to be able to filter the DC component. I skipped that while writing the simulator.

Fixed some other small issues with the trigger channel, like when the channel that is the trigger source is turned off, the trigger channel was swapped in the hardware, but not on the display.

A bit of a problem with the way the whole project came together. Without a clear design and a hard to crack black box, the code turned into a bit of a mess. Removed a lot of the rubble already, but the code can still do with a polish, and it still needs a rewrite of the whole waveform and picture view part.

When that is finished it is getting there, but still needs a lot of work to implement the FFT, measurements and what else that is missing.

At least the new code can easily be adapted to a new FPGA design.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on January 07, 2022, 07:23:04 pm
AUTOSET - sine good. Unipolar meander on video.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 07, 2022, 08:30:54 pm
Hi Alex62,

thanks for the video and the testing, but the version you have does not have the proper auto set functionality. It has part of the original reverse engineered code which is not very good. Might even skip the time per division setting al together.

I did test the new version on my hardware and I'm very pleased with the result. For frequencies above 75KHz it is very quick. Worst case it does five captures. 1 to set the sample rate and time per division and 2 per channel to determine the volts per division. For frequencies between 750Hz and 75KHz it needs an extra capture for the time per division determination. The volts per division ranging can then become a bit slower, because it is done on the determined sample rate set for the channel that is the trigger source. This means that for the even lower frequencies it can at worst case be very slow. It does a third capture for the frequency determination and again the volts per division ranging is done on the now set sample rate, which might even be the 500Sa/s. This means 6 seconds per capture.

The volts per division determination is done by doing a capture at 500mV/div. The resulting peak to peak measurement is used to divide a maximum screen range the signal can use, and this results in a value that can be used to match the ranges including the 500mV/div and below. So if the signal is within this range it only takes one capture. If it is out of this range it does a second capture at 2.5V/div. The same calculation is applied and the correct setting can be determined.

The maximum screen range depends on if only one channel is enabled or both channels are enabled. For only one the signal center is placed on the center of the screen and the signal can use 7.8 divisions. When both are enabled channel 1 is placed in the top section and channel 2 in the bottom section. Now the signals can only use 3.8 divisions.

All that is needed now is a check on the DC content in the signal. I have to think about what is the best way to handle this. Either always switch to AC, or if it is small enough, stay in DC mode and shift the signal center to allow the signal to be displayed properly. Or just leave it as is and let the user deal with it, when auto set more or less fails.

Happy to hear your thoughts on this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 10, 2022, 12:13:13 pm
Just a short update.

Working on the picture and waveform saving and viewing. Decided I did not like the original thumbnails and made my own version of it.

Like to hear if this is for the better or not.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ded on January 10, 2022, 08:32:22 pm
Hi, I think it's better.  Above all, the visible numbering is great.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 11, 2022, 05:06:13 pm
Another update.

finished the picture viewing part and polished the looks of the user interface a bit. Was not pleased with the buttons not being buttons, so modified most of that.

The new setup works with two directories. "\pictures" and "\waveforms" Was thinking about a no limits system, but with FatFs the needed code to step through pages of view items would be a pain in the bum. Going forward not that bad, but backing up a page would mean start at the beginning to find the first item of the requested page. So I reused an adapted version of the original code.

The original uses two fixed length files. One for the list with file numbers, and another for the thumbnails. I modified this to use only one file that grows with the number of saved items. It is still loaded into memory to be able to step through the thumbnail pages, which is why I limited it to the originals 1000 items per type.

The code for handling the items is for a large part the same for both types, so getting the waveform view working is not a lot of work. Need to adapt for the new sampling setup.

Once that is done, I still have to get the X-Y mode working again. Also needs to be adapted to the new sampling setup.

It will be a couple of day's before a new test release. This one will have a version number, which can be seen in one of the screen captures. Per advise of morris6 I placed it underneath the battery icon.

At some point I will setup a new github repository for just the new firmware. The reverse engineering and hacking is past tense. From now on only new code.

The picture view screen shows the file name in the bottom menu bar. As in the original this bar can be tapped away and back again by tapping outside of the button area.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: RolfNoot on January 12, 2022, 07:20:24 pm
Thanks for the excellent work!

I'm an owner of this scope, can I get a recap on the current state of the firmware without having to read 50+ pages? I've got some questions:
- is it worth to update the firmware yet over using the factory firmware
- if yes, what are the advantages / disadvantages
- is the upgrade process easy

Cheers,
Rolf
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2022, 08:29:41 pm
Hi Rolf,

the state of this new firmware is still very alpha. Would not recommend it for real usage yet.

The advantages are that it is fully open source, responds faster and is non fictional in what you see on the screen. Also a lot of the errors found in the original firmware are fixed. It does not hang when switching back from USB connection and what more.

It is different in comparing with the original that it uses separate sample rate and time per division settings, uses 3000 instead of 1500 samples per capture and got rid of the roll mode. It allows a time per division range of 200ms/div to 5ns/div.

The upgrade process is quite easy. See: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689) for the basic steps. These are only needed to prep the SD card and get it up and running for the first time.

Also take a look at these post for more info:
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3809966/#msg3809966 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3809966/#msg3809966)
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3908555/#msg3908555 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3908555/#msg3908555)
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3917249/#msg3917249 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3917249/#msg3917249)

It does not interfere with the original code and the scope can easily be restored to the original state, as you can read in the above mentioned posts.

It will still take a while to get the rest of the needed features into this new firmware.

Only the last couple of pages (page 45 and onward) tell about the development of the new firmware. Everything before that is about the reverse engineering of the original code. It tells a story of how much time it takes to do a project like this, and how frustrating it can be.

It would be great if you are willing to do tests on the new alpha release. I hope to get it done in a couple of days.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: RolfNoot on January 12, 2022, 08:55:13 pm
Sure, I am willing to do tests.

I like this scope a lot regardless the buggy Chinese firmware. I own several oscilloscopes (Agilent, Rigol) and find this neat one very handy to use. Not for fast precision measurements of course but just for a quick measurement without having the hassle of plugging it to a wall socket and waiting a long time to boot.

Good to hear lots of errors are fixed. Will keep an eye on this topic!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 13, 2022, 06:14:21 pm
Again a short update.

The waveform view part is implemented and working. Had to add a bunch of checks to disable changing scope settings that more or less need to stay what they are. Think of the trigger channel of trigger edge. The capture has already been done, so it will not make a difference. By disabling the changing of these settings it is clear what they were at the time of the capture. The menus show this by making the not selected options grey instead of white.

Also added the filename of the waveform being viewed to the right corner on the signal part of the screen.

Changed the file format too. Only the needed settings and the two trace buffers are saved. There is a version number and a simple checksum to safeguard it from a wrong file. Error messages are shown in that case, and the corrupted file is deleted.

Also thinking about allowing the volts per division setting to change when in stop or waveform view mode, to allow software zoom.

Next up is the x-y mode display. When that is done I will release a new test version. Then still a long list of to do items to work through, but the end is nearing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on January 13, 2022, 08:05:27 pm
Hi, Peter.
So far, everything is very good, a small problem with synchronization. When the frequency increases above 1 MHz, an offset from the set value occurs (shown in the photo). Thanks for the work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 14, 2022, 06:06:03 am
Hi Alex62,

thanks for the testing. This shift in the trigger position is something I have noticed before, but have not investigated it properly. It is a tricky one, because it has to do with the FPGA.

I noticed that you have build your own executable based on the repository. The V0.001 below the battery is the giveaway :)

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: JimBeam on January 15, 2022, 02:34:10 pm
Hi Peter,

I'm new to this group, I just got my FNIRSI (what a name...) a few days ago - and as always I could not keep my fingers from messing around with it (don't turn it on, tear it apart!)

The first thing I always do in this case is to look into eevblog to see if anyone has already done some investigations, and in most cases I'm lucky, and this time too  ;D
So a big THANK YOU for your work to change this little beauty into a real gem!

Next thing - especially if someone has made a replacement firmware - is to test that and poke around in the source code.
While doing so I found a small bug: if channel 1 is turned off, then the AUTO-SET function does not work.
And because of my poking I also found the solution: it can easily be corrected by just changing a '1' to a '2' in 8th line in the function scope_do_auto_setup() in scope_functions.c ...

Currently it reads:
Code: [Select]
uint32 dochannel1 = scopesettings.channel1.enable;
uint32 dochannel2 = scopesettings.channel1.enable;

where the second line should better read

Code: [Select]
uint32 dochannel2 = scopesettings.channel2.enable;

I also guess how that happened - I only say: copy line...

Did not do a pull request, as it is such a minor change, and there is a new repository on the way anyway.

Andreas
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 15, 2022, 02:50:08 pm
Well here it is. A new test version. Since Alex62 already tried the V0.001 version I made it V0.002.

The item view part is finished and tested to some extend. Both picture and waveform viewing is working. Did not test the picture file on a windows os, but it does work on linux. It no longer has the signal data embedded. It is just a picture. The waveform file format has been simplified and only holds the needed settings and the raw sample data.

Look in the source code to see what data is where in the waveform files. It is in the scope_functions.c file.

Check these functions:
Code: [Select]
void scope_prepare_setup_for_file(void);
void scope_restore_setup_from_file(void);
int32 scope_check_waveform_file(void);

void scope_save_view_item_file(int32 type);
int32 scope_load_trace_data(void);

The X-Y mode is also working with the new sample capturing.
Auto set is working reasonably well. Only when large DC components are in the signal it will screw up. (With the fix from the previous post. Just in time :))
50% trigger is also working, but the always setting needs a filter. The pointer on the right side of the screen is jumpy.
It is now possible to do vertical zoom when sampling has been stopped. This is also the case when viewing a waveform file.
Made most of the buttons be actual buttons with changing background color when touched. Also changed the voltage per division menu to show the channel color.
Triggering is more stable, but still has the position offset Alex62 pointed out.

I changed the settings data stored on the SD card. It now has a version number and a checksum. On failure it loads a default setup. This means that after installing this version a baseline calibration needs to be done.

Even though it is not finished, I'm going to take a break of the software and play with hardware. Bought a Dake Elec FA201 board to play with. Have to hook it up to a lichee nano and wire-up a jtag board like morris6 made.

So have fun with this test release.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 15, 2022, 02:58:50 pm
While doing so I found a small bug: if channel 1 is turned off, then the AUTO-SET function does not work.
And because of my poking I also found the solution: it can easily be corrected by just changing a '1' to a '2' in 8th line in the function scope_do_auto_setup() in scope_functions.c ...

I also guess how that happened - I only say: copy line...

Andreas

Hi Andreas,

you are welcome, and thank you for finding the bug. It is one of these things I tend to have more of now a days, as you can read in this thread. (Copy, paste, not edit |O)

It was just in time. Already wrote my previous post with a buggy version attached, but got a warning an other post was made in the mean time ^-^

Enjoy this new version and see if you can find more errors.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: JimBeam on January 15, 2022, 04:15:55 pm
Thanks Peter,

I will definitely enjoy the new version. Would you mind uploading the latest changes to the git?

Andreas
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: RolfNoot on January 15, 2022, 04:34:01 pm
Just had a little hassle with setting up the sdcard. Turned out the card in the scope was formatted with FAT16 (1GB). I had another card laying around so I decided to use that one and keep the original untouched. I made use of a USB cardreader to format the card.

As I am using a MAC, I tried to format with MAC Disk Utility which didn't work. Then I tried DiskGenius on my Windows VM and I was able to make a partition as required (Beginning Sector 2048, see attachment).

Next I followed the steps 11..17 to install the firmware bootloader https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689)

The (un)mounting process is a bit different for MAC Terminal. First I needed to check which device the card is on (check using Disk Utility or the following Terminal command):
"diskutil list external physical" (turned out mine was on /dev/disk8)
then
"diskutil unmountDisk /dev/disk8"
and using the dd command on MAC Terminal just as on Linux:
"sudo dd if=/location_of/fnirsi_1013d_fwb.bin of=/dev/disk7 bs=1024 seek=8"

Next the bootloader showed up and I was able to upgrade!

The first impression is that it looks much better, no weird slow refresh rates and an extensive ACQ setup menu. Super, thanks so much!!  :-+

Rolf
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 15, 2022, 05:27:28 pm
The new repository is created and loaded with the latest version.

https://github.com/pecostm32/FNIRSI_1013D_Firmware (https://github.com/pecostm32/FNIRSI_1013D_Firmware)

There is a read me with what is needed.

I added the bare SD boot loader with which the firmware can be loaded without the startup screen. Makes it a little bit faster. I have not tested it, and it is not in the make file of the scope firmware. So if you want to use it you have to do some fiddling.

The three project option is in the make file, and the already build binaries are in the dist folders.

To rebuild things it has to be done in the given project list order.

That is it for now.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on January 15, 2022, 06:15:55 pm
The new repository is created and loaded with the latest version.
Maybe you could add a Signature in your Forum Profile with this info?
Keep up the good work!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: morris6 on January 18, 2022, 08:24:08 pm
For those forum members working (fighting) with the Anlogic TD-IDE to get access to the al3a10 FPGA:

The name of the license file I linked to earlier is Anlogic_20220130.lic. This name suggests a limited validity up to the 30th of Januari. Looking around in the Sipeed.com download area I found another license file Anlogic_20220703.lic. Maybe this one is valid somewhat longer. Again, rename this file to Anlogic.lic and move it to the lic folder of your TD-IDE environment. It works for me.

Anlogic.com also has a support area with downloads. (Google translate) The registration form however is an obstacle, it looks like they are asking a Chinese telephone number to register....? So for now, big thanks to the firm of Sipeed for providing support to 'bloody foreigners'.

For your convenience find the license file attached here, the .txt extension added because forum rule.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 19, 2022, 12:09:23 pm
My board for playing with the Anlogic FPGA is taking shape.

Had to get the schematics of the FA201 board at first, so left a message in the shop I bought it from, but in the mean time started to reverse engineer it. I did get the original schematic when I was almost finished with my version. I have attached them both.

Made a symbol and footprint for this module in EasyEda and also a project for the test board. I find it easier to solder a test board by looking at a graphical representation of the connections then working from a net list.

The board can accommodate an AD9226 ADC and an AN9767 DAC module which I both bought on Aliexpress.

Next up is soldering al the needed wires. That will take a bit of time. Also have to make the JTAG programmer morris6 wrote about earlier and a board for interfacing the Lichee Nano 40 pin LCD connector with the 50 pin LCD panels I have. The LCD panel needs extra voltages like in the scope itself. The test board also has a connection for a touch panel, so when finished I can reuse parts of the firmware code.

One can say that the last year was a big prelude to this kind of projects, but still a lot of learning to do on FPGA design.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 19, 2022, 07:59:59 pm
I build the Anlogic JTAG programmer based on morris6 his schematic and at first I had the Tang Dynasty application fail with a segmentation fault every time I tried to scan for a device. Turns out it needs the proper permissions for the USB device.

To test it I ran the application with sudo and with the wanted result. It is able to read the FPGA identifier without crashing. This means I have to setup a dev-rule for it. (I'm using Linux Mint)

The USB device lists itself as: 0547:1002 Anchor Chips, Inc. Python2 WDM Encoder

Attached some pictures of the module I made for it.

Edit: I attached the udev rules file I made. After placing it in etc/udev/rules.d a logout and login is needed to enable it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 21, 2022, 07:40:14 pm
Soldering these test boards is a lot of work.

Yesterday I did the power connections on the main board and started with the design of the LCD connection board. A bit of focus was needed there, since with these adapter boards for converting 0.5mm FPC to 2.54mm headers the pins are swapped. 1 becomes 2 and 2 becomes 1, etc.

Last year I already ordered a lot of the needed stuff from aliexpress, including a step up converter with plus and minus 15V output. This because the LCD needs about -6V on one of its pins and 15V and 10V on other pins. Used what I had lying around zener diode wise to make the lower voltages, more or less like what is in the FNIRSI-1013D.

It looks like it is working, but did not get actual intelligent output on the display. When I turn on the Lichee nano with what is in the flash I get a white screen, that turns off an on again at some point and then stays white. Tried a SD card with my scope firmware, but that just results in a black screen. So it needs some investigation. I tried the display in the scope itself and it still works, so that is a plus.

Also need to power the board from a proper 5V supply. The 5V coming from the Lichee nano, at least with the cable I'm using, is only 4.7V. This has some effect on the 15V and 10V output. The measured voltages are ~0.6V lower than in the scope. I'm not sure if this is a problem for the LCD.

Hope to finish the other soldering tomorrow, but this means soldering about 80 lacquered copper wires, which is quite a bit of strain on both the back and the eyes.

Edit: The problem lies in the brightness control on the Lichee nano. Port pin PE6 is used to control the brightness, and in the scope firmware this pin is used in communication with the FPGA. Come to think of it, the scope code checks on the FPGA returning a valid response, which it does not get, so it will not start any way. This means I have to create another project to run on the Lichee nano.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 22, 2022, 02:04:11 pm
It took quite a bit of tinkering to get the display to work.

First I had to make a startup with fel for the lichee nano. A copy of the one for the scope without the FPGA and loading of the flash "FNIRSI" startup image code. Then I made a copy of my new startup screen also without the FPGA code. When loaded onto the lichee nano I could see that the display became a bit more white, but it did not show the startup screen.

So I got the Rigol out of the cupboard and started to measure the signals. All the dynamic signals looked good. Clock, sync and enable signals. Measured the signals on the actual 0.5mm FPC connector to make sure they were on the correct pins. I then turned to the passive signals and noticed that the derived voltages were to low. Opposed to the scope I changed the circuit to have the zeners in the "normal" position with a series resistor to drop the voltage over. Turns out the LCD draws more current then I expected. (I don't have a datasheet of this LCD panel) Without the load the voltages were as intended. Modified the board to mimic what is in the scope and now it works.

Finally I can move on to the soldering of the other board :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 23, 2022, 06:42:23 pm
Since I'm in favor of sharing my work I created a new repository for the Lichee Nano projects.

https://github.com/pecostm32/Lichee_Nano (https://github.com/pecostm32/Lichee_Nano)

It holds both hardware and software. A lot of the FNIRSI code is reused, but on the Lichee Nano - Dake Elec FA201 board I had to skip a couple of port E pins since they are used for controlling things on the Lichee Nano board itself. So for this I had to change the fpga_control.h file. Also had to remove a useless ic on the Lichee Nano. The resistive touch panel controller that sits on the underside of the board, but is missing on the schematics I have. It is I2C and was connected to pins PE11 and PE12.

For testing the stuff morris6 is doing I made a simple CH340 emulator that allows sending simple commands via a terminal. These commands control the communication with the FPGA. Had to make an adapted version for the Lichee Nano, and I'm pleased to say it works.

After already a year of tinkering with the FNIRSI-1013D it is nice to play with other stuff for a while, even if it serves the same purpose. Getting an improved scope.

And by the looks of things it seems I did a good job on the new firmware so far. No complaints yet. :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Mark963 on January 24, 2022, 10:54:52 pm
I'm afraid I'm kind of an old fart trying to figure out how to load any of this firmware. I saw comments about it only being for 8GB cards. I opened mine up and found it has a 1GB micro sd card. I have other 4, 8 and 16GB cards. Is there some way to use one of them to update the scope?

Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: TiredOldDad on January 25, 2022, 02:26:43 am
Hi, new here. I was looking for info about this oscilloscope which I plan to buy for checking stuff around the house (utility power, UPS, and portable generator outputs, etc.) My search took me to this forum and I'm glad it did.

I've started reading through a few pages but I've hardly scratched the surface as the information is overwhelming. Is there like a Wiki for this instrument where information about things like usage, capabilities, limitations, hacks, etc. are structured?

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 25, 2022, 05:49:06 am
I'm afraid I'm kind of an old fart trying to figure out how to load any of this firmware. I saw comments about it only being for 8GB cards. I opened mine up and found it has a 1GB micro sd card. I have other 4, 8 and 16GB cards. Is there some way to use one of them to update the scope?

Thank you.

Hi Mark963, welcome to the forum.

To try the new firmware all that needs to be done is load it on a SD card. The only constraint is that the card needs to be partitioned correctly.
I only tested it with FAT32 formatted cards, but it will most likely also work with FAT16. The firmware needs some free space at the beginning of the card. 1MB is sufficient.
So partition a card with a single FAT32 partition that starts on sector 2048.

This is described in the readme file in the repository https://github.com/pecostm32/FNIRSI_1013D_Firmware (https://github.com/pecostm32/FNIRSI_1013D_Firmware)

The scope can be used to act as a card reader/writer to do the work, but a dedicated card reader/writer can also be used.

Once the card is written with the firmware the scope should start with it.

Having it on a separate SD card makes it easier to switch between the original and the new firmware, but involves opening the scope.

The new firmware is not that different in usage compared to the original. It is not finished yet, so features like measurements and the FFT are still missing.

Have fun with it, and if you have questions just post them.

Regards,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 25, 2022, 06:14:18 am
Hi, new here. I was looking for info about this oscilloscope which I plan to buy for checking stuff around the house (utility power, UPS, and portable generator outputs, etc.) My search took me to this forum and I'm glad it did.

I've started reading through a few pages but I've hardly scratched the surface as the information is overwhelming. Is there like a Wiki for this instrument where information about things like usage, capabilities, limitations, hacks, etc. are structured?

Thanks!

Hi TiredOldDad, also welcome to the forum.

Unfortunately there is no wiki about this instrument.

You write about checking things around the house and more specific mains power related issues. For that kind of work I would use a digital multi meter, which is safer than hooking up a scope to mains voltage. Even with a battery powered scope like this one, things can easily go wrong.

This scope is nice for simple projects with micro-controllers or other electronics were the signals are large enough to measure. This scope can measure in steps of ~3mV at best. The hardware only does 100mV per division, with 8 divisions for a full screen. This with an 8 bit ADC means 0,003125V per step.

If I was you I would do some more research or start a new thread with a more specified question for advice on buying the right equipment for your tasks.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: TiredOldDad on January 25, 2022, 10:59:28 am
Hi TiredOldDad, also welcome to the forum.

Unfortunately there is no wiki about this instrument.

You write about checking things around the house and more specific mains power related issues. For that kind of work I would use a digital multi meter, which is safer than hooking up a scope to mains voltage. Even with a battery powered scope like this one, things can easily go wrong.

This scope is nice for simple projects with micro-controllers or other electronics were the signals are large enough to measure. This scope can measure in steps of ~3mV at best. The hardware only does 100mV per division, with 8 divisions for a full screen. This with an 8 bit ADC means 0,003125V per step.

If I was you I would do some more research or start a new thread with a more specified question for advice on buying the right equipment for your tasks.

Cheers,
Peter

Hello Peter,

I just need to see the waveforms to make basic evaluation of the output quality. I have a bunch of multimeters but they're just another tool in the box. I see that this scope can do FFT, which can be used to derive THD. Again, it doesn't need to be very precise. Just indicative will do.

So to check line power (100-240V AC), can I use X10 or X100 probes?

Thanks.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 25, 2022, 05:07:27 pm
Depends on the level of the mains voltage. With 240V the peak will be ~340,  so peak to peak 780V. This is out of range of the scope when a 10x probe is used, so a 100x probe will be needed, but when you are not sure about which wire is the phase and which the neutral the live voltage might be on the rim of the BNC connector. For this kind of work a differential probe is advisable.

And never try this when the scope is connected to USB.

The FFT in the original firmware is not that great. There is no indication of frequencies or actual levels. In the new firmware there is no FFT yet.

Regards,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on January 25, 2022, 08:17:50 pm
RE FFT- My experiece with "hybrid" FFT + waveforms is that one other the is compromised in display, i.e. you get 1-2 cycles of waveform and little ore no detail in the FFT OR you get lots of waves such that you cant really see them but useful detail in the FFT. I currently have one scope (Tek 5K) looking at the waveform and another (Tek 7K + Wavetek FFT plug in) for the FFT. A good FFT interface is important for the spectrum to be useful. I would not hesitate to get a second 1013 for a spectrum display if I got useful info from having both. In the larger scheme it would be very cost effective.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ledtester on January 26, 2022, 12:36:17 am
...
This scope is nice for simple projects with micro-controllers or other electronics were the signals are large enough to measure. This scope can measure in steps of ~3mV at best. The hardware only does 100mV per division, with 8 divisions for a full screen. This with an 8 bit ADC means 0,003125V per step.
...

Since we can modify the firmware what about the feasibility of hacking the front-end hardware to give a higher amplification mode?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 26, 2022, 01:30:21 am
Dear friends. I bought a non working 1013D at eBay. The scope starts up but the touchpad is inoperative. Im gessing the F1C100S sends the TP configuration on start up, if this is true, something is wrong because no I2C signals are present at any time at the TP connector. I removed the flash I and put all the firmwares I found at /pecostm32, still nothing at the GT911 signal pins. You mentioned an arduino sketch to program de TP but Im unable to find it, any way would be great if you help me to save my toy. Thanks in advance.  :-BROKE
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 26, 2022, 06:34:35 am
RE FFT- My experiece with "hybrid" FFT + waveforms is that one other the is compromised in display, i.e. you get 1-2 cycles of waveform and little ore no detail in the FFT OR you get lots of waves such that you cant really see them but useful detail in the FFT. I currently have one scope (Tek 5K) looking at the waveform and another (Tek 7K + Wavetek FFT plug in) for the FFT. A good FFT interface is important for the spectrum to be useful. I would not hesitate to get a second 1013 for a spectrum display if I got useful info from having both. In the larger scheme it would be very cost effective.

You are absolutely right about that. If both aspects are important you need two instruments.

The stock FFT on the 1013D is not useful at all, to my opinion. It only shows vertical lines on the frequencies present in the signal, which in it self is not bad, but there is no indication of frequency nor level. It lacks the ability to get a proper amount of samples for a better FFT. In my version the number of samples is doubled to 3000 samples, but still a little low.

That is why the project shifted to working on the FPGA.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 26, 2022, 06:41:12 am
Since we can modify the firmware what about the feasibility of hacking the front-end hardware to give a higher amplification mode?

That is certainly an option. For this, a better reversal of the hardware is needed. De-solder the capacitors and measure them and then do calculations on amplification and bandwidth for new resistor and capacitor values.

Within the new firmware it is not that difficult to make changes for a new front-end.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 26, 2022, 07:15:25 am
Dear friends. I bought a non working 1013D at eBay. The scope starts up but the touchpad is inoperative. Im gessing the F1C100S sends the TP configuration on start up, if this is true, something is wrong because no I2C signals are present at any time at the TP connector. I removed the flash I and put all the firmwares I found at /pecostm32, still nothing at the GT911 signal pins. You mentioned an arduino sketch to program de TP but Im unable to find it, any way would be great if you help me to save my toy. Thanks in advance.  :-BROKE

Hi Gustavo, welcome to the forum.

About the touch panel. Yes there should be I2C signals on the connections to the GT911. But when either the F1C100s or the GT911 is defective the signals might remain low. Try it with a disconnected touch panel. You should see a set of clock and data pulses at regular intervals.

The stock firmware uses a lower frequency then the new firmware. If I remember correctly the stock firmware frequency is about 40KHz for the clock. With the new firmware it is quite a bit higher. I tweaked it to near point of failure and dialed it back a bit to be reliable.

In the hack repository (https://github.com/pecostm32/FNIRSI-1013D-Hack (https://github.com/pecostm32/FNIRSI-1013D-Hack)) there is a lot of information. A file "Aliexpress links to handy stuff" with a link to a new touch panel, fpc connector to 2.54mm header converters, etc. The schematics, pictures pointing to components.

Also a lot of info in this thread. My involvement starts on page 19, and a lot of talk about the touch panel can be found on the pages 22 to 30 or so. For the arduino sketch look at message here: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3547611/#msg3547611 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3547611/#msg3547611). ser8989 wrote it.

The stock firmware seems to exist with or without writing a configuration to the touch panel. The new firmware does not. It only reads it at startup and calculates a conversion factor to get a 800 x 480 grid.

Success with the repair. Don't hesitate to ask more questions.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 26, 2022, 03:06:32 pm
Thanks so much for your time. I got all the info contained in the Hack Repository. At boot  there is no signal at F1C100S 63, 64 and 65 pins, they are at high state all the time, 3.1V.
Now I have a doubt: The GT911 at the TP must be programmed during 1013D production and then holds that register info in an internal EEPROM, or the processor do that every time the oscilloscope boots?

I ask this because if there is a way to program the GT911 with an arduino is because the 911 holds that programming info, if not, is a non sense if the info is lost once you turn 911 power off after the arduino procedure is done.

BTW the oscilloscope curent consumption is about 1.3 amps and the processor is very hot all the time, cant hold my finger over it for more than 2 seconds. is this normal for an ARM processor?
Its important to say that the oscilloscope shows everything in the screen, both channels and the wave parameters are shown correctly, the only one issue is the touchpad, of course this turns the oscilloscope useless.  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 26, 2022, 04:30:18 pm
The fact that the F1C100s gets quite hot is not a good sign. Have not measured current consumption, but 1.3A seems high.

The GT911 has FLASH memory for the configuration. It is only written when the CRC is correct and the write flag is set. There is also a check on the version number (first byte of the config data) but not sure when it discards a configuration based on it.

With an Arduino on 3V3 or level conversion in the I2C lines it is possible to test the touch panel. You can most likely find some sketches online that use the GT911 touch panel. When you write a new configuration to the touch panel it will remember it. That is why the new firmware only reads the configuration. There are different models in circulation where the sensor array is different or wired reversed, so writing a specific configuration gives problems like described in this thread. Coordinate reversal in either x and or y direction.

To test the processor port A there is the sunxi-fel tool. For this load the fel boot on a SD card and start the scope. With the sunxi-fel tool it is possible to write to the configuration and data register of port A. This way you can confirm if there is a problem in the processor. The F1C100s data sheet is also in the repository. Disconnect the touch panel just to be save.

I'm not behind my development system at the moment, so can't give the details on this, but with the information in the repository you should be able to get it done.

This way you can also see if the current draw drops and if the F1C100s stays cooler.

Edit: I hooked my scope up to a power supply with builtin A meter and on 4.1V (~full battery charge) it draws around 800mA. I had the current limit set to 1A at first but then it does not start properly, so there is some initial current draw of >1A. With the limit set to 1.5A it starts just as normal and the current reading is unstable but it stays below 900mA.

This might point to a faulty F1C100s. It is possible to buy some from Aliexpress for 3 dollar a piece or so. But be aware that it has a ground pad underneath, so de-soldering the old one needs special attention, like pre-heat from underneath with infrared or hot air.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 26, 2022, 09:03:19 pm
Have no words to thank you for your valuable time dedicated to this small toy. Im an electronic engineer and works mainly with microwave links and ultrasonic welding machines, have a pretty decent laboratory, but Im obsessed putting this oscilloscope to run correctly.

"write the image (???) to a SD card and stick it in your device. This will boot it into FEL mode and allow flash programming via USB"

I folowed the instructions and copied (in a windows 10 machine) the sunxi-fel tool (is this the image?) to the 1GB micro SD that came inside the oscilloscope in order to gain control of the osc. through the USB port, installed the SD, booted the osc and nothing happened, it booted normaly, am I doing something wrong?
Should the sunxi-fel tool be copied with my linux equiped raspberry PI3B
Its very obvious Im not a computers expert.

BTW, feels weird analyzing this FNIRSI with a $2K Keysight oscilloscope, but I wont rest till I fix it (hpefully with your help). Not an easy task finding people dedicated to save a $150 plastic brick and to help people for free!.
Again and again, THANKS  A LOT.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 27, 2022, 07:25:42 am
Hi Gustavo,

your welcome. I'm happy to help.

I'm not experienced with windows anymore but take a look here: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3825029/#msg3825029 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3825029/#msg3825029)
On windows you will also need a version of sunxi-fel compiled for it, so using a raspberry pi with linux could make live easier. Since you can't use the scope as card reader/writer you need one you can connect to your pi. (The one on the pi probably has the os in it)

Attached is the file that needs to be written onto the SD card. First you have to find the device the SD card is connected to. Linux command "lsblk" lists all the block devices on the system. On my system it mostly connects to /dev/sdc, but on the pi it might be /dev/sda or something else.

The bs=1024 combined with the seek=8 puts the file on sector 16 of the SD card. This is were the F1C100s looks to see if there is a boot loader. If it works the scope should start with a black screen. Connect the scope via USB to the pi and use "lsusb" to see if the scope is in fel mode. ("Bus 001 Device 008: ID 1f3a:efe8 Onda (unverified) V972 tablet in flashing mode")

Code: [Select]
sudo dd if=fel-sdboot.sunxi.txt of=/dev/sdc bs=1024 seek=8

See: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3825029/#msg3825029 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3825029/#msg3825029) for more info

The sunxi-fel tool for linux is also attached. Remove the .txt and make it executable with "chmod +x"

I also attached a file I use as a memory aid with the commands I used for testing. Testing port A is also in there. Ignore the rest of the crap :-DD

Success,
Peter

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 27, 2022, 07:48:59 am
Hi, new here. I was looking for info about this oscilloscope which I plan to buy for checking stuff around the house (utility power, UPS, and portable generator outputs, etc.)

For that usage I'd worry a lot more about getting the cables and safety procedures correct than any firmware updates. It can show a 50Hz/60Hz sine wave just fine without any mods.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 27, 2022, 03:00:28 pm
Thanks so much. I´ll do all you suggest to do. GREAT!
Yesterday I got a black screen and tought something was wrong  :horse:
Late this afternoon  I will use your tools to test the port, I gess port A is the oneconnected to de TP, am I right?

Thanks again.

NOTE:

Why I gess there is a problem with the TP (maybe just configuration) is because touching the panel send no I2C signals at all to the 100S.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 27, 2022, 03:18:48 pm
Yes that is correct. In the schematic of the processor part you can see which pin has what function.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 27, 2022, 04:50:19 pm
Why I gess there is a problem with the TP (maybe just configuration) is because touching the panel send no I2C signals at all to the 100S.

The touch panel only works as a slave. The F1C100s has to request data from the touch panel. There is the interrupt line form the touch panel, but that is not used as such.

With the touch panel disconnected the F1C100s will still try to communicate, so it should be possible to measure a clock signal in bursts.

Since the lines always seem to be high it can also be that they are shorted to VCC, causing larger currents to flow when the F1C100s makes these lines low. This could explain the high temperature of it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on January 27, 2022, 06:06:56 pm
Since the lines always seem to be high it can also be that they are shorted to VCC, causing larger currents to flow when the F1C100s makes these lines low. This could explain the high temperature of it.

Hopefully it's through a resistor:

https://en.wikipedia.org/wiki/Pull-up_resistor

https://en.wikipedia.org/wiki/Open_collector
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 27, 2022, 08:11:20 pm
It is fault finding, so if the lines are kept high by a short there is no real series resistor. In normal operation the lines have 10K pull up resistors, which is high for I2C but it works.

Not sure if the F1C100s port A pins use open drain or open collector or push pull, but when set low there will be a connection to ground with the possibility of a larger current then intended.

It is all guessing from my side since I don't have the broken scope on my desk.

My approach would be to disconnect the touch panel and do measurements. First without power to check on continuity between the port pins and VCC or GND. Then with another scope to see if there are signals on any of the pins. Another test would be with the FEL mode to control the pins statically.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 28, 2022, 01:43:01 am
Hi there. PCPROG, today I had a time window and made some basic tests on the oscilloscope.

1. Disconnected the TP and there is no signals whatsoever at the processor pins, no SCL nor SDL, the SCL impedance measured with 3.3 V bus as reference  is 10K, as expected, but the SCL impedance is 42 ohms, crazy low,my conclusion is that the CPU is faulty.
Made all the possible atempts to have live USB, booting with the linux utility, no success at all.
I´ll look for the F1C100S in China.
Hope I will be able to unsolder the central dssipation pad.

Thanks a lot.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on January 28, 2022, 04:23:44 am
Help me understand the larger picture of how the scope operates- Essentially it has a dedicated stripped down Linux OS that boots and runs from an uSD card that is formatted Fat32 if I understand what has transpired. So if I can copy the "drive" image to a uSD card and swap it for the original I would be running your software.

If so it opens the opportunity to make more focused customized versions that can easily be deployed. There are limitations (2 ch 8 bits and the limits of the native ADC stuff) but within those limits one could make some interesting devices. Everything from a vibration or acoustic analyzer to some smart auto diagnostic stuff.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 28, 2022, 06:33:18 am
Hi 1audio,

neither the original nor the new firmware uses linux. It is bare metal programming.

The way it works is that the F1C100s has a fixed startup program in ROM, the so called BROM. This program does a simple initialization of the processor and then reads sector 16 of a SD card if present of-course. When there is a correct boot header in the first 32 bytes of sector 16 the BROM will load the belonging program and executes it.

If no SD card or no boot header is found it tries the FLASH memory if present.

This is to our benefit, and what I use to load the new firmware without modifying the scope. By loading the new firmware package to sector 16 of the SD card in the scope it is forced to start the new firmware first.

Within the limitations of the original FPGA it is possible to make it what ever you like. The new firmware is not to complex and offers a display library to do simple graphics and text.

All that is needed to make your own stuff is a SD card boot loader and a main program. The boot loader is needed to enable the DRAM in the F1C100s, where the main program then is loaded and executed. The boot loader itself is loaded by the BROM in 32KB SRAM that is always enabled. To do display stuff this is not enough memory, hence the two stage startup.

To have my startup image displayed I use an extra step in the loading process.

To do this kind of process from the FLASH a different boot loader is needed. It has to address the FLASH instead of the SD card.

Hope this clears things up.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 29, 2022, 09:05:22 am
Did not have a lot of time to work on the project the last week, but this morning I finished the mod on the scope to get JTAG connected.

It was not easy with older eyes and not as steady in the hand anymore as time has gone by rather quickly. One moment you are in your forties and then you are almost sixty. Did not do it like morris6, to whom I applaud for a job well done. I used a male flat cable connector. At first I tried to solder the flat cable wires directly, but that was no success. So I used lacquered copper wire to solder to the components and soldered the lacquered copper wires to the flat cable.

Used a bit of hot glue to fix the wires to the board.

And it works. Am able to reprogram the FPGA with the JTAG programmer and the Tang Dynasty IDE.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 29, 2022, 10:48:32 pm
Hi there everyone, neeed help with two things please.

1. Where in the states can I get some F1C100s, the ones foun in China take 6 weeks to arrive to Miami!

2. Attached is a picture of the processor schematic showing an USB interface IC. No such IC in my oscilloscope

Thanks in advance
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 30, 2022, 05:37:08 am
Hi Gustavo,

can't help you with the first thing.

About the second one, you forgot to attach the picture, but I think you misread the schematic. If you are referring to the schematic in the repository, of which I attached the bit with the "USB ic" this is actually the USB connector. Since it is a USB-C connector it has a lot of pins to allow the insertion of the plug in either orientation.

I was thinking about your scope and wonder what caused the problem in the first place. The original firmware has some test code in it that suggests factory testing before packaging. Within this test code there is a bit for testing the touch panel. It involves touching the four corners and the center. It will not continue to normal operation without completion of the tests.

Unless the tests are skipped all together, which can be done by writing a flag in the FLASH memory, it should not have left the factory if it was already defective.

So my advise is to also test the touch panel itself on defects by static measurements and / or using an Arduino, and check the PCB after the F1C100s has been removed on any shorts just to make sure it is only the processor that is defective.

Hope you get it fixed,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on January 30, 2022, 03:00:02 pm
 |O Hi PCP, sorry  for my blindness about the connector. Today I´ll remove the F1C100s, I´m just looking for a good infrared sporce in order to rise the oposite side temperature of the board.
Y already ordered some processors from Aliexpress any way. Thanks so much!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on February 01, 2022, 12:04:26 am
It was not easy with older eyes and not as steady in the hand anymore as time has gone by rather quickly. One moment you are in your forties and then you are almost sixty.
I'm also a kid of the 60s. And when I started working with electronics, components were big and my eyes were good. Then components kept getting smaller and my eyes getting worse, untl I crossed a threshold.

Then I bought an old Bausch&Lomb SZ4 stereo microscope (barely younger than I am :)) and everything was easy again. I can now easily rework boards with 0402 components and solder to a single pin of an FPGA. It's hard to believe, but hand steadiness is completely dependent on how well you can see (unless there are actual neurological problems). With proper magnification, my hands are rock solid and I can work on the tiniest details

I cannot recommend enough a stereo microscope for anyone working with electronics, ideally with zoom. You'll also need a good support (which can cost more than the microscope itself), a ring led light and ideally a Barlow lens. A Barlow lens reduces magnification but increases depth of field. Most of the work I do uses much smaller magnification than I expected. Most of it is 10x: around 2x zoom, 10x oculars and the 0.5x Barlow lens. With a 4x zoom, I have a max 20x magnification, and I find it almost excessive for most cases. So the Barlow lens is a good tradeoff: most of the times, lack of depth of field is more impactful than magnification

I now enjoy soldering again, and I actually like SMD work more than the old style thru the hole. BTW: if you live in the USA, Hakko USA sells incredibly good SMD tweezers for ~$5, much cheaper than Amazon (and with $25 order there's free shipping)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 01, 2022, 06:25:24 am
Since it is not that often that I do this kind of soldering a microscope like that is a bit expensive. I have a digital one from banggood with a 7inch screen. It does the job, but the depth perception is not great. Also the base of the stand is not that big so makes working on larger objects like this scope a problem.

A friend of mine has an optical stereo one and I must say it is definitely better than the digital one I have. Still it is something you have to get used to, working with a magnifying aid. Positioning tweezers and soldering iron is, for me at least, keeping your mind focused on the job. Might have to do with the fact that I often exchange left for right :-DD

You are right about that SMD is much nicer then through hole. No bending and clipping wires. Way faster to finish a board with only SMD then the same circuit with through hole components.

At the moment I'm looking into the original FPGA and the open source bitstream tools of mmicko, frenky pointed to on page 51 of this thread. Managed to revert the .bin from the FLASH back to a .bit file, which I can use in the Tang Dynasty IDE to reprogram the FPGA. Getting the CRC in the header right was a bit of a search over which data it needed to be calculated.

The https://github.com/mmicko/prjtang/blob/master/docs/architecture/bitstream_format.rst (https://github.com/mmicko/prjtang/blob/master/docs/architecture/bitstream_format.rst) is not to clear on this and the code found there is lacking good commenting. The code in the repository is written in either phyton or C++. Can read it, but not to experienced with it. More of a regular C fan. Might be more work to do stuff, but I find it better readable then C++. Did not manage to build the code yet. Have to do more research into the projects that are needed for this open source FPGA development.

A bit of a problem in this open source community is the lack of proper documentation. Sure I'm also not to big on writing documentation, but try to make things clear, I hope.

It is a challenge to reverse the bitstream data back to RTL and maybe verilog, but not sure how to. A good learning opportunity into the working of FPGA's. Not a big deal if I fail in this quest. On the background morris6 is doing a nice job in creating new programming for the FPGA.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: JimBeam on February 01, 2022, 06:52:54 am
Hi Peter,

I'm very thankful, that you are more of a C type - like me... That's why poking around in your code is a lot more fun than trying to understand what someone wanted to say in Python... Though python isn't sooo much different from C, and also C++ isn't sooo much different from C. You could also i.e. have used RUST - that would have been an absolute  shopstopper for me. :-//

Having started as a hardware guy (I learned radio/tv technician) with some PC software programming in PASCAL, firmware design in 8051 assembler, later with KEIL C51, then some early PICs in assembler, moved on to AVRs and currently using ARMs in my designs (yes, I still am primarily a hardware guy), C is my favourite.

And, for the record, I am 61 now, too. And my eyes are also getting worse over the years... My trick is to wear reading glasses OVER my normal floating-focus glasses (are they called like that? Anyway, I guess you get the point)  :o

Andreas
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 02, 2022, 11:52:11 am
Pfffffff, managed to get the prjtang to do things. Looked at prjtrellis, which has more documentation on prerequisites and steps to take to build stuff. Not sure if the cpp stuff is needed for the python code, but got it build and installed.

I now have a database for the Anlogic FPGA devices that can be used with the Yosys and nextpnr projects. Next step is to see if it is possible to revert the original bitstream into a net-list and try to identify the logic in there and see if it is possible to turn it into verilog.

Attached is a html file with the layout of an AL3-10
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Mal on February 03, 2022, 09:48:52 am
Hi everyone I'm a newbie I have a 2013d but the screen is cracked not the front glass it doesn't work at all does anyone know of a screen I can replace it with the makers do not want to know at all ⁴
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 03, 2022, 10:22:55 am
Hi everyone I'm a newbie I have a 2013d but the screen is cracked not the front glass it doesn't work at all does anyone know of a screen I can replace it with the makers do not want to know at all ⁴

Typo or another model then the one discussed here?

If it is a typo you can get a new LCD from Aliexpress: https://nl.aliexpress.com/item/32693491775.html (https://nl.aliexpress.com/item/32693491775.html)

More useful items are listed here: https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Aliexpress%20links%20to%20handy%20stuff (https://github.com/pecostm32/FNIRSI-1013D-Hack/blob/main/Aliexpress%20links%20to%20handy%20stuff)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 04, 2022, 01:06:12 pm
The FPGA reversal is taking some shape. Still quite the road ahead.

Yesterday I was a bit stuck on how to map the configuration bits onto the tiles. I tried contacting mmicko by email, but did not get a response yet. After a short afternoon nap a light went on and I found how the configuration bit - tile relation is. Wrote my own code to convert the "fpga describing json data" to C header files, to speed things up. Just finished a bit of code to load a .bit file and map the configuration bits to their tiles.

To verify things, I created two simple designs in the Tang Dynasty IDE. This tells how many bits are set for the design and my listings of both the .bit files show the same numbers. Next up is verify the tile names with the chip viewer in the IDE.

Below is a list of what I have so far.
Code: [Select]
frame  bit   tilename            type                 x       y
0 826 mic_lr_x0y22 miscs_mic_io_l 0 22
0 828 mic_lr_x0y22 miscs_mic_io_l 0 22
0 829 mic_lr_x0y22 miscs_mic_io_l 0 22
0 880 mic_lr_x0y22 miscs_mic_io_l 0 22
0 882 mic_lr_x0y22 miscs_mic_io_l 0 22
0 883 mic_lr_x0y22 miscs_mic_io_l 0 22
0 904 mic_lr_x0y22 miscs_mic_io_l 0 22
0 906 mic_lr_x0y22 miscs_mic_io_l 0 22
0 907 mic_lr_x0y22 miscs_mic_io_l 0 22
0 923 mic_lr_x0y22 miscs_mic_io_l 0 22
0 958 mic_lr_x0y22 miscs_mic_io_l 0 22
0 960 mic_lr_x0y22 miscs_mic_io_l 0 22
0 961 mic_lr_x0y22 miscs_mic_io_l 0 22
1 914 mic_lr_x0y22 miscs_mic_io_l 0 22
1 921 mic_lr_x0y22 miscs_mic_io_l 0 22
1 932 mic_lr_x0y22 miscs_mic_io_l 0 22
2 940 x0y20 pib 0 20
3 619 x0y26 pib 0 26
4 621 x0y26 pib 0 26
5 942 x0y20 pib 0 20
24 975 x0y19 pib 0 19
27 975 x0y19 pib 0 19
156 620 x5y26 plb 5 26
158 620 x5y26 plb 5 26
246 616 x8y26 pib 8 26
249 297 x8y32 pib 8 32
250 295 x8y32 pib 8 32
250 617 x8y26 pib 8 26
433 285 x14y32 plb 14 32
435 284 x14y32 plb 14 32
617 297 x20y32 plb 20 32
619 296 x20y32 plb 20 32
801 292 x26y32 plb 26 32
802 294 x26y32 plb 26 32
811 27 x26y37 pib 26 37
813 26 x26y37 pib 26 37
880 22 x28y37 pib 28 37
882 23 x28y37 pib 28 37
882 57 x28y36 plb 28 36
885 57 x28y36 plb 28 36
887 11 mic_tb_x28y37 miscs_mic_io_t 28 37
887 21 mic_tb_x28y37 miscs_mic_io_t 28 37
887 23 mic_tb_x28y37 miscs_mic_io_t 28 37
888 13 mic_tb_x28y37 miscs_mic_io_t 28 37
888 20 mic_tb_x28y37 miscs_mic_io_t 28 37
888 22 mic_tb_x28y37 miscs_mic_io_t 28 37
890 8 mic_tb_x28y37 miscs_mic_io_t 28 37
890 21 mic_tb_x28y37 miscs_mic_io_t 28 37
890 23 mic_tb_x28y37 miscs_mic_io_t 28 37
918 14 mic_tb_x29y37 miscs_mic_io_t 29 37
918 16 mic_tb_x29y37 miscs_mic_io_t 29 37
918 23 mic_tb_x29y37 miscs_mic_io_t 29 37
919 18 mic_tb_x29y37 miscs_mic_io_t 29 37
919 20 mic_tb_x29y37 miscs_mic_io_t 29 37
919 22 mic_tb_x29y37 miscs_mic_io_t 29 37

When this is found to be correct it is looking into naming the configuration bits and determine what they do. This is still a bit of a mystery. The json "database" has a tilegrid file, which provided the data in the list, and a set of "bits" files. Some are easy to map from the tile type, like "pib", but the "miscs_mic_io_t" don't have a direct matching counter part.

But with a bit of tenacity I will get there.

Edit: Checked the tiles in the IDE and they match, so I'm on the right road. Ran the program on the FNIRSI fpga data and it shows only 51429 of the 2205900 configuration bits to analyze. Piece of cake :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 07, 2022, 06:27:10 pm
Not making a lot of progress |O

I have started a topic in the FPGA section to see if there is some needed knowledge out there, because I'm not having a lot of success. Mapping the configuration bits to understandable names is failing due to lack of information.

Have some hope that the work files of the Tang Dynasty IDE can supply some information, but the file I managed to some what decode is still quite cryptic. One upside, I'm learning python. A friend of mine pointed me to the pyCharm IDE, which makes it quite easy to code and debug. I'm using the decoder mmicko made for prjtang, so he did the hard work there 8) but it is still a big search to which number means what in the data count.

Code: [Select]
o56v~ 3 0
CcD 4 25 qPn"QxyGnwTr}5E.6 1 r|c\tR3qHSxT 2 r|c\tR3qPdeD 3 r|c\tR3rPT5CutIa 4 tN3}E_5D}ucVtVvd 5 E[5Or#cQ"G3|Ycg 6 C}2QP&as|In"W(e 7 E[5Or#cQ"G3|Yci 8 C}2QP&as|In"W(g 9 E[5Or#cQ"G3}Y[*3i+5G 10 tN3}E_5D}uc\+N(i\H 11 tN3}E_5D}uc\+Ze 12 qPn#C$2JF#W, 13 qPn#C$2JG#W, 14 qPn#C$2KP*Ge 15 qPn#C$2P[#W, 16 qPn#C$2Pd*3 17 r|c\tR3|Yce 18 C}2QP&a}(XB 19 tN3}E_5N)'8 20 P"a~qTn"W(e 21 E[5Or#c[+Vg 22 qPn#C$2Qd"V3qHS 23 tN3}E_5O)+8 24 P"a~qTn)G% 25
CerA 5 45 C}2QP&a}(X@ 26 tN3}E_5N)'5n5f99e!uBv 27 r|c\tR3|Yce 28 C}2QP&a}(XA5a88jpKnH 29 qPn#C$2Pd*5 30 r|c\tR3|Ycfa37iu7w@G 31 E[5Or#c[+Ve 32 qPn#C$2Pd*632ht<cI?x 33 P"a~qTn"W(e 34 E[5Or#c[+Vf2cs;h5Hp!t 35 tN3}E_5N)': 36 P"a~qTn"W(fcn:g:4y{J 37 C}2QP&a'uU 38 P"a~qTn)G%2cs;h5Hp!t 39 tN3#Lh5D&qQBeM32ht<cI?x 40 P"a$x]nuTr}cn:g:4y{J 41 C}2TW/at|OS|X32ht<cI?x 42 P"a$x]nyKw"cn:g:4y{J 43 C}2TW/axsPZ5a88jpKnH 44 qPn&J-2M^vN|2cs;h5Hp!t 45 tN3#Lh5N'|MRxa3?f{;73b 46 E[5Ry,c[)NzsIn5n6?iE53 47 r|c_{[3|W[|Ev2c{8n92q!uN63b 48 E[5Ry,c[)NzsIn5nG8une 49 C}2TW/a~&PXvG32qqBge26 50 P"a$x]n#U}yGT5aA5pthab 51 qPn&J-2Qb"KtucnCd@8cp:f9EcA 52 tN3#Lh5O'|MRxa3@f{;a;4xtgac 53 qPn&J-2Qb"KtucnCd@8c|Kze25 54 P"a$x]n#U}yGT5aAFi!q54 55 r|c_{[3}Y[*3i2c|KnHa<!xd:3a 56 E[5Ry,c\+N(a<n5oI?xHN;3b 57 E[5Ry,c_tF32ht<cI?x 58 P"a$x]n,Rrtcn:g:4y{J 59 n6?iD 60 Bd@8: 61 {8n92q!uN6 62 A5ptg 63 o6?iD 64 Cd@8cp:f9E 65 qqBg3:e!t;6 66 A5pt5oIK8 67 |KnHa<!xd: 68 AHp!tlzj 69 Fi!q 70
FjM 6 19 qPn&J-2FP$M&uJ 71 P"a$x]nuTr} 72 E[5Ry,cQ(C~c6Z 73 tN3#Lh5Ev~X\+Z 74 r|c_{[3sPZwK* 75 qPn&J-2G^$Hzw 76 E[5Ry,cR)D 77 r|c_{[3vMU% 78 C}2TW/axsPZ 79 tN3#Lh5K#sPZ 80 tN3#Lh5N'|MRx 81 C}2TW/a~&PXvG 82 r|c_{[3}Y[*3i 83 qPn&J-2Sbv 84 C}2TW/a$qH 85 P"a$x]n&Ks 86 qPn&J-2T[" 87 C}2TW/a$%I\+Z 88 r|c_{[3)TPw 89
r=Ac!t;uH2xsFc7> 1 1 txDaH8w!t 90
FkB2xtIv3Gh!r;c8 1 1 Cm}5v9Fx 91
!p?p3Gi!sJaH7v!tB 1 1 r=Ac!t;uH 92
Js!rA 0 1 r=Ac!t;uH 93
qPn"QxyGnwTr}5E.6 2 5 1 0 1
8< 1 vp:fF 2 Jes:t 3 K6pz 4 Mg 5
8B 6

Data shown above translates into what is shown below

Code: [Select]
macro 3 0
map 4 25 AL_LOGIC_DRAM16X4 1 AL_MAP_ADDER 2 AL_MAP_ALU2B 3 AL_MAP_BLE_ADDER 4 AL_MAP_BLE_GATE4 5 AL_MAP_BLE_LUT4 6 AL_MAP_BLE_LUT5 7 AL_MAP_BLE_LUT6 8 AL_MAP_BLE_LUT7 9 AL_MAP_BLE_MULT18X18 10 AL_MAP_BLE_MULT9X9 11 AL_MAP_BLE_MUX4 12 AL_MAP_F7MUX 13 AL_MAP_F8MUX 14 AL_MAP_GATE4 15 AL_MAP_LLMUX 16 AL_MAP_LUT1 17 AL_MAP_LUT2 18 AL_MAP_LUT3 19 AL_MAP_LUT4 20 AL_MAP_LUT5 21 AL_MAP_LUT6 22 AL_MAP_MULT_ADD 23 AL_MAP_MUX4 24 AL_MAP_SEQ 25
pack 5 45 AL_MAP_LUT1 26 AL_MAP_LUT1__default 27 AL_MAP_LUT2 28 AL_MAP_LUT2__default 29 AL_MAP_LUT3 30 AL_MAP_LUT3__default 31 AL_MAP_LUT4 32 AL_MAP_LUT4__default 33 AL_MAP_LUT5 34 AL_MAP_LUT5__default 35 AL_MAP_LUT6 36 AL_MAP_LUT6__default 37 AL_MAP_SEQ 38 AL_MAP_SEQ__default 39 AL_PHY_BRAM32K__default 40 AL_PHY_BRAM__default 41 AL_PHY_CLKDIV__default 42 AL_PHY_FIFO__default 43 AL_PHY_GCLK__default 44 AL_PHY_IOCLK__default 45 AL_PHY_LSLICE__lble5_2 46 AL_PHY_LSLICE__lble6_1 47 AL_PHY_LSLICE__lble_mux4_2 48 AL_PHY_LSLICE__lseq_2 49 AL_PHY_MSLICE__mble4_2 50 AL_PHY_MSLICE__mble5_1 51 AL_PHY_MSLICE__mble_adder_2 52 AL_PHY_MSLICE__mble_gate4_2 53 AL_PHY_MSLICE__mble_mux4_1 54 AL_PHY_MSLICE__mseq_2 55 AL_PHY_MULT18__mult18x18_1 56 AL_PHY_MULT18__mult9x9_2 57 AL_PHY_PAD__default 58 AL_PHY_VPAD__default 59 lble5 60 lble6 61 lble_mux4 62 mble4 63 mble5 64 mble_adder 65 mble_gate4 66 mble_mux4 67 mult18x18 68 mult9x9 69 seq 70
phy 6 19 AL_PHY_BANKREF 71 AL_PHY_BRAM 72 AL_PHY_BRAM32K 73 AL_PHY_CENTMUX 74 AL_PHY_CLKDIV 75 AL_PHY_CONFIG 76 AL_PHY_CSB 77 AL_PHY_FIFO 78 AL_PHY_GCLK 79 AL_PHY_IOCLK 80 AL_PHY_LSLICE 81 AL_PHY_MSLICE 82 AL_PHY_MULT18 83 AL_PHY_OSC 84 AL_PHY_PAD 85 AL_PHY_PIB 86 AL_PHY_PLL 87 AL_PHY_PREMUX 88 AL_PHY_VPAD 89
pin_test_tdpack 1 1 pin_test 90
pin_test_tdread 1 1 pin_test 91
pin_test_tdrtl 1 1 pin_test 92
work 0 1 pin_test 93
AL_LOGIC_DRAM16X4 2 5 1 0 1
di 1 raddr 2 waddr 3 wclk 4 we 5
do 6

Despite some frustration it is still interesting to pursue.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 09, 2022, 11:10:51 am
Again a small step in understanding the fabric of the FPGA.

Decided to visualize the configuration bits within the FPGA structure. Still have to figure out how the bits relate to the information in the Anlogic database files. The visualization did make things more clear. The FPGA has an array of configuration bits which is 1075 bits wide and 2052 bits tall. These map to the tiles (blocks) as can be seen in the bitmap. I expect that the bits within the tiles use a similar x,y coordinate system. Within the tilegrid tiles can have multiple parts. This is only in the x direction, causing the number of blocks to double. In the y direction blocks can be extended over several tiles. This is the case for the embedded memory and the left and right io blocks.

Attached is a zip of the original FPGA data so far and a zip of the Anlogic json database for those interested. The code to make the bitmap and other data is still work in progress, but if anyone wants it as is just let me know.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 11, 2022, 09:45:29 am
It is one big puzzle with millions of pieces.

I found some missing data in the decoded original database, that makes me wonder if prjtang can actually be used to generate a bitstream with the open source projects like nextpnr. The pin to pad list, which is needed to connect the outside of a package (lqfp or bga) to the actual io pads on the chip.

Within the bit files it shows names like IOL0.INCLKMUX or IOL3.MODE, which is an indication of the pad within the io tile, but no connection to the outside pin name. The data I found maps pins to names like pl22d or pt28a.
I guess it means pad left y22 io3 or pad top x28 io0.

Further more I have the idea that in prjtang the x and y coordinates for the bits are swapped. This is easily seen in the files for pib or plb. These tiles have 27*54 or 31*54 bits. The naming of the tiles suggests that the frame number is used as x coordinate and the bit position within a frame is mapped to the y coordinate. For this the direction is reversed. Bit 0 maps to tiles y37. I was able to verify this by looking at the chip viewer in the Tang Dynasty IDE. In the bit files the y data shows a range of 0-26 or 0-31 and the x data a range of 0-53.

Then there is the xoff and yoff data. I think this has to do with the fact that for instance top or bottom io blocks spread over three tiles. But in the data for these blocks the xoff only shows 0 and 1, so where does this leave the bits in the third block.

It is a way to learn about the real insides of a FPGA, but it is not easy.

Attached is a spread sheet with the missing data
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 14, 2022, 01:52:02 pm
Progress is slow but I took another step in solving the puzzle.

The data in the Tang Dynasty database for the AL3-10 is setup to go forward from a HDL description to a FPGA bit stream and not the other way round. This has to do with the tile offsets used in the bit description files. For an IO block in an edge tile there are some configuration bits that reside in one of the surrounding pib (programmable interconnect block) tiles.

To overcome this I first converted the json data to C structures and created a list for all the configuration bits by stepping through each tile and the belonging bit files. Based on this big list it is possible to find the meaning of every bit described in the database. Unfortunately this still shows bits being set that have no apparent meaning.

The question here is are these bits actually needed or is the Tang Dynasty IDE place and route code wrong.

My simple test design shows that it is setting bits for the other unused IO pins that reside in the same IO block. Again the question if this is needed or not. I'm not sure if it will damage the FPGA when these bits are made zero and the bit stream is recreated.

The data in the configuration database is getting more meaning now. For each bit there is an expression and a list of properties used in the expression. Based on the outcome the bit is set or not. For the IO this makes it a bit of a guess what the actual properties specified in the IO constraints are, but since the external hardware is know it is not to difficult to get that right.

Attached is a new listing and an improved bitmap of the bits in the original FPGA.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 15, 2022, 03:16:28 pm
Unfortunately I have to admit defeat. There are to many missing pieces of the puzzle.  |O

Today I decoded the database of the Tang Dynasty 2018 version, which is 16 times as big as the current version, in the hope to get more or different information, but the basic parts are more or less the same. The size difference lies in ~500000 lines of numbers that have no direct meaning to me.

Below is an excerpt of the file. It might be some routing information from tile to tile because the first sets of two numbers on the first line run from 0 0 to 34 37, which is the range of tiles in the AL3-10. But what do the other numbers mean :palm:

Code: [Select]
34 34 34 34 105 0 0 1 1 16
253270 253271 253280 253281 253282 253283 253290 253291 253292 253293 253298 253299 253306 253307 253378 253380
34 34 34 34 106 0 0 1 1 18
253270 253271 253280 253281 253282 253283 253290 253291 253292 253293 253298 253299 253306 253307 253325 253335 253382 253384
34 34 34 34 107 0 0 1 1 18
253272 253273 253278 253279 253284 253285 253290 253291 253292 253293 253298 253299 253304 253305 253324 253326 253377 253379
34 34 34 34 108 0 0 1 1 16
253272 253273 253278 253279 253284 253285 253290 253291 253292 253293 253298 253299 253304 253305 253381 253383
34 34 34 34 109 0 0 1 1 18
253268 253269 253274 253275 253288 253289 253308 253309 253324 253326 253381 253382 253383 253384 253433 253434 253435 253436
34 34 34 34 110 0 0 1 1 12
253268 253269 253274 253275 253288 253289 253308 253309 253433 253434 253435 253436
34 34 34 34 111 0 1 1 0 0

34 34 34 34 112 0 1 1 0 0

34 34 34 34 113 0 1 1 0 0

34 34 34 34 114 0 1 1 0 0

34 34 34 34 115 0 1 1 0 0

34 34 34 34 116 0 1 1 0 0

The listings I can make based on the available database data contain EMPTY bits in the routing of the signal, which makes it impossible to connect the dots. Also the lack of documentation about the interconnect, and the other parts of the chip make it very difficult to come to some proper results. I have not even looked at the logic blocks yet, so that can hold some surprises too.

The only option left would be to reverse engineer the Tang Dynasty IDE, but that is a bit to much for me.

I wonder if anyone out there has used the prjtang stuff in combination with yosys and nextpnr to make a working FPGA configuration, but I have my doubts.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: frenky on February 16, 2022, 07:45:28 am
Don't be so hard on your self.
You have done incredible amount of work which can be seen in your great firmware.

Just brainstorming here:
Would it be easier to make new "code" for FPGA from scratch?
Could we replace this FPGA with some pin compatible that is easier to work with?

Anyway for me 1013D (with your firmware) is now perfectly usable DSO even if it gets no further updates...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 16, 2022, 09:54:57 am
Don't be so hard on your self.

Hi frenky,

that is my inquisitive nature, just want to know how it all fits together :) I can't help but wonder if the Tang Dynasty software has some trickery under the hood, where they swap the bits within the blocks of a tile to throw the hackers off. It would explain the empty bits I find in the listings.

Just brainstorming here:
Would it be easier to make new "code" for FPGA from scratch?
Could we replace this FPGA with some pin compatible that is easier to work with?

Sure it is, and that is what morris6 is working on. He already has something working, but getting the trigger right is a bit of a problem. I made some mods to the firmware for him to test with. The Tang Dynasty IDE is ok for doing this work, so no need for another FPGA, all though a Cyclone IV would fit, but reworking the circuit board is not that easy. The chip also has a ground pad underneath.

The only benefit would be more DSP tiles. Memory is the same. Not sure if a GOWIN device is pin compatible. Having 8MB of sample memory would be nice. The AL3-10S also has this, but availability seems to be a problem.

Anyway for me 1013D (with your firmware) is now perfectly usable DSO even if it gets no further updates...

Good to hear that the new firmware makes it a better scope. I might look into the measurements and FFT in a while. I guess these are the only parts missing in comparison with the original.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 19, 2022, 05:09:22 pm
My brain kept on turning on the fpga thing and I managed to solve the problem I was running into. Not by reverse engineering the program, but by using it with IO properties I knew where they had to be located. The configuration data is packed in 1075 frames of 257 bytes, of which it only uses 2052 bits per frame. I assumed the unused bits to be at the end of each frame, but it turns out they are at the beginning. I was able to see this because the known bits were offset in the y direction by 4.

So with that out of the way I was able to get all the bits named correctly, so I went on to matching the IO pads to the pins, which was not to difficult.

Next I turned to the routing, and I did manage to find quite a bit of how it sticks together, but I fail to see the logic behind the interconnects. For each connect through a routing switch box it uses two bits and based on the bit names it is possible to pair them, but finding the connection between the different switch boxes is a mystery. I lack the knowledge for it and my searches on the net did not get me any further.

So the project is now parked on github: https://github.com/pecostm32/Anlogic_AL3-10_Analyzing (https://github.com/pecostm32/Anlogic_AL3-10_Analyzing) were it is already discovered by people interested in it. Even during uploading it was cloned :-DD

I heard back from mmicko that I'm right in that it is not possible to make Anlogic FPGA designs with nextpnr and he has not had time to do more work on the project. He has fixed his tools for decoding the database to list the bits on frame and bit index instead of y and x. His focus was mainly on the Eagle-20 device, which has some differences apart from the number of logic cells.

Maybe when I have learned more about modern FPGA's I will return to the quest, because I'm convinced it is possible to get it done with the proper knowledge.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 20, 2022, 12:21:47 pm
Turned back to the firmware and made the framework for the measurement displaying.

Deviated from the original and made it so that the measurements for a channel have their own location on the screen. Channel 1 measurements on the left and channel 2 measurements on the right.
Four rows of three columns max per channel, and only displayed when the channel and belonging measurements are enabled. The display order of the measurements is fixed and not as in the original where the order is dependent on the order in which they are enabled.

Also modified the menu to reflect the left right position of the data on the display. Channel 1 is now on the left of the menu.

Have to fill in the calculations for the major portion of the measurements. Only the frequency is done, since I already had that in the previous version.

So the easy part is out of the way :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2022, 12:23:31 pm
Added all the measurements and it seems to work. Only performed very short test on the actual device.

The Vrms is probably wrong. I based it on how it is done for a sine wave. Using the Vp as the base (maximum of the absolute min and max values compared to the ADC center and thus taking DC offset into account) and multiplying it by 0.7071.

At some point I have to add averaging over the measurements to make it a bit more stable, but as is will do for now.

This is version 0.003

The FFT has to wait. It is more work and I have to think about screen layout and functionality.

I'm going to look into morris6 his work as a new learning project. That is, what this whole expedition was and still is, about, learning :)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 21, 2022, 10:56:29 pm
Hello everyone, just a bit busy but last week I replaced the 1013D CPU and now is running normal, at least for a so cheap oscilloscope. The only ugly thing is the huge jitter it has. Is there a way to do something about this issue?

Thanks in advance.

GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 22, 2022, 06:47:58 am
Hi Gus,

Nice job in getting the F1C100s replaced and reviving the scope back to live. Have you tried it with the new firmware?

It does solve a bit of problems the original firmware has. The jitter might be caused by communication errors between the mcu and the "special ic" connected to the fpga. This is not used in the new firmware and it makes it faster and more stable.

Just follow the link in my signature to go to the firmware repository. Instructions on how to load it onto the scope are in the readme.

Enjoy,

Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 22, 2022, 01:52:26 pm
Thanks so much PCP, I´ll end some tasks related to my job and will turn on my raspberry and let you know the result, great if the toy become more stable.

BTW, yesterday I left the oscilloscope on and the battery is at exactly 0 voltys today, sad this toy has not an battery undervoltage protection. Thanks again. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on February 22, 2022, 03:28:52 pm
BTW, yesterday I left the oscilloscope on and the battery is at exactly 0 voltys today, sad this toy has not an battery undervoltage protection.
Many batteries has a built in BMS which does this,
i.e. shuts it off when the cell voltage goes below 3V.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 22, 2022, 03:33:34 pm
Thanks so much, seems like this batt has it. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 22, 2022, 04:04:44 pm
Dear PCP, were can I find your latest 1013D .bin firmware, I gess this is what I must load to the SD card using the USB port. Thanks a lot.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 22, 2022, 07:28:46 pm
Dear PCP, were can I find your latest 1013D .bin firmware, I gess this is what I must load to the SD card using the USB port. Thanks a lot.

See message: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4022467/#msg4022467 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4022467/#msg4022467)

The .txt is because the forum does not allow .bin files to be attached

It is also in the /dist folder in the repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 23, 2022, 01:02:20 am
Thanks PCP. After almost two hours I was able to transfer the new firmware (003) to the scope but sadly the touch screen is reversed. Is there something I can do?

Thanks a lot

GUS :-\
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2022, 06:44:29 am
Thanks PCP. After almost two hours I was able to transfer the new firmware (003) to the scope but sadly the touch screen is reversed. Is there something I can do?

Hi Gus,

you are welcome :)

How strange, because the whole quest of reverse engineering the firmware started with a reversed touch screen after replacement. The new firmware is using the touch screen as is and looks at the configuration to calculate some conversion factors, but it can't tell if the x and y are wrong :(

Luckily it is not a big problem and can easily be solved by writing a new configuration to the touch panel. But for this to be a success the configuration as is needs to be known.

See: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3808349/#msg3808349 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3808349/#msg3808349) and the messages before it on what to do.
The touch panel configuration is then written to the SD card. Post that on the forum and I will take a look at it.

Success,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 23, 2022, 02:53:19 pm
Thanks again and again Peter.

Yesterday when I tested de 1013 with your 003 firmware y managed to operate it with the reversed TS and noted there was no trigger at all, this could give you more clues about my issue, unless my scope has another defective part.

Y noticed too that the scope boots from the SD card and uses the EEPROM no more. Am I right?

I´m a bit confused about the files I should transfer to de Oscilloscope´s SD card, can you please clarify that?

Thanks Peter

GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2022, 03:40:01 pm
Hi Gus,

What does the scope do with the original firmware? Does it work normally? The thing is that there are different models of the scope with different FPGA's in them. The one I work with has an Anlogic FPGA instead of an Altera. I don't think there is a difference between them firmware wise, but you might have something different.

For the use of my firmware there are two possibilities.
1) Standard device only needs the fnirsi_1013d_v0.003.bin
2) Devices with a different display need a display configuration file.

This is explained in the readme files in the repository.

To make a backup of the original firmware including the touch panel configuration you need the fnirsi_1013d_fwb.bin of page 45 of this thread. This is a standalone program, that copies the content of the FLASH memory to the SD card. It also writes the touch panel configuration to the SD card. It is the latter I need to make the right configuration for  your scope.

This thread holds all this information, so it might be useful to read part of it. Like pages 44 to 46 as to how I got to the new SD card approach.

And you are right in that it does not use the FLASH (it is not an EEPROM) in any way. Removing the program from the SD card makes it return to the original firmware.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on February 23, 2022, 06:05:41 pm
Dear Peter, I think the firmware problem goes beyond the TP inversion because there is no trigger at all, the waves are in free run, so I suspect my 1013d has a different FGPA, to put things even more complicated.

One last question.The difference between the old model, mine, and the new one are only cosmetic or there are some functional improvements.

Thanks a lot Peter.

Take a HUG from Colombia.
GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2022, 07:56:02 pm
Hi Gus,

for as far as I know is the rest of the hardware the same between the different models. The difference between the old and the new is that it has the recessed connectors, and the front panel is the flat hardened glass.

The hardware differences know to me are
1) The FPGA: Altera Cyclone IV versus Anlogic AL3-10
2) The touch panel. There are differences in the number of sensors used. Most of them have, out the top of my head, 16x10, but I also have one that has 20x14.
3) The display. They have used at least three types, one of which has quite a displacement causing the screen to shift up and to the left.

The firmware is, for as far as I know, the same functionality wise. (Apart from ye or ne writing the touch panel configuration)

Can you post a photo of your pcb? And also some photo's of the device in action.

If you are willing to play with it, you could make a jtag connection on to the FPGA and see if it is possible to reprogram. The older board has it routed to an unpopulated header, so a bit easier.

As you can read in the last 4 or 5 pages, we are in the process of making a new FPGA programming. It is for the Anlogic device, but the verilog can be adapted for the Altera device.

It is a fun little device and would be unfortunate if, after all your efforts it is binned.

Regards,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 02, 2022, 08:14:07 pm
Hi everybody.
A bit lost because of my Job PCP. This time I need a hardware help,plese. The oscilloscope has TL431 as reference in the power supply section and a TL432 in the analog input section (dont know why), every data sheet I visited says this twuo chips have the same 2.49 V reference, so Gate + Cathode put both ICs as a 2.49 V shunt reference, in both Ocs sections 431 and 432 have the same configuration so it´s why I do not understand about two different references to obtain the same result.The funny part follows.

FRF1 TL432 produces 1.1 volts reference in contradiction with all foud datasheets I found,ok?
I removed the 432 and injected 2.495 volts in there, the trace goes up to the top to a point where you can not take it back to the center, crazzy ah!

So this is the favor I need, can you please measure VFR1 and let me know it´s value in your Osc?

Thanks so much.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 03, 2022, 09:30:35 am
Hi Gustavo,

The voltages I measure are:
TL431 (VREF) 1,194V
TL432 (VRF1) 1,233V

The voltage VREF from the TL431 is sampled by the MCU for the battery status indicator.

The voltage VRF1 from the TL432 is used to raise the virtual ground level on the BNC inputs. It is done this way to avoid a dual supply with a positive and negative voltage for proper signal conditioning. The op-amps are on 2,5V, so to be mid level VRF1 has to be ~1,25V. This why the scope does not work properly when connected to a grounded computer via USB and the inputs are connected to a grounded device under test.

Edit: I based the part identification on the photo of the old model scope. The one in the power supply reads 431 and the one in the analog section 432, and I assumed them to be TL431 and TL432.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 03, 2022, 01:47:57 pm
Thanks for your effort dera friend. Now Im even more confused. No TL431/432 can produce any voltage bellow its 2.49V reference, so neither of the chips dedicated for VREF and VREF1 are TL´s.
In my OS. VREF is 2.49 (a correct value for a TL) and VREF1 is 1.2V, the correct value for 2.5/2, then my SMD marked 432 is something different to a TL. Still surprised about your 1.19V at VREF.

 :-// |O

This thing is a lot of joy, for sure. Get a hug and thanks again.
GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on March 03, 2022, 02:54:55 pm
Thanks for your effort dera friend. Now Im even more confused. No TL431/432 can produce any voltage bellow its 2.49V reference, so neither of the chips dedicated for VREF and VREF1 are TL´s.
In my OS. VREF is 2.49 (a correct value for a TL) and VREF1 is 1.2V, the correct value for 2.5/2, then my SMD marked 432 is something different to a TL. Still surprised about your 1.19V at VREF.

The one in the battery circuit is referenced from VBAT not GND, so VREF will be the battery voltage less 2.5V.  Thus VREF will vary with battery charge.
The one in the analog circuit could be a TLV431/TLVH432 (or a similar Chinese clone) which is a 1.24V reference.

A "432" swaps pins 1&2, but that doesn't matter when they are connected anyway.  So they may have used a "432" just because it had different marking from the "431".
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 03, 2022, 03:07:00 pm
The VREF voltage depends on the battery charge, so in my scope the battery is not that full and since I have disconnected it quite a bit the connection of the battery is not that good anymore which also causes the voltage to drop, so that is explainable.

And Kean also has an explanation for the other voltage. :)

This is always a problem with SMD components. They are to small for proper markings, making it a guess what has been used.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 03, 2022, 05:03:32 pm
Thanks Kean, loud and clear.

Any way, being blind about the jitter with square waves, my scope when switched to DC input coupling shows a downward wave displacement as if the signal had a negative offset, no idea how to correct that and the only tool the scope has is a simple calibration that is no remedy for this uggly issue. Both channels behave the same way so is something common to both inputs, and the refserence is correct. Any idea dear friends?

GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 03, 2022, 08:54:36 pm
That might have to do with the virtual ground being pulled low by a ground loop somewhere. Look at the analog front end schematics. When in AC mode the capacitor in the input (C99 and C133) filter the DC component. VRF1 is added back in before the op-amp, so the signal swings around that level. When in DC mode the capacitors are shorted out and the external ground comes into play.

It is a really shit design and you have to be aware on how you use the scope.

I'm no expert on analog circuitry so might be wrong, but I do now about the software. Spent almost a year digging through the original code and it has may flaws. The new firmware is better but still has to cope with the short comings of the hardware.

To provide better help it is handy if you specify which software you are running, and how things are setup. What are you measuring, how did you connect things etc.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nrq on March 07, 2022, 07:01:24 pm
@pcprogrammer thanks a lot for your efforts in improving the firmware of this device. I flashed the most recent version today, but for some reason my touch screen is inverted and, most of all, after baseline calibration the X and Y axis for channel 1 is inverted, too. I read your post a few days ago with the link to the post from Nov. 12th, but I honestly am unsure what to do with it. should I flash the attached bin and does that bin file create a backup somewhere that I could upload for reference?

https://i.imgur.com/TFRn1Mn.jpg (https://i.imgur.com/TFRn1Mn.jpg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 07, 2022, 08:41:53 pm
Hi nrq,

welcome to the forum.

The touchscreen issue is something I can easily resolve by adding settings for it to the separate configuration file for the display adjustment. This way the inversion of X and Y touch can then be set. The firmware can then remain the same for all devices, and by loading the correct configuration file to the SD card the touch will be corrected.

The other problem you write about is probably that the scope is set in X-Y mode. That differs from the original where both channel pointers are on the left. In the new firmware the channel 1 pointer is on the top of the display, since it controls the X direction, where as channel 2 is for the Y direction so its pointer stays on the left.

The setting for this is in the same menu as in the original. Menu -> system settings -> X-Y display mode. It is near the calibration setting, so you might have touched it by accident.

The backup program I referred to is not really needed anymore, but having a backup of the flash and touchscreen config could be handy.  Installing it is done in the same way as the scope software. (It overwrites the scope software) After a reboot the scope makes the backup to the SD card. Here you can see how it works: https://youtu.be/h-tdKPDocHI (https://youtu.be/h-tdKPDocHI)

I will look into the touchscreen thing tomorrow.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 07, 2022, 09:47:00 pm
Hi there friends.

Dear PCP, yesterday I got some timefor my toy and found all FOUR BNC decoupling capacitors short circuited, and as an extra de 150 nF input capacitor for channel one was 0 ohms too. Now the reference 1.25V is present at the BNC connectors thanks to you.
The oscs is  behaving as I gess it did it when was brand new. The square wave jitter is only present above 1Mhz.
Now my main question PCP:
Which are de improvements on your firmware, I´m very curious about to know them in order to proceed with the flash with your help to invert X/Y TP coordinates.

Thanks so much. GUS :-/O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nrq on March 08, 2022, 06:27:29 am
Quote
The setting for this is in the same menu as in the original. Menu -> system settings -> X-Y display mode. It is near the calibration setting, so you might have touched it by accident.
Thanks, must've touched that while trying to navigate baseline calibration with inverted touch. :palm:

EDIT: otherwise it seems to mostly work fine with the new firmwar. Looking forward to try the inverted touch settings when it's available. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 08, 2022, 06:46:14 am
In order to cope with the inverted touch panels out in the field I added settings to the display configuration file. To keep it simple I did not include them in the checksum and just added them to the end just after the checksum. By default these where 0xFF, so left that for the normal operation. Making the bytes zero enables the swapping of the coordinate.

The first byte after the checksum is for the X coordinate and the second one for the Y coordinate. This way it is possible to cater for all options.

So for the scopes out there that have inverted touch when the new firmware is used, load the attached configuration file to sector 710 on the SD card and your problem should be solved. (At least if both X and Y are inverted :-DD)

The firmware repository is updated to reflect this new setup. Added a file to explain the configuration file and a versions.txt file to reflect the changes in the firmware versions.

To load the configuration file look at the below command. Make sure the "of=" part reflects the correct device on your system. Don't forget to un-mount it first.

Code: [Select]
sudo dd if=standard_display_tp_xy_swap_config_sector.bin.txt of=/dev/sdc bs=1024 seek=355

The new firmware version to work with this is v0.004
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: nrq on March 08, 2022, 07:03:53 am
Works perfectly now. For me only X-axis was inverted, I swapped the Y config value back to 0xFF and now touch works. Looking forward to playing around a bit more over the next few days.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 08, 2022, 07:47:19 am
Dear PCP, yesterday I got some timefor my toy and found all FOUR BNC decoupling capacitors short circuited, and as an extra de 150 nF input capacitor for channel one was 0 ohms too. Now the reference 1.25V is present at the BNC connectors thanks to you.

Well that makes you wonder what has happened to that scope :o

Which are de improvements on your firmware, I´m very curious about to know them in order to proceed with the flash with your help to invert X/Y TP coordinates.

As you can read in the previous post the touch has now been resolved with a configuration file.

Apparently FNIRSI made several versions of the firmware to cater for the different hardware out there. Seems to be the earlier models that have the touch panel either configured differently or have a different touch panel driver IC. Funny thing is that the whole new firmware quest arose from a defective and then when replaced inverted touch panel :-DD

To summarize the improvements:

1) Solved the hanging scope after USB disconnect
  A lot of the times the original firmware freezes when something has been read or written from/to the SD card via the USB connection and is then disconnected.
  It took quite a bit of time to tackle this part of the software due to the lack of documentation for the F1C100s and me being new to SD card and USB mass storage software.

2) Improved the handling of the acquisition data.
  The original firmware is sluggish in acquiring and processing the sample data. It also did not make full use of the available data. Furthermore it uses a "special IC" to do unnecessary tasks.
  The communication between the F1C100s and this IC is prone to error causing data corruption in the sample data.
  In the new firmware this "special IC" is no longer used and the full sample data is available. This means 3000 samples for all time base ranges instead of 1500 or even only 750 samples.
  The refresh rate is much higher in the new firmware.
  There is still room for improvement in the display part, to make it look smoother in the 100ns - 5ns/div range.

3) Fixed several issues with the picture and waveform saving and viewing part of the code.
  This part of the code is rewritten to make it more robust. The reverse engineered original code is crap, as is the whole original code. At some point I stopped reversing it because I could not bare the frustration of it anymore.
  The code can still be found in the hack repository. That is already cleaner then the original but unfinished. The whole story about this starts on page 20 or so of this thread.

4) Modified the acquisition speed versus time per division setup.
  Added a new menu that allows the selection of both the acquisition speed and the time per division setting. This gives flexibility in zooming in time.

5) Modified the measurement displaying
  In the original firmware the measurements are displayed based on the order of being enabled. This can lead to channel 2 measurements being in between channel 1 measurements.
  In the new firmware channel 1 measurements are on the left and channel 2 on the right. Also the menu has been corrected to reflect this.
  Funny side note: I viewed Dave's review of the scope video a couple of days ago and he rant's about this weirdness in the measurements menu :-DD

These are the main changes. And with it being fully open source it is possible to make it your own.

I have moved on to other projects to learn new things. At the moment I'm working on a arbitrary wave generator with the FA201 FPGA board and a Lichee nano. This will also be open sourced in the Liche nano repository I setup: https://github.com/pecostm32/Lichee_Nano (https://github.com/pecostm32/Lichee_Nano)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 08, 2022, 07:51:31 am
Works perfectly now. For me only X-axis was inverted, I swapped the Y config value back to 0xFF and now touch works. Looking forward to playing around a bit more over the next few days.

Then it is a good thing I made it with separate settings :)

Have fun with it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 08, 2022, 02:39:16 pm
Thanks so much in CAPITAL letters.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 08, 2022, 02:43:03 pm
Ok, derar PCP. As you already know I´m far from being a computer expert. Please let me know where can I find the *.bin with the x/y TP correction, I´m anxious having the scope updated.

Thanks again and again and hope your new project run well!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 08, 2022, 02:49:49 pm
Hi Gus,

the files you need are in attached to this message: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4049428/#msg4049428 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4049428/#msg4049428)

Since the forum does not allow .bin extensions .txt is added to the name.

Depending on what is inverted in the touch on your scope you might have to edit the "standard_display_tp_xy_swap_config_sector.bin.txt" file. The bytes in question are the 29th and 30th. They are set to 0x00 for inverting the touch. The 29th one is for X.

Success,

Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: saki68 on March 08, 2022, 11:51:39 pm
Hello,
First of all, congratulations on your great efforts, especially the  pcrogrammer member :clap: :-+
I noticed that when inserting new firmware (V0.002, V0.003, V0.004) when switching trigger mode to single or normal, the oscilloscope freezes after a couple of touch commands and must turn off after which we have to switch trigger mode to auto to used normally.
This does not happen with the original firmware, it is an older scope with 25Q16 flash.

Trigger mode is not overly necessary, but just to see if something can be fixed in one of the following firmware .
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 09, 2022, 12:16:35 am
Hello dear PCP, four hours and a half trying to send the .bin file to the scope and no way. I´m using a 4GB SD instead of the 8GB you are using,
 it´s the only one variable, does it matter?

Thanks so much
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 09, 2022, 06:19:39 am
Hello dear PCP, four hours and a half trying to send the .bin file to the scope and no way. I´m using a 4GB SD instead of the 8GB you are using,
 it´s the only one variable, does it matter?

Thanks so much

I thought you had it running before, so a bit strange you are not able to load it anymore. The card size should not make a difference, but it might be that the card is broken. I have some cards that don't allow me to load them in the scope, but seem to be working in an USB card reader/writer.

Try it with another card if possible, or use an USB card reader/writer if you have one.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 09, 2022, 06:30:51 am
Hello,
First of all, congratulations on your great efforts, especially the  pcrogrammer member :clap: :-+
I noticed that when inserting new firmware (V0.002, V0.003, V0.004) when switching trigger mode to single or normal, the oscilloscope freezes after a couple of touch commands and must turn off after which we have to switch trigger mode to auto to used normally.
This does not happen with the original firmware, it is an older scope with 25Q16 flash.

Trigger mode is not overly necessary, but just to see if something can be fixed in one of the following firmware .

Hi saki68,

welcome to the forum.

You are the first to report this, so hard to say if it is specific to your device, or specific to the older devices.

Which FPGA is used in your scope? The Altera Cyclone IV or the Anlogic one. The latter has the markings removed.

I played a bit with mine to see what happens, and I did notice it hanging when I tried auto set with normal enabled, but not on other touch commands. Have to do more tests with signals connected to investigate this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: saki68 on March 09, 2022, 08:17:11 am
In my case the FPGA is Altera Cyclone IV .
And yes, this happens when the trigger switches to single or normal mode and then presses AUTO SET, whether we have a signal at the input or not.
With the original firmware, when this is done and the AUTO SET trigger mode is pressed, it automatically switches to auto mode.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 09, 2022, 08:56:30 am
Hi saki68,

then it is clear. I have the same problem here, which means the FPGA needs to be set in AUTO mode before the auto set is done. Again a bit of Chinese logic :o The FPGA has a command of which I assumed it to be disable the trigger logic and just acquire one buffer full of samples. Guess it is not then. This shows I did not test this functionality in normal mode :-[

Will fix it by adding a bit of code to switch back to AUTO mode in the auto set function.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 09, 2022, 09:42:05 am
Fixed this problem and also added some initialization to fill in the signal part of the screen. I noticed that in absence of a trigger and set to NORMAL or SINGLE mode it would remain black on power up.

The changes can be found in the repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: saki68 on March 09, 2022, 09:59:45 am
Yes, I noticed that too, I forgot to write  :palm:...
I'll try a new firmware soon so I'll let you know.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 10, 2022, 01:07:14 am
Hello everybody-

Dear PCP, you are right, I got the 1013d reprogrammed just one time copying the firmware .bin from windows 10 to de SD using an adaptor, something that has no explanation for me, any way the question is a different one.

As per your instructions, the SD Card must have the following files in it:

1. fnirsi_1013d_sd_card_bootloader.bin
2. fnirsi_startup_screen.bin
3. fnirsi_1013d_v0.004.bin

For the #3 file, I´m using:
sudo dd if=fnirsi_1013d_v0.004.bin of=/dev/sdb1 bs=1024 seek=8

(I got the dd instruction to load the x/y coordinates switch that I gess must be done after loading file #3, am I right?)

Now my respetful question: how should I load #1 and #2 files?  :-//

For sure you are getting tired about my ignorance in this linux matters  :palm:

Thanks and thanks, GUS

BTW, this afternoon I bought a 8Gb SD just to kill my last variable and used an sd/USB adaptor in order to conect the sd directly at one raspberry PI3 USB port.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 10, 2022, 05:14:42 am
Hi Gus,

you are wrong. The instructions you refer to are for building the firmware. The final firmware package holds code from the three source projects.

For your scope two things are needed on the SD card:

1) The firmware package. (fnirsi_1013d_v0.005.bin is the latest posted a couple of messages back)
2) The display and touch panel configuration file.

On the SD card these need to be on fixed locations for it to work. The firmware needs to be loaded starting on sector 16 and the configuration file needs to be loaded to sector 710.

So "sudo dd if=fnirsi_1013d_v0.005.bin of=/dev/sdb1 bs=1024 seek=8" is for the firmware and "sudo dd if=standard_display_tp_xy_swap_config_sector.bin of=/dev/sdb1 bs=1024 seek=355" is for the configuration file.

A SD card sector is 512 bytes. The dd instruction bs=1024 tells it to use blocks of 1024 bytes. The seek=8 instruction tells it to skip the first 8 blocks. 8 * 1024 = 8192 ==> 8192 / 512 = 16 ==> meaning the firmware gets written starting from sector 16.

Once you have the scope working with the correct configuration for your touch panel and a new version of the firmware is released you only have to update the firmware.

For dd to work properly it is necessary to un-mount the SD card, even when directly connected to the Raspberry PI. So when you are performing the above actions you have to use "sudo umount /dev/sdb1" first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: RogueSS on March 10, 2022, 06:20:32 am
Hi Everyone,

New to this forum.
Firstly, I would like to acknowledge my appreciation for the work done by pcprogrammer and everyone else on improving this piece of equipment.

Came across this forum topic when I realized the FFT on this scope was rather lacking.
So I thought that having access to the .CSV data would allow me to process it on a pc using a python script.
Unfortunately the scope does not give you access to .CSV data.

So my first question I guess is the following: Is the plan to add this sort functionality(Access to .CSV file via usb) in the future?

I will be honest in saying that I have not attempted load this new firmware yet. (Afraid I will brick/damage scope, Significant amount of justification was involved to justify this purchase to my better half  :scared: )
Therefore I don't know what functionality have been added so far in terms of MATHS functions.
Will basic maths functions be added: -,+,/,x?

Thanks
RogueSS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: saki68 on March 10, 2022, 07:40:25 am
Congratulations pcprogrammer :clap:, with the latest firmware version the trigger function has been fixed, keep it up .
Move on  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 10, 2022, 11:32:52 am
Hi RogueSS,

first of all welcome to the forum.

Came across this forum topic when I realized the FFT on this scope was rather lacking.

You are correct that the FFT on the original scope is crap. But having said that, it is not implemented in the new firmware. The menu option to enable it is there, but that is it.

So I thought that having access to the .CSV data would allow me to process it on a pc using a python script.
Unfortunately the scope does not give you access to .CSV data.

Correct there is no .csv data available, but there is access to the sample data. In the original firmware it can be found in the .wav files. Someone on this forum made some software to make use of the data. You have to search for it.

In the new firmware there is also the .wav file option, and that provides the full 3000 samples per channel the scope has to offer. I wrote about the format of this file somewhere in this thread :)
The source can be found in the repository and it is not that hard to find what you need in it. Lost of comments in the code.

So my first question I guess is the following: Is the plan to add this sort functionality(Access to .CSV file via usb) in the future?

I have no plans for it at the moment. Moved on to other projects to learn new stuff.

I will be honest in saying that I have not attempted load this new firmware yet. (Afraid I will brick/damage scope, Significant amount of justification was involved to justify this purchase to my better half  :scared: )

It is practically impossible to brick these scopes, apart from applying wrong voltages to it of course. Sure it is possible to corrupt the SD card, but that can be swapped easily when you have a screw driver :-DD

The procedure described in the repository has been used successfully by several members and is quite simple. All you need is a computer with linux.

Therefore I don't know what functionality have been added so far in terms of MATHS functions.
Will basic maths functions be added: -,+,/,x?

The new firmware basically has the same functionality as the original. Only the FFT is missing. The one extra thing in the new firmware is the ability to select the sample rate apart from the time per division. Read through the previous pages to see a summation of the improvements and problems encountered by other users.

Read the text files in the main folder of the repository that holds the firmware. They give more information about what to do and how things came together. Just follow the link below in my signature.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 10, 2022, 01:04:57 pm
Good day PCP. I´m as lost as a horse in a balcony   |O, more clear, impossible. Is there a way on linux to check if in fact the SD sectors was written correctly?

What can I say?,just THANKS, THANKS. :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 10, 2022, 02:37:47 pm
Well you can use dd to read the data from the SD card and write it to a file and then use diff or meld or even wxHexEditor to check if the data is what it should be.

To read the data back use something like "sudo dd if=/dev/sdb1 of=test_read.bin bs=1024 seek=8 count=270". Don't forget to use umount before using dd.

The file test_read.bin will be a bit larger than the firmware file which is ~268KB if I'm not mistaken, but that should not be a big problem in comparing the two files. Otherwise trim down the count or use bs=512 and double the count to get a more accurate result.

For the configuration file the count is 1.

Use google on how to use diff, meld or wxHexEditor on your raspberry pi.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 11, 2022, 10:16:20 pm
Hello friends.
Dear PCP,a friend of mine, linux expert helped me to install the files in the sd. In my raspberry pi3 the SD must be mounted and no numbers after sda. Any way I modiffied the configuration file and the TP is normal, just to discover that the jitter is very pronuciated in y axis (amplitude), for sure a FPGA related issue. BTW your job is amazing.

A good cosmetic detail could be to invert the battery charging icon arrow, it glows to the right, to de discharge side when charger is connected.

With my problem for sure related to the FPGA I think I´m done unless you think diffent.

THANKS, again
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 12, 2022, 07:34:43 am
I should have spotted the usage of the partition in your command |O That is indeed what is wrong. I added a warning in the readme file in the repository that all actions need to be done on the block device and not the partition.

At least one problem solved in your scope. Touch now working as normal. The jitter in the amplitude can have multiple causes. Hard to say without a look on what you are seeing. So if you want help with that make a video and post it on youtube. Post a link to it here.

For the cosmetic detail take a better look at the new one and read more of this thread. It has changed already from an arrow to a lightning bolt.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: DavidAlfa on March 12, 2022, 09:12:31 am
Ahh nothing like checking the free support section in the morning :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 12, 2022, 12:55:12 pm
Ahh nothing like checking the free support section in the morning :-DD

Gives a purpose in live 8)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 15, 2022, 02:23:42 pm
Hi there everyone.

Dear PCP and general audience. This are the videos about the stock and V0.005 FW, for sure it is an issue that belongs only to my Oscilloscope, maybe you can give me clues about how to solve it because your FW is more than good!

Following are the two videos illustrating my problem, same frequency, same parameters.
Stock FW behavior
https://youtu.be/8X_vAiqH_Z0

V0.005 behavior
https://youtu.be/keY5LR544rk

Thanks so much for your time  :clap:

GUS
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 15, 2022, 04:11:25 pm
Hi Gus,

how certain are you that the signal source is good? I ask this to make sure it is the scope that is at fault.

Both stock and new firmware show the instability in the time domain. It is very restless indeed. The stock firmware goes out of its way to filter the signal, and that is why the amplitude variation does not show there.

The new firmware does nothing filter wise, so it displays the signal as it comes in.

It could be caused by a grounding problem. I'm using a Tektronix signal generator, which does not have the terminals connected to the chassis ground, but when the scope is connected to the computer via USB it also shows this kind of behavior.

I will do some tests here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 15, 2022, 04:29:21 pm
Dear PCP.
The signal source comes from a cheap chinnese 60 Mhz generator but in all my scopes shows very stable and clean. I´ll do some tests with a 10X test lead to see if the amplitude continue being jumpy.

Same problem with a 10X lead. Even with its own 1Khz test port the Y instability is exactly the same.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 15, 2022, 04:48:49 pm
My scope show similar behavior. See: https://youtu.be/obdTBKFggbY (https://youtu.be/obdTBKFggbY) A bit more stable in the time domain but it also wobbles in the amplitude.

I think that it is a power supply issue. The battery charge indicator shows a similar wobble. The FPGA will draw more current during acquisition causing the voltage to vary a bit.

It is not for nothing that the stock firmware has a lot of code in there to make the signal look very clean. (But not to clean since they also put a little bit of noise in :-DD)


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gustavo on March 16, 2022, 06:21:54 pm
Hi.
If Fnirsi people insert code to smooth wave representation on scree, it means only one thing the scope has a terrible power supplies design.. Yesterday I measured the ripple on the negative supplies and it was near to 15%, crazzy!

Supplies and front end need a very good thick shield. Needless to say its a 150 scope, but any way it is very poor designed in every aspect. Your jos is incredible but tha lack of "smoothing" code just to protect a terrible power supply design, makes the scope unusable.

BTW the 1.2 Volts supply used by the FPGA is very stable, it comes from a linear regulator. Please tell me you have any good idea about hot to use your 0.005 and get an acceptable behavior.

THANKS and THANKS. GUS ^-^
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 16, 2022, 07:45:57 pm
BTW the 1.2 Volts supply used by the FPGA is very stable, it comes from a linear regulator. Please tell me you have any good idea about hot to use your 0.005 and get an acceptable behavior.

All the main voltages are made with linear regulators. Only for the display boost converters are used. The negative voltage you write about is only used for the display. The problem lies in the fact that they did not use a separate regulator for the ADC's supply and the way they made the DC offset voltages. Also the PCB design could have been better with separate ground planes and ferrite filters for the different sections of the circuit. The whole design is flawed and cheap.

It might be improved upon with bigger capacitors near the ADC's. The signal looks stable right up to the ADC input, so the wobble is introduced in the conversion.

I'm not going to make improvements to the software. It was fun and I learned a lot from doing the reverse engineering, but it was also frustrating at times.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on March 16, 2022, 09:37:30 pm
Hello. It looks like the problem is in synchronization.
The video clearly shows how the signal behaves
at different trigger levels.
When synchronization is disrupted, the signal level is stable.
https://youtu.be/9kEPoelMRzo
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on April 04, 2022, 10:20:50 am
Hi! It looks like the problem is not in synchronization
Signal Video -  https://youtube.com/shorts/Gvucdw35t20 (https://youtube.com/shorts/Gvucdw35t20)
Video without signal, measurements jump - https://youtube.com/shorts/S4TJK1DZlaw (https://youtube.com/shorts/S4TJK1DZlaw)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Felipe Lacerda on May 24, 2022, 02:37:05 am
BTW the 1.2 Volts supply used by the FPGA is very stable, it comes from a linear regulator. Please tell me you have any good idea about hot to use your 0.005 and get an acceptable behavior.

All the main voltages are made with linear regulators. Only for the display boost converters are used. The negative voltage you write about is only used for the display. The problem lies in the fact that they did not use a separate regulator for the ADC's supply and the way they made the DC offset voltages. Also the PCB design could have been better with separate ground planes and ferrite filters for the different sections of the circuit. The whole design is flawed and cheap.

It might be improved upon with bigger capacitors near the ADC's. The signal looks stable right up to the ADC input, so the wobble is introduced in the conversion.

I'm not going to make improvements to the software. It was fun and I learned a lot from doing the reverse engineering, but it was also frustrating at times.

You really are a warrior!
Have you tried attaching an external regulator to the ADC? Zoombie board?
Do you have any suggestions for the switching noise when reduce lcd brightness?

There is a difference in the firmware of the units shipped recently.
But it is not available, to upgrade you have to buy a new product. :--
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 24, 2022, 05:09:18 am
Have you tried attaching an external regulator to the ADC? Zoombie board?

I did not try to make any hardware improvements. Only added the headers for connecting to the FLASH chips and made a connection for JTAG to the FPGA.

Do you have any suggestions for the switching noise when reduce lcd brightness?

The switching noise when LCD brightness is reduced is caused by the fact that the PWM used to control it has a frequency of ~800Hz. This signal turns the boost regulator on and off and due to the soft start function it has, the PWM frequency needs to be below 1KHz. Again a design mishap that could have been avoided by using another control mode given in the regulators datasheet.

There is a difference in the firmware of the units shipped recently.
But it is not available, to upgrade you have to buy a new product. :--

Would be interesting to see what they changed, but to buy a new unit for it :--

If anyone has a new unit they can try the firmware backup program I wrote to get a copy of the FLASH onto the SD card, and post it here.
The source code for it is here: https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/fnirsi_1013d_firmware_backup (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/fnirsi_1013d_firmware_backup)
The binary can be found in this thread: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3807689/#msg3807689)

Edit: Some scopes have slower FLASH chips and need a lower SPI clock to work properly. Uploaded the binaries to the repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on May 25, 2022, 09:04:06 am
Github user notsolowki was kind enough to upload a backup of his new ADS1013D II and on a binary level I can see a lot of differences. Ghidra has to show if the code has changed much, because it might just be reordered or shifted code which leads to jumps having different values.

Found an interesting video on extending Ghidra with CMSIS SVD data.

https://www.youtube.com/watch?v=q4CxE5P6RUE (https://www.youtube.com/watch?v=q4CxE5P6RUE)

It allows for mapping the peripherals to make the C code easier to read. Unfortunately there is no SVD file for the F1C100s, but I'm looking into making one.

At the moment testing this with the GD32E230 code from the 1014D. Copied the SVD file for the STM32F030, but they are not the same, so needs work to make the file match the GD32E230.

The video also learned me how to setup the memory map to overcome the mirroring of the FLASH.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Felipe Lacerda on June 10, 2022, 05:43:55 pm
Would be interesting to see what they changed, but to buy a new unit for it :--

If anyone has a new unit they can try the firmware backup program I wrote to get a copy of the FLASH onto the SD card, and post it here.

Through the support contact recently, and they send me this firmware file.  :box:
The attached file is exactly as I received it, for both display models.
Can you check if they are really different? I don't trust this company.
I hope it can help in some way.

regards.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 10, 2022, 06:46:43 pm
Through the support contact recently, and they sent me this firmware file.  :box:
The attached file is exactly as I received it, for both display models.
Can you check if they are really different? I don't trust this company.

I binary checked the files from the archive with each other and they show the expected differences for the two display types in the field.

Then I checked only the firmware part from the first file of the archive with the one someone on github gave me and these are the same.

There might be a problem with the touch panel though. The github user used my backup program which also saves the touch panel configuration, and that one is different from my original scope. When the firmware writes a new configuration to the touch panel, like we have seen with other versions of the firmware it will create problems.

Checking this with Ghidra is quite a bit of work, so a test of the new firmware on my older scope is probably the easier way to find out what it does. Will look into this later.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 11, 2022, 11:38:22 am
Looked at this "new" firmware on my old scope and it works without disrupting the touch panel, so no worries there.

Did not try it with signals, just tested the user interface and the USB mass storage. Have no idea what they changed. A quick scan did not show any differences, and it still hangs when coming back from USB connect.

Probably not worth updating to it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: kerleada77 on June 30, 2022, 01:33:07 pm
Hello, a new version of the 1013d oscilloscope came to me.
But it does not turn on, dismantled the oscilloscope, the voltage on the batteries is 4v.
Does anyone have a schematic for it?
I will be very grateful for your help
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on June 30, 2022, 03:09:50 pm
Hello kerleada77,

welcome to the forum.

If you had searched this thread you would have found the link to where the schematics can be found.

All you need to work on the scope can be found here: https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: kerleada77 on June 30, 2022, 06:39:11 pm
Hello kerleada77,

welcome to the forum.

If you had searched this thread you would have found the link to where the schematics can be found.

All you need to work on the scope can be found here: https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack)
Thank you so much
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on June 30, 2022, 09:44:04 pm
Hello, a new version of the 1013d oscilloscope came to me.
If you think it's a new version/revision of the PCB,
maybe you could post a high resolution photo of it?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: sigxcpu on July 03, 2022, 03:58:45 pm
While trying to use @pcprogrammer's firmware did anyone encounter a magenta screen with nothing working?
The firmware backup works fine, SD card reformatting an flashing with the loader and files worked fine.
Recovery ("unflashing" the sector 16) works fine.

Both combinations of the firmware (with and without the splash screen) fail with a full magenta screen, frozen. They both display the splash for a very short time then everything is magenta.

I've attached a picture of the board. This is a Daniu ADS1013D acquired ~2 years ago from banggood, so I guess it is not a "new" board.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 03, 2022, 04:23:41 pm
It seems to be the older type pcb but the FPGA does not have the Altera markings, not that it makes a big difference though.

I know others here have the scope with the BNC connectors sticking out like on your scope, but I don't know if they tried the new firmware.

Can you post the firmware you extracted with the firmware backup program, so I can compare it with the versions I have and see if there is a difference that could explain why the new firmware is not working?

The one without the splash screen is not tested, as described in the readme on the repository site.

Make sure you are using this file fnirsi_1013d.bin.  (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin))

The additional configuration files are only needed when the display is shifted or the touch panel gives the wrong coordinates. (X or Y swapped or X and Y swapped)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: sigxcpu on July 03, 2022, 05:23:48 pm
I've attached the TP file, too.

LE: It worked! I've used that specific fnirsi_1013d.bin you provided link for. I don't know what version of that file I was using before (the md5 sum was different). I was 100% sure I downloaded that one.
LE2: X is swapped, Y is fine (both standard and shifted). I tried tp_xy_swap sector but now X is fine and Y is swapped.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 03, 2022, 06:45:36 pm
In the readme there is also an explanation about the configuration file. You just need to change one of the values and the touch panel will work fine.

See this file: https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/configuration_file.txt (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/configuration_file.txt)

Just change the last byte of the sequence to back to 0xFF and y will be fine to.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: salavat on July 13, 2022, 07:54:55 pm
In the readme there is also an explanation about the configuration file.

Hello, I need some help)). Tried to upload your firmware. The most difficult part for me (mac user) was to format SD card properly, I tried various options - run gparted on ubuntu (did not work), using partition manager on windows (cannot recognise scope at all), etc, etc.

After playing around with formatting scope SD card on mac, I got 'SD card error" while booting the scope. FNIRSI logo appears at the beginning. I made a backup of the scope per your instructions on github page.

What should I do?)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 14, 2022, 03:14:04 am
I think others have successfully formatted the SD card with an apple mac.

Since your scope no longer boots, it can't be used as a PC coupled SD card reader/writer, so you have to open it up and take the SD card out and use a different SD card reader/writer to format the card.

You can also buy another SD card and stick it in the scope. Most likely it will already be formatted as needed. The scope will then boot the original firmware, provided you did not do things to modify the FLASH memory.

I only have experience with non virtual machine based Linux Mint in regards to playing with the scope. One important thing I found during development is the need for the un-mounting of the SD card partition(s) before using dd. Not doing so let to unpredicted results.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: salavat on July 14, 2022, 06:56:55 am
Thank you very much, that helped!

I am still want to use your firmware - what happens if I transfer firmware on just ordinary formatted card - will it work?
Do you know mac terminal command line parameters (diskutil) formatting sd card on scope as required? I searched for info, but could not find howto...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 14, 2022, 07:22:59 am
Most factory formatted SD cards have the free space needed before the partition to store the new firmware, so, I guess, yes you could use a new card.

Can't help you with the mac tools for formatting disks. Have never used modern mac's.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: salavat on July 14, 2022, 06:23:44 pm
Most factory formatted SD cards have the free space needed before the partition to store the new firmware, so, I guess, yes you could use a new card.

Can't help you with the mac tools for formatting disks. Have never used modern mac's.

Thanks! One dumb question though)) how do I know that I am using custom firmware?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on July 14, 2022, 06:37:18 pm
That is simple. Underneath the battery symbol you will see a version text and there is an additional top menu item.

See the screen shot here: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4048552/#msg4048552 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4048552/#msg4048552)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cool2000 on July 28, 2022, 04:59:08 pm
Hello,

I added some code for the sd card emulation to the Scope_emulator based on qemu sources:
https://github.com/froloffw7/FNIRSI-1013D-1014D-Hack (https://github.com/froloffw7/FNIRSI-1013D-1014D-Hack)
And also add AllWinner f1c100s ARM CPU and FNIRSI-1013D hardware support to qemu:
https://github.com/froloffw7/qemu (https://github.com/froloffw7/qemu)
Qemu emulation is running quite smooth similar to the real device. Some QEMU screenshots here:
https://github.com/froloffw7/Qemu-FNIRSI-1013D-Emulation-Screenshots (https://github.com/froloffw7/Qemu-FNIRSI-1013D-Emulation-Screenshots)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 08, 2022, 02:08:37 pm
For those interested I'm back on reverse engineering the FPGA.

I have gained some more insights on how the routing in the Anlogic FPGA works and are currently writing code to create a net list based on this new found information. It is a quest for knowledge and not this particular design that I'm after. I do hope that the new found skills will enable me to reverse engineer the Hantek DSO2D15 FPGA design though, which will be far more complex and useful.

Not going to write about it in this thread but any update will be posted here: https://www.eevblog.com/forum/fpga/reverse-engineering-anlogic-al3_10-fpga/ (https://www.eevblog.com/forum/fpga/reverse-engineering-anlogic-al3_10-fpga/)

The last post there is a question, but either no one knows an answer or no one cares enough to post a reply. :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on August 09, 2022, 04:35:35 am
This is great. Hope 1031D will get even better.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on August 12, 2022, 06:23:01 am
Hello,
I'm please that I joined this forum and community.
Big big thank you pcprogrammer for making firmware for this scope.
And my question. My 1013d seems to subtract ~1 VDC reading on CH1, no amount of "calibration" or auto set helps, on low voltage readings obviously is more significant.
I've checked pecostm32' analog input schematic and I'm wondering what I should look for to correct this error. I already resoldered virtually everything around analog input, that didn't help.
Do you have any suggestion what to look for? Maybe it is just some resistor picking up reference voltage with incorrect value?
(http://[attachurl=1])
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2022, 06:58:33 am
Since this is a static difference between the two channels I would advise to measure the voltages going into the ADC and see what the differences are between the two channels.

So measure ANALOG1_ADC_INPUT and ANALOG2_ADC_INPUT and compare them. Then check ADC1_OFFSET and ADC2_OFFSET after the smoothing filters, so on pin 3 of the ADC's.

Also good to know if this behavior is also there with the original firmware?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on August 12, 2022, 07:26:20 am
Thank you pcprogrammer for such fast response.
Yes, the same behavior is with the original firmware.
I'm sitting down soon with tools and do measurements and you know.
Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2022, 07:51:05 am
You are welcome.

The fact that it behaves the same with the original firmware shows that it is in the hardware. So best is to compare between the two channels with a DMM.

There is a difference between the OFFSET voltage handling in the original firmware and my firmware. Best use mine when doing the measurements.

Success with your quest :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on August 12, 2022, 09:23:07 am
Findings:
1. I understand that ANALOG1_ADC_INPUT and ANALOG2_ADC_INPUT is ANALOG1_AC_DC and ANALOG2_AC_DC on schematic, PIN1 on SSR MOSFET. They are the same, 1.09V
2. There are differences in resistor's values compared to schematic in filter section but that's not important I believe.
3. There are differences on RS8751RF comparators:
- CH1: "+" 1.10V,  "-" 1.02V,  "OUT" 1.13V
- CH2: "+" 1.19V,  "-" 1.23V,  "OUT" 1.23V

That seems like consistent 0.1V difference. Do you think that something in filters messing this up? 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2022, 09:47:49 am
No you are wrong.

ANALOG1_AC_DC is an output from the FPGA to control the KAQY214STLD "relay" to switch between AC and DC mode.

On the right side of the schematic you can see the signals I pointed to. (See them marked below) These are the outputs of the operational amplifiers.

As long as the resistor values are the same on both channels that won't be the issue.

What you call comparator, I call operational amplifier, and that is what it is here. The fact that there is a 0.1V difference between the two channels might be the problem indeed. The ADC measures the difference between the offset voltage on pin 3 and the input signal on pin 2. (See Scope_Data_Acquisition schematic) So measure the voltages on the ADC input pins against ground and report these back. Then it is possible to figure out what is causing the problem.

You are not looking for a 1V difference between the two channels, because the reading from the ADC is scaled in the software. For a zero reading on the display the input on the ADC should be equal to the offset voltage.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on August 12, 2022, 11:20:49 am
Comparator - its actually a Polish name for operational amplifier  ;) so apologize for that.
Found ANALOG1_AC_DC and ANALOG2_AC_DC.
What I noticed is that K1/K6 relay is on or off depends on V/div, and when it is in off state, VRF1 voltage (1.23V) drops on CH1 after the resistor R70 or PIN 2,7 of K1, VRF1 does not drops before R70 (directly on VRF1). This is not happening on CH2.
1. 50mV/div    (K1/K6 off),  ANALOG1_ADC_INPUT 0.67V, ANALOG2_ADC_INPUT 1.23V
2. 100mV/div  (K1/K6 off),  ANALOG1_ADC_INPUT 0.67V, ANALOG2_ADC_INPUT 1.23V
3. 200mV/div  (K1/K6 on),  ANALOG1_ADC_INPUT 0.95V, ANALOG2_ADC_INPUT 1.23V
4. 500mV/div  (K1/K6 off),  ANALOG1_ADC_INPUT 0.99V, ANALOG2_ADC_INPUT 1.23V
5. 1V/div         (K1/K6 on),  ANALOG1_ADC_INPUT 1.11V, ANALOG2_ADC_INPUT 1.23V
6. 2.5V/div      (K1/K6 off),  ANALOG1_ADC_INPUT 1.17V, ANALOG2_ADC_INPUT 1.23V
7. 5V/div         (K1/K6 on),  ANALOG1_ADC_INPUT 1.20V, ANALOG2_ADC_INPUT 1.23V

CH1 looks messy...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on August 12, 2022, 11:50:15 am
Analog electronics is not really my thing so I don't know how the amplifier works in this setup, but the K1 relay seems to change it from an inverter to an inverting amplifier. (Difference is -1x amplification versus either increasing or decreasing the signal with a variable rate whilst also inverting it)

When K1 is connecting pin 6 with pin 5 R69 is shorted and the offset from VRF1 is disconnected making it an inverter. When pin 6 is connected to pin 7 the feedback loop has R69 in it and the - input of the opamp is set at an offset via R70 to VRF1. The other two relays K2 and K3 select between the different input resistor combinations.

The fact that you see these differences between the two channels shows indeed that channel 1 has a defect. What causes it I don't know. Might be a faulty capacitor, resistor or even the opamp. One way to check if it is the opamp is to swap the two and see if the defect shifts to channel 2.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on August 12, 2022, 12:09:07 pm
After the last measurements I started to get the feeling that its the opamp.. you really confirmed that.
I'll order new opamps and replace it on CH1. It will take a few days (delivery, weekend...) and I'll let you know how it went.
Most of all, thank you!
 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: marauder on September 20, 2022, 11:47:13 am
Dear @pcprogrammer
I did it! It took a long time because I had to buy OPA356 (OAAI)  opamp from China (local, heavily overpriced seller failed to deliver it), I have replaced opamp doing watchmaker job, and the scope is working like a charm.
Thank you very much for your assistance and help.
Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: MilesStarr on October 04, 2022, 06:25:50 pm
This has been a handy little gadget, but I've run into a problem that I don't understand.  Maybe updated firmware would fix this, but before I go opening up the device to do this I wanted to see if anyone else ran into this.  Maybe this isn't addressed in the current firmware changes at all?

The save waveform function seems to work well against the autoscaled calibration.  I took the .wav file, used https://github.com/roberttidey/FNISR1013DScope to dump it into a JSON, and copy it into Excel to figure out the fiddly bits.  Beautiful.

Next I take a saved waveform while I'm looking for pulses on a 1 S/div timescale to then measure the pulse frequency and the data in the JSON doesn't show the pulse I can clearly see that is a few pixels wide on the screen.  So is there anything to be done or just use the obvious answer that this is just the wrong tool for that job.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on October 04, 2022, 07:12:40 pm
The original firmware uses a different acquisition setup for the slow time base settings. I'm not familiar with the software you are referring to, but the data for the slow time base settings might not be in the same part of the file as the data for the fast time base settings.

I did research the code of the original and reversed it to some point, but decided to write my own code and file format for storing the sample data. But I removed the slow time base settings in my version of the firmware.

There is a lot of information about the whole reversal here in this thread, and also a lot of data in this repository: https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack)

Try searching this thread for the .wav file format, it might be that I wrote about it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: MilesStarr on October 10, 2022, 03:31:52 pm
Sounds good, slow capture is functionally not useful then based on my attempts to use it.  Good to know, I'll stick to my other options.  I was just hoping to tote a little battery powered device instead of the wired instruments that I will need to use.

Unfortunately I'm just a mechanical engineer that gets my feet wet in electrical stuff, so your repository is quite over my head!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 10, 2022, 09:27:20 am
Reversing the programming: only in God mode...

Ok it took way more then 7 days, but if I had a son I would have to rename him Jesus, because I did it.  :-DD

The verilog is quite crude and there are some errors still, which might be timing related, but it works on the scope, at least with my firmware.

I will write more about the last endeavors in the thread in the FPGA section. https://www.eevblog.com/forum/fpga/reverse-engineering-anlogic-al3_10-fpga/50/#lastPost (https://www.eevblog.com/forum/fpga/reverse-engineering-anlogic-al3_10-fpga/50/#lastPost)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Kean on November 10, 2022, 10:18:30 am
Ok it took way more then 7 days, but if I had a son I would have to rename him Jesus, because I did it.  :-DD

The verilog is quite crude and there are some errors still, which might be timing related, but it works on the scope, at least with my firmware.

Congrats!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: mobby_6kl on November 11, 2022, 11:32:52 am
Hey all, I'm pretty sure I used to have an account years ago to talk about repairs but I guess it's gone now :)

I wanted to take advantage of the 11.11 sales to get my first scope for basic hobby and electronics or car repair stuff. I don't work on electronics every day, and in fact more like a few times a month so I wanted to keep the budget reasonable. Is this scope still a decent option? Right now it's about $140 including shipping and VAT. Some other alternatives I see could be the Hantek 6022BE, maybe 1008c, or Owon VDS1022. The tablet/usb form factor I think would be helpful for using it outside occasionally.

I've read through (some) of this and other budget scope threads but unfortunately I don't know enough to be able to tell what's a big deal or not. Is 13ns rise time ok for a budget scope? Is fake 100Mhz better than the more realistic 20Mhz in the other scopes? Software/hardware triggers, etc, I've no idea. Use would be occasional Arduino/ESP32 project, hobby-level repair or watching sensors in the car, etc. Thanks, appreciate any suggestions.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 11, 2022, 12:02:28 pm
Don't know about car electronics and sensors, but for the occasional Arduino or ESP32 project it is ok, but don't expect protocol decoding. It works fine up to 20 or 30MHz.

I have not tried working with it outside, so can't tell if the visibility out in the open is good. I like the size of the display compared to some of the other handhelds.

As long as you are aware that the actual specifications are
100mV/div
200MSa/s
~30MHz bandwidth
3KB usable sample memory per channel (In the FPGA it is actually using 4K * 32bits)

Have not kept up to date with prices, so no idea if $140 can get you something better.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on November 11, 2022, 12:19:24 pm
You could also take a look at the Owon HDS242,
the specs are real and it goes down to 10mV/div.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 11, 2022, 04:03:41 pm
You could also take a look at the Owon HDS242,
the specs are real and it goes down to 10mV/div.

You don't need 10mV for "Arduino".

I used something worse than this for "Arduino" for a couple of years. The difference between having something like this and having no scope at all is night/day.

For $140 in this form factor and battery powered? I'd get one.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on November 11, 2022, 06:08:05 pm
Hey all, I'm pretty sure I used to have an account years ago to talk about repairs but I guess it's gone now :)

I wanted to take advantage of the 11.11 sales to get my first scope for basic hobby and electronics or car repair stuff. I don't work on electronics every day, and in fact more like a few times a month so I wanted to keep the budget reasonable. Is this scope still a decent option? Right now it's about $140 including shipping and VAT. Some other alternatives I see could be the Hantek 6022BE, maybe 1008c, or Owon VDS1022. The tablet/usb form factor I think would be helpful for using it outside occasionally.

I've read through (some) of this and other budget scope threads but unfortunately I don't know enough to be able to tell what's a big deal or not. Is 13ns rise time ok for a budget scope? Is fake 100Mhz better than the more realistic 20Mhz in the other scopes? Software/hardware triggers, etc, I've no idea. Use would be occasional Arduino/ESP32 project, hobby-level repair or watching sensors in the car, etc. Thanks, appreciate any suggestions.
in general, stay away from USB scopes like the Hantek 6022BE. I have one, and it's junk. No hardware trigger, no AC coupling, poor software (even if there are slightly better open osurce alternatives). Also, USB scopes put your laptop at risk when used for high voltages/currents like in a car

For Arduino and similar, a logic analyzer is a much more useful tool than a scope. Even a ~$10 Saleae clone (24MHz, 8 channels) will give you a lot of value. Most of the times, when working with processors, you need to analyze digital signals and protocols, things a logic analyzers excels at, and very few scopes do well. Same for sensors in a car, where most use CAN which can be fully decoded by a cheap logic analyzer. Decoders can also be "stacked" so if you have for example a QSPI EEPROM, you can see either the QSPI instructions or the memory instructions directly (first you capture a stream of bits for each wire, then you interpret those bits as QSPI commands, then you interpret the QSPI commands into EEPROM instructions, all automatically done for you). With a scope, you'd see a tiny portion of that stream of bits (1 or 2 channels), not even enough for a frame. With a logic analyzer you see all 6 signals in parallel and can capture thousands of packets to analyze

The only times when you need a scope, is when a signal is corrupted by noise or otherwise. After all, all digital signals are analog in nature, and only an oscilloscope allows you to see malformed signals. But in that case, you usually need a better scope than what $100 can buy you. For most people a cheap, used 100MHz analog scope would be much better than a cheap digital one (space permitting, those things are beasts). Not saying a scope is not needed, but a toy scope won't help a digital hobbyist much either

Given your requirements, I'd buy first a $10 logic analyzer. And keep my eyes open for a used scope (Rigol or analog). Once you have more experience, you will know what you need in an oscilloscope. I used an analog dual channel 100MHz for years (and logic analyzers), then found a used Rigol DS2072A (300MHz, dual channel, 2Gsps) for $275 on Craigslist, which is my main scope for all analog and digital work
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 11, 2022, 06:25:41 pm
For Arduino and similar, a logic analyzer is a much more useful tool than a scope. Even a ~$10 Saleae clone (24MHz, 8 channels) will give you a lot of value. Most of the times, when working with processors, you need to analyze digital signals and protocols, things a logic analyzers excels at, and very few scopes do well.

But sometimes you want to watch the signals in real time, which those gadgets don't seem to do.

(Why not? It would be 10x more useful...  :-// )
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on November 11, 2022, 11:57:09 pm

But sometimes you want to watch the signals in real time, which those gadgets don't seem to do.

(Why not? It would be 10x more useful...  :-// )
I never found that to be a problem. With proper triggering (currently using a DsLogic), you can capture the relevant event and have it displayed in a fraction of a second.

By definition, signals you capture with a logic analyzer are too fast to be analyzed in real time. Even a relatively slow I2C fully decoded, is still too fast for real time display. Much better to capture the full stream for later analysis. Being able to capture and analyze 10 seconds of data is way more useful than a real time display. Coupled with extra signal pins for debugging, you can capture exactly what you need: set an extra GPIO to be used as a trigger or a marker

I guess I could think of a few edge cases where a real time display might be somewhat useful, but 10x more useful? Really not. Possibly 1% more useful in a typical usage

What scenario do you envision where real time display of events happening at a few tens of thousands per second can be useful? Nobody can read hex data at those speeds
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 12, 2022, 07:28:45 pm
By definition, signals you capture with a logic analyzer are too fast to be analyzed in real time. Even a relatively slow I2C fully decoded, is still too fast for real time display.

Sometimes I just want to see if a Arduino pin is changing or not after I press a button. I don't want to be constantly pressing "record"..."stop"...mouse around a bit to find the signal...   :horse:

Just show me the state of the line in real time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: robca on November 12, 2022, 07:58:11 pm
By definition, signals you capture with a logic analyzer are too fast to be analyzed in real time. Even a relatively slow I2C fully decoded, is still too fast for real time display.

Sometimes I just want to see if a Arduino pin is changing or not after I press a button. I don't want to be constantly pressing "record"..."stop"...mouse around a bit to find the signal...   :horse:

Just show me the state of the line in real time.
So, you basically want a multimeter set in voltmeter mode?  >:D

I mean, there are a lot of simple ways to do what you want, from a multimeter to a LED to an oscilloscope... I would not use a logic analyzer connected to a PC to monitor a single line for a slowly occurring event.

Incidentally, the hardware is capable of doing it, even the cheap $10 Seleae clones. Nobody seems to have written the code to handle it. I can set my DSLogic to capture in repetitive mode, and I get pretty much real time display of up to 16 signals. Sigrok command line has an option called --continuous, to continuously capture and decode signals. Saleae at some point offered Live View for some of their products https://blog.saleae.com/real-time-view-release-2/. Analog's Discovery offers real time also, from what I read.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: mobby_6kl on November 12, 2022, 09:06:54 pm
Thanks all.

I should mention I do have a logic analyzer (one of those knockoffs) and it is indeed very useful for debugging i2c or other digital communication. But as Fungus says, it would be sometimes nice to actually see the signals, and not everything is completely digital either. Whether it's "pay $200 for something that will sit in a drawer 360 days a year" I'm still not sure though, but I have a few hours left to decide :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: ledtester on November 12, 2022, 11:33:41 pm
You might look at the DSO2512G:

https://www.aliexpress.us/item/3256802899439203.html (https://www.aliexpress.us/item/3256802899439203.html)

Recent eevblog discussion:

https://www.eevblog.com/forum/testgear/new-2ch-pocket-dsosg-sigpeak-dso2512g/msg4506109/#msg4506109 (https://www.eevblog.com/forum/testgear/new-2ch-pocket-dsosg-sigpeak-dso2512g/msg4506109/#msg4506109)

Note that the video output is PAL not NTSC so you won't get color on NTSC monitors.

The Adrian Black video is here:

4/12 This $57 portable oscilloscope has a really cool feature (ZEEWEII DSO1511G review)
https://youtu.be/Uqrel5fQpK4 (https://youtu.be/Uqrel5fQpK4)

Adrian talks about the PAL/NTSC issue at 43:30.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 13, 2022, 09:43:37 am
Incidentally, the hardware is capable of doing it, even the cheap $10 Seleae clones. Nobody seems to have written the code to handle it.

Yep, I have no idea why Sigrok doesn't have a "real time" mode.  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Fungus on November 13, 2022, 09:45:06 am
So, you basically want a multimeter set in voltmeter mode?  >:D

Sometimes I want three or four.

And looking at a number isn't the same as looking at a graph.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 07:05:06 am
Hi there
imagine, I read all these pages.
As I understand, one of the root problem is the preparation of the
SD card. Not everyone has linux available and even with the linux, the procedure is rather complicated.


Why not use SD card image? As it realized for Raspberry and other boards.
With the Win32diskimager, Rufus or another tool this become one-click procedure.


So, the question is:
are there kind enougth people, who can make card image from his Scope and upload here.


Also card images with service programs are usefull.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 08:25:12 am
Most cards are already formatted as should and is dd really that complicated?

I don't use Windows, and have no knowledge on a SD card image format you mention, but I guess it should be simple enough to make something. But with an image the card size might be a given and you either loose space on a bigger card or it does not work with a smaller card.

I believe others have done the installing of the new firmware with a linux variant running in a virtual machine. There are live images available for this on the net. Should not be that difficult to get it done.

Another issue is the configuration file for both the display and touch panel. If tweaking is needed you still have to use some low level tool to write it to the card.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 09:01:58 am
It is common practice to install OS on an SD for the Raspberry PI, for example.
As to configuration files, knowing file location on SD, it is easy to edit bytes in it with any HEX editor.
BTW, could you produce a brief description of config file structure?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 09:58:28 am
BTW, could you produce a brief description of config file structure?

If you read these pages like you claimed you would not have to ask this, but here is a description of the "file" https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/configuration_file.txt (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/configuration_file.txt)

And there is a difference between an "OS" for the Raspberry PI and what I made. For the PI there is a boot loader that is located on the SD card just as where mine is, but the actual OS is in one or more partition(s) with a file system, and after startup this file system is mounted and accessible.

In my setup it is completely hidden outside any partition on the disk. Same for the configuration "file". It is just a sector on the disk with a fixed location. The firmware itself is less then 300KB.

If you want to use it I would say follow the instructions and do the work. It is not that hard.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 12:43:58 pm
Strange,
I put fnirsi_1013d.bin at sector 16 and
standard_display_config_sector.bin at sector 710 of SD card
with HxD editor, but nothing happened.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 01:40:13 pm
The sectors are correct, and the names of the two files are also correct. If these are the files from the github repository in my signature, then it should start with the new firmware.

But I have no sight on what you do, so can't say what is wrong.

Did you verify that what is on the card is actually equal to what is in the file fnirsi_1013d.bin?

The configuration file is only needed when the image on the display is shifted or when the touch panel responds inverted for either x,y or both.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 02:02:38 pm
DiskBegin, FWBegin, FWEnd картинки в HxD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 02:25:25 pm
What happens when you have the SD card in the scope and power it on?

The first bytes of sector 16 seem to be correct so I assume the rest is too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 02:51:35 pm


Цитата: pcprogrammer Сегодня в 08:25:25 (https://www.eevblog.com/forum/index.php?topic=238226.msg4523357#msg4523357)>What happens when you have the SD card in the scope and power it on?

Just normal start in stock FW
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 03:00:11 pm
Sorry can't read Russian :o

But the fact that it starts the stock firmware means it does not see the correct boot header on the SD card. Why I don't know, because at a quick glance it looks ok in your hex listing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 15, 2022, 03:07:45 pm
I guess something wrong with the card structure
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 15, 2022, 03:34:46 pm
The fact that the stock firmware starts without errors means that the card works. The scope would fail with a "SD error" message when the card is not formatted correctly. You can see this by removing the card and then start the scope.

Without hands on it is very difficult to address these kind of problems.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on November 15, 2022, 11:39:36 pm
So, the question is:
are there kind enougth people, who can make card image from his Scope and upload here.

 Try this one. Done with Rufus based on mine 16 GB card, previously created with dd. I also tried to use HxD with no success.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 16, 2022, 06:44:10 am
Bingo!
I write image to 8Gb card until error. Then cancel.
Everything works!


Side effect: card did not recognized by PC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: mobby_6kl on November 16, 2022, 09:27:51 am
You might look at the DSO2512G:

https://www.aliexpress.us/item/3256802899439203.html (https://www.aliexpress.us/item/3256802899439203.html)

Recent eevblog discussion:

https://www.eevblog.com/forum/testgear/new-2ch-pocket-dsosg-sigpeak-dso2512g/msg4506109/#msg4506109 (https://www.eevblog.com/forum/testgear/new-2ch-pocket-dsosg-sigpeak-dso2512g/msg4506109/#msg4506109)

Note that the video output is PAL not NTSC so you won't get color on NTSC monitors.

The Adrian Black video is here:

4/12 This $57 portable oscilloscope has a really cool feature (ZEEWEII DSO1511G review)
https://youtu.be/Uqrel5fQpK4 (https://youtu.be/Uqrel5fQpK4)

Adrian talks about the PAL/NTSC issue at 43:30.
Thanks, this is what I ended up going with. Seems like both reasonably cheap and useful enough, and if I end up getting a real bench scope later, it would be a useful portable tool thus minimizing "waste" :) Let's see.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 16, 2022, 12:35:46 pm
Writing to 16Gb card gives full functional.
So, the technique have a rights to live.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 19, 2022, 09:09:42 am
The 2.5V bias on the input ground terminals is infuriating.
I suppose adding a -2.5V source to power the input OPAMPs would not be difficult.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 19, 2022, 09:47:40 am
Yep, but modifying it won't be easy.

Here is the schematic for the input part https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/Schematics/Scope_Analog_Input.png (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/Schematics/Scope_Analog_Input.png)

The 2.5V reference voltage you mention is only 1.25V, and is used throughout the design. To improve on it you would have to rip out the whole front end and create your own. It is not worth it in my opinion, because the rest of the sampling system is also crap.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 19, 2022, 01:12:09 pm

Did it quick and dirty. The most painful operation was cutting grounds at OPAMPs.

The offset solution is not perfect, but it works.

The test signal is now displayed with the correct ground level.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 20, 2022, 10:11:12 am
Improved variant
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 20, 2022, 01:08:06 pm

Somewhere in this thread already mentioned the ability to switch the firmware.
I have automated the process.
The circuit is plugged between 3.3V and SD card supply pin.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on November 22, 2022, 11:08:30 am
Final and most stable offset Mod.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dimorlus on December 01, 2022, 11:28:58 am
Is there a way to update software under Windows, possible on a SD card in a card reader? Maybe there is a ready SD image for win32diskimager-1.0.0?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on December 01, 2022, 07:52:48 pm
See reply #1480 on November 15, 2022, higher on this page. Image of 16 GB SD card made with Rufus.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 02, 2022, 05:49:37 am
I added the file to the firmware repository.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dimorlus on December 02, 2022, 11:22:17 am
Ok, firmware works with rufus image. But when I connect Ch1 to the Test signal of the oscilloscope and press "Auto set" button, I see that both channels start to jump in vertical direction. It depends of the sync level, if there is no synchronization channels are not jumps. With the original SD card all ok.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 02, 2022, 12:42:19 pm
Did you use the calibration function first?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dimorlus on December 02, 2022, 03:08:28 pm
Did you use the calibration function first?

After calibration shaking of the both channels (connected to the "Test 1kHz" only CH1) become less, but didn't disappear.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 02, 2022, 04:10:22 pm
Well it is free and open source and comes as it is. You can always revert to the original firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dimorlus on December 02, 2022, 04:53:02 pm
Sure, in any case, thanks a lot.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on December 03, 2022, 07:13:44 am
Hi. Today i have turned on the the device and after few moments the screen turned off. Now it does not power on at all. It was not measuring anything when it turned off. Any clue what could be wrong?

TNX
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 03, 2022, 07:21:28 am
Dead battery, voltage regulator, etc. It can be a lot of things that are at fault. You will have to open it up and measure voltages.

Take a look here: https://www.eevblog.com/forum/testgear/fnirsi-1013d-as-much-use-as-a-chocolate-fireguard/ (https://www.eevblog.com/forum/testgear/fnirsi-1013d-as-much-use-as-a-chocolate-fireguard/)
That one still works but faulty. There are pointers on measuring the voltages in that thread.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on December 03, 2022, 08:00:59 am
TNX it helped a lot. BAT is ok on MIC29302 3.3V pin i have 1,92V. I have injected 3.3v on that pin and it has turned on. I have measured on the same chip input and it is BAT input but output is 1,92. So i assume that the MIC29302 is defect. Will order replacement chips.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 03, 2022, 08:12:24 am
Quote
Can a LM2577 or LM2596 be used instead of the MIC2903

No, because it is a linear regulator and not a buck converter.

Edit: I guess you yourself deduced that because you removed the above not literal quoted from your post :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 03, 2022, 08:16:13 am
TNX it helped a lot. BAT is ok on MIC29302 3.3V pin i have 1,92V. I have injected 3.3v on that pin and it has turned on. I have measured on the same chip input and it is BAT input but output is 1,92. So i assume that the MIC29302 is defect. Will order replacement chips.

Did you measure the current when injecting the 3.3V? Should be about 1Amp.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on December 03, 2022, 08:26:39 am
I have used variable power supply  to inject voltage (DPS5020) and it showed 0,8A at the beginning when the relays triggered, after that it has dropped to around 0,55A.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 03, 2022, 09:32:42 am
I have used variable power supply  to inject voltage (DPS5020) and it showed 0,8A at the beginning when the relays triggered, after that it has dropped to around 0,55A.

Sounds good. The ~1Amp I measured was when supplied with 4.5V on the battery terminals. Question is where the remainder of the current is drawn then? Guess it also depends on the selected sample rate. The ADC's might draw more current when clocked at 100MHz. Have to look at the specs.

Another question is why your regulator died?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on December 03, 2022, 10:03:00 am
I do not know. The scopes were not connected when it died. I have touched the terminal with the finger and it went blank. Will report back when i will get the linear regulator replaced so it can help someone in the future. Maybe attach those photos with ref voltages into the git for easy troubleshoot. It was really helpful in my case. I hope you will continue to make it better.

TNX
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 03, 2022, 10:39:10 am
Maybe attach those photos with ref voltages into the git for easy troubleshoot.

Uploaded them to the firmware repository :-+

I hope you will continue to make it better.

No plans for it anytime soon. Busy with other projects :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dimorlus on December 04, 2022, 08:34:21 am
I found another bug. When connected to a sine with a DC offset, firstly, the autoset did not work, and secondly, synchronization was only when the trigger level was "under" the sine, as if a signal without a DC was being received by the trigger
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on December 04, 2022, 08:39:07 am


Quote from: dimorlus on Today at 02:34:21 (https://www.eevblog.com/forum/index.php?topic=238226.msg4560766#msg4560766)
I found another bug. When connected to a sine with a DC offset, firstly, the autoset did not work, and secondly, synchronization was only when the trigger level was "under" the sine, as if a signal without a DC was being received by the trigger

Confirm


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Asu on December 08, 2022, 07:55:58 pm
Hello! First, I want to say thank you to the community here for the informative thread and the people who tirelessly reverse engineered and developed the new firmware. With that said, I have quickly skimmed through all 60+ pages and I'm here to confirm my findings and have some questions if you don't mind answering.

Is it possible to have the new firmware on a new SD card (through SD card reader, not the scope itself) and keep the original SD card as it is and possibly switch between the two firmwares by just swapping SD card in case something goes wrong? If so, what is the definitive steps I can take as a beginner (not much experience in programming)? And overall, how foolproof the whole process should be? Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 09, 2022, 06:16:37 am
Hello Asu,

welcome to the forum.

Yes you can load the new firmware to a new SD card, and it can be done with a separate card reader/writer.

It depends on the operating system you use on your personal computer as to what the procedure is. There is an image of a SD card with the firmware that can be used on Windows with software for writing disk images. Since I'm not a Windows user anymore I can't help with that.

On a Linux machine the same steps described in the firmware repository apply. It does not matter if the SD card is in a dedicated card reader/writer or the scope. Linux just sees them as block devices.

The SD card image is also in the repository, just like most of the needed information to make it work. Follow the link to the repository in my signature below.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolferl1210 on December 09, 2022, 01:53:05 pm
Hello pcprogrammer, thanks for your work and providing it to the community
the FNIRSI-1013D arrived today per mail - ordered at the FNIRSI shop on Aliexpress.

On a Windows PC with Rufus 3.21 the 'NO_LABEL.vhd' that you been so kind and packed
into V0.005_Windows.7z transferred to a 16GB SD

Swapped the original SD with my new created SD ... power ON, here we go, light, easy, perfect!

Wish that all 'hacks' beeing so easy to be implemented

greetings from Vienna/Austria
wolferl1210
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 09, 2022, 02:01:35 pm
On a Windows PC with Rufus 3.21 the 'NO_LABEL.vhd' that you been so kind and packed
into V0.005_Windows.7z transferred to a 16GB SD

That honor goes to Sleo, I just added it to the repository.

But for the rest you are welcome. It was an interesting project.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on December 10, 2022, 08:19:52 pm
Thanks to both of you. I was able to use the .7Z file (even though my SD card had 1 fewer block than the original it seems to work).

Thanks for the new firmware and making it so easy to load with that file using Win32DiskImager.  And for getting rid of the slower boot screen that makes it boot much faster now.

QQ: It seems with the new firmware the trace is a bit more jittery, both in voltage and in frequency, depending on the samples per second selected. It's hard to compare by constantly flipping cards back and forth but it just something I am noticing, or at least think I am, using the new firmware. Is it just me or my scope or an intended change?

Thanks again.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 11, 2022, 05:11:39 am
Hi bffargo,

I know it is a long read, but it is all described in this thread. It is not your scope, it is intentional, because the original software does a lot of unnecessary processing on the data it is much slower in updating. And sure, there is room for improvement with trace averaging, something like dot mode or using a sync function to try to represent the real signal more closely, but that is again a lot of work.

Have fun with it, and when it does not suit your demands just switch back to the original.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on December 11, 2022, 04:15:25 pm
Reversing the programming: only in God mode...

Ok it took way more then 7 days, but if I had a son I would have to rename him Jesus, because I did it.  :-DD

(https://media.tenor.com/ewSGstsRiR8AAAAM/el-sultan-you-the-man.gif)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: techneut on December 11, 2022, 07:37:28 pm
Ok, this is confiusing. One God worshipping another one. :scared:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tv84 on December 11, 2022, 09:38:06 pm
Ok, this is confiusing. One God worshipping another one. :scared:

We're polytheists...  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tatel on December 12, 2022, 05:07:35 pm
A good friend of mine asked me for advice. He wants to buy an oscilloscope for his 18 years old son. He wouldn't want to pay more than €100. I made clear to him that in this price range, any oscilloscope would be quite bad. But he wants advice from me about the more bang-for-the-buck cheap oscilloscope anyway. The boy plays with arduinos and has already a Saleae clone. He also looks at his father's car electronics. So I think either FNIRSI-1013D or Owon VDS1022 could more or less fit the bill. Foriantbr's unofficial firmware for the Owon seems to make that oscilloscope quite a bit better. GitHub repository has a good list of improvements made.

However I wonder what this 1013D with unofficial firmware could do. I looked at the github repository and more or less parsed this thread, but I'm unable to get a feature list of shortcomings solved or new features added by this firmware. It seems that pcprogrammer's firmware more or less does for the FNIRSI the same as oriantbr's for the Owon. I would love to know what this device is capable of, after reflashing. Does that feature list exist? Could you guys give me a pointer to it? Are there any remaining problems?

Also it seem there are at least two variants of 1013D, with recessed or protruding BNC connectors. Any hints about which one would be "better"?

Many kudos for the people that makes that cheap hardware better. I too worship you...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on December 12, 2022, 06:36:36 pm
If you can stretch the budget a bit, you could look at Hantek 2C42 or Owon HDS242.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 12, 2022, 07:43:14 pm
However I wonder what this 1013D with unofficial firmware could do. I looked at the github repository and more or less parsed this thread, but I'm unable to get a feature list of shortcomings solved or new features added by this firmware. It seems that pcprogrammer's firmware more or less does for the FNIRSI the same as oriantbr's for the Owon. I would love to know what this device is capable of, after reflashing. Does that feature list exist? Could you guys give me a pointer to it? Are there any remaining problems?

I think that somewhere in this thread there is a summation and I will try to repeat it here from memory.

The original has a buggy USB mass storage interface that causes the scope to hang when disconnected from the computer.
It also has some bugs when it comes to displaying the correct time per division when zooming in on a stopped signal.
It calculates a perfect sine when the input is above 44.x MHz and displays that instead of the real measured signal.

In it self all minor bugs or features that are not to bad, but are resolved in the open source firmware.

Right out lies from FNIRSI are the 1GSa/s sample rate and the 100MHz bandwidth. Truth is 200Ma/s and ~30MHz.

The open source firmware lacks some features the original has.

The FFT is not implemented.
The ROLL mode when in the 50s -20ms time base settings is not implemented.

A bug with the auto set has been reported that when there is a DC offset in the signal it does not work properly.

Some say that the open source firmware has a bit of a volatile display and it could use some improvement there.

Also it seem there are at least two variants of 1013D, with recessed or protruding BNC connectors. Any hints about which one would be "better"?

Basically the only difference between the two is the look. Hardware is mostly the same. Some older versions with the protruding BNC connectors use an Altera FPGA where the newer ones use an Anlogic FPGA. The programming of the FPGA's is the same.

I would not advise buying either the FNIRSI 1013D or 1014D. The input sensitivity is crap. They say 50mV per division, but that is based on a software zoom. It is 100mV per division with a 1x probe.

But like tunk wrote, a bit more money spend can get your friend a better scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tatel on December 12, 2022, 08:43:32 pm

I would not advise buying either the FNIRSI 1013D or 1014D. The input sensitivity is crap. They say 50mV per division, but that is based on a software zoom. It is 100mV per division with a 1x probe.

But like tunk wrote, a bit more money spend can get your friend a better scope.

Good to know. I'm thinking I'm going to advise him to choose between a dirty cheap toy , the Owon VDS1022 or go all the way to an entry-level, 4-channel, benchtop oscilloscope. If it were me, I would choose the toy and next year it could be the 4-channel. The kid is quite smart and he will need the 4-channel pretty soon. But, not my bussines anyway.

Thank you very much for the information
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tunk on December 12, 2022, 10:15:13 pm
If you go for the toy version, this may have the best performance/price ratio (40/18MHz model):
https://www.eevblog.com/forum/testgear/new-toy()-scope-dso154pro-1ch-claimed-40mss/ (https://www.eevblog.com/forum/testgear/new-toy()-scope-dso154pro-1ch-claimed-40mss/)

Edit: At least on paper - there's no reviews or tests yet.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on January 04, 2023, 05:42:24 am
Just for info. Replacing this one did fix the problem. It is alive again.
Common symptom is that the red led is on but the display is not working, then there is a big chance the chip MIC29302 is dead.
Replacing it with the ne one will fix the problem.
https://www.aliexpress.com/item/1005002625862420.html (https://www.aliexpress.com/item/1005002625862420.html)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2023, 08:26:32 pm
Michal Derkacz (github user ziutek) made an update for the firmware. He improved the RMS measurement and created a new version v0.006 for it. I merged it into the repository after looking at the code. Did not test it myself and took it on face value.

There is no new image file made like for version v0.005, so windows users who fail to use the binary in the repository have to hope on someone posting a new image file here on the forum.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: yar on January 16, 2023, 05:56:43 am
I've lurked on this thread for approximately forever.  I fiddled with the URL and bookmarked a post far into the future, so when I remember to cruise on over here, I get effectively the "last" page, even without logging in.

I don't *need* 100Mhz and as a mere software guy, my standards are pretty low for a scope. I value the small size and absence of a hundred knobs. I use it "just" for finding which wire I've missed, watching i2c (for "yep, that looks like i2c. I really did get all the output bits enabled" or seeing "the device is selected and talking back, but I can't 'hear' it, so I have problems with receiver enable" and not actual decoding) or confirming why two RS-232 devices aren't playing nice, audio issues, timing an interrupt handler or other profiling by wiggling a GPIO during entry/exit, etc. While I *wish* it had protocol decoding, it wasn't advertised with signal decoding and I can break out one of the $6 logic analyzers when I do. I'm just pretty happy to have a small, portable device for those few times I need a scope and not a LA. I wish it would do everything (plus ponies!) but I'm actually not unhappy with this device.

However, I want to give a big thank you to PCProgrammer. Watching the reverse - and then forward - engineering exercise around this thing was VERY educational. Learning more about the horrors of Allwinner (I'm team RISC-V, where they're new, and not ARM at this level) and all the terrible decisions that went into building a low cost cheap product was fascinating to watch. While I've not actually used the results (see also: low standards) the results seem impressive and it's nice to know that if I need this improved version - or want signal decoding badly enough to implement it - that we have this excellent base to build around.

I just wanted to say thank you. It may seem strange that I'm not thanking you for having actually used the end result, I'm thanking you for the insight into the process of reverse engineering, the act of tracing parts back to their mother sources, for the act of figuring out the magic chips - or at least the code that used it well enough you didn't HAVE to figure out the magic chips - was a service to engineers around the globe. It was super clever to build an emulator that first ran the original code so you could work out UI, measurement/signal handling, and related issues on a Normal Computer (with a debugger) and then take that code back to the real hardware - that's definitely a trick I'm keeping in my toolbox.

So, PCProgrammer (and other contributors), I just wanted to say it publicly: Thank You.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on February 14, 2023, 12:20:52 am
Michal Derkacz (github user ziutek) made an update for the firmware. He improved the RMS measurement and created a new version v0.006 for it. I merged it into the repository after looking at the code. Did not test it myself and took it on face value.

There is no new image file made like for version v0.005, so windows users who fail to use the binary in the repository have to hope on someone posting a new image file here on the forum.

I'm too lazy to make an image for each new firmware version (as well as for different SD cards), so I made this little utility for Windows users.

This utility can load/verify/delete binary firmware directly to the USB-connected oscilloscope or to an SD card in a card reader. It can also read/write/clear/compile/fix LCD/TP configuration sector and load/save it as a file.

The utility writes directly to the physical sectors of the selected device, so there is a potential risk of data corruption. As usual, use it at your own risk. But I tried to make it safe enough - it won't work with devices that aren't USB, recognized by the system as hard drives, have a non-512 byte sector size, containing a system volume, etc (and won't even put that devices on the list). Also it can read but will not write to physical sectors that falls within MBR and existing partitions of any type (except of RAW).

The "F1C100S" device (i.e. Allwinner CPU of Fnirsi 1013D/1014D oscilloscope) will be the selected device by default if it is present, then the software will look for SD/SDHC cards and then for other USB storage devices. Side effect: USB flash drives will also be on the list because I don't know of a reliable way to distinguish them from noname USB card readers.

The utility requires administrator rights to directly access the physical device. If you are using an administrative account, elevation will be performed automatically (you may get a UAC warning), for a non-administrative account, you will be prompted for administrator credentials.

This software does not have any undocumented, trojan or destructive features, and does not use any third party libraries and components. It does not write anything to the file system or registry. It's made with Delphi VCL and pure Win32API. Software compatible with systems from Windows XP SP3 to Windows 11 (both X86 and X64). Any bug reports and suggestions are welcome.

How to use: For convenience, place this .exe in the same folder as the firmware binaries (and configuration binaries, if needed) and run. Do not worry about safely removing the device, the program writes data immediately, ignoring system caching. I added everything that is needed at the moment to the zip - two firmware binaries (v0.005 and v0.006) and configuration sectors for 1013D/1014D (without swapping TP, do it yourself, it's easy).

PS: Sorry for not implementing automatic light/dark theme switching, ;-) maybe in the next version...
PPS: For curiosity and possible future use: disabled input fields can be unlocked by double-clicking on the label above it.


By the way. With Windows and original firmware, the oscilloscope mounts as a disk device one second after selecting "USB Connect". With PCProrgammer's firmware (v0.005 and v0.006 tested) this takes some time, maybe a minute. Just wait, then reselect device, if not in the list.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cool2000 on February 14, 2023, 11:34:56 am
It seems that RMS measurement implemented in the version v0.006 requires some changes for the saved WAVE files. Currently it doesn't show correct value.
Possible solutions could be: save calculated RMS value with the other WAVE file settings or recalculate RMS value from the file samples after loading.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on February 14, 2023, 03:50:10 pm
@Sleo
What's wrong?
Launched with admin permissions
Tested on two PC and two card-readers
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on February 14, 2023, 04:47:33 pm
@Sleo
What's wrong?
Launched with admin permissions
Tested on two PC and two card-readers

Sorry, it's not widely tested yet.
Either the specified sectors belong to the mounted partition, or the user does not have write access to the physical device. The third version is of course my mistake somewhere in the code.
i will have to add diagnostic log output for such cases.

Your card may be formatted with not enough space between MBR and first partition. Try, please, press "Clear" button (it rewrites only one sector), does it get the same error?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on February 14, 2023, 07:51:11 pm
Your card may be formatted with not enough space between MBR and first partition. Try, please, press "Clear" button

Maybe you reccomend the right formating?
Clear did nothing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on February 14, 2023, 11:29:10 pm
Your card may be formatted with not enough space between MBR and first partition. Try, please, press "Clear" button

Maybe you reccomend the right formating?
Clear did nothing.

"Clear" does not mean formatting the card, erasing the partition, MBR, etc. It clears (deactivates) the previously written firmware, returning the oscilloscope to its original firmware. More precisely, it writes zero to the first byte of the first sector of the firmware, which does not allow the bootloader to recognize the presence of firmware on the SD card.
If this operation not raises an error, then you have write access to the physical device and the first sector has been successfully overwritten. So it seems to me that the assumption of insufficient "hidden" space is correct. I will write recommendations for such a case a little later.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on February 15, 2023, 01:09:58 am
Your card may be formatted with not enough space between MBR and first partition. Try, please, press "Clear" button

Maybe you reccomend the right formating?
Clear did nothing.

Well, I reproduced this situation.

You can check the offset of the first partition using the command line:
DISKPART
LISt DISk
SELect DISk * (use appropriate disk number here)
SELect PARtition 1
DETail PARtition ("Offset in Bytes" is the value you are interested in)
EXIt

Offset 1048576 bytes is the default for 8 GB and larger devices, partitioned using Windows. This offset leaves about 1 MB of free space for oscilloscope firmware.
But if Windows formats an already partitioned device with less free space, it DOES NOT CHANGE the existing offset. You need to delete the partition and create it again.

Command line way:
DISKPART
LISt DISk
SELect DISk * (use appropriate disk number here)
CLEar
CREate PARtition PRImary
EXIt

Disk Manager way:
Find your card, right click on partition, select "Remove Volume", confirm.
One more right click, select "New Single Volume", next, next, next... You may leave everything as default.

After creating the partition, you need to format it as FAT32. Then use my loader, it should work without errors.
Please note that the default offset for 1..4 GB devices is 65536, so there will not be enough space for oscilloscope firmware without special repartitioning.

I think I should at least add a check for "hidden" free space on the SD, what do you think?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on February 15, 2023, 06:12:25 am
Now that works!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: juan3211 on March 17, 2023, 11:41:53 pm
Hi guys, I am newbie with oscilloscopes.
I have an 1013D between Aliexpres and my home.
I have a doubt about this.

I have read that with the 10x probe, this oscilloscope is capable of measure up to 400v

In oscilloscopes' specs, are these values peak or peak to peak (I mean, from -400 to 400)?
I have found different answers

This is important. If 400v specification is from -400 to 400, then I could use 10x probe to check pure sine inverter wave form

If 400v is peak , then I can't

Another question is: imagine that the previous answer is that I can measure only 400v. Is it better a 100x probe or a 400/40 little transformer ? Does transforme change/disturb/smooth the output sine wave of an inverter ? Even with load connected to inverter ?

Could you guys please ask me first answer? And if I need a 100x probe, for my use may be better/cheaper a little transformer ?

Thanks a lot.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: wolferl1210 on March 18, 2023, 02:18:04 pm
By the way. With Windows and original firmware, the oscilloscope mounts as a disk device one second after selecting "USB Connect". With PCProrgammer's firmware (v0.005 and v0.006 tested) this takes some time, maybe a minute. Just wait, then reselect device, if not in the list.

Thanks for the V0.006 release.

Screen 'USB connection'
Finger tip on the ' ON / OFF ' button and the screen returns to the scope view.
On my Windows PC (Win10 x64) the USB connect never shows up as a device ???

Checked with the device manager in Win10. There is a flick of the screen by tapping ON/OFF, could not find out if and what has changed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 18, 2023, 03:36:49 pm
Checked with the device manager in Win10. There is a flick of the screen by tapping ON/OFF, could not find out if and what has changed.

On the scope side nothing changed for as far as I checked. I don't use windows for development, so can't help there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 18, 2023, 03:39:58 pm
....

Best to start a specific topic with the question about measuring high voltages. I'm no expert on this subject, but would not trust this scope to be save with a 10x probe measuring mains voltage.

But if you do make sure there is no USB connection to anything. Power adapter or computer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: juan3211 on March 18, 2023, 09:54:10 pm
Thanks a lot. I will open a new post.

Anyway, does anybody already do it ???? 10x probe to measure a pure sine wave of 230VAC ?

Thanks.

Best to start a specific topic with the question about measuring hi



Best to start a specific topic with the question about measuring high voltages. I'm no expert on this subject, but would not trust this scope to be save with a 10x probe measuring mains voltage.

But if you do make sure there is no USB connection to anything. Power adapter or computer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on March 20, 2023, 11:25:01 am
Anyway, does anybody already do it ???? 10x probe to measure a pure sine wave of 230VAC ?

Of course somebody did  :)
Just do not connect the scope to the computer with the USB cable during this measurement. The probe itself is limited to 600V peak-to-peak (at 10x) and the scope input is limited to about 40V (400v with 10x probe), so it's suitable for 230V power line measurement.
230V is an RMS value (measured at the line terminal with respect to the neutral terminal or vice versa). The peak value is 1.41 * Vrms = 325V. Both values are displayed relative to zero, which is the ground of the scope. On the one half of the period, Vpeak is +325V, on the other half -325V, so the total sine waveform sweep is 650V. But the maximum peak-to-peak voltage is only 325V with polarity reversal each half of a period.
This oscilloscope has a maximum v/div = 50v (with 10x att) and 8 vertical divisions, so the maximum screen space is 400V. The 650V wave will be off screen with 10x attenuation. To see the full wave, you need a probe with 100x attenuation. You can move the wave up or down to see the bottom or top half, but there is a bug in the alternative firmware with displaying vertically shifted waveforms.

Pictures 1 and 2 - alternative firmware v0.006, pictures 3 and 4 - original Fnirsi firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: juan3211 on March 20, 2023, 08:48:19 pm
Thanks a lot @Sleo.

Of course I will use without conneting any PC or usb cable.

First, thanks a lot, I had a doubt about the 40V limit. I didn't know if it was -20 to 20V or -40 to 40V.  As I have read you, the answer is -20 to 20V is the real limit.

Why have you not broken it with a 10x probe? You are really measuring -32.5 to 32.5V aren't you? Or does the 40V value of the specs a RMS value? (so what a "incorrect" or "misunderstable" specs)

Second, I understand what you say about I won't see full wave.

Do you know if I use a step down transformer to reduce 230VAC to .... 24VAC por example ... will it disturb/smooth/.... the wave? what about FFT (armonics) ? are they affected?

I want to measure the "quality" of different waves from inverters (pure sine, modified, comparation between several pure sine waves or between modified ones)....

Thanks a lot.


Of course somebody did  :)
Just do not connect the scope to the computer with the USB cable during this measurement. The probe itself is limited to 600V peak-to-peak (at 10x) and the scope input is limited to about 40V (400v with 10x probe), so it's suitable for 230V power line measurement.
230V is an RMS value (measured at the line terminal with respect to the neutral terminal or vice versa). The peak value is 1.41 * Vrms = 325V. Both values are displayed relative to zero, which is the ground of the scope. On the one half of the period, Vpeak is +325V, on the other half -325V, so the total sine waveform sweep is 650V. But the maximum peak-to-peak voltage is only 325V with polarity reversal each half of a period.
This oscilloscope has a maximum v/div = 50v (with 10x att) and 8 vertical divisions, so the maximum screen space is 400V. The 650V wave will be off screen with 10x attenuation. To see the full wave, you need a probe with 100x attenuation. You can move the wave up or down to see the bottom or top half, but there is a bug in the alternative firmware with displaying vertically shifted waveforms.

Pictures 1 and 2 - alternative firmware v0.006, pictures 3 and 4 - original Fnirsi firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on March 20, 2023, 11:47:11 pm
I had a doubt about the 40V limit. I didn't know if it was -20 to 20V or -40 to 40V.  As I have read you, the answer is -20 to 20V is the real limit.
No, No. The answer is 40V difference, regardless of polarity. You can measure -40V relative to ground, or +40V relative to ground. But not +40V relative to -40V. This is not the case for an AC power line, where +V and -V present on L-wire relative to N-wire at different times. Maximum peak voltage between L and N for 230VAC line is 325V (absolute value). But the sine waveform is 650V in height due to polarity change during period.

Why have you not broken it with a 10x probe? You are really measuring -32.5 to 32.5V aren't you?
40V limit was found in old version of scope manual. It's not a hardware limit, but just a scope screen height at max v/div. The hardware limit is very high, at least some hundred volts even with 1x probe. The input resistance is at least 1.2MOhm, allowable input current of operational amplifier protection diodes is 10 mA, so it needs about 12 KV on the input terminal to break the input amplifier. The real limit depends on the break voltage of passive components - resistors, capacitors, relays, PCB, probe, etc.

Do you know if I use a step down transformer to reduce 230VAC to .... 24VAC por example ... will it disturb/smooth/.... the wave? what about FFT (armonics) ? are they affected?
Why not to use just a resistive divider? Two resistors 200-500 KOhm @ 0.5W should be a good choice. Transformer has an inductance and magnetization effects, that may affect your waveform.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: 1audio on March 27, 2023, 09:58:35 pm
HV should be a separate subject. However 1) get an X100 probe rated for 1 KV. They are not expensive if you don't need 200 MHz (you don't). 2) a transformer is a very good and safe way to monitor the power line. You get full isolation and some HF and LF filtering of stuff on the power line that is basically noise. A commercial product for that was made but expensive and 120V circuits only.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: cool2000 on May 25, 2023, 09:52:19 pm
1) get an X100 probe rated for 1 KV. They are not expensive if you don't need 200 MHz (you don't).
2) a transformer is a very good and safe way to monitor the power line.
I have one x100 from AliExpress claimed rated for 1KV. After some time it simply stop working, so I have to disassemble it. There was some problem with the central wire. It doesn't look reliable and safe enough. Resisters used in voltage divider definitely not rated for 1KV and isolation itself is very poor.
So I think the transformer should be better option.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Mortys on May 25, 2023, 10:41:32 pm
Hello, can you help me when doing the sleo method, I get the screen displaced to the left
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on May 28, 2023, 10:04:09 pm
You definitely need to write something to the configuration sector. I don't know which configuration is right for your oscilloscope, but you can try all known ones. The only problem is, if the LCD settings are wrong, it may not be so easy to press the "connect" button on the touchscreen. Nevertheless, you can use a card reader to write a different configuration or clear the configuration sector.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on August 11, 2023, 11:08:17 am
Is the oscillation up and down caused by interference in the power supply?  Even the battery charge level fluctuates, wouldn't it help to filter the power supply better? Thank you

https://youtube.com/shorts/-fPYNPpwxRg?feature=share

Is there a bug list of the original and this alternative firmware?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on September 15, 2023, 09:19:40 am
The power supply solution is a disaster.  From the distribution of power paths to the super attack of the connection of analog and digital power on the AD converter.  The use of power supply IOs that have guaranteed parameters at an input voltage of 4.3V and higher is laughable when it is powered from a 4.2V lipo.  It would be appropriate to provide a step-up converter to 5V for the oscilloscope circuits (except the backlight).  Otherwise, on my new version, u17 and U13 are powered by 3v3 (not 2.5v as shown in the schematic)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on September 16, 2023, 05:23:10 pm
The increase in the level of interference when switching from 100 Msa to 200 Msa/s is caused by what?
https://youtu.be/QJjuiEPd3dA
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on September 16, 2023, 07:04:46 pm
Bad hardware design.

The sampling done by the FPGA is done at the set rate divided by two. So on 200MSa/s the ADC clock is 100MHz. The two ADC's per channel are sampled interleaved leading to the 200MSa/s. The higher clock rate will lead to more power usage and can bring more noise on the signals.

That is what you get with a cheap scope.

In the original software they added a lot of filtering on the waveform captures to make it look like a nice and pure signal. In the open source software there is no filtering. The captured data is displayed as is, and shows the imperfections of the system.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on October 11, 2023, 09:42:07 am
 Please Fix this mistake https://www.youtube.com/watch?v=Ujkd74Alvwc (https://www.youtube.com/watch?v=Ujkd74Alvwc)

and fix this ? https://www.youtube.com/watch?v=4lHlmQo4xEU (https://www.youtube.com/watch?v=4lHlmQo4xEU)
Similarly, the cursor moves when selecting the trigger (how does it work, the cursor moves to the selected place depending on ch1 or ch2, but if I select a menu and change my mind or click on ch1 while ch1 was previously selected, it causes the trigger cursor to move.

and The menu item (automatic confirmation) does not work. automatic confirmation is on, it is necessary to constantly tap the screen after calibration for confirmation.

At what voltage does the oscilloscope actually turn off, is the function of automatic shutdown at low voltage implemented in the software?

Vawefrom and picture error

Well thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on October 12, 2023, 07:05:11 am
I interrupted the power supply for the main stabilizer 3.3V.  Now the main stabilizer is powered from the lipol converter => 5V, so the pad does not run when the battery is discharged.  The disadvantage is the constant consumption of the inverter of 0.157mA, Pin4 (AL142, FP6291, MT36291) dc converter enables it to be turned off, so it would probably be possible to connect it to pin 1 SPX293XX

Don't pay attention to the wires, they have a different purpose. The intervention in the pcb is minimal.
[attach=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on October 29, 2023, 03:17:54 pm
I started making some modifications to the code, it's difficult because the code is long and I don't have enough free time.

But I edited the part dealing with calibration, if there is interference at 200MSa/200ns, but that's only on my device.
Automatic confirmation works when calibration is successful, no need to click on the screen.

https://www.youtube.com/watch?v=USaHSeFiv7s (https://www.youtube.com/watch?v=USaHSeFiv7s)

BIN file is: v1.007
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on October 31, 2023, 01:28:22 pm
 Corrected the TRIGGER setting function, it no longer moves when reconfirmed. Changing the color of the TRIGGER cursor, yellow for channel 1 and blue for channel 2.
BIN file 1.008

https://www.youtube.com/watch?v=bDMWeoLttEY (https://www.youtube.com/watch?v=bDMWeoLttEY)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 02, 2023, 08:27:06 am
A minor error appeared there. As for confirmation, during calibration. The flood was thought to be different. So fixed (I inverted it).

If someone were to ask why it is in version 1.00x, even though some changes were made in the ranges during calibration.

Since no one writes anything, you probably don't use it or it works.

!! I take no responsibility if anything goes wrong !!

bin verzia 1.009
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 02, 2023, 09:27:33 pm
I still can't solve the problem with the thumbnail. When turning on the oscilloscope and saving an image or waveform. at the set range of 200MSa/s (200ns/div to 5ns/div) the created thumbnail is damaged.

instead of the signal value, the value 0xF5 is inserted there. I don't understand where it is taken there, and why it is not there with other settings.
I am attaching the thumbnail file.
2. wav is not ok, corrupted input hex0x3B 0x3A
17.wav is corrupted by multiple input of F5 instead of the correct value.

subroutine
void scope_thumbnail_set_trace_data(PCHANNELSETTINGS settings, uint8 *buffer) in scope functions

or here
void scope_create_thumbnail(PTHUMBNAILDATA thumbnaildata)

As you can see, the wav files look fine, but the thumbnail doesn't.
I also wondered if the preview is not made from the displayed data, instead of the raw data that contains the wav. It's been a long time, it definitely needs a fresh look.

The image of the problem overview is on page 62 at the very bottom https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1525/ (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1525/)

can someone look at it, thanks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 03, 2023, 07:03:57 am
I fixed the color of channel 2 in the thumbnail.  :-DD
v1.010
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 03, 2023, 11:44:47 am
Something is wrong there, even on good files there is a recurring 2wav error. has B3 and A3

The problem probably does the subroutine scope_thumbnail_calculate_trace_data. It is not so visible on other ranges. There is inserted 0x3a and 0x3b, but the value there has nothing to do there. I don't know I will fail a subroutine or is somewhere with a memory that it is overlapped and overwriting what it does not.
[attach=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 06, 2023, 10:45:04 am
Thumbnail problem is FIXED. :box:  (wavefrom 4.wav) although the remaining 15 bytes are random and unwritten, but I don't want to deal with it now. So far, no one has minded. It was very difficult to find the problem, without help.

The color of the TRIGGER cursors has been added to the thumbnail, to determine whether it is a TRIGGER of channel 1 or 2. verzia 1.012

I will try to remove the TRIGER problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 06, 2023, 01:29:34 pm
IMPORTANT !!!!
the software contains an error when deleting items (images or wavefrom) if you re-select items that are not displayed there (select or select all) and select DELETE, then confirm the deletion. the device will freeze, and only uploading the special file from page 51 will help (fnirsi_1013d_calib_capture.bin)

(who would do such a stupid thing :D)

After performing the data capture, it is possible to upload the firmware again, the device will work.

(it does not affect the original firmware, it always works)

FIX it!!! it will be updated in the next firmware release
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 06, 2023, 05:29:35 pm
Modified source files (if anyone wants to improve) and bin files can be found here: https://github.com/Atlan4/Fnirsi1013D

ALWAYS contact me before use. The files are not always up to date. It is possible that I have a newer version on my PC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 06, 2023, 05:46:19 pm
It seems that RMS measurement implemented in the version v0.006 requires some changes for the saved WAVE files. Currently it doesn't show correct value.
Possible solutions could be: save calculated RMS value with the other WAVE file settings or recalculate RMS value from the file samples after loading.
Good day. you can specify the problem more precisely. what it does, how it manifests itself, when and where.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 07, 2023, 10:06:34 pm
Fixed the problem with deleting non-existent thumbnails (with total freezing), fixed the graphics of the delete menu, fixed the range of the TRIGGER.

File 1.0.13.bin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 08, 2023, 09:36:18 am
Fine-tuning of TRIGGER values, small correction. Refinement of the position of the course in relation to the horizontal and vertical TRIGGER
file 1.013a

Does anyone know of any bugs?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on November 08, 2023, 11:56:19 am
Does anyone know of any bugs?

... You can move the wave up or down to see the bottom or top half, but there is a bug in the alternative firmware with displaying vertically shifted waveforms.
Pictures 1 and 2 - alternative firmware v0.006, pictures 3 and 4 - original Fnirsi firmware.

Look at pictures 2 and 4 in https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4768094/#msg4768094 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4768094/#msg4768094) - firmware .005 and .006 cute off top/bottom of wave that is higher half of screen, when center is shifted down/up (original firmware do not).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 08, 2023, 02:44:13 pm
That has to do with the way the alternative firmware samples the data. In the original code shifting the display up or down modifies the offset voltage on the ADC, and can show the signal correctly because it then samples the shifted signal, where as the alternative firmware shifts the sampled data on the screen and therefore can't show the top of the signal because it is not there in the sampled data.

The benefit of this setup is that it is possible to move saved wave forms up and down, the down side that it does not work like the original.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on November 09, 2023, 09:36:40 pm
The benefit of this setup is that it is possible to move saved wave forms up and down, the down side that it does not work like the original.
It seems to me that the best way is a combination of two - offset shift when live waveform moved, and screen data shift when saved waveform moved.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on November 09, 2023, 09:55:19 pm
Does anyone know of any bugs?
One more bug (or a feature) is a very slow storage device mounting on Windows (fw .005 to .013 tested, Win10/11). It takes about a minute after pressing "USB Connection". Original firmware mounts in a second.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 09, 2023, 11:10:47 pm
Does anyone know of any bugs?

... You can move the wave up or down to see the bottom or top half, but there is a bug in the alternative firmware with displaying vertically shifted waveforms.
Pictures 1 and 2 - alternative firmware v0.006, pictures 3 and 4 - original Fnirsi firmware.
It's not a bug, it's a feature. The original programmer decided to move the signal only in software, the original firmware moves it by changing the voltage level on the AD converter. Otherwise, when you exceed the range of the converter in the alternative software, you will see the upper-limit or the lower-limit line.
This oscilloscope will never be good, so put a resistor in front of the probe and you will be in the AD converter range :D you will just have to use your head to calculate the voltage.

Look at pictures 2 and 4 in https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4768094/#msg4768094 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4768094/#msg4768094) - firmware .005 and .006 cute off top/bottom of wave that is higher half of screen, when center is shifted down/up (original firmware do not).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 09, 2023, 11:17:39 pm
Switch to linux, you will connect in less than 1s :D And the original soft line freezes when working with usb. To be clear, I will not talk about the periphery. This means no modification of usb, access to sdcart. Even though I'm considering finding out if it would be possible to modify the recording on the card so that data such as time and date can be recorded. However, I am worried about what the IO of the touch panel will say about i2c sharing

P. S. The connection speed problem for windows was fixed in version 0.019b
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 10, 2023, 07:30:39 am
The touch panel won't mind since it uses a dedicated address on the I2C bus, which is bit banged by the way.

@Atlan: When you decide to make such a modification for date and time, I would advise to make it behind a system setting to enable or disable it, since it requires a hardware modification to make it work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 10, 2023, 10:14:41 pm
OK, first I have to find where the data about the date and time of the file is hidden in the code....

I was playing a bit, who can guess what changed :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 11, 2023, 07:51:38 am
@Atlan:
If you plan on using the date/time stamp on the file you can look into the file system code used in the project. (http://elm-chan.org/fsw/ff/ (http://elm-chan.org/fsw/ff/)) Not sure if it supports it.

I did make some modification to the code to protect it against NULL pointers.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 11, 2023, 02:52:01 pm
Added buttons to the measurement menu. Select All and Clear.
https://www.youtube.com/watch?v=T0liHh1Ws1I (https://www.youtube.com/watch?v=T0liHh1Ws1I)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 13, 2023, 09:18:35 am
Correction of measurement menu dimensions, increased select all and clear buttons
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 16, 2023, 06:45:46 pm
This is just another test program, it takes data from channel 1, calculates the average and displays it on channels 2.

         scopesettings.channel2.tracebuffer = ((scopesettings.channel1.tracebuffer) + (channel1tracebufferAVG))/2;
         channel1tracebufferAVG=scopesettings.channel2.tracebuffer;

Anyone can guess what it will do with a non-repeating signal.

I would be interested in something like that, it can be seen better on the video. It's so stupid, but why not.

https://www.youtube.com/watch?v=FTFZfCbf0Mc (https://www.youtube.com/watch?v=FTFZfCbf0Mc)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 16, 2023, 07:41:48 pm
As for the TRIGGER, the original programmer was trying to avoid the imperfection of the flood trigger.
The result is a more stable trigger at high frequencies, but the signal jumps up and down

(all problems are caused by the stupid design of the input and ad converters, and interference with the power supply)

try here is another trigger
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 17, 2023, 07:24:29 am
I want some feedback on the filtering and the other trigger. well thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 17, 2023, 08:05:39 am
The largest part of the trigger handling is done in the FPGA, and it is basically crap. Since it is done on the samples taken it is bound to the sampling rate and won't catch narrow pulses on longer time bases settings.

I did not implement any filtering in my version of the firmware, but if you want to know more about the original firmware filter setup start reading the posts from here on (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg3623711/#msg3623711)

That is where I found the code they used to do what they do and it is quite inefficient. Spend quite some time on figuring it out and then dumped it and decided to go without filtering first.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 17, 2023, 08:39:13 pm
The filtering is not very important, too much filtering will create a nice picture that has nothing in common with reality.
The filter is only because the whole design of it is bad.
And also because there is such a possibility.  Worse is the bouncing trigger at higher frequencies or sampling
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on November 18, 2023, 05:53:42 am
I have tried both firmwares and both shows the same behavior. On original when I do the test measure  on the back of the oscilloscope the 1khz option the wave is shown. Also there is a clear view of the screen.
On both non original firmwares only one tiny violet line is shown when 1khz test is connected. And screen shows on the yellow tumbs brighter horizontal spots.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 18, 2023, 08:18:02 pm
I have tried both firmwares and both shows the same behavior. On original when I do the test measure  on the back of the oscilloscope the 1khz option the wave is shown. Also there is a clear view of the screen.
On both non original firmwares only one tiny violet line is shown when 1khz test is connected. And screen shows on the yellow tumbs brighter horizontal spots.
Please pictures, thank
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on November 19, 2023, 04:40:30 am
Here they are.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 19, 2023, 04:47:16 am
Turn OFF mode X-Y ;)

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: illiac4 on November 19, 2023, 05:21:18 am
Oh. TNX. What about the colors of the screen?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 19, 2023, 05:55:43 am
And screen shows on the yellow tumbs brighter horizontal spots.
fix in firmware 0.019g
This is a question for the flood programmer. I can see a yellow wavefrom on yellow background.

1. Edit Trigger for higher frequencies, and cancel the correction I gave there.
2. 50% TRIGGER to change to calculate it to set it real to 50%
3. Off Move (Tracks) If the channel is turned off.
4. Switching the Sampling Frequency-Repair at WaveFrom Thumbnail

RMS I still didn't look around.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 19, 2023, 10:05:57 am
I started work to integrate RTC DS3231. It will be contributed as a Case and Date Setting menu. And find out if this information can be written to the file. This will require extensive code adjustments. Hardware should not be a problem. Fit 4 wires for large area of 0805 components.

It would not be able to change the file name by date-time and omit the change of file attributes, what do you ?

I will remove the errors described by the bug. Soon a new firmware - modified trigger. I hope it will be good.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 21, 2023, 10:07:44 am
Can someone explain to me the reason why they did not use an analog trigger with a comparator?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on November 21, 2023, 10:26:45 am
Can someone explain to me the reason why they did not use an analog trigger with a comparator?

Who knows? Money, incompetence, inexperience, etc.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 21, 2023, 12:04:07 pm
It is possible when they didn't even give the RTC for 1E.  I have the feeling that they designed it in the simulator and then had it manufactured.  Without any tests.
The whole design looks like it was made by students.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 21, 2023, 08:34:19 pm
So if you have time to have fun. the color of the H trigger varies depending on whether the trigger trigger value is found in the samples. red trigger not found - the middle of the buffer of samples is used. green trigger value found (+- 2 bits)

To give you an idea of how "well" a digital trigger based on an AD converter works.

I think there's no point in looking for the trigger value in the samples. in the case of a rectangular course, there is nowhere. you just have to think that it is always in the middle of the sample.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 22, 2023, 11:22:28 am
Version for use: v0.015
Trigger location, fixed in the center of the sample. (real center-4)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 22, 2023, 04:21:01 pm
So adding RTC to use the file name in date and time format, maybe I will also leave the serial number.

Is anyone thinking about installing the RTC there?

https://www.youtube.com/watch?v=U7UPA64YcXI (https://www.youtube.com/watch?v=U7UPA64YcXI)

Even if I don't announce, I constantly remove errors found.  And I added a couple of them too :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 23, 2023, 01:23:46 pm
I see 15 downloads the last version. Is there a trigger better? Signal less jumps up down?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on November 23, 2023, 06:50:24 pm
Yes. Up down got better. What can not be said about the horizontal, especially less than 100ns.
Thanks for the work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 23, 2023, 07:51:47 pm
Triangle square  sine? Triger 50%? One or 2 period on displej. Pls upload video.

Do you have a lipo to 5V converter installed?  The used linear stabilizer requires a minimum input voltage of 4.3V.  (good idea to power it from a 4.2V battery that is discharging)

https://www.youtube.com/watch?v=7BYtLHjrObw (https://www.youtube.com/watch?v=7BYtLHjrObw)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Alex62 on November 25, 2023, 06:53:36 pm
Video without DC-DC at 5 volts.
I put DC-DC on 5 volts - only the interference increased.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on November 26, 2023, 06:29:15 am
So you have to write it in FNIRSI, because if the captured sample contains the numbers 78,82,77,81 and the trigger is set to 80, it is difficult to find out where the trigger is. That's how a digital trigger works.
Maybe after collecting 10 samples and averaging them, I believe that the signal will be clean, but unrealistic.

The AD converter picks up interference and this has a big impact on the result.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 03, 2023, 07:13:01 am
So the files already have a time and date stamp. 
[attach=1]
It is worse with the display of date and time in the thumbnail oscilloscope, the flood programmer took it quite comprehensively and included the path to the file in the name.  Which complicates things quite a bit.
[attach=2]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 03, 2023, 01:36:23 pm
Fixed error, channel 1 axis could not be moved after autoset, If channel 2 is off.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 05, 2023, 09:20:42 am
Assembly of the RTC module.

https://www.youtube.com/watch?v=YgxN9rrtkDI (https://www.youtube.com/watch?v=YgxN9rrtkDI)

It is necessary to program the menu to set the time and date.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 05, 2023, 05:37:14 pm
There would be interest in modified oscilloscope software for fault finding on underground cables.?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 06, 2023, 08:58:10 am
-----------------------------------------------------------------------------------
******************************** SCOPE FUNCIONS ***********************************
-----------------------------------------------------------------------------------
   4654 50% triger
   4313 50% triger
   4151 colored trigger cursors
   4200 new calculation of the trigger position
   ---- save a reload adding trigger data variables
    224 changing the inscription usb connected to OFFUSB
   7316 thumbnail-adding a trigger cursor color
   7459 thumbnail-adding a trigger cursor color
   6791 correction, forbidden marking of deleted thumbnails
   1511 green box run-black text, stop red box white text
    427 gren-black/red white button Start/stop
   5085 Add calibration osffet horizontal triger, +x move right, -x move left ,scope_display_trace_data
   3606 Select All/Clear add button in measures_menu
   4401 Change chek  scope_process_trigger - for high f ,canceled since version 0.015
   5226 Filtering values on the display (prevsample+sample)/2
   1795 Changing the dimensions of the button and moving the overall placement of the RTC wheel scope_trigger_settings
   4735 Called the function to change the color of the START/STOP button to green when AUTOSET is pressed
   512 471 CHange next and prev function button (inverted) change text
    
----------------------------------------------------------------------------------
******************************* State machine ************************************
----------------------------------------------------------------------------------
    973 confirmation calibration
   2489 change dimension box (confirm delete yes/no)  _|
   1400 runstate change program position gren-black/red white button Start/stop
   1896 Select All/Clear add button in measures_menu
   128  Prohibited shifting of track ch1 if channel CH1 is switched off void touch_handler(void)
   138  Prohibited shifting of track ch2 if channel CH2 is switched off void touch_handler(void)
   527  After Autoset, it is not possible to move CH1 if CH2 is off. If ch2 is off, use touch for ch1   
   1462 CHange next and prev function button in wavwforms view (inverted) 1507
   

List of files where changes were made with line numbers (shifting occurs, so over time the line number will not fit exactly)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 06, 2023, 07:49:31 pm
I thought there would be a gift for 6.12, but I can't make it :D
[attach=1]
FPGA Does anyone know what type it is?
[attach=2]

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 07, 2023, 12:00:00 pm
See light on end.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 07, 2023, 02:50:53 pm
FPGA Does anyone know what type it is?

It is an Anlogic FPGA. Seems yours has yet another one in it. The first batches had an Altera EP4CE6 FPGA in it. Then came a version with an Anlogic AL3-10 (https://anlogic.com/en/product/fpga/saleagle/salal3) and now it seems to be the Anlogic EF2L45LG144B (https://anlogic.com/en/product/fpga/salelf/salelf2). The new one has more memory bits, but less logic cells. Not a problem for their design, because it does not use a lot of it.

Since it works with the firmware I wrote, they most likely did not change the design and if you are interested in it you can check out the work I did on reverse engineering the bitstream for the AL3-10 version. Did not do the full thing, but the part that concerns the sampling is done. Skipped the semi I2C part for the special IC. See the thread (https://www.eevblog.com/forum/fpga/reverse-engineering-anlogic-al3_10-fpga/msg3992447/#msg3992447) on this forum or my github (https://github.com/pecostm32/Anlogic_AL3-10_Analyzing) repository about it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 07, 2023, 03:24:58 pm
I looked at it. It's a shame that you didn't finish it so that more memory is used for the samples. But it's very complicated. I would have to install new programs and learn how to work with them. And then what? new AD converters, new PCB, new input amplifier with divider. And finally, a box with a completely different oscilloscope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 07, 2023, 06:15:13 pm
Version 0.016g full RTC support, g - beta version for testing
https://www.youtube.com/watch?v=CzC73Oc7DBw (https://www.youtube.com/watch?v=CzC73Oc7DBw)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 07, 2023, 08:24:53 pm
I looked at it. It's a shame that you didn't finish it so that more memory is used for the samples. But it's very complicated. I would have to install new programs and learn how to work with them. And then what? new AD converters, new PCB, new input amplifier with divider. And finally, a box with a completely different oscilloscope.

That is why I did not continue with it. Had my fun with the reverse engineering and making the new firmware setup, but in the end the scope is not really worth the time.

A bit of a problem with making a new configuration for the FPGA with more sample memory is the need for dedicated firmware. Would not have been a big issue if the FPGA was configured by the MCU, but it having a dedicated FLASH makes it harder for others to update the scope. Then there is the issue of the different revisions with different FPGA's out there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 08, 2023, 12:23:48 pm
Installed RTC, uploaded the binary.  Everything works great.
 Thank you for your work and the knowledge you share.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 08, 2023, 05:17:48 pm
Fix of the run/stop button switching in SINGLE mode, addition of the WAIT text in single mode.

Added restrictions for setting the days of the month (31 and 30 days), February 28 and 29 days are not blocked. It doesn't matter to anyone, think about it when setting it up.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 10, 2023, 01:10:11 pm
I rolled back the trigger point search. It can be said that it is activated above 3.5Mhz. the color of H changes to red.
Try it. V0. 017
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on December 11, 2023, 07:49:03 am
How to fix problems with RTC
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 11, 2023, 10:13:51 am
The RTC is not installed-connected, or poorly connected

It is necessary to disassemble the oscilloscope. buy a pcb with RTC ds3231, unsolder 2 pieces of resistors, and solder 4 wires. Everything is on the video.

https://www.aliexpress.com/item/1812869576.html?spm=a2g0o.detail.0.0.cff00W710W71WB&gps-id=pcDetailTopMoreOtherSeller&scm=1007.40050.362094.0&scm_id=1007.40050.362094.0&scm-url=1007.40050.362094.0&pvid=e8e29073-4712-4095-b857-7d446b34d0d0&_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40050.362094.0,pvid:e8e29073-4712-4095-b857-7d446b34d0d0,tpp_buckets:668%232846%238110%231995&pdp_npi=4%40dis%21EUR%211.16%211.1%21%21%211.22%21%21%402103081017022902483743824eec29%2112000020316543302%21rec%21SK%21704161510%21 (https://www.aliexpress.com/item/1812869576.html?spm=a2g0o.detail.0.0.cff00W710W71WB&gps-id=pcDetailTopMoreOtherSeller&scm=1007.40050.362094.0&scm_id=1007.40050.362094.0&scm-url=1007.40050.362094.0&pvid=e8e29073-4712-4095-b857-7d446b34d0d0&_t=gps-id:pcDetailTopMoreOtherSeller,scm-url:1007.40050.362094.0,pvid:e8e29073-4712-4095-b857-7d446b34d0d0,tpp_buckets:668%232846%238110%231995&pdp_npi=4%40dis%21EUR%211.16%211.1%21%21%211.22%21%21%402103081017022902483743824eec29%2112000020316543302%21rec%21SK%21704161510%21)

https://www.youtube.com/watch?v=YgxN9rrtkDI (https://www.youtube.com/watch?v=YgxN9rrtkDI)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on December 11, 2023, 04:32:17 pm
You're right,,, was my mistake, there was no power. Thanks.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 11, 2023, 08:56:19 pm
Fine-tuning of display details, correction of touch coordinates for CH1 V- and V+ sensitivity control v0.017a

fix error start stop button with chage triger mode if open sensitivity menu v0.017b
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 12, 2023, 09:53:10 am
Picture view added time and date information.
Correction of thumbnail display errors without time and date. v0.017c
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 12, 2023, 10:09:15 am
Waveform view added time and date information. v0.017d
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 12, 2023, 02:36:19 pm
1. v0.017d - works as intended. 
2. I noticed that the “AutoSet” function does not work correctly in the “DC” mode.  Does not shift the potential “0” indication arrow to realize the full signal swing on the screen.  This works on the original (factory) firmware.  If possible, please fix the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 12, 2023, 03:58:34 pm
Pls video.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 13, 2023, 10:47:34 am
https://youtu.be/HNE1a3KQaxo (https://youtu.be/HNE1a3KQaxo)
https://youtu.be/3ARC39e-rIM (https://youtu.be/3ARC39e-rIM)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 13, 2023, 12:41:41 pm
Do you mean something like that? use sine to see signal clipping
try v0.018b only test (not for use) only channel 1, no autoset
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 14, 2023, 04:52:41 pm
FW v0018b: The voltmeter displays numbers depending on the position of the waveform on the screen.  When moving the zero pointer along the "Y" axis, the signal is shown either above or below the pointer.  Conclusion - the test firmware does not work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 14, 2023, 06:10:21 pm
https://youtu.be/PvyyLhLGvew (https://youtu.be/PvyyLhLGvew)
I wanted that when pressing the "AutoSet" button in the "AC" mode, the zero level indicator, and the signal itself, would always be in the center of the screen (along the "Y" axis).  This is true in new firmware.  In the "DC" mode, when you press the "AutoSet" button, there should be an oscillogram in the center of the screen (along the "Y" axis).  The zero pointer (if there is a constant offset) in this case must be shifted up or down, depending on the polarity of the signal offset.  The voltmeter will show the correct numbers, provided that the signal is within the acceptable range for measurement.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 14, 2023, 08:27:52 pm
Try this.v0.018c channel 1 performs a shift so that the signal is always displayed in the center. (works in a limited range -+0.5V offset) Or do you want it to display as in the original firmware (always in the center, even at the expense of the height of the signal display)

The problem is that it is STILL necessary to adjust the range switching.

You have to realize that I am just editing the program. In order to implement changes, it is necessary to devote a lot of time to it.

If I adjust the scope switching, I think it will work as you want.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 17, 2023, 08:16:45 am
Nowhere in the program is it checked whether the AD converter is not overloaded.
Switching the sensitivity is done based on whether the signal fits on the screen :D

It will have to be modified to work in DC mode.

The last version to use is v0.017d
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 18, 2023, 07:15:15 pm
Autoset for channel 1 if in DC mode with offset. Try the functionality. v0.018f only test
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 21, 2023, 02:58:38 pm
https://youtu.be/nsCt2JHbD0g (https://youtu.be/nsCt2JHbD0g)

Thanks for the work you've done. This is much closer to the original firmware. But the dynamic range is small, or the switching points need to be shifted. I'll post later how it should be.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 21, 2023, 06:15:40 pm
For clarity, I will start with the previous version.
https://youtu.be/T1aCo7WfnYU (https://youtu.be/T1aCo7WfnYU)

All modified versions, from 0005 to 0017d, do not work with signals with a DC offset. Here are some examples:
1. Set the gain to 50mV/div. We apply a sine wave without DC offset, and increase the signal to the limit. We press auto set, and we get a gain of 100 mV/div, and an oscilloscope without limitation. We increase the signal again to the limit. We press auto set, and we get a gain of 200 mV/div, and an oscilloscope without limitation. And so on, that’s how it should work.
2. Enter the DC offset (1:05) to limit the sine from above. Click auto set and get a gain of 100mV/div!!! (was 1v/div), and oscillogram with limitation. I remove the DC offset (1:53). Press auto set and get a gain of 1v/div. And this is the situation at any gain.                                                                           
I suspect that they were too clever with the ADC transformations. It turns out that the measurement of the signal value for working out an auto set does not occur in a complex manner (AC + DC), but only according to the “residues” from the sine limit. Since in AC mode everything works as it should.                                                                       
                                     
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 21, 2023, 06:31:26 pm
In this video, the behavior of the original FNIRSI 1013d firmware under similar conditions, as in the video, post above. The correct operation of the auto set function and the choice of channel gain are clearly visible.

https://youtu.be/CyLg-Wa5yF4 (https://youtu.be/CyLg-Wa5yF4)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 23, 2023, 07:32:38 pm
You brought the error or request for a problem in DC mode. After the release of version 0.017d (that's why no one solved it in previous versions)

I started working on it from version 0.018. Current BETA version for use v0.018g (dc shift applied to ch1 and ch2 channels)

There was already talk about the fact that the old programmer introduced a software shift of the signal.
Therefore, the signal shift due to DC offset is currently solved purely by software. And that's why it has a limited dynamic range.
Therefore, the change of the color of the signal to red is supplemented if there is a limitation of the signal due to exceeding the range of the AD converter.

It's a beta version, so I don't solve some calculation imperfections such as the 50 trigger, and not aligning to the center of the grid
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 24, 2023, 07:09:16 am
Can someone measure voltages in DC and AC 50(60)Hz mode.  With the implementation of the check with a multimeter, for example (aneng8002) or another somewhat accurate one.  It would be appropriate if it was at least 4 oscilloscopes.  2 old 2 new versions.  Measurement on both channels separately.  On the range of 100mV, 200mV, 500mV, 1V, 2.5v and 5V.  Use the following voltages for measurement: 50mV, 100mV, 250mV, 500mV; 1.25V; 2.5V.  Do not forget to calibrate the oscilloscope and the probe in 1x mode before measuring. 

Well thank you. 

Would you be interested in an expanded menu of channels for choosing a specific sensitivity value?  It will be just small buttons.

P.S. HAPPY AND MERRY CHRISTMAS.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 24, 2023, 03:11:23 pm
I only have a simple Chinese analog generator that produces a sine wave of only 2.3V RMS (VPP = 6.6V). I can’t set the voltage and frequency accurately, the error is 0.1-0.2V, 0.1-0.2Hz. If it suits you, I can make a video. Or take a photo?
And questions arise:
1. Specify the firmware versions (old, new) that should be used for measurements.
2. Is the 50 mV range not needed?
3. Which input mode (AC or DC) should I choose when measuring AC?
4. What is the measurement order? Example: select the 5V range, and sequentially apply a signal of 50, 100, 250, 500mV, 1.25V, 2.5V, until a limitation appears. Then we move to the 2.5V range and repeat the signal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 25, 2023, 10:41:19 am
1.software version from 0.006 to 0.0.18j are all the same.
2.50mV is produced by the software
3.Let's simplify it, measure voltage in DC mode
4.
Range 100mV measured voltage 50mV,
range 200mV measured voltage 100mV,
range 500mV measured voltage 250mV,
range of 1V measured voltage 500mV,
range 2.5V measured voltage 1.25V,
range 5V measured voltage 2.5V.

All you need is a 3V power source and some potentiometer and a precise measuring device on which the voltage is set, for example 50mV, then the measured voltage is described from the oscilloscope, for example 47mV

Just write the values on the forum.
50mV - the oscilloscope showed 47mV ......
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 25, 2023, 01:01:10 pm
Range    |       Uin        |     CH1        |     CH2
              |                    |Urms=Uavg | Urms=Uavg
----------------------------------------------------------------
100mv    |   50,11mv   |     54mv      |  54-58mv
----------------------------------------------------------------
200mv    |   100,05mv | 100-108mv |  108mv 
----------------------------------------------------------------
500mv    |   250,1mv   |     250mv    |  250-270mv
----------------------------------------------------------------
   1v       |   500,1mv   |     500mv     |  500mv
----------------------------------------------------------------
  2,5v     |   1,2501v    |1,20 - 1,30v  |  1,20v
----------------------------------------------------------------
   5v       |   2,501v      |      2,5v        |   2,4v
----------------------------------------------------------------
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 25, 2023, 02:48:39 pm
It is not yet clear why, even with the input connector disconnected, the voltmeter shows an offset. 
Moreover, it decreases with increasing sensitivity.
https://youtu.be/OMuJZHylKOM?feature=shared (https://youtu.be/OMuJZHylKOM?feature=shared)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 25, 2023, 03:42:08 pm
The relay is powered by 3V res from the same voltage as the FPGA, AD converters and operational amplifiers.  They have some pickup and when they are turned on and off, the voltage changes, which affects the track.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 25, 2023, 06:10:37 pm
But on the original fnirsi 1013d, under the same conditions, this effect is not observed.  All voltmeter fields show "0".
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 26, 2023, 08:12:08 am
The original firmware ignores the change in 2 or 3 bits.  Try it yourself, take a low voltage source, for example 300mV.  Connect 100k to the potentiometer and connect the oscilloscope to the runner.  And find out that on the range of 100mV DC, the oscilloscope starts to show from a voltage of 35mV.

The original firmware is full of such things, it shows beautiful patterns that do not correspond to reality.  The difference is probably the same as between a painted model and one who gets up in the morning.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 26, 2023, 09:14:24 am
First I checked - everything is as you say.  Then I remembered that I had already read about the included digital filters.  Thank you for the clarification.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 26, 2023, 05:56:53 pm
Editing of the displayed data from the voltage cursors. added Y1 , Y2 and dY. color-coded for channel 1 and channel 2

Small mistake in v0. 018j, but it should be OK version 0.018k
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 27, 2023, 09:52:04 am
tokar: try v0.018l and try to measure the values again to see if the accuracy improves.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 27, 2023, 11:26:06 am
Range    |     Uin          |     CH1          |     CH2   
---------------------------------------------------------------
100mv    |   50,11mv   |   48-50mv     |   50mv   
---------------------------------------------------------------
200mv    |   100,05mv |    100mv       |  100mv   
---------------------------------------------------------------
500mv    |   250,0mv   |     260mv       |  260mv   
---------------------------------------------------------------
   1v        |   500,1mv   |  500-520mv  | 500-520mv
---------------------------------------------------------------
  2,5v      |   1,2501v   |      1,15v        |  1,35v   
---------------------------------------------------------------
   5v        |    2,500v    |       2,4v         | 2,6-2,7v 
---------------------------------------------------------------
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 27, 2023, 12:51:37 pm
Ok, thank you.  I will do the calibration option.  For channel 1 and 2. Calibration at the upper end of the range to reduce the influence of interference.

It will take some time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 27, 2023, 04:41:05 pm
See next
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 27, 2023, 07:22:03 pm
Original solution.  Maybe it will be more convenient than the standard one.  Is this an addition to the main attenuator?  Or will the sidebar be removed in the future?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 28, 2023, 07:04:32 am
The problem with this solution is that you can't see the setting change on the progress.  But for known values ​​of the measured voltage, it will speed up the setting.
There are no plans to remove the sensitivity setting menu.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 28, 2023, 07:36:16 am
I just wanted to draw your attention to the fact that there is no need to abandon the side menu. A similar menu was used in DSO112a (Fnirsi, JYE Tech).  Not very comfortable.  Open the menu, select sensitivity, exit to the screen.  And see that you missed.  And repeat everything from the beginning.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on December 28, 2023, 08:21:36 am
Hi, I bought a new version of the oscilloscope, I am posting the file for the touchscreen. When I did backup according to the instructions, a message appeared on the display special touch panel detected.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 28, 2023, 09:27:27 am
 :popcorn: firmware v0.019a quick menu sensitivity

https://www.youtube.com/watch?v=P80Y6p1X-7g (https://www.youtube.com/watch?v=P80Y6p1X-7g)

display special touch panel detected. If a flood programmer appeared here, he would answer you as soon as possible. Try to be patient. He reads it here sometimes.

Have you tried opening your firmware backup in the loader program and checking the values in the touchscreen tab?
I have never done it, and as always everything at my own risk.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 28, 2023, 10:53:58 am
Hi, I bought a new version of the oscilloscope, I am posting the file for the touchscreen. When I did backup according to the instructions, a message appeared on the display special touch panel detected.

Thanks for uploading the file, and welcome to the forum.

Hope you enjoy your new scope.

Edit: @Atlan. gadak used the flash firmware backup program I wrote and it signaled that he has a scope with the touch panel configuration I was after when I did the reverse engineering and new software development. I, at the time, f'ed up my second scope that has the same touch panel.

Since the first release of the new firmware that is loaded onto the SD card, the touch panel configuration is no longer written to the touch panel. In case of reversed touch coordinates the other hidden configuration file can be modified, like one of your pictures shows a program for I guess.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 28, 2023, 11:55:44 am
So, I have to load the firmware into the oscilloscope, and when I find a problem (but it may be necessary to select the sdcard because it won't be able to click on the usb connection), I have to load the downloaded configuration into the loader, fix it and upload it.  (I see that there are quite different numbers in his file)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 28, 2023, 01:32:13 pm
FNIRSI 1013D Differences between original and alternative firmware.
https://www.youtube.com/watch?v=TLhMkw0sPVY (https://www.youtube.com/watch?v=TLhMkw0sPVY)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 28, 2023, 01:35:20 pm
So, I have to load the firmware into the oscilloscope, and when I find a problem (but it may be necessary to select the sdcard because it won't be able to click on the usb connection), I have to load the downloaded configuration into the loader, fix it and upload it.  (I see that there are quite different numbers in his file)

It is a different configuration file. The one that gadak supplied is what is written in the flash memory of the touch panel. That is no longer used in the new firmware. There is the new configuration file I devised to allow for the needed adjustments of both the LCD settings and the touch panel coordinates reversal, be it in either X, Y or both the directions.

See the manual for the GT911 (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/IC's/GT911%20Programming%20Guide_v0.1.pdf) for explanation about the data in gadak his file. It is what is written to address 0x8047 in the GT911.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 28, 2023, 01:49:20 pm
Everything works better than before. There is little left to do - launch the Fourier transform functionality. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on December 28, 2023, 03:40:23 pm
I installed firmware v.0.019a. Here is how my oscilloscope reacts
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 28, 2023, 03:45:24 pm
is there any problem? does the opposite touch work or?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on December 28, 2023, 04:02:40 pm
Everything works great, all the buttons on the right side of the top bar and the battlebar
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on December 29, 2023, 02:57:02 am
Just wanted to say thanks to all of those working on the alternate firmware. v19 flashed fine for me and like the new controls. Keep up the good work. I wonder what else will be possible in the future?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 29, 2023, 08:35:19 am
I would especially like help with fixing the problem: It takes a long time before the oscilloscope data storage is recognized in Windows. The original firmware will connect immediately.
(I saw that some identifiers were omitted in the alternative firmware)

The future. Complete DC shift via hardware. Fine tune 50 trigger. implement FFT with X cursor

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 29, 2023, 10:16:09 am
I have tried to work through the original firmware as much as possible to find out about the USB setup, but with the lack of documentation about the USB peripheral in the F1C100s it was not easy to get to a working setup. Since I only use Linux for my development, I never tried it on Windows.

The way you can try to find out why it is taking so long on Windows is to look into the communication with Wireshark. I have no idea if it works on Windows for capturing USB communication, but it does on Linux and has helped me during the development. USB is tricky and I tried to keep the code as simple as possible. It might be that I left out some actions needed on Windows for faster connection.

My code is based on samples I found on the internet and some documentation about mass storage and SD cards. Adapted it until it worked fine for me under Linux. Not very professional I know, but it is just hobby. Not earning any money of it.

The code is divided based on the layers. The usb_interface handles the low level part of the communication (the end points) and the mass_storage_class does the middle layer. This is the translation of the commands send via USB to communicate with the SD card. The sd_card_interface is used to connect to the SD card.

Maybe Windows is using the mass storage reset command, which is not implemented, but there is something in comments in the usb_interface about it.

All I can say, the basis is there and success playing with it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Биржа on December 29, 2023, 01:55:35 pm
Подскажите пожалуйста подключил свой fnirsi-1013D к компу хотел попробовать обновить,но при открытии программы за сомневался вроде ни че не нажимал потом отключил.Через день включаю он сначала заставка,а потом черный экран и надпись  SD Cart error :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 29, 2023, 02:30:43 pm
Windows 3x send message: usbd status canceled, but it takes 3x20s.  And for 4 times the oscilloscope after the data is accepted and then the disk is connected.

I'll look into it, but it's very unknown things.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 29, 2023, 02:35:32 pm
Подскажите пожалуйста подключил свой fnirsi-1013D к компу хотел попробовать обновить,но при открытии программы за сомневался вроде ни че не нажимал потом отключил.Через день включаю он сначала заставка,а потом черный экран и надпись  SD Cart error :-//
Insert a new card into the oscilloscope, or format the card fat32 and use the loader program.  Zip and clear/return to factory function.  Alternatively, just remove and insert the card into the oscilloscope, sometimes the card has a bad contact.

And use ang lang
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 29, 2023, 03:05:24 pm
Win 3x send message: usbd status canceled, but it takes 3x20s.  And for 4 times the oscilloscope after the data is accepted and then the disk is connected.

I'll look into it, but it's very unknown things.

My experience with USB is not very extended either.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 29, 2023, 03:07:30 pm
Подскажите пожалуйста подключил свой fnirsi-1013D к компу хотел попробовать обновить,но при открытии программы за сомневался вроде ни че не нажимал потом отключил.Через день включаю он сначала заставка,а потом черный экран и надпись  SD Cart error :-//

Quote
Please tell me, I connected my fnirsi-1013D to the computer, I wanted to try to update, but when I opened the program I doubted it, I didn’t press anything, then I turned it off. Every other day I turn on the screensaver first, and then the black screen and the inscription

Welcome to the forum.

Since this is basically an English written forum, please use google translate to make your posts. Saves us the trouble of translating and you will get a better response.

Cheers,
Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 29, 2023, 03:59:46 pm
I am attaching captured data under win7 using wireshark 3.2.0rc2
The difference is on line 20 or 25, missing storage capacity.

I will try to look at the uncommented things for storage

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Биржа on December 29, 2023, 05:16:14 pm
Thank you very much! I inserted another formatted flash drive and everything worked. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: OneDiy on December 30, 2023, 07:38:35 am
Hello, the mod firmware has a problem measuring high frequency sine waves.
Test video follow this link https://youtu.be/7SoDIUYZDho
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 30, 2023, 07:59:00 am
Hello, the mod firmware has a problem measuring high frequency sine waves.
Test video follow this link https://youtu.be/7SoDIUYZDho

Welcome to the forum.

I looked at your video and the weird spike in the sine wave is definitely wrong, so there is a problem there, but keep in mind that the original does some heavy filtering on what it displays, just to make it look good. Somewhere above 43MHz it even makes up it's own signal as you can see here (https://youtu.be/SApQPL3pDvc).

To determine if it is an error made by me or by Atlan, could you try the same test with my latest version found here (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 30, 2023, 01:03:34 pm
does channel 2 do it too? Surely you don't have any sweep or other function active on that generator?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 30, 2023, 03:03:37 pm
@Atlan. Here is some work stuff used on reverse engineer the USB mass storage device. I need to search my system to find other bits of documentation. Will post it here after I find it.

Edit: added an archive I found on the net and used to figure out the USB peripheral of the F1C100s.

Edit2: I remembered that I used code from Linux for the F1C100s as a guide on the mass storage, so found the files and added them too.

Edit3: Found an other source I looked at during the development. Added that too.

Edit4: The documentation I used can be found here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Manuals). Look at the SCSI_commands_reference.pdf, musbmhdrc_pspgUSB.pdf and usbmassbulk_10.pdf documents for more on the subject.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 30, 2023, 04:09:28 pm
Well thank you.  :popcorn:
But too late, I already fixed it. but it may still be seen.

Try it, the disk will be available in win7 in 6 seconds
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 30, 2023, 04:44:08 pm
I checked v0019b, the initialization time is the same as in the original. Version 0019a was detected in ~63sec, Win 10 home.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 30, 2023, 04:58:24 pm
Thank you for the response.

So what next?  Implementation of FFT or hardware shift of the signal (in dc mode)

P. S. You need a menu for calibration.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 30, 2023, 05:32:15 pm
Hardware shift of the signal is preferable. FFT is rarely required.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on December 30, 2023, 06:44:10 pm
...
P. S. You need a menu for calibration.
I didn't understand your phrase. Do I need to take any action?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on December 30, 2023, 07:45:46 pm


So what next?  Implementation of FFT or hardware shift of the signal (in dc mode)
 

Am I the only one missing the ability to do long time divisions with measurements? The are nice for in-rush and automotive use
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 30, 2023, 08:30:02 pm
Menu for calibration. Because each oscilloscope has slightly different values in the input section and then shows inaccurate voltage values. So that the exact voltage would be connected and software calibration would be performed to measure it more accurately.

After these shifts, any DC will never measure it accurately.
v0.019c add hardware DC shift. Only channel 1 and only for positive osffet. (for negatives it should work as in previous versions)
automatic mode is now in DC mode and the offset is incredibly slow

Write to fnirsi..... long mode does not support TRIGGER.
The plan is to start the oscilloscope with the trigger at the highest sampling frequency, and after the memory is full, it will immediately switch to LONG MODE.
the problem is that this function was not included during programming. that way I have to study it and use it. Be patient. Does the long mode work correctly in the original?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 31, 2023, 07:42:50 am
Alternative firmware: smallest range 200ms/div (has a trigger in all ranges)
Original firmware:
auto: smallest range 50s (20ms - 50s no trigger)
single: the smallest range 10mS has a trigger
normal: smallest range 50ms (20-50ms no trigger)

Is it really necessary to have a free-running watch?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 31, 2023, 08:23:34 am
And that is why I decided to not implement it  :)

For me there is no use case for the roll mode, but implementing it is not that big of a deal. It needs an "if" select between the display functions, because for the roll mode you need to plot the points as they come in.

This can best be done with an interrupt. Setup a timer with the intended sample interval to match the time per division and read the samples with the fpga command 0x28 and data 0x00 to capture the samples and 0x24 and 0x26 to read the data for the two channels. Read 10 bytes per channel and average them.

The sampling rate needs to be set when switching to roll mode with fpga command 0x0D and data 0x00 0x00 0x07 0xD0.

It might require some testing to see it is really like this. Wrote it up based on memory and a quick glance here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/FPGA%20explained).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 31, 2023, 08:25:04 am
thank you

I thought it was enough for fpga to send the value for the timer.  (and appropriate fpga settings) And everything else is already provided by fpga, ie it takes 10 samples, makes an average and stores in fifo.  When the memory fills up with 3000 samples, it will be notified.  The data is then processed and displayed.  I'm wrong?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on December 31, 2023, 12:47:04 pm
To determine if it is an error made by me or by Atlan, could you try the same test with my latest version found here (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin).
I cannot confirm this problem. Tested with a sine wave from 1 to 25 MHz, firmware v.005, v.006 and v.019b. I do not see any spikes, except of broken and shaky line due to no filtering. MHS-5200A DDS-generator was used.

But too late, I already fixed it. but it may still be seen.
Try it, the disk will be available in win7 in 6 seconds
Confirmed, v.019b connected as fast as the original firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 31, 2023, 01:02:24 pm
thank you

I thought it was enough for fpga to send the value for the timer.  (and appropriate fpga settings) And everything else is already provided by fpga, ie it takes 10 samples, makes an average and stores in fifo.  When the memory fills up with 3000 samples, it will be notified.  The data is then processed and displayed.  I'm wrong?

For roll mode the FPGA has no actual support to do a timed capture of the samples. With the commands 0x24 and 0x26 the samples are just taken directly from a single ADC per channel. What I described is how it is more or less done in the original code. There they time the main loop to be so many ms and based on that plot the points as they come in.

To make it a bit more precise I mentioned using a timer interrupt. The difference with the way it is now, where the samples needed for displaying are read in one swoop, and then displayed on the screen, is that each averaged sample is displayed directly after it has been read. So you need a separate function for the displaying, where it uses a global variable to remember the current x position. The main loop then only handles the touch input, while the interrupt routine displays the samples.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 31, 2023, 01:58:51 pm
From here on it seems that the FPGA switches to 0x0D for time base setting and the data is read with 0x24 and 0x26, 10 bytes per read. 0x28 is written 0x01 after or before every read sequence. 0x0D is also written
Once it switches to this state the special IC is no longer addressed. The scope just reads the data with the other hard coded FPGA commands. Probably based on timer interrupt.

time / div     command 0x0D data
 8  100mS          0x00 0x00 0x07 0xD0

Nowhere is it checked whether the transfer has already finished, i.e. that 10 bytes were filled with the AD converter?

Or should I understand it so that the FPGA constantly samples data (according to the set sampling frequency) and with the command 24v or 26 it will give me the last 10 samples?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on December 31, 2023, 02:28:39 pm
The special IC in the original is just a data translator. The data in the repository was made before I found out what the thing did and that it is not needed for anything.

The command 0x0D sets the rate with which the ADC is clocked. The 0x07D0 means 100KSa/s.

With the command 0x28 the mode is selected. Needs to be set to 0x01 for the roll mode sampling. Not sure if it is needed for every read of the samples.

With the command 0x24 the ADC of channel 1 is selected. Reading the FPGA data port after that just returns the last sample the ADC has taken. The code to read the FPGA might be to fast for the 100KSa/s setting and you get the same sample multiple times, or just samples taken in a row, but with no way of knowing the real timing between them.

Command 0x26 selects the ADC of channel 2.

So you can read one sample or many and try to do things with them, but without knowing what the real timing is between the samples one can wonder about the benefits of more samples this way.

My focus when reverse engineering the FPGA was more on the sampling part for the short times per division, so not certain about it all.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on December 31, 2023, 04:39:41 pm
v0.019d only for test
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on January 01, 2024, 05:15:41 am
If you are bored, take a peek at all the "labscope" automotive use cases on YouTube. You will find an amazing use of the scope for those cases. Pico automotive software is a good example.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on January 01, 2024, 05:29:05 am
I will confirm on windows11  19d  connects fast now on usb mode. Prior it took minutes to be detected
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 01, 2024, 11:37:07 am
If you are bored, take a peek at all the "labscope" automotive use cases on YouTube. You will find an amazing use of the scope for those cases. Pico automotive software is a good example.

Send a link to the video or write what exactly you need.  I'll see what I can do with it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: flywheelz on January 02, 2024, 04:14:26 am
I have been watching many reviews of 1013D and I have few questions.

1. Is the buffer only about 2 screens?
2. When zoomed in, are you able to scroll through the whole waveform?
3. What bugs/limitations have been fixed in custom firmware.

Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 02, 2024, 07:24:05 am
3.Displays real unfiltered waveforms ( the original displays an imaginary waveform )
No bug with switch 100mV
It works from 0V (unlike the original)
It doesn't freeze.
The cursor shows Y1 and Y2 and the difference between Y1 and Y2
Possibility to add time and date ( If the RTC circuit is installed )
Ability to choose sensitivity directly from the channel menu
The measurement menu items are on the right side :D
Quick selection of all measurement items, quick cancellation of all measurement items.
Improved appearance
The firmware is constantly improved. ( original firmware never )

disadvantage
no FFT (It's in the plan)

Buffer 3000byte per chanel in FPGA

1 and 2 will be answered by the original programmer.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 02, 2024, 12:25:11 pm
Atlan already answered question number 1. In the FPGA it can hold 4096 samples per channel, but the software reads in, if I remember correctly, 3000 samples. With the screen being about 750 samples wide this means 4 screens in a buffer.

About question number 2, I can't remember if I made it scroll-able into the previous or next screens.

The original firmware has lots of bugs or shortcomings, and most of them are written up in this thread.

Atlan took up the stick and is making several improvements on where I left of, and information about his work can be found in the last 4 or so pages of this thread.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 02, 2024, 04:14:50 pm
How much free memory is actually available in uP?
FFT takes a bit of memory and I have no idea how much is still available. Is it possible to load the entire memory from the FPGA? 4096 bytes? I can't think of any reason why it shouldn't be possible.

I thought about switching (scrolling) using a tap in the lower part, meaning that the trigger will turn, move and contain the page number.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 02, 2024, 07:03:40 pm
The processor has 32MB of memory for both the program and the data. The program is not so big, but the display takes a bit more. My guess is that there is at least 24MB available. It also has some 40K SRAM in the address range 0x0001 0000---0x0001 9FFF, but I don't think I set it up in the linker script, and you would have to make a dedicated segment for it to be used in the code.

There is some issue with the full 4096 bytes of sample memory. Due to the way it is setup in the FPGA it does not use all of it. That is why the code has these weird numbers in there you wrote about a while back, when looking into the trigger system.

Yeah you could do something like that to allow scrolling through the samples. A bit like how it is done with the cursor lines. A more fancy way would be an actual zoom setup with the original signals in the upper half and the zoomed in in the lower half, but that is much more work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: flywheelz on January 03, 2024, 01:26:53 am
Thank you both for the answers. You are doing an amazing job  :-+ Such a shame the software is not updated by the manufacturer or at least release the source. The hardware seems good for the price and nothing else like it.

I have the DS203 with custom fw https://github.com/MotoMaxis/DS203-DSOQuad and it has served me well. Mostly for automotive use that does not require high bandwidth. It shows an okish square wave up to 2Mhz and sine up to 12Mhz. It has 10 screens buffer.  It has a nice selection of Trigger types, Trigger modes, FFT, MAP, SPEC, Invert, Decoders and much more. Its open source.  The input buttons are a pain to use and the 2.8" screen is hard to see in sunlight.  Anyways its my benchmark scope to beat.

I would like my next scope to have a bigger screen buffer. According to the specs of FNIRSI-1013D it has 128Kpts storage but 4 screens seems very little. The DS203 is 4Kpts and has 10 screens.  I can scroll through multiple engine revolutions. However there is no zoom function.

Few Screenshots from my DS203 with Wildcat 6.5 firmware.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 03, 2024, 05:35:32 am
10x200 points on the screen, 1013D theoretically has 4x700 points.
I'll look into it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 03, 2024, 08:58:43 am
According to the specs of FNIRSI-1013D it has 128Kpts storage but 4 screens seems very little.

The specs of the FNIRSI-1013D are a big lie. The original Altera FPGA has 270Kbits of available embedded memory and the newer ones with Anlogic FPGA's have more. (496Kbits or 700Kbits) But what counts is how many of these bits they used, and that is only 32768 bits per channel. So 4KByte per channel of which only about 3500 bytes are usable.

The sampling rate is only max 200MSa/s per channel instead of the 1GSa/s marking on the front and the bandwidth is 30MHz at best.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 03, 2024, 04:52:11 pm
...
After these shifts, any DC will never measure it accurately.
v0.019c add hardware DC shift. Only channel 1 and only for positive osffet. (for negatives it should work as in previous versions)
automatic mode is now in DC mode and the offset is incredibly slow
...
v0019c . Signal limitation occurs at 4.5 screen cells. On the original with 8 cells.
[attach=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 03, 2024, 07:08:18 pm
v0019c.  When you press Autoset, the range with the lower V/div value is selected.  Although weakening is required, not strengthening.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 03, 2024, 10:32:40 pm
I will add to the previous message.  If there were no limitation of 4.5 cells, then an increase in sensitivity would be justified.  In the original, switching to another range occurs at a signal level of 2 cells with increasing sensitivity.  And 5 cells when decreasing.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on January 04, 2024, 07:39:53 pm
I owed the a reply about how restoring the long time division but adding the measurements feature would be nice for automotive use. This shows it nicely from another low cost scope.

We basically need more screen of less samples and still see min/max over the period.  The events might be a car crank and capturing the current for a few seconds for a relative compression test or pressure transducer to determine engine component failure or excessive backpressure.

Here is a playlist of the application (hscope automotive module)

https://www.youtube.com/watch?v=-8ZbvZKquv0&list=PLVTHwkz_OOVHQeRFd9ESd2nMRf4yIIPwL (https://www.youtube.com/watch?v=-8ZbvZKquv0&list=PLVTHwkz_OOVHQeRFd9ESd2nMRf4yIIPwL)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 05, 2024, 08:03:27 am
Tokar: try 0.019d?

Now it is possible to scroll, progress by 2 screens.  350+750+350 display points.  By removing the restriction, it will be possible to move 3000 samples over the entire memory, but I have to find out how the recalculation for display is solved.

Long time is possible, but more change code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: St_dsk on January 05, 2024, 01:33:43 pm
First version Fnirsi-1013D( fpga Altera) firmware v.0.019d. The displayed output voltage, in Ch1 and Ch2, depends on the frequency, with a F>4MHz
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 05, 2024, 02:43:21 pm
Hardware problem, check on original firmware
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 06, 2024, 05:54:37 am
Hello, I noticed one nuance, when setting the brightness of the display from 0 to 50% there is a squeak inside. Is it like this?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 06, 2024, 07:36:08 am
Recovery firmware
If something doesn't work. Or it works strangely.

It beeps even on the original firmware, the more discharged the battery, the louder it beeps.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 06, 2024, 07:41:42 am
Hello, I noticed one nuance, when setting the brightness of the display from 0 to 50% there is a squeak inside. Is it like this?

I'm sure you will hear that too with the original firmware. The brightness setting is done with pulse width modulation of the displays background LED driver. The chip used in the device has a max input frequency of 1KHz, and the FPGA outputs ~800Hz for this. The coil used in the boost converter makes this noise.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 06, 2024, 11:00:28 pm
Tokar: try 0.019d?

v0019d Device after calibration, and autoset. Sensitivity 500mv/div. We increase the DC voltage until the limit is reached, press autoset. And, lo and behold, the signal (2.4v 500mv/div) without limitation, expanded to full screen (0:29). Setting time by pressing autoset is ~5s.
We increase the signal to the limit (5v). We press autoset, the range switches to 1v/div. But the limitation remains. Still the same 4.5 cells as reported earlier (#1697). We increase the voltage to 7V, press autoset. The range changes to 2.5v/div, the limit disappears (1:50).
Then I gradually increase the voltage, and at 16V I get a transition to 5v/div (3:39). But the "0" marker is in the center of the screen. I increase the voltage again, checking the status each time by pressing autoset. There is a limitation at 22V, but there is no offset of the “0” marker (5:20). At 31v we get a marker shift, and, as a result, the signal limitation is removed (7:30).                                               
https://youtu.be/2mIM5b9XkMI (https://youtu.be/2mIM5b9XkMI)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 07, 2024, 06:36:42 am
Moving the signal through the entire memory. it is necessary to reduce the sampling rate in the menu if you want to capture a larger time segment.
beta v0.019e
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 07, 2024, 12:17:41 pm
Hi! Looks like a small bug with setting of pin 14 U1 (output from CPU to LCD) - very small amplitude of LCD_D12 (1V and 50Hz distortions from environment). On original FW there is full amplitude 3V. Because of it there is some graphical noise in a middle of screen (lower bit of Red color is distorted, it viewable on ACQ menu).  Maybe this pin it is not programmed as output?
Also because of it startup logo have not quite smooth gradient
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 07, 2024, 12:25:25 pm
some pictures. tested this pin with another oscilloscope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 07, 2024, 01:37:36 pm
Hi! Looks like a small bug with setting of pin 14 U1 (output from CPU to LCD) - very small amplitude of LCD_D12 (1V and 50Hz distortions from environment). On original FW there is full amplitude 3V. Because of it there is some graphical noise in a middle of screen (lower bit of Red color is distorted, it viewable on ACQ menu).  Maybe this pin it is not programmed as output?
Also because of it startup logo have not quite smooth gradient

Hi _AVP_, welcome to the forum.

Good catch. I did notice something with the display while I did the development, but never looked into it.

And you are absolutely correct that there is a bug. So thanks for mentioning it here.

@Atlan, since you are working on it with new releases, it is easiest if you make the small change. In the function sys_init_display the port configuration register 1 needs not 0x22222227, but 0x22272222. See the code part below. I have not tested it, but it should do the trick. The comment in the source was and is correct, but the actual value was not.  :palm:

Code: [Select]
void sys_init_display(uint16 xsize, uint16 ysize, uint16 *address)
{
  int32   time;
  uint32 *ptr = DISPLAY_CONFIG_ADDRESS;
  uint32  checksum = 0;
  uint32  index;
 
  //Setup the used port D pins for LCD
  *PORTD_CFG0_REG = 0x22222227;   //PD00 is not used for the display
  *PORTD_CFG1_REG = 0x22272222;   //PD12 is not used for the display
  *PORTD_CFG2_REG = 0x00222222;   //Only 22 pins for port D
   
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 07, 2024, 01:50:14 pm
 :-\  :palm: 0.019f  ??? mistake  :scared:

0.019g is ok  :phew:

I hope that there is no similar error when reading data from fpga.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 07, 2024, 02:13:27 pm
I hope that there is no similar error when reading data from fpga.

Doubt it, but you never know. I did make more of these copy, paste forget to edit errors.  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 07, 2024, 02:23:07 pm
I still can't get over the noise on the AD converter. I tried to use a 10-bit converter and the noise is almost the same... I tried to split the power supply for the analog and digital parts at 8-bit and it didn't help.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 07, 2024, 03:26:20 pm
Addition to message #1707.
 v0019d.  I provide a complex AC + DC signal.  I press autoset (0:50).  This results in very slow signal processing.  If the DC signal (only) is processed for 5 seconds, then the complex signal is ~ 30-40 seconds.  During processing, the image on the screen freezes, clearly visible by the clock in the upper right corner.  I reduce the AC signal (2:15), press autoset.  The DC signal spans the entire screen, AC goes beyond the screen, but the limitation does not show (3:10).  I increased the AC value (3:25), the line at the top turned red - limitation.  I turned off the AC signal completely and pressed autoset (3:44).  The result is not satisfactory: 2.5v/div, Uin =12v DC, which does not correspond to the span of 8 cells (4:25).  I reduce the DC signal to a minimum - there is no reaction on the screen.  I set it to 0.5v DC, press autoset (5:25), the readings are correct.  I increase the signal to 12V, press the autoset (5:53, 6:01), and at 2.5v/div I get a swing of 4.5 cells and a limit.  I’m watching an unrestricted signal (5v/div) (6:25) - everything is fine.
https://youtu.be/UU2kYDJEzzc (https://youtu.be/UU2kYDJEzzc)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 07, 2024, 04:07:20 pm
DC mode. Yes, it is far from functional.  It will be necessary to come up with some functional solution.  It's not fun looking at it all the time.  Sometimes you need to rest and find a solution.  Besides, you also have to go to work :D But thanks for the information.  I appreciate it.

Has anyone checked the timestamp of the files?  Does the time and date of file creation or modification match under Linux and Windows?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 07, 2024, 04:47:18 pm
I still can't get over the noise on the AD converter. I tried to use a 10-bit converter and the noise is almost the same... I tried to split the power supply for the analog and digital parts at 8-bit and it didn't help.

The ADC's used might well be B stock of a clone of the AD9288 assumed to be used. Maybe they are not even 100MHz parts, but 80MHz or less, and used with overclocking. Further more the whole design is noisy. There is no separation between analog and digital ground. The power supply setup for the analog part is crap. Etc.

It is a nice platform to play with and learn (scope) software development, but that is it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 07, 2024, 07:21:25 pm
They put other fpga there, even the pcb has at least 3 versions.  So why not change the power supply and GND?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 08, 2024, 06:40:49 am
What is the idea of ​​starting the calibration of input dividers? 
In practice, it only needs to be done once.  Should the fixed firmware be used to recall this calibration?  Or add an item to the menu for Reset basic settings?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 08, 2024, 07:28:27 am
The calibration on the new firmware is two fold.


I tried to make it better then the original, to always have the +3K samples instead of like what the original does. For the 100MSa/s and below they only use a single ADC per channel and read just 1500 samples. Only on the ranges that need 200MSa/s they use the second ADC, and get the extra samples.

The equalization in the original is done on adding or subtracting something on the second ADC data. This reduces more on the total resolution. My version tries to divide it and modifies the data of each ADC with half the difference of the average.

The calibration has nothing to do with accuracy. That is why they called it base line calibration.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 08, 2024, 07:34:25 am
It's OK.  This is the calibration of the input dividers.  Now 7 constants are fixed in the code.  Otherwise, it would be a completely different calibration by connecting precise voltages and adjusting the conversion constants.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 08, 2024, 08:10:10 am
Ah, yes I remember these. Those values are from the original firmware. Probably not worth spending a lot of time on trying to improve on that.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 08, 2024, 09:02:54 pm
Menu for calibration of input dividers
https://www.youtube.com/watch?v=0EHChTCYDh0 (https://www.youtube.com/watch?v=0EHChTCYDh0)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 09, 2024, 02:34:57 am
Menu for calibration of input dividers

Rational :clap:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: OneDiy on January 09, 2024, 02:40:55 am
V0.019g found a problem with display. Tried setting TP and couldn't fix it.

(https://sv1.picz.in.th/images/2024/01/09/d7zVEra.jpeg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 09, 2024, 10:21:05 am
try to change config sector 710. Firmware loader doing it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 09, 2024, 11:07:22 am
interestingly, it didn't move his image before. I would try another SD card. I'm curious what the PC programmer will say. Try this
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/configuration_file.txt
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 09, 2024, 12:01:58 pm
How is it possible to delete the data saved by the firmware on the sd card.  They are in an area where they cannot be deleted even by formatting.  By deleting the partition?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 09, 2024, 03:29:44 pm
Fill in "00" from 16 to 2047 physical sector.  Use the loader to record the attached file.  The entire FW area on the SD card will be cleared.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 09, 2024, 05:07:27 pm
While it has been some time ago that I did work on it, my thought was the program size had gone up to much, but the latest bin file is still below 300KB, so no problem there by the looks of it.

Another thought is if it could have been overwritten by an increased number of settings written to the card. They are also in the reserved 1MB part of the SD card, but have to look at the code to see where they are located.

I would have expected you (Atlan) to also suffer from the same issue then, since your scope is an even newer release and might have a shifted display too.

@OneDiy, you can always remove the card from the scope and use a card reader/writer connected to the PC to write the needed configuration file or reload the version that did work to see if it still works as before.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 09, 2024, 05:08:15 pm
Fill in "00" from 16 to 2047 physical sector.

That is the way to get rid of the new firmware  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 09, 2024, 05:13:54 pm
Just looked and the settings are written starting from sector 700 on the SD card. Means 5KB of room before the display configuration data. That is a lot of settings, so not likely to be a problem, I would think.

From the file variables.h
Code: [Select]
//----------------------------------------------------------------------------------------------------------------------------------
//Defines
//----------------------------------------------------------------------------------------------------------------------------------

#define SETTINGS_SECTOR                 700    //Location of the settings on the SD card for now

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 09, 2024, 05:47:59 pm
And why doesn't the command with "zero" in the Linux terminal delete the configuration?  I don't remember exactly which numbers in the console are used for deletion.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 09, 2024, 06:47:31 pm
Fill in "00" from 16 to 2047 physical sector.

That is the way to get rid of the new firmware  :-+
Nothing prevents you from uploading it, or another firmware again.  But there will be confidence that no remnants from the previous code will interfere.  Or did I misunderstand the question about deleting data?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 09, 2024, 07:00:44 pm
My goal was to get the device into flood condition.  Neither the command zero nor the return to the default state via the loader will erase the configuration data from the sd card.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 09, 2024, 08:02:08 pm
The command "sudo dd if=/dev/zero of=/dev/sdc bs=1024 seek=8 count=1" only clears the first 1024 bytes of the area where the program resides on the SD card.

As a bit of background information, overwriting only the first 32 bytes of sector 8 is sufficient to forsake the loading of the program. It is the eGON header that needs to be there to signal the MCU that there is program code that needs to be loaded. The F1C100s has a build in boot loader that checks the attached storage devices at specific locations and in a specific order to see if there is such a header.

With the SD card being checked before the FLASH, allows us to take over the scope like we do. It took a bit of searching to find information about this. The Allwinner documentation is quite sparse.

I worked on this for a good part of a year to figure it all out. Reverse engineering the original firmware, searching the web for information about the F1C100s, writing code to emulate the whole thing, figuring out the commands for the FPGA and how it all worked, dismissing the special IC as not needed by performing several tests, etc.

But that is just a bit of background.

The problem with the shifting display is a bit of a mystery, and the question is if others also experienced it. It is up to OneDiy to do some tests, like reloading the other version that did work properly, to see what is causing the problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on January 09, 2024, 08:40:35 pm
My goal was to get the device into flood condition.  Neither the command zero nor the return to the default state via the loader will erase the configuration data from the sd card.

You can erase (fill with zeros) any single sector using my loader. Just go to 'LCD/TP Config' tab, double click on word 'Sector' and input required sector number (decimal). Then select 'Clear configuration (all bytes are null)' in the list and write it.
If you need to fill more than one sector, create a null binary of the required length and load it using 'Firmware' tab to the required start sector (start sector field can be edited in the same way).
You will receive an error if you try to modify an MBR or an existing partition.

If necessary, I can modify the loader so that it fills with zeros any required space, for example all 'hidden' sectors between partition table and beginning of the first partition.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 09, 2024, 09:58:30 pm
It would be nice to have a button in the LOADER that deletes the data on the sd card from sector 700 where the settings are located.  There are some 16-bit constants and at the end 14pcs 32-bit constants newly added.  (I am not sure if they are included in the control sum).  By erasing and turning on the oscilloscope, the basic settings will be loaded.  (the button must delete only the calibration data on the SD card, the firmware on the SD card must remain)

1013 I have 2 pieces.  New versions: one from 2022 and the other from 11/2023, the touch display and the screen work normally on both, they don't even require special settings.

Currently, the firmware contains more code and various auxiliary information for debugging that I use.  It works normally.  And the helper code is not found in the published versions.  The file may have been damaged during transfer, or there may be a problem with the sd card.

PS That button will be a necessity :D even if I could do it in the program to check the calibration values.  It will be better if someone messes up the calibration to be able to delete it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: OneDiy on January 10, 2024, 12:33:30 pm
I encountered a scrolling display problem. with all versions of modified firmware Fixed by writing TP CONFIG value with 1013d_version_3.bin The display screen is normal. But it doesn't work with v0.019g.

(https://sv1.picz.in.th/images/2024/01/10/d7NHRxf.jpeg)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 10, 2024, 01:19:55 pm
try 0.019e

version e and version g, enables progress scrolling. I got a lot of trouble with this and x times the oscilloscope ended up frozen with a rainbow image.
I canceled some things to make the shift possible. There is some mention about overflow

else if(xrange > 725.0)
  {
    //Limit on max screen pixels to avoid disp_xend becoming 0x80000000 due to overflow
    //xrange = 725.0;//comment
  }

I always knew that the measure was a bit inaccurate. But even now, when I check it, I see how it is out of tolerance.
Does anyone want to check the original firmware, how exactly does it show the voltage?
I would be interested if the manufacturer carries out any calibration.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 10, 2024, 02:55:15 pm
New firmware v0.020d Calibration of the input divider. You must have the notification confirmation option turned on. Otherwise, only the search for 0 of the ADC converter is performed.

What will happen if it has more than 300kB?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 10, 2024, 03:20:08 pm
What will happen if it has more than 300kB?

If the binary grows beyond the 300KB nothing will happen. When it grows beyond 346KB it will start to overwrite the settings sector (700).

You still have plenty of room for now.

In the case you do grow it to big, the settings sector has to move up, and when that comes in range of the configuration sector (710) that will have to move too. The code needs to be adapted for these changes, so it will read and write the correct new locations in that case.

When it becomes really big the reserved space on the card needs to be enlarged (now 1MB) but for that to happen, you will have to write a lot of code first  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 10, 2024, 03:50:31 pm
With the new version 0.020d the measurements appear higher on the screen and do not start from the bottom

In case it helps.
Thanks for all the development, it is spectacular.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 10, 2024, 04:02:21 pm
This is preparation for displaying the position of the displayed signal in buffers.  Now it is possible to scroll the displayed signal in a larger range than 2 screens.  To make it possible, you need to reduce the sampling frequency through the menu ACQ.

I would be interested in how to solve the display problem.  (oneday)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 10, 2024, 07:28:05 pm
 :) v0.020d Follow the instructions for calibration.  You must have the notification confirmation option turned on. Calibrate without usb and probes.  In the next step, when prompted, connect the required voltage to both channels at once.  After finishing the calibration, close the menu and turn off the oscilloscope to save the data. 

I would appreciate it if you could let me know if the accuracy has improved.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 11, 2024, 07:09:12 am
I have a feeling that loader does not write data.  I tried to write the configuration to sector 700. The result should be data corruption and loading of preset values.  It didn't do anything.  Even uploading a different configuration does nothing to the display.  It will either not be written or the program data will be shifted and it will be written to the wrong location.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on January 11, 2024, 10:52:16 pm
I have a feeling that loader does not write data.  I tried to write the configuration to sector 700. The result should be data corruption and loading of preset values.  It didn't do anything.  Even uploading a different configuration does nothing to the display.  It will either not be written or the program data will be shifted and it will be written to the wrong location.
I had to remember; the loader was written almost a year ago... It really rewrites one sector, i.e. 512 bytes, because of this is a requirement of WinAPI and driver. BUT it changes only the first 30 bytes (the rest 482 bytes is a copy of old sector), exactly as described by pcprogrammer. Sorry for misrepresentation. To write the whole sector you have to prepare 512-bytes binary file and load it using 'Firmware' tab (start sector may be edited by double click on words 'Start sector'). The location of written data should be correct, if you enter sector 700, loader writes to offset 0x57800. I just read sector 700 of my device (v0.019b) and corrected byte 16 (0x5780F) from 0x00 to 0x0F. As you can see in HxD it was written to correct location.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 12, 2024, 09:37:17 am
Yes, I checked it, the bytes change, but it does not affect the result, the oscilloscope still starts in the basic configuration and ignores what is recorded in sector 710.

Therefore, ONEday does not move the image on the display

//----------------------------------------------------------------------------------------------------------------------------------
#include "display_control.h"
#define DISPLAY_CONFIG_ADDRESS    (uint32 *)0x81BFFC00

this shows somewhere in the RAM memory, but I don't know how the value from the sd card gets to the data instead of the ram.
In addition, other data can already be written in the given place, since some data (RAM) has been added to the program

I found something here: fnirsi_1013d_sd_card_bootloader.c
It's just that I don't even have it included in the MAKE translation, so I don't know if it will change anything

    //Load the remainder of the program from the SD card
    if(sd_card_read(PROGRAM_START_SECTOR + 1, blocks, (void *)0x81C001E0) != SD_OK)
    {
      //On error just frees
      while(1);
    }
  }
 
  //Load the display configuration sector to DRAM before the startup screen program
  if(sd_card_read(DISPLAY_CONFIG_SECTOR, 1, (void *)0x81BFFC00) != SD_OK)
  {
    //On error just frees
    while(1);
  }
 
  //Run the startup screen program
  unsigned int address = 0x81C00000;

It would be good if the flood programmer looked at it. well thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2024, 11:26:38 am
Code: [Select]
//----------------------------------------------------------------------------------------------------------------------------------
#include "display_control.h"
#define DISPLAY_CONFIG_ADDRESS    (uint32 *)0x81BFFC00

This is a bit of a bodge, I confess. As it was something added late in the development and spread over multiple projects the define is not well documented.  :palm:
Should have been in a shared include file.

In the "fnirsi_1013d_sd_card_bootloader" project the display configuration data is read from the SD card into this memory location, and then used by the other two programs for setting up the display. First the splash screen program "fnirsi_1013d_startup_screen" uses it, and then the final program "fnirsi_1013d_scope" uses it again.

So check if your changes to the main program "fnirsi_1013d_scope" overwrite the memory starting from 0x81BFFC00 in any way.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 12, 2024, 11:46:11 am
So check if your changes to the main program "fnirsi_1013d_scope" overwrite the memory starting from 0x81BFFC00 in any way.

I have no way of finding out. For uP there is no development environment, no simulation.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2024, 01:53:05 pm
So check if your changes to the main program "fnirsi_1013d_scope" overwrite the memory starting from 0x81BFFC00 in any way.

I have no way of finding out. For uP there is no development environment, no simulation.

I wrote an emulator and someone else hooked qemu into it to make it faster. My code is here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/Scope_Signal_Handling_Development). The only problem for you might be that it is written for Linux using X11.

Probably there is also some linker output information about memory usage, but can't say what tools to use for that. Maybe something in the .elf file that can be dumped.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 12, 2024, 03:34:07 pm
If I understand correctly, the program from the sd card is copied to RAM.  It is possible that there is already so much that the program (and RAM value etc Buffer) reached the address where the data for the display is.

It will not be easier to move the incriminated data further by a few KB
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 12, 2024, 05:39:56 pm
I upload v0.019d, shift the image.
I upload 0.020d and the image remains shifted. How is it possible that it remains shifted when it obviously does not load the data from the 710 because it cannot be reversed. I also noticed that v0.020 is shifted, but at start-up the opening image is correct.

uploading any data to the 710 has no effect on the TP xy or the screen.

How is it possible
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 12, 2024, 06:28:35 pm
I just tried this firmware. I see a lot of good things. Thanks a lot!
Just a couple of notes:

1. Hangup during calibration

System Settings -> Baseline calibration -> press OK

I hear once relay click. And it's all. I waited about 10 minutes - no result.
The device hangs until a power reboot.

2. Not entirely correct BMP files format

Screenshots are currently 768070 bytes size (instead of the original 800000) and are not recognized by some programs.
I've tried a few app - MS Explorer and Edge browser everything displays fine, but Firefox only displays "cannot be displayed because it contains errors", Paint Shop Pro says "Not valid BMP", and the Python Pillow image library crashes on it with the exception "Unsupported BMP header type (56)"

Is it possible to return the .BMP to its original format? Оriginal .BMPs displays correctly everywhere.

Version 0.20e
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 12, 2024, 06:42:28 pm
Does V0.019d have the correct images?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 12, 2024, 06:54:50 pm
I tried 0.019d and 0.020e - no diffs for me except version number at top right corner.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2024, 08:04:14 pm
If I understand correctly, the program from the sd card is copied to RAM.  It is possible that there is already so much that the program (and RAM value etc Buffer) reached the address where the data for the display is.

It will not be easier to move the incriminated data further by a few KB

The way it works is that the F1C100s boot loader checks sector 8 of the SD card to see if there is an eGON header there. If so it loads the code found to the boot RAM, which is only 32K. The it jumps to this code to execute it.

This is the "fnirsi_1013d_sd_card_bootloader" code. It initializes the DRAM in the F1C100s and then loads the next program from the SD card, which starts at sector 48. It also loads the data from sector 710.

Code: [Select]
//----------------------------------------------------------------------------------------------------------------------------------

#define PROGRAM_START_SECTOR      48
#define DISPLAY_CONFIG_SECTOR    710

The next program is "fnirsi_1013d_startup_screen" to show the PECOs SCOPE screen. This is loaded to memory address 0x81C00000. The boot loader jumps to this address to execute that code.

This bit of code loads the final program from sector 92 into memory starting at address 0x80000000 and executes it after showing the startup screen.

Code: [Select]
//----------------------------------------------------------------------------------------------------------------------------------

#define PROGRAM_START_SECTOR              92

The binary that is loaded to the SD card contains all three bits of code such that the starts correspond with the given sectors. To do this I wrote the flashfilepacker program, but that is setup to run on linux.

I don't think the problem is with the data on the SD card, but with the allocation of the data in the scope program.

Try to find the differences between 19d and the version where it started to fail.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 12, 2024, 08:09:10 pm
Is it possible to return the .BMP to its original format? Оriginal .BMPs displays correctly everywhere.

Except on Linux. The original version placed some data between the header and the actual bitmap, and used a pointer in the header to point to the image data. The default programs on linux do not use this pointer and assume the data to follow directly after the header.

Quite strange that the header is not found to be correct, because it is based on the guide lines given here (https://en.wikipedia.org/wiki/BMP_file_format).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 09:13:55 am
Linux is a very fun system, just that fun cost me 3 hours of my life.
It should be fine now.
try v0.020f working display shift for ONEDIY

All compiled versions from 0.019d to 0.020e are poorly translated from Ccode to BIN format
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 13, 2024, 11:39:22 am
Are times per division of 1 or 2 seconds implemented in the future?
It is important in some automotive things.
Thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 13, 2024, 11:58:51 am
Quite strange that the header is not found to be correct, because it is based on the guide lines given here (https://en.wikipedia.org/wiki/BMP_file_format).

Maybe this will help fix the problem:
I look Pillow code. It check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) and raise error because header size is 56 bytes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 13, 2024, 12:35:07 pm
Linux is a very fun system, just that fun cost me 3 hours of my life.

Welcome to the club.  :-DD

Good that you solved it. I'm busy with my own projects. Happy to reply now and then with some recollection about the development, but I'm not going to spend time on it looking into more serious problems.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 01:00:42 pm
Quite strange that the header is not found to be correct, because it is based on the guide lines given here (https://en.wikipedia.org/wiki/BMP_file_format).

Maybe this will help fix the problem:
I look Pillow code. It check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) and raise error because header size is 56 bytes.

0.020f Did it solve the calibration problem?

Are times per division of 1 or 2 seconds implemented in the future? YeS

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 13, 2024, 01:29:07 pm
0.020f Did it solve the calibration problem?

No. It hangs like before.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 02:52:56 pm
Switch trigger to AUTO.  Fix later...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 13, 2024, 03:00:37 pm
Switch trigger to AUTO.  Fix later...

Yes! Trigger was in "Normal" mode. In "Auto" mode, calibration works without freezing.
Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 03:21:14 pm
It already works in every mode v0.020h, thanks for reporting the error. if only they were such easy mistakes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 13, 2024, 03:39:16 pm
With version v0.020h, those numbers appear on the screen above the trigger, and the entire rounded area flashes.

Autoset freezes often
Thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 03:58:35 pm
 :palm:
Only DC mode?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 13, 2024, 05:53:52 pm
It already works in every mode v0.020h, thanks for reporting the error. if only they were such easy mistakes.

In v0.020j first step of calibration now working - i hear several clicks of relay and green text Calibration successfull.

But it turns out that at next step Сalibration still hangs :(
After clicking OK on the “Set 300 mV DC and press OK” item, I hear the relay click once - and that’s all before the power restart.
(300mV DC is connected to CH1 at this moment, trigger set Auto CH1)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 13, 2024, 06:11:52 pm


Follow the instructions for calibration.  You must have the notification confirmation option turned on. Calibrate without usb and probes.  In the next step, when prompted, connect the required voltage to both channels at once.  After finishing the calibration, close the menu and turn off the oscilloscope to save the data.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 13, 2024, 06:25:51 pm
..connect the required voltage to both channels at once..

Sorry, it's my mistake! Calibration now works fine. Thank you!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 14, 2024, 05:57:42 am
Quite strange that the header is not found to be correct, because it is based on the guide lines given here (https://en.wikipedia.org/wiki/BMP_file_format).

Maybe this will help fix the problem:
I look Pillow code. It check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) and raise error because header size is 56 bytes.

After add value 56 to check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) condition Pillow successfully opens a 768070 bytes bmp.
Maybe you can try just increasing the BMP header to 64 bytes?
As I understand it, 56 is a non-standard header size, which causes a problem in many cases.



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on January 14, 2024, 09:48:33 am
fnirsi_1013d.bin v0.020j.bin
Something wrong with CH1 below 500mV after calibration
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 11:05:42 am
Possible bad calibration, bad touch on ch1 during calibration.

v0.020p checking the limits of calibration values. If the calibration is bad, it will say calibration failed
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on January 14, 2024, 01:30:18 pm
I got every time Calibration fail until I switched to stock FW and made there Baseline Calirbation.
Returnig back to new FW Calibration ended successfuly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on January 14, 2024, 01:36:13 pm
I guess it'll be comfortably to have ability to make partial calibration:
e.g. only baseline or to stop on 3, 6 or 7.5V.
You do not allways have all available voltages on site.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 01:53:05 pm
Which is the stock firmware?  The calibration of the input dividers needs to be performed only once.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on January 14, 2024, 02:03:30 pm
I made a fast switching between SW(described some pages ago). What is version I do not remeber it is one of the Fnirsi's releases.
I do not know does it needed be done once or twiсe, but the fact is fact.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 03:16:34 pm
Evi upload firmware 0.021, go to the main menu. Push the usb connection. On the blue screen, tap on the PC screen. Take a photo of the displayed values and post it on the forum.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Evi on January 14, 2024, 03:23:41 pm
Can I ask about purpose?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 14, 2024, 03:33:15 pm
Quite strange that the header is not found to be correct, because it is based on the guide lines given here (https://en.wikipedia.org/wiki/BMP_file_format).

Maybe this will help fix the problem:
I look Pillow code. It check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) and raise error because header size is 56 bytes.

After add value 56 to check header size (https://github.com/python-pillow/Pillow/blob/main/src/PIL/BmpImagePlugin.py#L98) condition Pillow successfully opens a 768070 bytes bmp.
Maybe you can try just increasing the BMP header to 64 bytes?
As I understand it, 56 is a non-standard header size, which causes a problem in many cases.

I found easy working solution for fix BMP format :)
Just change only one byte - 56 to 40 here (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/variables.c#L652) (i use binary hack for .bmp, change one byte at 0x0e offset )
After that Firefox, Telegram and Python successufllly recognized screenshots.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 03:45:48 pm
won't I be missing some data in the header?

v0.021a  here I changed the //Size of DIB header
   40, 0, 0, 0, //56,0,0,0

Can I ask about purpose?
I want to know what the tolerance is on the input part that did not pass the calibration.

I hope that you did the first part of the calibration without USB and with the probe disconnected, and then set the voltage on the test and confirm OK
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 14, 2024, 03:52:53 pm
won't I be missing some data in the header?

Who knows.

Nice those semi standards. According to the wikipedia page about bitmap file format it is a specific header format to use when additional information needs to be specified. In this case for the correct color mapping.

I tried the modification of the single byte on a file I have on my system and Firefox failed on it before, but opened it just fine after the change. The default image viewer on Linux Mint has no problem with either.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 14, 2024, 04:01:09 pm
won't I be missing some data in the header?
v0.021a
Position of pixel array (https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/variables.c#L645) still correct - it not changed.
The last 16 bytes of the DIB header just won't be used, I think.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 14, 2024, 05:22:54 pm
The last 16 bytes of the DIB header just won't be used, I think.

And yet these bytes tell the layout of the color information within the 16 bits per pixel. That is why I choose this header format.

Ah well, if it works it works.  :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on January 14, 2024, 05:56:39 pm
fnirsi_1013d.bin v0.020j.bin
Something wrong with CH1 below 500mV after calibration

I had similar results yesterday pulling 20J.; though mine was that it didn't work correctly in higher V/div settings only. I recalibrated 3 times (which is a huge pain as I had to hack some interesting BNC splitters and bench DMM probes to detect exact voltages at the inputs and tweak with analog power supply dials). Manually fiddling with volt range on each channels got signals showing correctly.

But auto set is completely broken it doesn't detect anything right no matter channels being on or voltages or waves applied.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 05:57:54 pm
Fargo, an image with data as I wrote above. (auto settings not work in DC mode?)

I will take one BNC T-piece, insert it into ch1, connect it to ch2, and from the BNC T-piece I will stretch the cable with alligator clips to the measuring device and the power source.

Tokar: I know about your request for DC mode, I'll come back to it later.

 I am now working on scrolling the record in memory. 

And somehow there is quite often a request for roll mode or long recording. 

I would appreciate some help with auto DC mods if anyone has time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on January 14, 2024, 06:19:26 pm
Fargo, an image with data as I wrote above. (auto settings not work in DC mode?)

I will take one BNC T-piece, insert it into ch1, connect it to ch2, and from the BNC T-piece I will stretch the cable with alligator clips to the measuring device and the power source.

Yeah that's pretty much how I did it. DMM'd one side of the T and through various interconnects tied CH1 to CH2 over two T's. I just don't have exact parts to make it line up perfectly, but once I got it all it was stable and same power going into both sides. But the numbers seemingly below show that it was inconsistent for some reason? (just reading into the variances and seem to be correlated to having problems on one end for CH1 and other end for CH2)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 06:27:42 pm
Ch1 5V and ch2 100mV are out of calibration.  For calibration, use a properly filtered voltage, possibly a 7815 and a potentiometer.  You have to remember that the oscilloscope takes a sample and when there is a peak, it calibrates according to it.

50mV is just 100mV * 2

I will modify the software tomorrow.  It would be a problem to calibrate this way.  I'm not sure that this software will let you calibrate. 

Now the only option is to record the 00h.bin mentioned about 2 pages ago into the oscilloscope, it will erase everything.  And you will recalibrate... 

That's why I wanted the loader to be supplemented with a button that confuses the configuration data.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on January 14, 2024, 06:38:26 pm
Am using a SMPS bench power supply with Owon bench DMM connected metering the voltage right at the BNC. I can switch to a Linear one if you think the frequency of the SMPS is causing an issue
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 14, 2024, 06:44:27 pm
I wanted to use the rd6006, but when I saw what it had on the output, I used an analog source.  See text up.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 15, 2024, 10:19:55 am
 :scared: V0. 021b mistake   :-//

 :popcorn: 0.021c ok  :phew:

Added possibility to reset calibration values. (if a bad calibration occurs) Added notification of a faulty calibration if the offset cannot be set (only if there is some hardware problem, bad ad converter, missing ad converter, problem with the offset voltage setting)

Input divider calibration is enabled when the oscilloscope is turned on for the first time and baseline calibration is used.

Calling up the calibration of the input divider is possible only through the menu by resetting the calibration values. (or by deleting the data on the sd card where the configuration data is located. NEED SDCART READER No It can be done with a card stored in the oscilloscope. )

After successful calibration of the input divider and switching off the oscilloscope, the data is written to the SD card. (Unless you change the burnt components on the input circuits, it will no longer be needed - that is, if you do not erase, do not replace the sd card)

If the calibration is started again, only the base level calibration will be performed. i.e. 0 is found. (What sometimes needs to be done)

By uploading the firmware, the calibration of the input divider DOES NOT CHANGE.
https://www.youtube.com/watch?v=KK51iftmdVU (https://www.youtube.com/watch?v=KK51iftmdVU)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 15, 2024, 01:26:24 pm

With the version updated to v0.021c, resetting the calibration in the USB menu does not work.
At least in my case.

Thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 15, 2024, 01:27:34 pm
Does the button respond to touch?  Make a video.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 15, 2024, 01:29:14 pm
After returning to the factory firmware and putting the modified one again if it comes out.

Sorry
Thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 15, 2024, 09:13:45 pm

With the version updated to v0.021c, resetting the calibration in the USB menu does not work. At least in my case.
I confirm.
 Procedure: v0021a, “Baseline calibration”, calibration of 0.3-15V dividers was successful.  I closed the menu, turned it off and turned on the device.  I click the menu - USB connection - PC window.  We get a table of constants. 
I'm flashing it via loader v0021c.  Notification enable, Baseline calibration, I get "Calibration successful".  Click the menu - USB connection - PC window.  No reaction.  I fill sector 700 ""00h". I repeat the above steps - there is no expected result.
I fill sectors from 16 to 2047 "00h". Turn it off - turn on the oscilloscope, the Fnirsi screen saver. Calibrate. Flash v0021c. I repeat the above steps - there is no expected result.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 16, 2024, 06:45:50 am
It is no longer necessary to enable the notification.  Resetting the values ​​does not work, because they are written again during a correct shutdown.(use external sdcard reader) The option is to click on the screen starting in usb mode.  You have to click right in the middle of the pc screen.  Very precisely in the center of the pc screen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 16, 2024, 07:05:11 am
Yes, it works. Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 16, 2024, 07:33:57 am
What works?  It must work to get to the calibration reset via usb screen.  To see if the calibration is within limits.  I would like a picture with calibration data.  Well thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 16, 2024, 07:47:39 am
I would like a picture with calibration data.
My results. (might be useful too)
Successfully calibrated with using 100% analog source - 4 x Li Ion + multi-turn potentiometer :).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 16, 2024, 09:07:22 am
Calibration in version 021c.  Voltage source: battery.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 16, 2024, 10:15:47 am
I hope that we can close the issue of calibration.  That it works for everyone, via usb menu!

The top photo is kind of blue. :D text in menu is white?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 16, 2024, 11:04:08 am
The top photo is kind of blue. :D text in menu is white?

Yeah. Text is white. It lloked blue probably because I was shooting at a bit of angle.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on January 16, 2024, 12:06:42 pm
Hello, I get a calibration error in the last step of 15v.
I don't think my contribution will be of much use either, my mini power supply is 500mv, so maybe that's the reason for the error, anyway I'll send a photo of the data returned.

Thanks for your work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 16, 2024, 12:42:04 pm
Use the led, for example the red one, it works as a zener and set it to 300mV with a 10k potentiometer.  The calibration ends with an error, because the range for the connected voltage is in numbers from 3000000-4000000.  As you can see in the picture, you are outside the limits for the 100mV/div range (300mV is expected at the input)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 16, 2024, 04:01:10 pm
v0.021e Small corrections to the calibration code. Added text if there is a problem with offset calibration. (which no one will ever see, unless there is a HW problem). Error notification, right at the problem calibration, not at the end of the calibration.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on January 17, 2024, 05:20:19 am
I wanted to use the rd6006, but when I saw what it had on the output, I used an analog source.  See text up.

Thanks Atlan. I finally got mine calibrated. My bench 30V/5A SMPS box was extremely noisy (200+mv sometimes higher), so I switched to a linear one that was about 50-70mv noise, but actually fed that into an RD6006 to do the settings much easier digitally vs. analog dial.  Perhaps your input supply on the RD was noisy making it worse?

In any case I got it calibrated, but not after having 15V fail 3 times in a row. If I keyed in the following on the RD6006, I got the following metered at the BNC inputs: (I think these are the steps, but if not, you'll get the point)

RD Set = Actual metered V at BCN
.30 = .3006
.60 = .6004
1.50 = 1.503
3.00 = 3.001
7.5 = 7.499
15.0 = 14.97

So therefore I was naturally trying to up 15.0 to 15.03 on the RD6006 which then leveled off at 15.00x V at the BNC. But every time I did that it said calibration failed.  Therefore on the final time I just let it have the values above with the 15.0V sagging just the hair, and then it calibrated just fine not trying to force an exact perfect value.

I do have some more BNC splitters and stuff coming to make this much easier in the future with cleaner more-easy-to-redo setup. But thanks again.

Hello, I get a calibration error in the last step of 15v.

See my comment above for a failure a 15V as well until I stopped trying to "perfect it".
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 17, 2024, 05:56:12 am
The latest version will write immediately when a failure occurs.  Previously, they waited until the end and so wrote an error if it occurred.  It's a shame that you didn't take pictures of the values ​​when the failure occurred.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 17, 2024, 06:37:27 am
... Added text if there is a problem with offset calibration. (which no one will ever see, unless there is a HW problem)...
I created an error and saw the message. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 17, 2024, 07:24:49 am
When calibrating the base, nothing should be connected to the BNC :D

v0.021f
I simplified the calibration process, in the case of an error, the number 4000001 appears in the calibration values.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 17, 2024, 05:32:25 pm
Correction of minor graphics errors, addition of the reaction of pressing the 50% button in the channel menu. Nothing important.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 18, 2024, 06:43:29 am
In firmware 0.006 {also v0. 017d} automation works well in DC mode?  It also works for a DC signal, e.g. 5V from the battery?

Except for the error that the signal is not shifted from the center line.  .
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 18, 2024, 11:09:18 am
v0017d:
CH1 & CH2 included. Calibration without connectors connected.
I press autoset - sensitivity of channels 1 & 2 - 500mV/div.
Voltage source: battery. The polarity is positive.
I apply 1v, autoset - sensitivity unchanged.
I supply 2V, autoset - sensitivity unchanged.
I supply 2.25V, autoset - sensitivity of CH1 - 500mV/div, CH2 - 50mV/div.
From “0” 4.5 cells, and an increase in sensitivity (a decrease is needed).
When 5V is applied (sensitivity 5V/div), the same thing happens: after pressing autoset, the sensitivity of CH1 is 500mv/div, CH2 is 50mv/div. And the oscilloscope voltmeter readings channel 1 - 2.26V, channel 2 - 467mV.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 18, 2024, 11:22:24 am
Tokar: AC signals  is ok?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 18, 2024, 12:12:08 pm
v0017d:
Channels 1 & 2 included. Calibration without connectors connected.
I press autoset - sensitivity of channels 1 & 2 - 500mV/div.
Modes AC, DC.
Voltage source sine generator 100Hz. There is no DS at the output.
I supply 40mV, autoset - sensitivity 50mV/div.
I increase it to the limit (70 mV rms), autoset - the sensitivity of channels 1 & 2 becomes 100 mV / div.
I increase it to the limit (155mV rms), autoset - the sensitivity of channels 1 & 2 becomes 200mv/div.
I increase it to the limit (290 mV rms), autoset - the sensitivity of channels 1 & 2 becomes 500 mV / div.
I increase it to the limit (740 mV rms), autoset - the sensitivity of channels 1 & 2 becomes 1v / div.
And so on...
I think everything is fine with AC.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 18, 2024, 04:32:25 pm
I see that in auto mode it does not set the offset according to the selected sensitivity.  It was also forgotten during the calibration.  Let's fix it.

The flood code of the auto-setting, the original firmware probably does not exist in C?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 19, 2024, 07:16:21 pm
Does the original firmware also detect whether it is AC or DC when you press "auto"?  Or does he leave this choice to the operator?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 19, 2024, 08:45:27 pm
You can take a look at how far I got with the reversal. Noticed I did not upload the last state of affairs, so just did it now. https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/fnirsi_1013d_original_scope (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/fnirsi_1013d_original_scope)

In the scope_functions.c there is a function scope_do_auto_setup. Not fully finished but maybe it helps.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 19, 2024, 09:41:10 pm
Does the original firmware also detect whether it is AC or DC when you press "auto"?  Or does he leave this choice to the operator?
I applied AC + DC to channel 1, and only AC to channel 2. Visually (by the AC, DC icons in the channel menu) there is no search for whether channels belong to AC or DC. The polarity and complex signal level (AC + DC) in DC mode are taken into account. And the level of the AC signal (without DC) in AC mode.
And each channel (together or separately) can be expanded to fill the entire screen (Y=8 cells). And not Y=4.5 cells per channel before the limit, as is now implemented in modified firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 19, 2024, 09:46:40 pm
What happens if you use only one channel, switched to AC.  And if you apply 1khz with an offset of e.g. 1V to the input (are you thinking of a dc+ac signal?)

 I will come across something interesting :D
scope_get_long_timebase_data
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 19, 2024, 10:47:35 pm
Fnirsi original.
Signals were given on all photos:
AC = 1v, 1kHz rms
DC = 1v

Photo 1 - AC mode, signal only AC.
Photo 2 - AC mode, signal AC+DC. 
Photo 3 - DC mode, AC+DC signal.
All oscillograms after pressing automatic.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 20, 2024, 07:21:27 am
OK, thank you.  So the ac/dc mode must be selected by the user.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 20, 2024, 05:11:13 pm
found one more problem - oscilloscope gives a SD error 3..5 times of 10 starts. Tryed  two different cards with 8Gb capacity. FW loaded by firmware loader. Tryed one more 32Gb card - no change. Rewrited config sector, did calibration - but it starts not often
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: coppercone2 on January 20, 2024, 06:10:30 pm
that sounds like it might be a bad socket
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 21, 2024, 10:51:09 am
I bought a film and stuck it on the display. 20x100cm https://www.aliexpress.com/item/1005005179170765.html?spm=a2g0o.order_list.order_list_main.234.96651802iflMid (https://www.aliexpress.com/item/1005005179170765.html?spm=a2g0o.order_list.order_list_main.234.96651802iflMid)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: boojum on January 21, 2024, 03:22:49 pm
I bought a film and stuck it on the display. 20x100cm https://www.aliexpress.com/item/1005005179170765.html?spm=a2g0o.order_list.order_list_main.234.96651802iflMid (https://www.aliexpress.com/item/1005005179170765.html?spm=a2g0o.order_list.order_list_main.234.96651802iflMid)

I'm waiting for this one to be delivered https://aliexpress.ru/item/1005005978848349.html?sku_id=12000035147348074 (https://aliexpress.ru/item/1005005978848349.html?sku_id=12000035147348074)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 22, 2024, 07:07:28 am
No, when I write orig FW (through USB) - it starts every time, even if I don't touch SDcard. Maybe need to add some delays in FW to access SD?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 22, 2024, 07:54:31 am
found one more problem - oscilloscope gives a SD error 3..5 times of 10 starts. Tryed  two different cards with 8Gb capacity. FW loaded by firmware loader. Tryed one more 32Gb card - no change. Rewrited config sector, did calibration - but it starts not often

No, when I write orig FW (through USB) - it starts every time, even if I don't touch SDcard. Maybe need to add some delays in FW to access SD?

Original firmware loads from FLASH using the SPI interface, but does check the SD card on being there and having a valid partition based on a FAT format. This is only a short interaction with the SD card.

To see if there is a problem you can try reading and writing images or waveforms when running the original firmware to see if this works as intended.

The SD card works with a dedicated interface and sets its speed based on the type of card in the socket. The new firmware uses the build in F1C100s boot loader to load the first bit of code, and then this code takes over to load the splash screen, and then the actual firmware is loaded.

A video of what your system does when starting the new firmware could help in determining the problem.

It might well be that the F1C100s has problems, or maybe bad connections.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 22, 2024, 09:19:00 am
Try the firmware version 0.006, in the new versions I also modified the code for the startartup screeen, so I made a mistake somewhere.

If someone has time.  It can measure the deviation of the measured voltage with a 10x probe.  If I have calibrated to 1x
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 22, 2024, 01:27:31 pm
v0021g.
I did not switch the probe input to 10x. I switched
only in the oscilloscope menu.
_______________________________________
Range    |   Uin     |      1x     |     10x    |     100x   |
---------------------------------------------------------------
5v/div    |     10v   |      10v   |    100v   |   1,00kv  |
---------------------------------------------------------------
2,5v/div |      5v    |      5v     |     50v    |    500v    |
---------------------------------------------------------------
 1v/div   |      1v    |       1v    |     10v    |    100v    |
---------------------------------------------------------------
0,5v/div |      1v    |       1v    |     10v    |    100v    |
---------------------------------------------------------------
0,2v/div |     0,4v  |      0,4v  |       4v    |      40v    |
---------------------------------------------------------------
0,1v/div |    0,25v |     0,25v |      2,5v   |     25v    |
---------------------------------------------------------------
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 22, 2024, 04:46:13 pm
That's what switching the probe was all about.  Because I don't think there will be 1:10
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 22, 2024, 05:23:28 pm
With the probe at the 1:10 position, I also tried it at a sensitivity of 5V/div.  The readings agree, only the values ​​are 10 times smaller. 
And please make the problem statement more detailed.  Otherwise, the problem of triple translation and double perception arises. :)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 22, 2024, 05:37:45 pm
Probe 10x, oscilloscope 10x, and bring the voltage to the probe and compare with what the oscilloscope shows.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 22, 2024, 06:33:40 pm
I'm sorry, but only tomorrow.  There is currently no access to the device.  Can someone make a table so as not to keep Atlan waiting?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 22, 2024, 08:15:19 pm
It's not urgent.  Now I'm working on autosetup.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 23, 2024, 08:40:26 am
Source Uin, U_calibr - battery.  P6100 probes, included at 10x.  Channel menus are included at 10x. Manual mode selection.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on January 24, 2024, 07:06:10 pm
I tried to save/view pictures/waveforms - all works. On orig FW and custom all is OK. Problem only when it starts. I see splashscreen and 70/30% normal start or "SD error". On orig FW it never give an error.  It works same on any SD card.
Video of start in zip.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 24, 2024, 08:24:02 pm
I tried to save/view pictures/waveforms - all works. On orig FW and custom all is OK. Problem only when it starts. I see splashscreen and 70/30% normal start or "SD error". On orig FW it never give an error.  It works same on any SD card.

I don't know what can be wrong here. The fact that it shows SD error tells me that it fails in the actual scope firmware part after already loading lots of data from the SD card, only to fail when mounting the file system.

I wonder what happens if you erase the new scope software by clearing sector 8 on the SD card, but leave the rest of the card untouched and then use it with the original firmware, if it still works normally or also fails once in a while with the SD error.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 24, 2024, 09:26:00 pm
Why is the calibration constant chosen, which results in a value of 235 units?(for AD 128 value) (it reduces the range of the AD converter to 220bit) At the same time, the area for displaying the signal is 0-402 units.  Why was such a calibration value not chosen that would give a result of 201, ie the center of the display.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 25, 2024, 06:45:52 am
Ask FNIRSI.

I just copied it from the original source and paid no further attention to it. My goal was to get something operational that was close to the original. Started with improvements on the sampling part of the code, but lost interest due to the total crappiness of the hardware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 25, 2024, 02:24:22 pm
Beta v0.022d Version for testing, adjusted 50% trigger setting.
Auto setup used from flood code (with all the errors it has :D)
It does not contain hardware signal shift. (I don't know if it is necessary)
Automatic setting of the time base is not implemented.

Try it if it works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 25, 2024, 04:52:33 pm
Hello, please advise, after calibration according to the instructions above, when connecting the dura ch1 marker 1 is lower and the difference in readings of 0.3 volts (actual value is 15.06 volts on the lab power supply), is this how it should be? What is the problem?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 25, 2024, 04:54:41 pm
Two screen
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 25, 2024, 05:13:21 pm
Also when I pressed autoset this is what happened, Vrms shows 15 volts correctly. I tried to go to the calibration menu when the probes are pulled out and calibrate, the channel indicators ch1,ch2 are aligned, but when reconnecting the probes to measure the voltage, everything goes astray on the photo you can see.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 25, 2024, 06:10:18 pm
 Make a video.  I don't see a problem in the photo.  Without the voltage connected, the yellow line should point to the yellow cursor (blue to blue), by connecting the voltage the line will show the voltage (moved away from the yellow cursor) (blue)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 25, 2024, 06:20:02 pm
Uh, thank you. Got it. That's right. And 0.2 V difference between ch1 and ch2 is normal.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 26, 2024, 10:45:40 am
V0.022f Autosetup with DC and AC mode support. Automatic detection of sampling frequency. Changing the colors of V-cursor data and position dY.

I started working on the option: Long time base
It will take some time because you have to create a menu and arrange for switching between Short time base and Long time base.
But first I have to try it.

P. S. Does anyone use current probes?  Is it necessary to add the possibility of displaying A instead of V somewhere?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 26, 2024, 04:57:53 pm
The RTC module is not required for the function of the alternative software.  And it is disabled by default.
Even if you turn it on by mistake, nothing happens except for incorrect time data.  So if you don't save something with such a wrong time.  (I didn't try)

Trying the firmware takes some time, which I don't have.  So that's why versions come out more often so that someone can try it out, even if it's not fully functional.

V0.  022f should actually be a usable version, suitable for work.

How do it:
https://youtu.be/LVI45oJHTK8?si=DPj073HgD5Jeuydx

Loader.zip
https://github.com/Atlan4/Fnirsi1013D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 26, 2024, 07:01:07 pm
Change sample rate, to increase the visible bits of the DS3231 i2c bus. The original firmware cannot do that.

https://www.youtube.com/watch?v=IAhKKigb37k (https://www.youtube.com/watch?v=IAhKKigb37k)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 26, 2024, 10:10:15 pm
Autoset works as it should!!! :clap: This is very good. Perhaps the working area of the signal along “Y” can also be increased? Since with 8 screen cells the signal only works on 4 cells, which is not very good.
The same signal AC+DC on different firmware:
PECOs v0022F
[attach=2]
FNIRSI
[attach=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on January 26, 2024, 10:55:41 pm
Can you please tell me if the calibration should be done after each firmware update through the menu-usb connection?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 27, 2024, 07:07:55 am

By uploading the firmware, the calibration of the input divider DOES NOT CHANGE.
If it is necessary, there will be a warning about it in the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 27, 2024, 02:18:29 pm
v0022F, upgraded from v0014C, which worked well.
No waweform displayed at all, on both channels, 1x or 10x, DC or AC. (used internal & external generator)
Trigger icon flashes red (i presume that means trigger events?), but still straight yellow line. patient is dead ;)
PS. RTC module is installed and works fine.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 27, 2024, 02:37:17 pm
Calibration done? Picture calibration value? Video?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 27, 2024, 03:04:09 pm
Calibration done? Picture calibration value? Video?

calibration is missing in the main menu.  that seemed strange to me on the first run (i have watched your video on how to do calibration), but i thought you have removed it from v0022
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 27, 2024, 03:29:19 pm
What is this for? What do the values mean?

#define SETTING_SECTOR_VERSION_HIGH  0x0100
#define SETTING_SECTOR_VERSION_LOW   0x0002  //0x0003
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 27, 2024, 05:19:03 pm
try this

it works. waveform displayed, P-P amplitude is correct,  but it's shifted down of channel baseline. 
calibration option still missing in the main menu
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 27, 2024, 07:22:19 pm
Did you turn on the USB connection and click as accurately as possible in the center of the screen? And there he reset the values by clicking OK.

P.S. 7 file downloads :D intended for one person only :D not working V+ and V- for CH2 channel
(By uploading the special version, set default settings of the oscilloscope. If you upload 0.022j, the default settings will be uploaded again.) reset calibration data

Reload the latest version 0.022f.
What does the original software do? didn't you make a short circuit?

Baseline calibration always works, and its task is to set zero. PLS VIDEO!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 27, 2024, 08:15:07 pm
What is this for? What do the values mean?

#define SETTING_SECTOR_VERSION_HIGH  0x0100
#define SETTING_SECTOR_VERSION_LOW   0x0002  //0x0003

That is something added to allow checking on the version of the settings. When this is changed the system will know the settings on the card belong to a different version of the software, and an error can be generated.

Used in the function void scope_save_config_data(void) when writing settings to the SD card and void scope_restore_config_data(void) when reading them back. These functions can be found in scope_functions.c
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 27, 2024, 08:52:53 pm
Can I set the 2 constants to any value?  So that default values ​​are loaded with a new firmware release?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 27, 2024, 09:04:06 pm
Did you turn on the USB connection and click as accurately as possible in the center of the screen? And there he reset the values by clicking OK.
Reload the latest version 0.022f.
What does the original software do? didn't you make a short circuit?
Baseline calibration always works, and its task is to set zero. PLS VIDEO!!

reloaded your test fw (not 0.0022f release), and somehow this helped, let me perform succesful levels calibration. re-taping blue screen confrims that new values are saved.

i connect to internal gen, then to external (DSO203 Wildcat 6.5).  looks weird (see attached pics), but result is identical on both devices (fnirsi gen connected to DSO and vice versa). so let's assume it works correct.

then, i have changed test fw  to 0.0022f and wow  - it now works here also.

i will continue testing further.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 28, 2024, 05:40:57 am
I think I know where the problem is.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 28, 2024, 06:22:23 am
Can I set the 2 constants to any value?  So that default values ​​are loaded with a new firmware release?

Yes that is what it does in the scope_restore_config_data function. It checks if these values match what is read from the SD card and loads a default set if not.

Only changing for instance the low one will do this too.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 28, 2024, 07:32:18 am
Ok, thank you. 
I added some texts at the start of the new software.  A text about uploading default values ​​will be displayed, if necessary also a text about calibrating the input divider. 
The new version has moved the location of the saved values ​​on the SD card.

The result will be loading the default data and deleting the input calibration data.  Calibration of input dividers will be required.

I have to make a board with reference voltages.

Long time mode.  A million code edits.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 29, 2024, 07:53:55 am
Every time I look at the pcb, how the power supply and bus lines are solved, I want to cry.  It is not possible that in the era of simulators and Altium Designer and high-quality oscilloscopes, something like this could be created.

I would like to try to install some ferrites to reduce interference.  Yes, they can be given somewhere.  But where they could make the most difference with the AD converter, it is impossible there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 29, 2024, 01:11:59 pm
Every time I look at the pcb, how the power supply and bus lines are solved, I want to cry.  It is not possible that in the era of simulators and Altium Designer and high-quality oscilloscopes, something like this could be created.

I would like to try to install some ferrites to reduce interference.  Yes, they can be given somewhere.  But where they could make the most difference with the AD converter, it is impossible there.

I doubt that would help. It's about diff pairs length tuning, which is obviously failed in our device.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 29, 2024, 01:46:12 pm
I was also looking at the nice lines from AD to FPGA, each of a different length :D

Long time base

https://www.youtube.com/watch?v=uS9gW6L0a0A (https://www.youtube.com/watch?v=uS9gW6L0a0A)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: naiclub on January 30, 2024, 09:34:56 am
I was also looking at the nice lines from AD to FPGA, each of a different length :D

Long time base

https://www.youtube.com/watch?v=uS9gW6L0a0A (https://www.youtube.com/watch?v=uS9gW6L0a0A)
Can this kind of feature, FNIRSI-1014D, be done?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 30, 2024, 09:52:04 am
TOKAR: Test it.
Test channel 1 for signals with DC offset. Your favorite activity. :D channel 2 is not modified. Menu to the right do not use V2+ and V2-

v0.022o version only for testing the autosetup function
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 30, 2024, 01:06:48 pm
Can this kind of feature, FNIRSI-1014D, be done?

No, the 1014D has to much differences for just using this firmware. There has been some work done on the 1014D, about which you can read here (https://www.eevblog.com/forum/testgear/new-bench-scope-fnirsi-1014d-7-1gsas/msg4616806/#msg4616806).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 30, 2024, 05:04:17 pm
Do you want a battery indicator in percentages? 95...90 ...85 But the value will fluctuate.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on January 30, 2024, 06:24:40 pm
Only if it could be smoothed. The jitteriness of the current one is noticeable in the corner of your eye sometimes.

I can't recall -- does it change color when < 5/10/15% ? If not, that would be a good add at least.  Don't think I've pushed it that low before. Would be nice as long as it didn't flicker (go green>yellow once 15% is hit, but not turn back green until 20% is hit, etc.. assuming you can track state easily enough if not just looking directly at the current pixel color)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on January 30, 2024, 07:37:04 pm
Do you want a battery indicator in percentages? 95...90 ...85 But the value will fluctuate.

Add a slow averaging filter on it.

In the original code they do something with the time base setting to compensate the reading. The FPGA plus ADC's will draw more current when the sampling rate is higher, but I don't think it is needed when properly filtered.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 31, 2024, 08:11:16 am
Long time base, everyone send 100E to my account :D It requires big modifications in the code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 31, 2024, 02:36:12 pm
In long base mode 100ms/div, rendering on the screen takes a lot of time. if the time and voltage cursors are active, it is already very close in time.
When saving the WAV course, it is possible to activate cursors in it and measure with them.

The video shows where the process was saved to the file. A jump is visible in the given part.
Data in long mode are continuously written to a 3000-byte buffer. Next, it is possible to save this entire buffer in a wav file and view it later.
https://www.youtube.com/watch?v=td3_2nj9WD0 (https://www.youtube.com/watch?v=td3_2nj9WD0)

The original firmware cannot do anything. A wav is like an image.

The long mode is almost functional, it's just necessary to remove many small errors that arose due to inclusion in the flood code. There is always a possibility that there is a big mistake somewhere. The test was with a periodic signal.



Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on January 31, 2024, 05:28:52 pm
...
v0.022o version only for testing the autosetup function
[attach=1]
The parameters for negative voltage are identical to the table above.  With one big BUT... When performing autoset for the ranges 200mV, 1v, 5v (two-rank), the "0" mark goes down the screen, but should go up.  You have to pull it out with your finger
https://youtu.be/wY5TosP4008 (https://youtu.be/wY5TosP4008)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on January 31, 2024, 08:39:46 pm
 :-// |O
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on January 31, 2024, 08:56:48 pm
Do you want a battery indicator in percentages? 95...90 ...85 But the value will fluctuate.

personally, i would prefer exact voltage instead of %
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 01, 2024, 05:42:31 am
Do you want a battery indicator in percentages? 95...90 ...85 But the value will fluctuate.

personally, i would prefer exact voltage instead of %

With a 6 bit ADC using only half of the range it won't be very exact.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 01, 2024, 01:29:50 pm
What is the procedure to erase part of the screen?

When you close the trigger menu, a copied part of the flood screen will remain there. In the same way, even when leaving the wav or image viewing mode, the fragment that was under the main menu will remain on the screen. how can I delete it effectively?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 01, 2024, 05:05:57 pm
Ah yes, that is right, the menu's save the screen part used for the menu before displaying the menu, and on exit copy the saved part back. This to avoid redrawing the whole screen.

Erasing can easily be done by writing black pixels to a section of the screen with one of the display functions, but you would still need to redraw the grid etc. I believe the section of the display is copied into a second screen buffer, so it is possible to setup a new screen in that buffer and overwrite the saved bit.

Looking at your pictures makes me think that you keep on sampling even when a menu item is open, which is not the case in short time base operation if I'm not mistaken. This means you would have to check in your code that builds up the screen if a menu is opened and if so also update in the second screen buffer.

Don't pin me down on this, because it is all from memory. Did not look at the code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 01, 2024, 05:40:23 pm
ok trigger menu my mistake.

To find out, the main menu does not work from the beginning (v0.006), when leaving the picture or wav menu and the slow sampling rate, you can see the artifact on the display until it is overwritten.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 01, 2024, 07:45:18 pm
When someone wants to see what's new. So the unfinished beta version here v0.023c

It is still necessary to make support (long time base) for the trigger in single and normal mode.

Add the possibility of a time delay for the trigger.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on February 02, 2024, 10:52:16 am
Do you want a battery indicator in percentages? 95...90 ...85 But the value will fluctuate.

personally, i would prefer exact voltage instead of %

With a 6 bit ADC using only half of the range it won't be very exact.

that is sad :(   but anyway, better than battery symbol, which is constantly jumping from full to 3/4 even after overnight charge. this is annoying....
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 02, 2024, 11:01:08 am
.....

that is sad :(   but anyway, better than battery symbol, which is constantly jumping from full to 3/4 even after overnight charge. this is annoying....

In mine the battery connector also is a cause of fluctuation. Has been connected and disconnected so often that it became crap.

Have not used any of these cheap two bit scopes since the reverse engineering.  :-DD
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 02, 2024, 11:52:16 am
I have already removed the pins and tensioned them.
Have you tried the new firmware version?  :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on February 02, 2024, 04:01:48 pm
.....

that is sad :(   but anyway, better than battery symbol, which is constantly jumping from full to 3/4 even after overnight charge. this is annoying....

In mine the battery connector also is a cause of fluctuation. Has been connected and disconnected so often that it became crap.

Have not used any of these cheap two bit scopes since the reverse engineering.  :-DD

i have them both (fnirsi 1013 and 1014d) for a purpose - there will be no regrets in case of accidental burn :) I work with high voltage , so this could happen (and happens) sooner or later. also , galvanic isolation from AC is important.  at the moment of purchase, i thought that 1014d is a "big bro" version of 1013, but the same (maybe even worse) shit in fact...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 02, 2024, 05:10:09 pm
I have already removed the pins and tensioned them.
Have you tried the new firmware version?  :D

No not yet. Busy with my own project of a remote control system for fischertechnik.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 02, 2024, 05:18:48 pm
i have them both (fnirsi 1013 and 1014d) for a purpose - there will be no regrets in case of accidental burn :) I work with high voltage , so this could happen (and happens) sooner or later. also , galvanic isolation from AC is important.  at the moment of purchase, i thought that 1014d is a "big bro" version of 1013, but the same (maybe even worse) shit in fact...

I bought my 1013D to use as a small device on my computer bench to measure output from my digital synthesizer project I was working on. Unfortunately it arrived with a defect in the touch screen, which started the whole reverse engineering ordeal. Bought another one to be able to compare my version of the code with the original, without having to swap between them on the same device. Got the 1014D as a gift from someone and started on the reverse engineering of it, but got fed up with it and left it as is.

For most of my MCU work I use either my Rigol or my Yokogawa scope. Much better devices.  :-+

Also have a Hantek DSO2D10. Bought that as a possible project because it uses the same MCU. Use it once in a while to do some quick measurement. Better than the FNIRSI, but not perfect.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on February 02, 2024, 06:14:49 pm
Hello, please tell me how to record firmware through a card reader without connecting the oscilloscope to the computer. The program for flashing gives a message on the photo shows
Calibration of ch2 860 50mv value 0 fails. Tried 2 times to calibrate. And when I press the off usb screen it gives hieroglyphics
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: naiclub on February 02, 2024, 06:26:09 pm
Hello, please tell me how to record firmware through a card reader without connecting the oscilloscope to the computer. The program for flashing gives a message on the photo shows
I'd like you to reformat it. You must use FAT format. And it must be done in mbr mode only, not gpt mode.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 02, 2024, 06:39:38 pm
https://www.youtube.com/watch?v=4yFmStYuK_o (https://www.youtube.com/watch?v=4yFmStYuK_o)

Page 62
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1525/ (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1525/)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on February 02, 2024, 06:46:26 pm
Calibration of ch2 860 50mv value 0 fails. Tried 2 times to calibrate. And when I press the off usb screen it gives hieroglyphics. Firmware 023c
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 02, 2024, 08:29:52 pm
0.022f robi co?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on February 02, 2024, 10:58:12 pm
0.022f it's working fine
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Sleo on February 02, 2024, 11:05:02 pm
Hello, please tell me how to record firmware through a card reader without connecting the oscilloscope to the computer. The program for flashing gives a message on the photo shows
I suppose the card has not enough 'hidden' space. Read this message. Reformat will not do the job, you need to repartition the card.
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4702625/#msg4702625 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4702625/#msg4702625)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 03, 2024, 04:49:24 am
Calibration of ch2 860 50mv value 0 fails. Tried 2 times to calibrate. And when I press the off usb screen it gives hieroglyphics. Firmware 023c
0.022f it's working fine
The same situation. The m-SD card is filled with "00", then formatted in FAT32.  FW was reset to the original (Fnirsi), then filled with v0023c.  Calibration was successful.  But the calibration constants for ch2 50mv are zero.  Channel 2, 50mv/div range does not work.  The “beam” does not move, the voltmeter does not display values, and does not manually select limits.  When the voltage increases to 210mV and the autoset is pressed, it switches to the 100mv/div range and starts working as it should.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 03, 2024, 06:53:19 am
And when 23c is uploaded and the calibration is not performed, does it work?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on February 03, 2024, 06:57:31 am
Not work. And installing the firmware deletes the calibration data
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 03, 2024, 08:53:25 am
I confirm, it does not work (ch 2, 50mV/div).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 03, 2024, 09:23:01 am
Only one sector on the sd card is written and there are more variables.

I don't know whether to enable writing to 2 sectors and change the control from 256 to 512.

Or move offsets. I assume a 16bit record needs 2 positions. 9 values (16bit)  will be written from offset 10 to 28

#define CHANNEL1_SETTING_OFFSET                    10    // 9*16bit   
#define CHANNEL2_SETTING_OFFSET                    40    // 9*16bit   
#define TRIGGER_SETTING_OFFSET                       70    // 8*16bit   
#define OTHER_SETTING_OFFSET                         100   // 9x16bit   
#define CURSOR_SETTING_OFFSET                      130   // 6x16bit
#define MEASUREMENT_SETTING_OFFSET          160   //26*16bit
#define CALIBRATION_SETTING_OFFSET              200   //14*16bit
#define INPUT_CALIBRATION_SETTING_OFFSET 230   //14*32bit

It does not contain the area where the calibration data is. I move the values a bit and it will work.

try this:
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 03, 2024, 11:39:55 am
I converted it to multiples of 16.

PC, you don't have a table somewhere about what the sampling frequency is if the value 2000 is written into the fpga.  In the long time base mode.  I assume that it is possible to change the frequency in order to achieve more uniform sampling when changing from about 100ms to 50s
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 04, 2024, 05:46:50 am
It works?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 04, 2024, 06:26:23 am
I converted it to multiples of 16.

PC, you don't have a table somewhere about what the sampling frequency is if the value 2000 is written into the fpga.  In the long time base mode.  I assume that it is possible to change the frequency in order to achieve more uniform sampling when changing from about 100ms to 50s

Within the FPGA there is a 32 bit counter to divide the clock down. The value set for the sampling frequency is used as the divider, but I need to consult my work to give the formula and the clock frequency. Will get back to you on this.

Edit: I looked at the verilog file here (https://github.com/pecostm32/Anlogic_AL3-10_Analyzing/blob/main/FNIRSI-1013D_FPGA/finrsi_1013D/fnirsi_1013d.v).

There is a variable "sample_rate_divider" that is used to make the sample clock. It is set with the FPGA command 0x0D.

The main clock runs at 200MHz. When "sample_rate_divider" is 0 the 200MHz is divided by 2 and the sample clock is 100MHz. This is the clock signal for the ADC's and the sample memory. For the software it means a sampling rate of 200MSa/s.

When set to 1 the 200MHz is divided by 4 giving a sample clock of 50MHz. For 3 it means dividing by 8 giving 25MHz.

The sample clock is based on the formula:  clk = 200MHz / ((sample_rate_divider + 1) * 2)
The sample rate is then:  rate = clk * 2

This only applies for when both ADC's are used to get the interleaved samples. When only reading data from one ADC the sample rate equals the clock rate.


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 04, 2024, 11:34:15 am
Well thank you.  So that I set the sampling frequency so that the samples are spread over the interval according to the selected time per div. 50s/div..... 100ms/div
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 04, 2024, 02:06:26 pm
...
try this:
Yesterday I didn't see the binary file. Today I downloaded it and tried it. It calibrates normally. Positive and negative voltages are shown correctly on the screen.
I don’t like the autoset time (sometimes long) - from 2 to 14 seconds, but it works.
CH 2 manual gain does not work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 04, 2024, 04:58:04 pm
Implemented long time mode, with support for trigger auto, normal, single. v0.023g

https://www.youtube.com/watch?v=BaJblNHIVfk (https://www.youtube.com/watch?v=BaJblNHIVfk)

The setting of the falling rising edge must be programmed. Correct overview of waveforms and images in long time mode.
Autoset from version 0.022f

Fixed some errors that were found.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on February 04, 2024, 09:43:59 pm
Firmware 0.023g Calibration is successful, but auto set works very slowly, hangs up if the measurement range changes downward in voltages. For example, at 11 to 12 volts auto set works faster than from 9 volts to 1 volt. Ch2 less than 6 mV does not display ch1 less than 3 mV does not display
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 05, 2024, 01:57:25 pm
v0023g. Range 5 V/div.
Channel 1, Ulim =21.7V
Channel 2, Ulim =20.5V
If you press auto-tune when the signals are limited (red), the device goes into a stupor (“beam” and the pointers move to the edges of the screen, the voltmeter turns off, the range value disappears). You can get out of the situation by reducing the voltage below the limiting threshold and pressing auto-set (does not work separately, manual mode and turning off the power do not help). Under the same conditions, and the polarity changes to negative, generation (excitation) occurs. The way out of the situation is similar.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 06, 2024, 09:19:19 am
PC: Is it possible to use the SPI interface to control the AD9833 generator?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 06, 2024, 09:57:38 am
PC: Is it possible to use the SPI interface to control the AD9833 generator?

In theory I would say yes, but you need an additional chip select signal and adapt the software to disable the use of the FLASH and control the new chip select. Also check the clock phase and polarity of the AD9833. The software might need to set that too when switching to the AD9833.

There are two free pins on the MCU, but connecting a wire to one of them might be a bit tricky.

The peripheral is described in the user manual, but as for all the other things in the chip it is sparse.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 06, 2024, 11:05:27 am
If I remove the flash, can I use all the necessary pins?  Alternative firmware does not access the flash at all?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 06, 2024, 11:16:18 am
If I remove the flash, can I use all the necessary pins?  Alternative firmware does not access the flash at all?

Sure. For as far as I can recall it is now all done on the SD card, and the flash is not used, despite code being there to access it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 06, 2024, 12:16:40 pm
Maybe this will be useful:
data on 25Q16 at addresses 0x 1FD000 - 0x 1FD1F3 changes when loading a new version, calibrating, setting the time. It is possible that changes occur during other operations.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 06, 2024, 07:08:42 pm
Nothing should be written there...

In the long mode, programmed trigger to the rising or falling edge.

The hardware trigger does not work in long mode.  It works, but does not provide information whether it is a rising or falling edge.  So I turned it off.  And the detection is done by software.

I added a condition to the autoset for 5V/div, maybe it won't freeze when it's in red, I haven't tried.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 07, 2024, 08:01:56 am
v0023h.
Range 5 V/div. The signal (positive/negative) in limit mode works fine and does not freeze.
Viewing the recorded WAV (X-stretch/compress) is only possible through the ACQ menu. Briefly touching the screen causes the image to disappear (must change time/div). You need to open the image again. Is this how it should be? Or am I doing something wrong?
Pressing and holding your finger on the screen allows you to move the image around the screen - it works correctly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 07, 2024, 11:37:45 am
There were 2 subroutines for loading values ​​for long mode and erasing the display.  Since they were almost the same, I created one.  I probably forgot the condition for viewing wav.  It is also necessary to disable sampling change in browsing mode and adjust the ACQ menu.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 07, 2024, 03:15:05 pm
Since I have enough other work, this project has slowed down.  The plan is to divide the signal shift into the hardware part in real time, and the software part in wav mode.  That should solve the automatic problem.  Will anyone be interested in the assembly of the signal generator?  It will also lose the ability to run flood firmware.  Although there is the possibility of adding an i2c circuit to control the gain of the input amplifier for better sensitivity.  What would enable, leave the flash.

It would also be a nice project for a bachelor's thesis.  Take the flat, copy the layout, modify critical things, redo the input part, add the generator and rtc.  And finally, a new program for fpga.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: naiclub on February 07, 2024, 05:38:01 pm
Since I have enough other work, this project has slowed down.  The plan is to divide the signal shift into the hardware part in real time, and the software part in wav mode.  That should solve the automatic problem.  Will anyone be interested in the assembly of the signal generator?  It will also lose the ability to run flood firmware.  Although there is the possibility of adding an i2c circuit to control the gain of the input amplifier for better sensitivity.  What would enable, leave the flash.

It would also be a nice project for a bachelor's thesis.  Take the flat, copy the layout, modify critical things, redo the input part, add the generator and rtc.  And finally, a new program for fpga.
I want to do this. Is there anyone who can do this? Can you take me to do it?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 07, 2024, 08:17:12 pm
Get a cheap Arduino nano (https://nl.aliexpress.com/item/1005005128673508.html) clone or STM32F103 based bluepill  (https://nl.aliexpress.com/item/1005006110046576.html)and an AD9833 module (https://nl.aliexpress.com/item/1005006415782085.html) from aliexpress and connect them together. Search for some code on the net and stick it in to make it work.

Or check out for instance this article: https://www.instructables.com/Arduino-Controlled-AD9833-Function-Generator-With-/ (https://www.instructables.com/Arduino-Controlled-AD9833-Function-Generator-With-/)
Or this one https://circuitdigest.com/microcontroller-projects/build-your-own-function-generator-with-arduino-and-ad9833-module (https://circuitdigest.com/microcontroller-projects/build-your-own-function-generator-with-arduino-and-ad9833-module)

Search on google for "arduino ad9833 dds signal generator" and you will find all sorts of projects like this.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 08, 2024, 06:42:42 am
I was thinking of rebuilding the entire pcb of the oscilloscope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: naiclub on February 08, 2024, 07:57:31 am
I was thinking of rebuilding the entire pcb of the oscilloscope.
Do you have a detailed circuit diagram? I happen to have a file of one person who is Russian. But when I try to compile the file and it doesn't go through, it's stuck here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: alesfilip on February 08, 2024, 02:35:41 pm
You need install RotaryEncoder Arduino Library  ;)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 08, 2024, 05:34:26 pm
The saved format of waw files does not have the correct display scale.  Moreover, it does not fit with time per div with short time base.  I will fix it.  It will take a while.  Still removing some bugs found.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 09, 2024, 10:00:36 am
fixed errors, and added some new errors :D

v0.023m
Long time base 100ms/div to 50s/div. In the waveform view mode, the range is from 20ms to 50s/div (multiple zoom options)
Long time base uses a memory of 3000 samples per channel.
Trigger options: Normal and single with the option of setting the trigger level and type of edge. Auto free run mode, no triggered.
In the long mode, the menu of measured values is not displayed.

write notes on errors.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 09, 2024, 05:34:20 pm
ok fix it 3 error. erasing the display when turning on or off the time or voltage cursor. Correction of the cursor scale time-wrong value in short base, it no longer shows GHz, Bad sampling value for 500ms 5s and 50s
v0.023n
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 10, 2024, 05:51:41 pm
Yesterday when I decided to use an oscilloscope to measure the switched power and I discovered the 3 errors that are removed in the 0.023n version.

Today I wanted to check the multiplexing speed of the display, and I found out that it is in the red range when set to 1V.
It will be necessary to solve the problem with the shift of the signal in DC mode.
Nothing can replace real tests :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 15, 2024, 07:14:41 pm
It seems that RMS measurement implemented in the version v0.006 requires some changes for the saved WAVE files. Currently it doesn't show correct value.
Possible solutions could be: save calculated RMS value with the other WAVE file settings or recalculate RMS value from the file samples after loading.
only 1 year and 1 day :D
fix in v0.023o

The value was not saved in the wav file, added. (rms value)
Fixed screen clearing after exiting waveview mode.
FIxed wrong frequency in autoset mode
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 16, 2024, 09:02:25 am
Good afternoon! Atlan, thank you for your hard work. A bug has been found in version v0.023o. When the stopped pulse is stretched or compressed, it is reset to 0 value.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 16, 2024, 12:11:02 pm
Fixed. V0.023p
The correct switching of the sampling frequency when switching from stop to run also works.

If you reduce or expand the signal in the stop, the run will be displayed in the current setting during the transition.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 16, 2024, 08:39:54 pm
Another problem has been discovered, the displacement of the zero level of the beam during the transition to the ACQ long period.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 17, 2024, 07:54:06 am
Make video.

Now I am modifying the program so that it does not wait for the end of the transfer.  Quite a lot of interventions in the program.

PC:
I would say that a field[730] was created for the displayed data on the display.  But is it not used anywhere?  Channel1pointsbuffer and 2
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 17, 2024, 04:42:17 pm
https://youtu.be/J_cZJTdngeQ?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 17, 2024, 07:05:52 pm
PC:
I would say that a field[730] was created for the displayed data on the display.  But is it not used anywhere?  Channel1pointsbuffer and 2

I think it was intended to be used for the wave file storage. The buffer is being filled when a channel trace is displayed on the screen. See "void scope_display_channel_trace(PCHANNELSETTINGS settings)" function in scope_functions.c, but by the looks of it that is it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 17, 2024, 08:18:40 pm
In next version firmware will is bug fixed.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 10:52:41 am
hi, when i try to change the time and date, it shows ? you can't change it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 18, 2024, 02:38:18 pm
hi, when i try to change the time and date, it shows ? you can't change it.
Touch the buttons to set the time and date

https://www.youtube.com/watch?v=CzC73Oc7DBw (https://www.youtube.com/watch?v=CzC73Oc7DBw)

The work has progressed, so hopefully there will be a new firmware release soon.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 02:47:26 pm
it's not working for me, when i change it, it sets hours 45 minutes 85 day 45 month 25 year 20165
when i change it, it shows 3?:7?:7?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 02:58:55 pm
see pictures it doesn't work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 03:19:35 pm
i try with version 0.023p and its the same problem, even with version 0.019 it's not working. it keeps showing the 3?:7?:7?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 18, 2024, 03:38:18 pm
Broken or wrongly connected RTC module
https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1600/ (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/1600/)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 05:03:37 pm
the unit is new, i bought it, 3 days ago?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on February 18, 2024, 05:15:19 pm
the unit is new, i bought it, 3 days ago?
Read the post linked above. It doesn't come with real time clock. It's a mod you have to do if you want it by adding an extra circuit and soldering it in. It doesn't work on base hardware without the mod.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: arne2501 on February 18, 2024, 05:18:39 pm
okey thanks, now i understand. i will install it. thanks for the response.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 19, 2024, 02:14:43 pm
It is interesting that no one complained that it still deletes the calibration data, even when it is announced that only the default data will be uploaded. FIXED
It should already work, that is, unless there are changes regarding the calibration or the location of the values on the SD card. It will not be necessary to recalibrate the input divider. You can perform the baseline calibration whenever you need.

v0.023s allows the code to run without waiting for the conversion to finish in the FPGA. This means that the time on the display is not frozen, and the T cursor and V cursor buttons work as they should.

Again, the bigger the changes in the code, the more likely it is that there will be more errors. So test it.

P.S. I did not notice a signal shift when switching from short to long mode.
I have a working manual for the firmware, but it is not finished or translated, and I don't even want to deal with it. Maybe when there is free time for that.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 19, 2024, 02:28:22 pm
Another problem has been discovered, the displacement of the zero level of the beam during the transition to the ACQ long period.
Take a photo of the calibration data
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 19, 2024, 07:07:17 pm
Strangely, two oscilloscopes have the same level problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 19, 2024, 10:36:17 pm
It's interesting that it doesn't make me 2 pieces. We'll see if anyone else can be found

v0.023t
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 20, 2024, 04:11:15 am
Is there a utility to restore the tp configuation after it is saved with this tool? Somehow one of my units now has the touch screen coordinates backwards. I was able to fix this running your code with the config file but this doesn't help with the original firmware of course. I didn't have to use your config file previously either before this issue cropped up. I don't know how this came about but I compared my original FNIRSI_1013D_tp_config.bin to one that I got from the fwb tool after this issue cropped up and there are a few bytes different between the files. I would really like to get this back working with the original firmware as well.

Thanks

Here is the tool plus the steps to make it work.

!! I take no responsibility if anything goes wrong !!

Steps for making the FNIRSI-1013D firmware backup on a Linux machine:
  • Connect the scope to the computer via USB.
  • Turn on the scope and start the USB connection via the main menu option.
  • Wait until the file manager window opens. (Only if auto mount is working properly)
  • Close the file manager window.
  • Open a terminal window (ctrl + alt + t) and type the "lsblk" command (!do not use the quotes!) and check which device the scope is on. (~8GB disk)
  • Copy the files from the card to have a backup on your computer.
  • Un-mount the partition. ("sudo umount /dev/sdc1" in my case)
  • Just to be more safe make a backup with dd. ("sudo dd bs=4M if=/dev/sdc of=sd_card_backup.bin" again in my case)
  • Open gparted and check if the device is properly formated. (Use right mouse and information to see the sector info)
  • If not delete the partition and make a new one leaving 1M free at the start. Format is fat32.
  • When the partition remounts after the previous step un-mount it again.
  • Use dd to place the backup package on the SD card. ("sudo dd if=fnirsi_1013d_fwb.bin of=/dev/sdc bs=1024 seek=8")
  • This will re-mount the partition. Un-mount the partition again. ("sudo umount /dev/sdc1" in my case)
  • Turn of the scope and turn it back on. This will start the backup process.
  • Wait until it is done and the scope is mounted again. File manager window should open after a while.
  • Copy the three files to the computer. (FNIRSI_1013D_full_flash_backup.bin, FNIRSI_1013D_tp_config.bin, FWB_FSI_1013.bin)
  • Turn off the scope and turn it back on. It should start normally.

When the scope showed the "!! special touch panel detected !!" message please upload the "FNIRSI_1013D_tp_config.bin" file in this thread.

If your scope uses a smaller or bigger SD card be warned that this is not tested yet. Only 8GB cards have been tested.

See the attached image for info on the sd card sectors. Screen cap from gparted.

Remove the .txt extension from the firmware backup package file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 05:56:59 am
https://youtu.be/-eb8TvmtihE?feature=shared
Part of the beam displays the current value, and part of the false one
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 20, 2024, 06:40:59 am
https://youtu.be/J_cZJTdngeQ?feature=shared
This also happens on my device, although to a lesser extent.
https://youtu.be/UYh5JF16DdE (https://youtu.be/UYh5JF16DdE)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 20, 2024, 07:59:20 am
Is there a utility to restore the tp configuation after it is saved with this tool? Somehow one of my units now has the touch screen coordinates backwards. I was able to fix this running your code with the config file but this doesn't help with the original firmware of course. I didn't have to use your config file previously either before this issue cropped up. I don't know how this came about but I compared my original FNIRSI_1013D_tp_config.bin to one that I got from the fwb tool after this issue cropped up and there are a few bytes different between the files. I would really like to get this back working with the original firmware as well.

Thanks

The original firmware writes a configuration to the touch panel that should make it work correctly, as long as the two where compatible with each other from the start.

The 1013D comes with different displays and touch panels and therefore also different firmware. After repairing my initial 1013D with a new touch panel, the coordinates were also reversed. That is why I started the reverse engineering. Somewhere in this thread there is more info about it. It has been to long for me to recall the exact details.

So ask yourself if you loaded new original firmware to the flash and with that messed it up, or swapped the top halves of the two scopes. It can be fixed, but for that you will have to read through this thread. Start at page 19 or so.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 20, 2024, 11:30:05 am
https://youtu.be/-eb8TvmtihE?feature=shared
Part of the beam displays the current value, and part of the false one
This is after manually selecting the sampling frequency and time per div or after pressing AUTO. The display with data cannot be seen well in the video
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 11:56:11 am
it was not possible to achieve a repeat effect, once it was when switching to a faster scan
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 12:05:39 pm
the effect was manifested at ACQ 200KSa/s 500us/div and 100KSa 1md
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 20, 2024, 12:06:25 pm
https://youtu.be/J_cZJTdngeQ?feature=shared
This also happens on my device, although to a lesser extent.
https://youtu.be/UYh5JF16DdE (https://youtu.be/UYh5JF16DdE)
Upload v0.023u. Start the Base calibration, and upload the image from the calibration with the data here.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 12:16:37 pm
v0.023u defect 100KSa 1ms and 50KSa 2ms
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 20, 2024, 12:36:58 pm
Ok, there's something there. I will find out later.

fast test:

set 200KSa/s and 500us/div, turn the oscilloscope off and on, will the error appear? If the 200us/div option is selected in the ACQ menu, does the error disappear? if 500us/div is selected next in the ACQ menu. does the malfunction no longer appear?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 01:53:40 pm
https://youtu.be/b6aEUykkB2I?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 20, 2024, 03:36:41 pm
And when a sine or rectangular waveform is introduced there, what does it do?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 20, 2024, 03:53:36 pm
https://youtu.be/DDkhqrzV6Gk?feature=shared
I found out the full error algorithm. when turned on at a frequency of 100/1, everything is as in the video. When an alternating signal is applied, the beam stabilizes. when the signal is removed, the interference returns. If the frequency is lowered by 50/2, the effect is the same, if increased to 500/200, the beam stabilizes, but flickers, if the frequency is increased to 1/100, everything returns to normal. When the frequency is reduced to the early limits, everything works well.
Gaps occur only if you turn on the oscilloscope with a frequency of 200/500 or lower, if you set the frequency above this value before turning it off, then there are no problems in all modes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 20, 2024, 05:06:52 pm
Is there a utility to restore the tp configuation after it is saved with this tool? Somehow one of my units now has the touch screen coordinates backwards. I was able to fix this running your code with the config file but this doesn't help with the original firmware of course. I didn't have to use your config file previously either before this issue cropped up. I don't know how this came about but I compared my original FNIRSI_1013D_tp_config.bin to one that I got from the fwb tool after this issue cropped up and there are a few bytes different between the files. I would really like to get this back working with the original firmware as well.

Thanks

The original firmware writes a configuration to the touch panel that should make it work correctly, as long as the two where compatible with each other from the start.

The 1013D comes with different displays and touch panels and therefore also different firmware. After repairing my initial 1013D with a new touch panel, the coordinates were also reversed. That is why I started the reverse engineering. Somewhere in this thread there is more info about it. It has been to long for me to recall the exact details.

So ask yourself if you loaded new original firmware to the flash and with that messed it up, or swapped the top halves of the two scopes. It can be fixed, but for that you will have to read through this thread. Start at page 19 or so.

I have not even taken the ribbon cable out of the displays let alone take out the displays. I had not loaded new original flash nor had I even run a flash operation. The closest I came was setting up an SD card with fnirsi_1013d_startup_with_fel.bin and running your code out of RAM. The first version I found of fnirsi_1013d_startup_with_fel.bin on github did not work and left the screen magenta and many pixels blinking and no allwinner devices found using lsusb. I found another version on github that worked as expected. It was after this that the display became reversed on the x coordinate. It seems maybe that the first version that didn't work correctly may have been the culprit but I wouldn't have thought this would be the case. At this point I had never flashed any code into the scope.

After your message above I tried re-flashing the code from the backup into the scope. It behaves the same with the reversed coordinates. Additionally, I have already read this whole thread and it did not look like anyone had this experience as I have made absolutely no changes to the HW.

Thanks for your reply. I hope there is some way to get this working again...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 20, 2024, 06:46:11 pm
Is there a utility to restore the tp configuation after it is saved with this tool? Somehow one of my units now has the touch screen coordinates backwards. I was able to fix this running your code with the config file but this doesn't help with the original firmware of course. I didn't have to use your config file previously either before this issue cropped up. I don't know how this came about but I compared my original FNIRSI_1013D_tp_config.bin to one that I got from the fwb tool after this issue cropped up and there are a few bytes different between the files. I would really like to get this back working with the original firmware as well.

Thanks

The original firmware writes a configuration to the touch panel that should make it work correctly, as long as the two where compatible with each other from the start.

The 1013D comes with different displays and touch panels and therefore also different firmware. After repairing my initial 1013D with a new touch panel, the coordinates were also reversed. That is why I started the reverse engineering. Somewhere in this thread there is more info about it. It has been to long for me to recall the exact details.

So ask yourself if you loaded new original firmware to the flash and with that messed it up, or swapped the top halves of the two scopes. It can be fixed, but for that you will have to read through this thread. Start at page 19 or so.

I have not even taken the ribbon cable out of the displays let alone take out the displays. I had not loaded new original flash nor had I even run a flash operation. The closest I came was setting up an SD card with fnirsi_1013d_startup_with_fel.bin and running your code out of RAM. The first version I found of fnirsi_1013d_startup_with_fel.bin on github did not work and left the screen magenta and many pixels blinking and no allwinner devices found using lsusb. I found another version on github that worked as expected. It was after this that the display became reversed on the x coordinate. It seems maybe that the first version that didn't work correctly may have been the culprit but I wouldn't have thought this would be the case. At this point I had never flashed any code into the scope.

After your message above I tried re-flashing the code from the backup into the scope. It behaves the same with the reversed coordinates. Additionally, I have already read this whole thread and it did not look like anyone had this experience as I have made absolutely no changes to the HW.

Thanks for your reply. I hope there is some way to get this working again...

Of course there is. By the sound of it your version of the 1013D does not write the configuration to the touch panel and it then indeed got screwed up by using a wrong version of code I wrote.

A bit of background. I wrote lots of test code while working on the reverse engineering to get to the bottom of it all. At some point, after noticing that there are different hardware version of the scope out there, I decided to not write the touch panel configuration, like my first version of the 1013D did and use the touch panel as is to control the scope with the new firmware. To allow for touch panels with the coordinates swapped to still work I added a configuration option to tailor for the different hardware. Same as with the different displays.

So now back to your problem. The way to solve it is to write a correct configuration to the touch panel, and this can be done with any device that has an I2C interface. Keep in mind that the touch panel works on 3.3V, so when using a MCU running on 5V use some 100 Ohm serial resistors and 2K2 to 4K7 Ohm pullup resistors to 3.3V.

The programming guide for the touch panel can be found here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/IC's/GT911%20Programming%20Guide_v0.1.pdf).

In the touch panel configuration there are two ways to reverse the coordinates, but I only used the order of the scan lines to do the swap. The data in question starts on address 0x80B7 - 0x80C4 for the y direction and 0x80D5 - 0x80EE for the x direction. I might be mistaken which is for which. Doing this from memory.

When you have a bluepill lying around you can take a look at the project here (https://github.com/pecostm32/STM32F103_GT911_Conf_Writer).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 20, 2024, 07:53:59 pm
Is there a utility to restore the tp configuation after it is saved with this tool? Somehow one of my units now has the touch screen coordinates backwards. I was able to fix this running your code with the config file but this doesn't help with the original firmware of course. I didn't have to use your config file previously either before this issue cropped up. I don't know how this came about but I compared my original FNIRSI_1013D_tp_config.bin to one that I got from the fwb tool after this issue cropped up and there are a few bytes different between the files. I would really like to get this back working with the original firmware as well.

Thanks



The original firmware writes a configuration to the touch panel that should make it work correctly, as long as the two where compatible with each other from the start.

The 1013D comes with different displays and touch panels and therefore also different firmware. After repairing my initial 1013D with a new touch panel, the coordinates were also reversed. That is why I started the reverse engineering. Somewhere in this thread there is more info about it. It has been to long for me to recall the exact details.

So ask yourself if you loaded new original firmware to the flash and with that messed it up, or swapped the top halves of the two scopes. It can be fixed, but for that you will have to read through this thread. Start at page 19 or so.

I have not even taken the ribbon cable out of the displays let alone take out the displays. I had not loaded new original flash nor had I even run a flash operation. The closest I came was setting up an SD card with fnirsi_1013d_startup_with_fel.bin and running your code out of RAM. The first version I found of fnirsi_1013d_startup_with_fel.bin on github did not work and left the screen magenta and many pixels blinking and no allwinner devices found using lsusb. I found another version on github that worked as expected. It was after this that the display became reversed on the x coordinate. It seems maybe that the first version that didn't work correctly may have been the culprit but I wouldn't have thought this would be the case. At this point I had never flashed any code into the scope.

After your message above I tried re-flashing the code from the backup into the scope. It behaves the same with the reversed coordinates. Additionally, I have already read this whole thread and it did not look like anyone had this experience as I have made absolutely no changes to the HW.

Thanks for your reply. I hope there is some way to get this working again...

Of course there is. By the sound of it your version of the 1013D does not write the configuration to the touch panel and it then indeed got screwed up by using a wrong version of code I wrote.

A bit of background. I wrote lots of test code while working on the reverse engineering to get to the bottom of it all. At some point, after noticing that there are different hardware version of the scope out there, I decided to not write the touch panel configuration, like my first version of the 1013D did and use the touch panel as is to control the scope with the new firmware. To allow for touch panels with the coordinates swapped to still work I added a configuration option to tailor for the different hardware. Same as with the different displays.

So now back to your problem. The way to solve it is to write a correct configuration to the touch panel, and this can be done with any device that has an I2C interface. Keep in mind that the touch panel works on 3.3V, so when using a MCU running on 5V use some 100 Ohm serial resistors and 2K2 to 4K7 Ohm pullup resistors to 3.3V.

The programming guide for the touch panel can be found here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/IC's/GT911%20Programming%20Guide_v0.1.pdf).

In the touch panel configuration there are two ways to reverse the coordinates, but I only used the order of the scan lines to do the swap. The data in question starts on address 0x80B7 - 0x80C4 for the y direction and 0x80D5 - 0x80EE for the x direction. I might be mistaken which is for which. Doing this from memory.

When you have a bluepill lying around you can take a look at the project here (https://github.com/pecostm32/STM32F103_GT911_Conf_Writer).

Thanks for the info. Isn't it possible to use your bit banged I2C code on github to reprogam the touch panel configuration instead of connecting other hardware? It seems that is what happened in the first place. Once again thanks for the help!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 20, 2024, 09:23:04 pm
PC:
Where do these numbers come from?

1800,   //200ms/div 12
    1800,   //100ms/div
    1800,   // 50ms/div
    1800,   // 20ms/div (Was 800, but that does not yield enough samples)
    1800,   // 10ms/div
    2500,   //  5ms/div
    2500,   //  2ms/div
    2500,   //  1ms/div
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2024, 07:36:28 am
Thanks for the info. Isn't it possible to use your bit banged I2C code on github to reprogam the touch panel configuration instead of connecting other hardware? It seems that is what happened in the first place. Once again thanks for the help!

Sure it is, but you have to write it yourself. The code can be small enough to do it in the bootloader. Just take that project and remove the loading of the next code and stick in the I2C bit with the needed touch panel configuration. All the needed bits and pieces can be found in what I wrote. It might even still be in the new firmware disabled with a define.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2024, 07:44:21 am
PC:
Where do these numbers come from?

1800,   //200ms/div 12
    1800,   //100ms/div
    1800,   // 50ms/div
    1800,   // 20ms/div (Was 800, but that does not yield enough samples)
    1800,   // 10ms/div
    2500,   //  5ms/div
    2500,   //  2ms/div
    2500,   //  1ms/div

Probably from the original code. The number of samples read from the FPGA, but don't think this is still used in the code.

Consider the way it all came together as being chaotic, and not well structured. There will be bits and pieces that are not used anymore.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 09:04:24 am
Those numbers are sent to the FPGA

//short time base
void fpga_set_time_base(uint32 timebase)
{
  //Make sure setting is in range
  if(timebase < (sizeof(timebase_settings) / sizeof(uint32)))
  {
    //Write the command to set the short time base data to the FPGA
    fpga_write_cmd(0x0E);
   
    //Table settings ranges from setting 0 (200mS/div) to 23 (5nS/div)
    fpga_write_int(timebase_settings[timebase]);

const uint32 timebase_settings[35] =
{//long time base
    1800,   //50s/div
    1800,   //20s/div
    1800,   //10s/div

It worked until now, I don't understand why it broke. The numbers are always sent the same. It looks like the fpga has finished filling the magazine early. I don't know if they didn't feel the flood numbers because sometimes only 750 samples are taken. because 1500 samples are taken, the times are short and the collection is finished sooner. But again, it doesn't agree, so why does it somehow work when switching to a higher number and then back to sleep (however, some sampled data is still missing at the end.)

I increased the number, but that's a bad solution because I don't know where the problem actually is.

FIRMWARE v0.023x
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 09:19:33 am
Thanks for the info. Isn't it possible to use your bit banged I2C code on github to reprogam the touch panel configuration instead of connecting other hardware? It seems that is what happened in the first place. Once again thanks for the help!

Sure it is, but you have to write it yourself. The code can be small enough to do it in the bootloader. Just take that project and remove the loading of the next code and stick in the I2C bit with the needed touch panel configuration. All the needed bits and pieces can be found in what I wrote. It might even still be in the new firmware disabled with a define.

#ifndef USE_TP_CONFIG
#ifdef SAVE_TP_CONFIG
void save_tp_config(void)
{
  //Create a file for the touch panel configuration. Fails if it already exists
  if(f_open(&viewfp, "FNIRSI_1013D_tp_config.bin", FA_CREATE_NEW | FA_WRITE | FA_READ) == FR_OK)
  {
    //Write the touch panel configuration to the sd card
    f_write(&viewfp, tp_config_data, sizeof(tp_config_data), 0);

    //Close the file to finish the write
    f_close(&viewfp);
  }
}
#endif
#endif

//----------------------------------------------------------------------------------------------------------------------------------
//Touch panel configuration for the GT9157 set to 800x480 resolution

#ifdef USE_TP_CONFIG
#define USE_LR_CONFIG

#ifdef USE_LR_CONFIG
uint8 tp_config_data[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
  0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01
};
#else
uint8 tp_config_data[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x8B, 0x2A, 0x0C, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x18, 0x16, 0x14, 0x12, 0x10, 0x0E, 0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x22,
  0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x18, 0x16, 0x13, 0x12, 0x10, 0x0F, 0x0C, 0x0A, 0x08, 0x06,
  0x04, 0x02, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01,
};
#endif
#endif

#ifdef USE_TP_CONFIG
  //Clear the checksum before calculating it
  checksum = 0; 
 
  //Calculate checksum over the configuration data (first 184 bytes)
  for(i=0;i<184;i++)
  {
    checksum += tp_config_data;
  }
 
  //Do the last action to make it the correct checksum
  checksum = ~checksum + 1;
 
  //Put the checksum in the buffer
  tp_config_data[184] = checksum;
 
  //Send the configuration data
  tp_i2c_send_data(TP_DEVICE_ADDR, TP_CFG_VERSION_REG, tp_config_data, sizeof(tp_config_data));
#else
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2024, 09:33:42 am
Those numbers are sent to the FPGA

//short time base
void fpga_set_time_base(uint32 timebase)
{
  //Make sure setting is in range
  if(timebase < (sizeof(timebase_settings) / sizeof(uint32)))
  {
    //Write the command to set the short time base data to the FPGA
    fpga_write_cmd(0x0E);
   
    //Table settings ranges from setting 0 (200mS/div) to 23 (5nS/div)
    fpga_write_int(timebase_settings[timebase]);

const uint32 timebase_settings[35] =
{//long time base
    1800,   //50s/div
    1800,   //20s/div
    1800,   //10s/div

It worked until now, I don't understand why it broke. The numbers are always sent the same. It looks like the fpga has finished filling the magazine early. I don't know if they didn't feel the flood numbers because sometimes only 750 samples are taken. because 1500 samples are taken, the times are short and the collection is finished sooner. But again, it doesn't agree, so why does it somehow work when switching to a higher number and then back to sleep (however, some sampled data is still missing at the end.)

I increased the number, but that's a bad solution because I don't know where the problem actually is.

v0.023x

Ah it is coming back slightly. At first I thought the 0x0E to be for the short timebase settings, but it is something else, and I need to look at the reversal of the FPGA to see what it is actually used for. 0x0D is to set the sample clock, as discussed earlier. If I recall correctly it has something to do with the number of samples after the trigger, but I'm not sure.

Don't have time to look at it now. Maybe later today.

Does this mean that you are using the actual sampling system to do the long timebase settings? The original does not.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 10:00:25 am
No, I use the same system as the original.

It seemed easier to modify the constant tables to include the data needed for the long base.  But since those tables are used everywhere, even if some data for long mode are not necessary, I had to supplement them so that the dimensions of the tables fit.  It was probably not a good idea.

In addition, I have the feeling that adding another 2 values ​​would make it agree.  The situation is even worse.  So I suspect that the values ​​between the sampling frequency and the time base value do not match.  Since it is in the code, the question is whether it was ok before, but it was working before.
At the same time, the values ​​written on the LCD correspond to what should be sent to the fpga.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2024, 01:06:45 pm
I'm looking at the setup in the FPGA. 0x0E command writes into a register named "time_base_set". When the sampling system is reset with command 0x01 and data 0x01, a counter named "time_base_cnt" is reset. This counter counts up on the sample write clock.

When this counter becomes larger then the "time_base_set" value a flag named "time_base_timeout" is set.  In auto mode this stops the sampling. In normal mode the sampling only stops when there has been a trigger and enough samples have been collected.

It is a stupid setup but you have to do with it.  :-DD

So the conclusion is that this value sets the number of samples collected in auto mode. It is less for the slower rates to diminish the wait time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 02:35:32 pm
I'm thinking about what it's good for... Or what it could be used for.  If the trigger was turned off, it would be possible to collect the set number of samples with this system.  The question is what time_base_cnt the clock - does it depend on the sampling frequency?

About 0.023x works, so far no one has reported a problem.  We'll see what the user does with the touchscreen, because the oscilloscope code contains things to write to the touchscreen.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 21, 2024, 03:28:52 pm
Thanks for the info. Isn't it possible to use your bit banged I2C code on github to reprogam the touch panel configuration instead of connecting other hardware? It seems that is what happened in the first place. Once again thanks for the help!

Sure it is, but you have to write it yourself. The code can be small enough to do it in the bootloader. Just take that project and remove the loading of the next code and stick in the I2C bit with the needed touch panel configuration. All the needed bits and pieces can be found in what I wrote. It might even still be in the new firmware disabled with a define.

Yes, I knew it was on me to write it. I thought I saw a pretty clear path to modifying fnirsi_1013d_fwb.bin to write the configuration file instead of reading it and not copying the firmware to a file. I just wanted to make sure there wasn't some bug that you had found previously that would prevent this path. Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 03:38:05 pm
Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 21, 2024, 03:43:13 pm
Thanks for the info. Isn't it possible to use your bit banged I2C code on github to reprogam the touch panel configuration instead of connecting other hardware? It seems that is what happened in the first place. Once again thanks for the help!

Sure it is, but you have to write it yourself. The code can be small enough to do it in the bootloader. Just take that project and remove the loading of the next code and stick in the I2C bit with the needed touch panel configuration. All the needed bits and pieces can be found in what I wrote. It might even still be in the new firmware disabled with a define.

#ifndef USE_TP_CONFIG
#ifdef SAVE_TP_CONFIG
void save_tp_config(void)
{
  //Create a file for the touch panel configuration. Fails if it already exists
  if(f_open(&viewfp, "FNIRSI_1013D_tp_config.bin", FA_CREATE_NEW | FA_WRITE | FA_READ) == FR_OK)
  {
    //Write the touch panel configuration to the sd card
    f_write(&viewfp, tp_config_data, sizeof(tp_config_data), 0);

    //Close the file to finish the write
    f_close(&viewfp);
  }
}
#endif
#endif
...


Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 21, 2024, 03:50:17 pm
Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c

Hi Atlan, it would be fantastic if you could generate a bin saving me having to get the build set up  :D Can you set it up to read in a fixed filename that has the touch screen config? If the filename could be FNIRSI_1013D_tp_config.bin as it is saved from the backup tool and using that format would be useful to a lot of people that wind up in my predicament.

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 21, 2024, 04:04:34 pm
I'm thinking about what it's good for... Or what it could be used for.  If the trigger was turned off, it would be possible to collect the set number of samples with this system.  The question is what time_base_cnt the clock - does it depend on the sampling frequency?

About 0.023x works, so far no one has reported a problem.  We'll see what the user does with the touchscreen, because the oscilloscope code contains things to write to the touchscreen.

The time_base_cnt depends on the sample clock. Every sample written increases this counter. So on a low sample rate it takes its time to collect the samples. It is possible to disable the trigger and have the system just take in a bunch of samples. Does not work on normal trigger mode. Has to be auto.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 21, 2024, 04:19:45 pm
Version 0.23x has indeed been fixed, but at a frequency of 50KSa/2 ms and below, a zero-level ripple has appeared
https://youtu.be/YTPkPzBNzJI?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 04:56:19 pm
That's a feature :D I see that it moves nicely even with 2 channels.  Have you modified the power supply, i.e. cut the 4.2V to the 3V stabilizer and installed a 5V step up to power the 3V stabilizer?  Attention 5V must not reach the inverters for the display.  I see that there is quite a lot of interference on 2 channels.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 21, 2024, 05:48:18 pm
No, I haven't installed it, I'm waiting for it to arrive from China. Have you done anything else about nutrition?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 05:57:48 pm
I added some capacitors, but it seems to me that the situation has worsened :D

Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c

Hi Atlan, it would be fantastic if you could generate a bin saving me having to get the build set up  :D Can you set it up to read in a fixed filename that has the touch screen config? If the filename could be FNIRSI_1013D_tp_config.bin as it is saved from the backup tool and using that format would be useful to a lot of people that wind up in my predicament.

Thanks!

dfw_ee Upload your backup file here to the forum
FNIRSI_1013D_tp_config.bin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 21, 2024, 06:41:29 pm
Instructions and description

[attachurl=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: BreakingOhmsLaw on February 21, 2024, 08:49:38 pm
I feel that the real question here is: how the hell did they come up with that brand name?
Was there a committee that sat down together in a room and said "Yeah, FNIRSI! That's the one, we'll roll with that. FNIRSI!"

It sounds like something you catch on a vacation in a jungle, or like an off brand hemroid cream.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on February 21, 2024, 09:15:05 pm
I feel that the real question here is: how the hell did they come up with that brand name?
Was there a committee that sat down together in a room and said "Yeah, FNIRSI! That's the one, we'll roll with that. FNIRSI!"

It sounds like something you catch on a vacation in a jungle, or like an off brand hemroid cream.

There actually is a meaning behind it. Dave or someone reviewing a recent product explained it. I wish I could remember the details, but it was letters from their full company name or something like that. If I find the video I'll post the link.

Edit: They removed the EI and UI from the longer name from the company to come up with it.  Here is some random context found so far showing it's a bit longer word in their company name. Perhaps a native speaker or one that can read the written glyphs can provide more info.
https://www.youtube.com/channel/UCONj2ghlwwgYnc_WJq29XYg (https://www.youtube.com/channel/UCONj2ghlwwgYnc_WJq29XYg)

https://trademarks.justia.com/877/85/fnirsi-87785437.html (https://trademarks.justia.com/877/85/fnirsi-87785437.html)
Shenzhen Feiniruisi Technology Co., Ltd.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 21, 2024, 10:37:05 pm
I added some capacitors, but it seems to me that the situation has worsened :D

Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c

Hi Atlan, it would be fantastic if you could generate a bin saving me having to get the build set up  :D Can you set it up to read in a fixed filename that has the touch screen config? If the filename could be FNIRSI_1013D_tp_config.bin as it is saved from the backup tool and using that format would be useful to a lot of people that wind up in my predicament.

Thanks!

dfw_ee Upload your backup file here to the forum
FNIRSI_1013D_tp_config.bin

It is attached. Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on February 22, 2024, 10:18:31 am
https://youtu.be/glwu0KrXKts?feature=shared
A new bug on ACC LONG resets the waveform when trying to change the cursors
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: naiclub on February 22, 2024, 11:08:42 am
Why don't you do FNIRSI_1014D? For example, adjust the scope measurement to 230V. Using a measuring tape X10 is enough. without needing to use the X100 cable
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 22, 2024, 11:41:45 am
https://youtu.be/glwu0KrXKts?feature=shared
A new bug on ACC LONG resets the waveform when trying to change the cursors
This is a feature, the second option is to turn it off.  (I decided to let the user set the limits and then turn on the sampling. (there is not enough time to sample and render the entire display) Take a WAVe snapshot and you can measure there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on February 22, 2024, 05:16:31 pm
Actually I like that idea now that I try it but if in stop mode could it act differently( or do we need to just use the waveform)?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: uncle_sem on February 22, 2024, 05:22:25 pm
Today I tried to upgrade firmware 0.019d to version 0.023t and the oscilloscope stopped responding to the input signal, always showing a flat line on both channels. Calibration ended with an error. Firmware 0.023p worked fine, and when I installed 0.023t next, it also worked fine. Just for information for those who missed several intermediate versions of the firmware like me
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 22, 2024, 07:17:09 pm
ALWAYS provide legible photos of the working screen of the oscilloscope and the calibration menu with values. (or video) I don't have a crystal ball.

Because in a certain version, the data was moved to sector 709 (previously it was in 700). Data control has been added since a certain version and, if necessary, a prompt is displayed to 1. only upload default values or 2. default values and reset calibration data.
In each case, if a new firmware is installed, it is possible to call up the menu menu with calibration data via USB, and reset them.
I assume that there were 0 values, so that nothing was displayed.

The latest version is 0.023x

Actually I like that idea now that I try it but if in stop mode could it act differently( or do we need to just use the waveform)?

Long mode should only display the signal. That's what he was meant for. The original can't do anything. The possibility to save a wave and carry out the measurement in the browsing mode has been added here, as well as to move the signal from the memory to up to 3000 samples.

The signal is displayed and buffered, so it is possible to redraw the screen with the buffered signal when stopped and cursors will be available. We should think about whether it would be possible to do it this way. It would be a bit strange.

The priority is to finally solve the shift of the DC level, then I need a brain and a lot of time.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 22, 2024, 07:50:44 pm
There are certainly differences. PC. what do you think, can I copy it directly there?

firmavare data:
uint8 tp_config_data[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
  0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01
};

backup data>
6D,20,03,E0,01,05,0D,00,01,0A,28,0F,50,32,03,05,00,00,00,00,00,00,08,17,19,1C,14,87,29,0A,66,
68,EB,04,00,00,02,00,02,11,00,01,00,00,00,00,00,00,00,00,00,5A,8C,94,C5,02,07,19,00,04,93,5E,
00,87,66,00,7C,70,00,72,7A,00,6B,86,00,6A,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,04,06,08,0A,0C,0E,10,12,14,FF,FF,
FF,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,28,26,24,22,21,20,1F,1E,1D,0C,0A,08,06,
04,02,00,FF,FF,FF,FF,FF,FF,FF,FF,FF,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,8D,00
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: polyman on February 23, 2024, 02:00:09 am
Hello:

I would like to install the new firmware on my scope but I am having some issues and was wondering if some kind sould can help me climb out of it.
I am not messing around with the SD Card on the scope just yet. To validate my understanding of the process the setup is Linux, with a generic 4GB
SD card on /dev/sdb. I am following the instructions given in the README.md to write a firmware image (fnirsi_1013d.bin downloaded from the pecostm32
github repo) to the SD Card. The first problem I encounter is here:

> 10) If not delete the partition and make a new one leaving 1M free at the start. Format is fat32.

GParted does not allow me to leave 1MB free at the start even though the "Free space preceeding" field clearly says 1MiB. I can do 2MiB or more, but not 1.
I am not a fat32 expert but this seems to be related to the size of the card. GParted reports that the SD Card inside my oscilloscope is 8GB and has 4MB free
before the sdb1 partition. Question: Is the size of this free space a critical parameter?

After following the direction on how to prepare the SD card outlined in the YouTube video by Atlan titled "FNIRSI1013D fix sdcart problem with load firmware"
second problem is here:

> 12) Use dd to place the firmware package on the SD card. ("sudo dd if=fnirsi_1013d.bin of=/dev/sdc bs=1024 seek=8")

Once dd is done I can indeed mount the /dev/sdb1 partition but there is no content whatsoever in the partition and all the space in the card is reported
as available. If I understand the process correctly, I was supposed to find the files necessary to boot the scope, but alas there is nothing.

What am I missing?

Thanks
Polyman


Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 06:10:56 am
The minimum required space is 1MB, yes, 8GB is basically 4MB.  Nothing else matters.  You will not see the files, if you want to see the bytes, use the HxD program for Windows.

When the card is turned on, the program from the card is loaded into the oscilloscope.  It is advisable to make a Flash backup beforehand
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 07:47:48 am
dfw_ee Check if the picture fits the transcript. check byte by byte.

[attach=1]

  0x6D, 0x20, 0x03, 0xE0, 0x01, 0x05, 0x0D, 0x00, 0x01, 0x0A, 0x28, 0x0F, 0x50, 0x32, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x17, 0x19, 0x1C, 0x14, 0x87, 0x29, 0x0A, 0x66, 0x68,
  0xEB, 0x04, 0x00, 0x00, 0x02, 0x00, 0x02, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x5A, 0x8C, 0x94, 0xC5, 0x02, 0x07, 0x19, 0x00, 0x04, 0x93, 0x5E, 0x00, 0x87,
  0x66, 0x00, 0x7C, 0x70, 0x00, 0x72, 0x7A, 0x00, 0x6B, 0x86, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x26,
  0x24, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02, 0x00, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0x00
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 08:00:59 am
There are certainly differences. PC. what do you think, can I copy it directly there?

firmavare data:
uint8 tp_config_data[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
  0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01
};

backup data>
6D,20,03,E0,01,05,0D,00,01,0A,28,0F,50,32,03,05,00,00,00,00,00,00,08,17,19,1C,14,87,29,0A,66,
68,EB,04,00,00,02,00,02,11,00,01,00,00,00,00,00,00,00,00,00,5A,8C,94,C5,02,07,19,00,04,93,5E,
00,87,66,00,7C,70,00,72,7A,00,6B,86,00,6A,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,02,04,06,08,0A,0C,0E,10,12,14,FF,FF,
FF,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,28,26,24,22,21,20,1F,1E,1D,0C,0A,08,06,
04,02,00,FF,FF,FF,FF,FF,FF,FF,FF,FF,FF,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,8D,00

If the second set of data is from the touch panel that has now reversed coordinates due to being written with possibly the first set of data then it is quite clear. The range of data with these numbers "28,26,24,22,21,20,1F,1E,1D,0C,0A,08,06,04,02,00" differs from "0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28" and explains the reversal of the X direction.

Just use the second set as the needed configuration, and don't test it on your own scope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 08:03:42 am
3 different TP configurations.
The PC will tell you which one to upload.
Above all, don't try it just like that!!!! as always, no one guarantees anything, everything at your own risk.

uint8 tp_config_data1[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x87, 0x29, 0x0A, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02,
  0x04, 0x06, 0x08, 0x0A, 0x0C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x22, 0x24, 0x26, 0x28, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01
};

uint8 tp_config_data2[] =
{
  0xFF, 0x20, 0x03, 0xE0, 0x01, 0x0A, 0xFD, 0x00, 0x01, 0x08, 0x28, 0x08, 0x5A, 0x3C, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x1A, 0x1E, 0x14, 0x8B, 0x2A, 0x0C, 0x75, 0x77,
  0xB2, 0x04, 0x00, 0x00, 0x00, 0x9A, 0x01, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x50, 0xA0, 0x94, 0xD5, 0x02, 0x08, 0x00, 0x00, 0x04, 0xA1, 0x55, 0x00, 0x8F,
  0x62, 0x00, 0x7F, 0x71, 0x00, 0x73, 0x82, 0x00, 0x69, 0x95, 0x00, 0x69, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x18, 0x16, 0x14, 0x12, 0x10, 0x0E, 0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x22,
  0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x1C, 0x18, 0x16, 0x13, 0x12, 0x10, 0x0F, 0x0C, 0x0A, 0x08, 0x06,
  0x04, 0x02, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x01
};

uint8 tp_config_data3[] =
{
  0x6D, 0x20, 0x03, 0xE0, 0x01, 0x05, 0x0D, 0x00, 0x01, 0x0A, 0x28, 0x0F, 0x50, 0x32, 0x03, 0x05,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x17, 0x19, 0x1C, 0x14, 0x87, 0x29, 0x0A, 0x66, 0x68,
  0xEB, 0x04, 0x00, 0x00, 0x02, 0x00, 0x02, 0x11, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x5A, 0x8C, 0x94, 0xC5, 0x02, 0x07, 0x19, 0x00, 0x04, 0x93, 0x5E, 0x00, 0x87,
  0x66, 0x00, 0x7C, 0x70, 0x00, 0x72, 0x7A, 0x00, 0x6B, 0x86, 0x00, 0x6A, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0E, 0x10, 0x12, 0x14, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x28, 0x26,
  0x24, 0x22, 0x21, 0x20, 0x1F, 0x1E, 0x1D, 0x0C, 0x0A, 0x08, 0x06, 0x04, 0x02, 0x00, 0xFF, 0xFF,
  0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8D, 0x00
};
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 08:44:23 am
Yep. Add the 0x before the numbers and put them in the "uint8 tp_config_data[]"  array.

Then have dfw_ee test it.

It might be needed to change the first byte to 0xFF. This is a version number and needs to be higher or equal to what is in the touch panel flash memory.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 09:11:08 am
dfw_ee try TP3 bin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 03:05:02 pm
dfw_ee try TP3 bin

TP3 oddly enough still has x reversed. TP1 has y reversed and TP2 has x reversed. TP1 actually works best in that the touch points although reversed in y work on the right hand side of the screen where the squares are located. TP2 and TP3 have to be touched about one square to the left to register the touch.

Many thanks for working on this!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 03:11:05 pm
Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c

I downloaded one of the zip files to see if I could build and many modules completed but got this error:

arm-none-eabi-gcc -Wall -Wno-write-strings -Wno-char-subscripts -fno-stack-protector -DNO_STDLIB=1 -O3 -mcpu=cortex-m3 -mthumb   -c -O2 -MMD -MP -MF "build/Release/GNU-Linux/fnirsi_1013d_scope.o.d" -o build/Release/GNU-Linux/fnirsi_1013d_scope.o fnirsi_1013d_scope.c
/tmp/cckjbrA2.s: Assembler messages:
/tmp/cckjbrA2.s:79: Error: selected processor does not support requested special purpose register -- `mrs r3,cpsr'
/tmp/cckjbrA2.s:81: Error: selected processor does not support requested special purpose register -- `msr cpsr_cxsf,r3'

Any idea what I'm missing in the build environment?

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 03:30:45 pm
TP3 is exactly what you put here as a backup.  That is, what was there before you tried to experiment.  Only if you did the experiments without backup.

PC will find a solution :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 03:38:36 pm
TP3 is exactly what you put here as a backup.  That is, what was there before you tried to experiment.  Only if you did the experiments without backup.

PC will find a solution :D

Yes, I know that's why I said oddly enough  ;D I did no experiments before the backup. With TP1 and running the original flash firmware y is reversed but running the pecos software both x and y are reversed and I have to put 00 in both positions in the reversal file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 03:48:32 pm
TRY new TP3 and TP4 is from my oscilloscope.

Linux had fun again, no one noticed that the size didn't fit, who knows what he actually compiled there :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 04:31:23 pm
Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c

I downloaded one of the zip files to see if I could build and many modules completed but got this error:

arm-none-eabi-gcc -Wall -Wno-write-strings -Wno-char-subscripts -fno-stack-protector -DNO_STDLIB=1 -O3 -mcpu=cortex-m3 -mthumb   -c -O2 -MMD -MP -MF "build/Release/GNU-Linux/fnirsi_1013d_scope.o.d" -o build/Release/GNU-Linux/fnirsi_1013d_scope.o fnirsi_1013d_scope.c
/tmp/cckjbrA2.s: Assembler messages:
/tmp/cckjbrA2.s:79: Error: selected processor does not support requested special purpose register -- `mrs r3,cpsr'
/tmp/cckjbrA2.s:81: Error: selected processor does not support requested special purpose register -- `msr cpsr_cxsf,r3'

Any idea what I'm missing in the build environment?

Thanks!

That is simple. The MCU is not based on cortex-M3.

Compiler flags need to be:
Code: [Select]
CFLAGS=-Wall -Wno-write-strings -Wno-char-subscripts -fno-stack-protector -DNO_STDLIB=1 -mcpu='arm926ej-s' -O3 -mfloat-abi=soft
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 04:41:52 pm
TP3 is exactly what you put here as a backup.  That is, what was there before you tried to experiment.  Only if you did the experiments without backup.

PC will find a solution :D

It has to do with the two ranges in the data. One is for the y and the other is for the x.

In version 2 there is an error in the first range that starts with 0x18, 0x16, 0x14 etc. It should start with 0x14 down to 0x00. Also the data of the second range looks off. So this version will no work very well.

These values depend on how the IC is connected to the glass panel. It is a bit strange that the one supposed to be the original one still has some range reversed.

Lookup the meaning of the data in the programming manual I linked to in a previous post. That might clear thing up.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 05:31:31 pm
The question is how it tests it, whether it uploads the TP bin and then uploads the original firmware, and as we know, it also has 2 versions of the TP. And if by chance you try it on an alternative, there is a problem that it may have a loaded configuration in sector 709 and that will change its coordinates again.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 06:09:12 pm
Download zip. https://github.com/Atlan4/Fnirsi1013D/tree/main
Ideally, the one that contains all 3 folders for the oscilloscope.  It contains parts of the code that you should be able to touch, just try to remove them or call them correctly.  IF you have a backup, maybe the PC would be able to tell which part of the code needs to be loaded.  Purely theoretically, I can generate a bin here, but without a guarantee.  Which you write in the IO for touch panel.

fnirsi_1013d_scope/touchpanel.c
https://github.com/pecostm32/FNIRSI_1013D_Firmware/blob/main/fnirsi_1013d_scope/touchpanel.c



I downloaded one of the zip files to see if I could build and many modules completed but got this error:

arm-none-eabi-gcc -Wall -Wno-write-strings -Wno-char-subscripts -fno-stack-protector -DNO_STDLIB=1 -O3 -mcpu=cortex-m3 -mthumb   -c -O2 -MMD -MP -MF "build/Release/GNU-Linux/fnirsi_1013d_scope.o.d" -o build/Release/GNU-Linux/fnirsi_1013d_scope.o fnirsi_1013d_scope.c
/tmp/cckjbrA2.s: Assembler messages:
/tmp/cckjbrA2.s:79: Error: selected processor does not support requested special purpose register -- `mrs r3,cpsr'
/tmp/cckjbrA2.s:81: Error: selected processor does not support requested special purpose register -- `msr cpsr_cxsf,r3'

Any idea what I'm missing in the build environment?

Thanks!

That is simple. The MCU is not based on cortex-M3.

Compiler flags need to be:
Code: [Select]
CFLAGS=-Wall -Wno-write-strings -Wno-char-subscripts -fno-stack-protector -DNO_STDLIB=1 -mcpu='arm926ej-s' -O3 -mfloat-abi=soft

I didn't think it was the cortex-M3 but I just did a make all on your unzipped file so I didn't set any MCU. This was the directory "v0.023m_long_mode_OK". Are there environment variables set up to select the MCU. I haven't really looked much at the make file...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 06:35:59 pm
Are you sure that the given zip contains all 4 address books?  So you will solve the problem with make.

https://github.com/pecostm32/FNIRSI_1013D_Firmware/tree/main

Netbeam didn't work for me, so I compile under ubuntu, via cmd, and upload via cmd.  I installed the Balik ArM translator via cmd
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 07:52:36 pm
The question is how it tests it, whether it uploads the TP bin and then uploads the original firmware, and as we know, it also has 2 versions of the TP. And if by chance you try it on an alternative, there is a problem that it may have a loaded configuration in sector 709 and that will change its coordinates again.

Well to make sure the data is written correctly to the touch panel, I would make another backup with the correct version of my backup program, and then see if it is the same as what it is supposed to be.

Take a couple of SD cards, and load one with the backup software and one with the new firmware and one with the write touch panel code. Mark them properly to know which is which and swap them for doing the tasks. Saves re-writing the card over and over.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 23, 2024, 08:03:00 pm
I didn't think it was the cortex-M3 but I just did a make all on your unzipped file so I didn't set any MCU. This was the directory "v0.023m_long_mode_OK". Are there environment variables set up to select the MCU. I haven't really looked much at the make file...

It is probably best to get the code from my repository (https://github.com/pecostm32/FNIRSI_1013D_Firmware/tree/main) and not Atlans, as he him self also suggests.

You don't need netbeans, but you do need linux with gnu-arm-none-eabi tools installed. Be aware that to make it work you have to compile the projects in order, but this is only needed once or when changes are made to the other projects of course.

Only three of the projects are needed, and the order to compile is given there also, but copied below for clearness.

Code: [Select]
For a version with a startup screen that shows PECOs sCOPE three projects are needed:

    "fnirsi_1013d_sd_card_bootloader" which loads the startup screen code and executes that
    "fnirsi_1013d_startup_screen" which shows the startup screen and loads and executes the actual scope code
    "fnirsi_1013d_scope" this is the actual scope code

The code is not that complex. Just look at the main function and you will see the startup process. Atlan already lead you to the touchpanel.c file where all the magic happens.

Success,

Peter
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 09:36:17 pm
I didn't think it was the cortex-M3 but I just did a make all on your unzipped file so I didn't set any MCU. This was the directory "v0.023m_long_mode_OK". Are there environment variables set up to select the MCU. I haven't really looked much at the make file...

It is probably best to get the code from my repository (https://github.com/pecostm32/FNIRSI_1013D_Firmware/tree/main) and not Atlans, as he him self also suggests.

You don't need netbeans, but you do need linux with gnu-arm-none-eabi tools installed. Be aware that to make it work you have to compile the projects in order, but this is only needed once or when changes are made to the other projects of course.

Only three of the projects are needed, and the order to compile is given there also, but copied below for clearness.

Code: [Select]
For a version with a startup screen that shows PECOs sCOPE three projects are needed:

    "fnirsi_1013d_sd_card_bootloader" which loads the startup screen code and executes that
    "fnirsi_1013d_startup_screen" which shows the startup screen and loads and executes the actual scope code
    "fnirsi_1013d_scope" this is the actual scope code

The code is not that complex. Just look at the main function and you will see the startup process. Atlan already lead you to the touchpanel.c file where all the magic happens.

Success,

Peter

Thanks Peter. I already had gnu-arm-none-eabi  of course or nothing would have compiled. Lots of modules compiled correctly just not the last. Doesn't the makefile determine the order of the build? The code already makes pretty good sense to me but the build process is not working due the error above...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 23, 2024, 09:38:23 pm
TRY new TP3 and TP4 is from my oscilloscope.

The new TP3 worked the same. TP4 does not boot as it goes straight to the internal firmware. I spent the last 2 hours thinking the card wasn't getting written correctly but I can load any other TPx or other pecos software and they all load correctly.

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 23, 2024, 09:59:26 pm
Use files from pecos.  Because mine have manually edited Make and other related files.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: LunaC on February 24, 2024, 02:50:37 am

Actually I like that idea now that I try it but if in stop mode could it act differently( or do we need to just use the waveform)?

Long mode should only display the signal. That's what he was meant for. The original can't do anything. The possibility to save a wave and carry out the measurement in the browsing mode has been added here, as well as to move the signal from the memory to up to 3000 samples.

The signal is displayed and buffered, so it is possible to redraw the screen with the buffered signal when stopped and cursors will be available. We should think about whether it would be possible to do it this way. It would be a bit strange.

The priority is to finally solve the shift of the DC level, then I need a brain and a lot of time.
[/quote]

Yeah, I only saw the reset on cursor movement after seeing it reported. I originally didn't see it since saved the wave first before measuring. I did see an offset between long and normal mode of around 400mv without signal or probes applied.

Youve done great!

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 24, 2024, 04:34:29 am
The shift should not be there, give a picture of the calibration data. V0. 023x
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 24, 2024, 08:07:28 am
Thanks Peter. I already had gnu-arm-none-eabi  of course or nothing would have compiled. Lots of modules compiled correctly just not the last. Doesn't the makefile determine the order of the build? The code already makes pretty good sense to me but the build process is not working due the error above...

There is no overall make file. Each project has its own make file. What is integrated in them is the copying of the output to the other project directory and the merging them together to make the needed single binary to load on the SD card.

With "project" I mean a set of .c and .h files that contain a single main function and other functions needed to make the compiled binary.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 24, 2024, 08:19:42 am
Changes to the diagnostic screen. v0.024
[attach=1]
Listing with cmd for dwf ee
[attach=2]

new TP3 and TP4 were compiled badly.

Complete projects from TP1 to TP4 are uploaded here.
https://github.com/Atlan4/Fnirsi1013D/blob/main/TP%20write%20config%20v0.023x.zip

Of course, TP3 and TP4 must be run through the compiler to generate the correct BIN.

Pay attention to deleted files in Linux, even if they are in the recycle bin. When I run make, it uses the files that are in the recycle bin, instead of those that are in the project directory
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 24, 2024, 03:36:04 pm
Thanks Peter. I already had gnu-arm-none-eabi  of course or nothing would have compiled. Lots of modules compiled correctly just not the last. Doesn't the makefile determine the order of the build? The code already makes pretty good sense to me but the build process is not working due the error above...

There is no overall make file. Each project has its own make file. What is integrated in them is the copying of the output to the other project directory and the merging them together to make the needed single binary to load on the SD card.

With "project" I mean a set of .c and .h files that contain a single main function and other functions needed to make the compiled binary.

The only make file I see is the one in the directory with the .c and .h files. That isn't the make file for the "project"?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 24, 2024, 03:38:14 pm
Changes to the diagnostic screen. v0.024
(Attachment Link)
Listing with cmd for dwf ee
(Attachment Link)

new TP3 and TP4 were compiled badly.

Complete projects from TP1 to TP4 are uploaded here.
https://github.com/Atlan4/Fnirsi1013D/blob/main/TP%20write%20config%20v0.023x.zip

Of course, TP3 and TP4 must be run through the compiler to generate the correct BIN.

Pay attention to deleted files in Linux, even if they are in the recycle bin. When I run make, it uses the files that are in the recycle bin, instead of those that are in the project directory

Thanks Atlan. Hopefully I can get it to build  ;D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 24, 2024, 04:12:51 pm
Did you see the picture? you have the complete path to the MAKEfile there.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 24, 2024, 04:21:42 pm
PC: How is a specific PIN set in the processor, should it be input or output? Are the pins open collector?
If I want to set the MISO-61-PC2 pin as an input, how do I do it?
Or is it already set somewhere as an output?
How can I load it? (if pin==1) through which register?

I am considering connecting a pull-up resistor and an optocell there. It would serve as an external trigger (max 12V input). The BNC should be placed next to the power switch, at least for the glass version...

Sometimes it's good to have it. For example, when debugging uP, ext trigger, it is possible to see a specific part of the process, e.g. i2c code
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 24, 2024, 05:59:52 pm
Thanks Peter. I already had gnu-arm-none-eabi  of course or nothing would have compiled. Lots of modules compiled correctly just not the last. Doesn't the makefile determine the order of the build? The code already makes pretty good sense to me but the build process is not working due the error above...

There is no overall make file. Each project has its own make file. What is integrated in them is the copying of the output to the other project directory and the merging them together to make the needed single binary to load on the SD card.

With "project" I mean a set of .c and .h files that contain a single main function and other functions needed to make the compiled binary.

The only make file I see is the one in the directory with the .c and .h files. That isn't the make file for the "project"?

Look in the nbproject directory in each project. There are the dedicated .mk files for the different configurations like debug and release. These are called from the main make file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 24, 2024, 06:02:32 pm
PC: How is a specific PIN set in the processor, should it be input or output? Are the pins open collector?
If I want to set the MISO-61-PC2 pin as an input, how do I do it?
Or is it already set somewhere as an output?
How can I load it? (if pin==1) through which register?

I am considering connecting a pull-up resistor and an optocell there. It would serve as an external trigger (max 12V input). The BNC should be placed next to the power switch, at least for the glass version...

Sometimes it's good to have it. For example, when debugging uP, ext trigger, it is possible to see a specific part of the process, e.g. i2c code

Take a look at the user manual (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/blob/main/Manuals/Allwinner_F1C200s_User_Manual_V1.2.pdf). Chapter 3.7 tells you everything you need to know.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 24, 2024, 08:55:21 pm
Did you see the picture? you have the complete path to the MAKEfile there.

Yes, the problem was never the Makefile. I did "make all" and that caused the problem. I don't know why I didn't just type make. Had been up way too long I guess  ;D Anyway, I am able to build everything now including the TPx versions

Thanks for all the help Atlan and Peter!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 25, 2024, 06:50:34 am
Finally the scope touch screen is working normally again. I used the TP1 executable and a hex editor to change the 0x8047 register to a 0xBD to reverse the axis. Ran the executable and all is good. I had tried setting values in registers 0xB7 to 0x80C4 with 0x8047 set to FD but could not get it to work completely right. The axis were correct but the touch points were about 1 square below what was printed.

Thanks Atlan for writing the various TP programs! I am able to build these but when loaded on the SDCard it isn't loaded but boots from the internal flash. This is what happened with your orginal TP4 version. Any idea what is causing this? I got around it by just hacking the TP1 file with a hex editor.

Thanks Peter for all the help and pointing me to the display programming manual.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 25, 2024, 07:25:56 am
Finally the scope touch screen is working normally again. I used the TP1 executable and a hex editor to change the 0x8047 register to a 0xBD to reverse the axis. Ran the executable and all is good. I had tried setting values in registers 0xB7 to 0x80C4 with 0x8047 set to FD but could not get it to work completely right. The axis were correct but the touch points were about 1 square below what was printed.

Thanks Atlan for writing the various TP programs! I am able to build these but when loaded on the SDCard it isn't loaded but boots from the internal flash. This is what happened with your orginal TP4 version. Any idea what is causing this? I got around it by just hacking the TP1 file with a hex editor.

Thanks Peter for all the help and pointing me to the display programming manual.

Sounds like the boot loader is missing. The first 32 bytes of sector 16 on the SD card need to be the eGON boot header for the F1C100s to start loading the actual boot loader into the internal SRAM. The boot loader is then executed and this will enable the DRAM and load the actual program.

The bytes need to be like shown below.

Code: [Select]
06 00 00 EA 65 47 4F 4E 2E 42 54 30 F7 6F 69 AE 00 3A 00 00 53 50 4C 02 00 00 00 00 00 00 00 00
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 25, 2024, 08:18:34 am
 download again, fixed
https://github.com/Atlan4/Fnirsi1013D/blob/main/TP%20write%20config%20v0.023x.zip

tp3 and tp4 work, TP4 contains all 4 data fields

firmware is:  fnirsi_1013d.bin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 25, 2024, 07:08:55 pm
download again, fixed
https://github.com/Atlan4/Fnirsi1013D/blob/main/TP%20write%20config%20v0.023x.zip

tp3 and tp4 work, TP4 contains all 4 data fields

firmware is:  fnirsi_1013d.bin

Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 25, 2024, 09:38:51 pm
Test firmware for Tokar.
Add DC offset auto settings for CH1. Try CH1.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 26, 2024, 02:04:10 am
download again, fixed
https://github.com/Atlan4/Fnirsi1013D/blob/main/TP%20write%20config%20v0.023x.zip

tp3 and tp4 work, TP4 contains all 4 data fields

firmware is:  fnirsi_1013d.bin

There is still something I am missing. What is the process that converts from the fnirsi_1013d_scope.bin which is 258,048 bytes to the fnirsi_1013d.bin 0.023 TP1 write.txt which is 297,032 bytes and has the boot loader. The extra bytes I'm assuming is the boot loader but I don't know the process for getting there. Is it something post to the build or is it a make target or something else? The .txt versions boot from the sdcard and the .bin do not. My builds only produce the .bin that is the smaller size. These 2 versions were in the zip file you sent before I did any builds.

Sorry I haven't figured this out...
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 26, 2024, 06:32:47 am
Last uploaded TPczip. In it, all versions of bin, run alternative firmware

Do not change the names of the files in the working folder!!!
mksunxi and flashfilepacker and fnirsi_1013d_scope.elf They must be set in properties as executable.
[attach=1]

If the names are correct, the program that is there will combine all 3 bins from the projects into one. fnirsi_1013d.bin
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 26, 2024, 07:52:06 am
mksunxi is used to fix the checksum in the program header the boot loader uses. This is a tool written by the sunxi group.

flashfilepacker is the one who takes the separate bin files and sticks them together in the final bin file. This is a tool I wrote myself. Source can be found here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Test%20code/flashfilepacker).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 26, 2024, 09:58:00 am
Small fixes, adding offset to both channels. Bit of a miscalculation of the shift. I will finish later. Firmware v0.024c

Modified instructions for the oscilloscope. FNIRSI 1013D  alternative firmware v0.024c ANG v1.doc
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 26, 2024, 02:30:32 pm
Last uploaded TPczip. In it, all versions of bin, run alternative firmware

Do not change the names of the files in the working folder!!!
mksunxi and flashfilepacker and fnirsi_1013d_scope.elf They must be set in properties as executable.
(Attachment Link)

If the names are correct, the program that is there will combine all 3 bins from the projects into one. fnirsi_1013d.bin

I have used the latest TPczip. I extracted the files and made no changes whatsoever. I did a make in the TP1 directory and it built a .bin file that replaced the .bin file that was already in your directory. It did not replace the combined .txt file. It is the .txt files that actually work. Here is the last part of the build process which seems to match the picture you sent the other day:

arm-none-eabi-objcopy -O binary dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.elf dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.bin
./mksunxi dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.bin
bootloader size= 3f000
The bootloader head has been fixed
./flashfilepacker -o dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin -i dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.bin -l 0x9800

From above it looks like only the .bin file is the output and this file does not load on the sdcard. The .txt file that pre-existed in your directory does load. The pre-existing .bin file does not. It behaves the same as the new bin files that I build. No names have been changed nor anything else after the unzipping. How did the .txt files come about? It isn't a simple renaming of the .bin file.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 26, 2024, 02:59:19 pm
The output file to look for is fnirsi_1013d.bin

the command "./flashfilepacker -o dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin -i dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.bin -l 0x9800" takes the data from fnirsi_1013d_scope.bin and copies it to fnirsi_1013d.bin starting from location 0x9800.

There should already be a fnirsi_1013d.bin file in the directory with the boot loader and splash screen code in it, and then it adds the scope program to it. If there is no existing fnirsi_1013d.bin file it will create it and put zeros in the space before 0x9800.

When there is one with the scope program already in there it will be overwritten with the new data, so it can be reused over and over. No need to rebuild the boot loader and splash screen code as long as there is a valid fnirsi_1013d.bin file with these two in it.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 26, 2024, 05:24:32 pm
Look again at the last picture I put here, you must not have any other files there.  And no more files with a similar name to txt

I said TP4. No tp1 no tp2
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 27, 2024, 01:54:23 am
The output file to look for is fnirsi_1013d.bin

the command "./flashfilepacker -o dist/Debug/GNU_ARM-Linux/fnirsi_1013d.bin -i dist/Debug/GNU_ARM-Linux/fnirsi_1013d_scope.bin -l 0x9800" takes the data from fnirsi_1013d_scope.bin and copies it to fnirsi_1013d.bin starting from location 0x9800.

There should already be a fnirsi_1013d.bin file in the directory with the boot loader and splash screen code in it, and then it adds the scope program to it. If there is no existing fnirsi_1013d.bin file it will create it and put zeros in the space before 0x9800.

When there is one with the scope program already in there it will be overwritten with the new data, so it can be reused over and over. No need to rebuild the boot loader and splash screen code as long as there is a valid fnirsi_1013d.bin file with these two in it.

This was very helpful to understand the process of how the sdcard binary is built. The problem was the fnirsi_1013d.bin had all zeros at the top instead of the bootloader and splash screen. I grabbed one that had it and did a build and everything now works.

Thanks!

BTW, I saw your youtube video about the touch screen issue you originally had with it not responding in certain locations. I think I read that is what sent you down this whole reverse engineering path. This work that you did on the reverse engineering is very impressive! Did you get that particular unit to ever work?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 27, 2024, 02:00:39 am
Look again at the last picture I put here, you must not have any other files there.  And no more files with a similar name to txt

I said TP4. No tp1 no tp2

Thanks, got it working. Many thanks for putting together the TPx programs!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 04:50:06 am
Does TP work properly?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 27, 2024, 07:16:40 am
BTW, I saw your youtube video about the touch screen issue you originally had with it not responding in certain locations. I think I read that is what sent you down this whole reverse engineering path. This work that you did on the reverse engineering is very impressive! Did you get that particular unit to ever work?

Yes that is what started it all. I did get the unit working again, but with an acrylic screen so it looks a bit shitty.

It was a fun project and I learned a lot from it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 07:35:01 am
PC:
In what range can the numbers be for setting the DC offset
#define HIGH_DC_OFFSET   500
#define LOW_DC_OFFSET   1200

Zero calibration is around 860 - 870

So what are the limits if I want to use it to shift the signal.  Thx
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 27, 2024, 08:08:41 am
PC:
In what range can the numbers be for setting the DC offset
#define HIGH_DC_OFFSET   500
#define LOW_DC_OFFSET   1200

Zero calibration is around 860 - 870

So what are the limits if I want to use it to shift the signal.  Thx

The FPGA counts from 0 to 1999 clocked on 50MHz to make the carrier frequency for the offset. So 25KHz at the output. The setting for the pulse width is a 16 bit value but in this case the useful range is 0 to 1999 for 0% to 100%.

As it is running of 3.3V IO this would mean 0 to 3.3V. The used ADC input range is smaller than that due to the input opamps running on 2.5V.

The given high and low values probably come from the original code.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 09:00:13 am
According to me, there is a mistake in the scheme, at least my glass versions of the oscilloscope have 3.3V on the operands.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 27, 2024, 10:04:25 am
DC measurements for v0024b CH 1.
For v0024c the table is similar.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 27, 2024, 11:46:02 am
According to me, there is a mistake in the scheme, at least my glass versions of the oscilloscope have 3.3V on the operands.

It might well be that they have changed things. The version I used to draw up the schematics definitely has 2.5V on the opamps. Have measured it with a DMM.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 01:01:13 pm
Tokar: does that mean it's good?
PC:The reference is 1.25v, so it doesn't matter if the device has 2.5 or 3.3V, because the downward shift from the reference is always the same.

Does anyone have firmware 0.0.  24c on a device that does not have embedded connectors.  That is, the first version of the oscilloscope.  Could you post a screenshot of the diagnostic screen?  (ideally calibrated) but it must be firmware 0.024c and must be after activation of the autorange without a connected signal on both channels.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 27, 2024, 01:26:23 pm
Does TP work properly?

Yes, I've had it working properly for several days now since I hex edited the original TP1 program. But now I have built your code with the table modifications needed that match the "hacked" version that also works. Thanks, again!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on February 27, 2024, 02:42:41 pm
Tokar: does that mean it's good?
...
This is better than all previous compilations. There are no very long freezes when performing autoset. The longest is 8 seconds when moving from 0.5V to 1V
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 04:54:05 pm
The flood started at a sensitivity of 100mV.  The original firmware starts at the highest range, even 24c.  Hopefully today I will be able to recalculate the coefficient so that the signal shift corresponds to the displayed value.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 27, 2024, 09:35:09 pm
firmware v0.024d
If the DC offset. Added recalculation coefficient for correct calculation of measured values, recalculation coefficient for axis placement, recalculation coefficient for waveform placement, recalculation coefficient for trigger level.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 28, 2024, 07:39:20 am
I have to start a small project with ch32v003 as a replacement for ZK SMC01.  It will take some time until I study it and come to uP.  The firmware of the oscilloscope should be quite usable.  If you come across a mistake, I'll look into it again.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on February 28, 2024, 08:13:44 am
Quote
The flood started at a sensitivity of 100mV.

I have to ask what you intended to say here. I have seen you use "the flood" on many occasions and I can't see the meaning of it in the context of the scope, so my guess is you are using a translator to make up your posts and it results in this.  :-//
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 28, 2024, 09:18:55 am
I don't use diacritics, so that can also be a problem when translating :D I usually at least take a quick look at what the translator produces.  Flood was meant as your firmware.  The translator allows the word to be translated as "original".  Which confuses me, because it can mean firmware fnirsi.  (I didn't want to think about it) so I left the flood version of the translation flood even though it's stupid.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 28, 2024, 09:33:09 am
0.024d is not perfect, because it uses a constant to shift the signal, by which it multiplies the value of the centers, obtained by the multiplied number.  Then it does not apply to individual ranges because they have their own calibration constants.  It will be necessary to think about it.  But basically it works.  Just the code is currently full of parts // :D and also located in files test.C test.H
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: polyman on February 29, 2024, 05:16:32 am
Atlan:

is the 0.024 version supposed to be fully functional firmware or only meant to test particular features
you are working on? I am asking because I tried flashing 0.024d on my device and I get a flatline on
both channels. I tried baseline calibration but it did not make any difference.

A quick check shows that 0.022g displays the 1KHz calibration signal correctly on both channels, so
I am reasonably confident that the scope is functional.

Polyman
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 29, 2024, 05:48:20 am
Does TP work properly?

I finally figured out why TP1 had an axis reversed and using TP3 didn't change it. It is because the last byte of the array was 0x00 in tp_config_data3[]. It has to be an 0x01 to signal that there is fresh data otherwise the controller deems it as invalid data and does not store it. So TP3 was making no change. I made this slight modification and the original data now works perfectly. Also have done another backup and compared the 2 tp_config files and they exactly match.

I already had it working as I mentioned before but wanted to get to the bottom of it all since it made no sense that the reversed x values were not making any difference.

Thanks again!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on February 29, 2024, 07:30:35 am
POlyman Always give images from the oscilloscope.  Screen shot with progress and visible settings.  And in this case, mainly a picture with calibration data.  I assume that they will be 0 in the calibration.

Call up the calibration of the input dividers via the menu of calibration values. You have 0 there. there should be calibration values 35xxxx or basically something like 36000, 38000 40000
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on February 29, 2024, 01:53:12 pm
Atlan:

is the 0.024 version supposed to be fully functional firmware or only meant to test particular features
you are working on? I am asking because I tried flashing 0.024d on my device and I get a flatline on
both channels. I tried baseline calibration but it did not make any difference.

A quick check shows that 0.022g displays the 1KHz calibration signal correctly on both channels, so
I am reasonably confident that the scope is functional.

Polyman

I saw this initially with v0.023x. I put in v0.023p which worked and then put v0.023x back in and it then worked. Subsequently v0.024 and v0.024d have worked correctly as well.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: dfw_ee on March 01, 2024, 04:40:46 am
Here are 2 utilities derived from the Atlan TPx code that will write a FNIRSI_1013D_tp_config.bin file to the scope. This makes it easy to restore a tp_config file back to the scope. There are no changes needed to the FNIRSI_1013D_tp_config.bin file written by the fnirsi_1013d_fwb.bin program and the name has to remain to be found correctly. This utility will write an 0x01 in the last byte to signal that fresh data is coming so this does not have to be done to the saved back up file. The only byte that might have to be changed is the very first byte in the backup file if a number higher than what is in this file has been written to the scope subsequent to the backup.  If the backup file starts with 0xFF there won't be a problem. The FNIRSI_1013D_tp_config.bin file needs to be in the top level directory of the SD card in the scope. This utility itself is written to the SD card the same as fnirsi_1013d_fwb.bin or any of the other firmware posted here using dd or equivalent.

If there is no FNIRSI_1013D_tp_config.bin file found then the utility will report an error and will not write any data to the scope.

There are 2 versions attached. The first is: write_fnirsi_1013d_tp_config.bin.txt. This works as described above. The second is: write_fnirsi_1013d_tp_config_save.bin.txt which works the same but additionally stores a file named my_tp_config.bin on the SD card which is the same data written to the scope to verify what was written.

These work with my scopes but as always use at your own risk!!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 01, 2024, 08:56:59 am
v0024d. DC mode. When manually selecting the measurement limit, the signal range is 8 cells! Those. whole screen! Thanks for the solution.
Among the disadvantages, maybe insignificant:
After calibration, without connected probes, and USB.
1) Two channels are included. When autoset, a limit of 50 mV is selected, and a bias (multiple polarity) is obtained from the “0” indicator to half a cell on both channels.
2) One channel is on, any channel. When autoset, a limit of 50mV is selected, but there is no shift from the “0” pointer.[attach=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 01, 2024, 12:03:11 pm
fixed 0.024e try.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 01, 2024, 03:21:58 pm
Great version! But there is still a displacement of the rays relative to zero on a slow scan. I didn't find any more problems.
https://youtube.com/shorts/kM7rwTxG14M?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 01, 2024, 05:06:25 pm
Try it one more time, but wait until the signal is rendered in the short mode of 200ms, it will take a while.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 01, 2024, 05:51:34 pm
it doesn't help, the signal will also be shifted
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 01, 2024, 07:21:50 pm
Do the basic calibration, put the picture with the calibration values ​​here.

Long mode does not use ADC channel difference compensation.  But that shouldn't have a significant effect on the shift.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 01, 2024, 07:29:13 pm
After the basic calibration
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 01, 2024, 08:42:27 pm
engineer.r152 try this. it should be fine.

Did you make any adjustments on the oscilloscope?  Those values ​​look scary, as does the signal flow.

I see that it shows the temperature :D I haven't even had time to test it yet.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 01, 2024, 09:04:14 pm
Excellent! The problem is solved, the beam is stable at zero value! Thanks! The temperature is displayed, as far as I know, it is issued via I2C from the clock chip. It is displayed correctly!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bpeletronica on March 01, 2024, 10:49:45 pm
Hello, I hope everyone is well!

Sorry for any spelling mistakes, I'm using a translator!

Today I ventured to change the 1013D's firmware. I changed the SD card, and imported the firmware through "Loader". All very well. At this moment, I have firmware v0.024f, recently posted.
I was testing other firmware versions, and they all had this ripple, and this small imperfection in the square wave (images attached). I tried to do the calibration in the menu, and nothing changed. The original firmware fixes this.

What could I be doing wrong? Is there any procedure to be done besides updating the firmware? How do I calibrate this?

Thank you all, and congratulations on the project! The new firmwares greatly improve the equipment’s functionality!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on March 02, 2024, 01:42:54 am
I was testing other firmware versions, and they all had this ripple, and this small imperfection in the square wave (images attached). I tried to do the calibration in the menu, and nothing changed. The original firmware fixes this.

1) It appears you have not done proper voltage calibration. All your defaults are ending in 00000. You must provide a stable voltage in 0V3, 0V6, 1V5, 3V0, 7V5 and 15V0 levels when re-calibrating those levels

Atlan's Calibration post with video example: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg5279620/#msg5279620 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg5279620/#msg5279620)

2) The new firmware shows actual level readings, what you are calling jitter. The original firmware averaged those out giving a fake display that did not represent the actual levels. 

I posted about that way earlier in the thread, here is that post and the response from others regarding that:
My Post: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4573744/#msg4573744 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4573744/#msg4573744)
PCProgrammer's Reply: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4574389/#msg4574389 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4574389/#msg4574389)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on March 02, 2024, 09:30:42 am
fnirsi_1013d.bin v0.024f.txt   - ???  CH - 1  :--   CH - 2  :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 02, 2024, 09:41:08 am
Without a picture of the diagnostic screen, it won't help me at all.

Always provide a picture or video with the problem where the parameters of the oscilloscope are visible, and a picture of the diagnostic screen with the values.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 02, 2024, 09:51:52 am
Hello, I hope everyone is well!

Sorry for any spelling mistakes, I'm using a translator!

Today I ventured to change the 1013D's firmware. I changed the SD card, and imported the firmware through "Loader". All very well. At this moment, I have firmware v0.024f, recently posted.
I was testing other firmware versions, and they all had this ripple, and this small imperfection in the square wave (images attached). I tried to do the calibration in the menu, and nothing changed. The original firmware fixes this.

What could I be doing wrong? Is there any procedure to be done besides updating the firmware? How do I calibrate this?

Thank you all, and congratulations on the project! The new firmwares greatly improve the equipment’s functionality!

The program displays the signal as it is. Instead of improving the hardware, Cinan did magic with the signal to make it look good.

No problem. Sit at the PC, there is a diagram, the layout of the components. They crossed it, removed the errors that are there from the power supply to the signal line between the FPGA and the AD converter. Ideally, a new program for FPGA. When will you probably have it done?

But for your good feeling, it is planned to add a moving average.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on March 02, 2024, 10:02:47 am
CH-1, CH-2
Calibrate it again?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on March 02, 2024, 10:04:05 am
CH-1, CH-2
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 02, 2024, 11:00:17 am
Press autoset, without a connected signal. Did it help?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on March 02, 2024, 12:15:14 pm
The new calibration helped,,, thank you!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bpeletronica on March 02, 2024, 12:59:07 pm
I was testing other firmware versions, and they all had this ripple, and this small imperfection in the square wave (images attached). I tried to do the calibration in the menu, and nothing changed. The original firmware fixes this.

1) It appears you have not done proper voltage calibration. All your defaults are ending in 00000. You must provide a stable voltage in 0V3, 0V6, 1V5, 3V0, 7V5 and 15V0 levels when re-calibrating those levels

Atlan's Calibration post with video example: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg5279620/#msg5279620 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg5279620/#msg5279620)

2) The new firmware shows actual level readings, what you are calling jitter. The original firmware averaged those out giving a fake display that did not represent the actual levels. 

I posted about that way earlier in the thread, here is that post and the response from others regarding that:
My Post: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4573744/#msg4573744 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4573744/#msg4573744)
PCProgrammer's Reply: https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4574389/#msg4574389 (https://www.eevblog.com/forum/testgear/fnirsi-1013d-100mhz-tablet-oscilloscope/msg4574389/#msg4574389)

Hello!

Before, the CH1 & CH2 calibration did not appear for me.
I installed the stock firmware on the osciloscope, and upgraded it to v0.024f.
Now the CH1 & CH2 calibration appears!
I will calibrate it soon, and return with results!

Thanks a lot for the help!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bpeletronica on March 02, 2024, 02:28:31 pm
Calibration performed using a regulated power supply.
Everything perfect!

Thanks very much!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 02, 2024, 05:30:58 pm
Auto set in AC mode set offset to zero.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 03, 2024, 01:33:52 pm
Does anyone use current probes?  What?  With what parameters.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 03, 2024, 01:54:13 pm
Yes, I use it. Parameters 100 mV per 1 A and 10 mV per 1 A
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 04, 2024, 06:07:17 pm
The plan is to add an Average button and a long/short mode switch to the ACQ menu.  Added option to display data in mA and A if a current probe is used.  Adding a sun icon to toggle between maximum and set brightness.  (does anyone need it?)

If possible, a software trigger for short mod will be added.  Allows the use of the entire memory of 3000 samples.  Suitable for tracking communications.  Now the trigger is always in the middle of the memory, which means that only 1500 samples are available for the signal.

Generator sine square triangle connected to SPI, I will place the BNC connector next to the switch.  It totally fits in there.  I am considering whether to equip it with an amplifier regulated via i2c.

Can you think of anything else?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 04, 2024, 06:38:55 pm
is it possible to scroll the signal using the slider at the bottom of the screen?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 04, 2024, 07:02:28 pm
Not, but it was planned.  It's not that simple :D
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 04, 2024, 09:46:29 pm
It's a pity, but everything is working out so well!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: lamazoid on March 05, 2024, 08:39:29 pm
The plan is to add an Average button and a long/short mode switch to the ACQ menu.  Added option to display data in mA and A if a current probe is used.  Adding a sun icon to toggle between maximum and set brightness.  (does anyone need it?)

If possible, a software trigger for short mod will be added.  Allows the use of the entire memory of 3000 samples.  Suitable for tracking communications.  Now the trigger is always in the middle of the memory, which means that only 1500 samples are available for the signal.

Generator sine square triangle connected to SPI, I will place the BNC connector next to the switch.  It totally fits in there.  I am considering whether to equip it with an amplifier regulated via i2c.

Can you think of anything else?

adding more probe divider options, like 50x, 100x, 1000x (bench scopes usually have those)
this is very useful when working with high voltage probes.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 06, 2024, 01:45:09 pm
I tried to load the backup firmware via the loader, and it didn't work, the original software still started. What could be the problem? I uploaded a backup bin in linux. The backup software started, I copied the files from the sd card and immediately tried to load the oscilloscope's FW, it didn't work, the relay clicked and the screen remained black. I used the loader under Windows and loaded the firmware there, the oscilloscope turned on. What is it? (wi11 wanted something regarding the restart to install updates)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on March 06, 2024, 02:01:46 pm
No idea about the loader on windows, but on linux you do need to unmount the partition before using dd to load something to the SD card. Maybe you forgot that between the copying of the backup files and the loading of the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 11, 2024, 05:20:55 pm
Since I used bin for backup, after using make, it probably just inserted a new code into the backup BIN. by deleting the scope bin, replacing it with a functional scope bin, it works already after using make. at least I hope so, because I fixed the mistake. so hopefully it will work after all.

DC mode. When measuring a signal with a DC shift. For example, 5V PWM from uP, does not display frequency, duty and time.
Fixed in firmware 0.024i

Tokar, can you check if this update also made autoset faster? for signals with a DC shift?

Now I remembered that there are unfinished things in channel switching. That's how it is when it is done on two things at once. :(
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 12, 2024, 08:09:40 am
In version 0.024i, the sensor does not work on the new V/A, Average, ACC Long buttons
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 12, 2024, 09:08:57 am
v 0024i. After the reboot, a notification about reset to default and the need to calibrate. The temperature is not displayed correctly.
Conditions: CH1, 1:1, initial range 5V, DC=0-2.5V, AC=0-1V, 200Hz-5kHz.
Autoset speed:
DC mode (DC only) - 8-10 sec.
AC mode (AC only) - 1-2 sec.
DC mode (DC+AC) - 1-2 sec.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 12, 2024, 09:12:15 am
 Yes, because I started working on it, but then I had to do something else.  And I forgot what changes I made in between.  Hidden under A/V is 1x 10x 100x

Tokar: Default settings is RTC off. Switch on, temperature ok
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 12, 2024, 09:24:01 am
...
Tokar: Default settings is RTC off. Switch on, temperature ok
I'm sorry, I understood about the clock, but I didn't have time to correct the post, you already answered.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 12, 2024, 07:41:32 pm
Hello, there is a problem on firmware 0.024e, 0.024f, 0.024g channel ch2 the cursor jumps up and can not move it down. At any voltage. Also when using autoset the voltage is actually 9.3 and after pressing autoset it shows 8.6 volts.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 13, 2024, 04:55:15 am
Read red text, uploat picture with calibration data.
Did the basic calibration go without error?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 13, 2024, 09:22:27 am
Calibration went without errors. Autoset mode underestimates real voltage values
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 13, 2024, 10:08:36 am
Try the following manipulations, set the voltage, for example 13 volts and connect to the first and second channel of the oscilloscope, press autoset and see how the second channel will react. The marker of the second channel rises to the very top, and there is no possibility to sign it on the screen. Only by disconnecting the voltage from the noise of the second channel and pressing autoset again, the situation stabilizes and the marker goes down to the initial position. If you re-apply voltage to the second channel and do not press autoset, then the voltage value is measured correctly.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 13, 2024, 10:57:13 am
If the trigger is chosen for ch2.  Does it behave the same?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 13, 2024, 01:12:53 pm
I confirm that there is such a problem with CH2, it behaves the same with the CH1 or CH2 trigger enabled
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 13, 2024, 01:49:52 pm
It is not important to make any adjustments to the voltage range or sweep time. Channel two is not subject to any adjustment or modification.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 13, 2024, 03:10:12 pm
Maybe I'll look at it tonight.

Just connect any DC voltage and press autoset?

Changing the trigger from ch1 to ch2 will not change the behavior of ch1.  Ch2 is fine and ch1 moves the flow up?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 13, 2024, 08:32:05 pm
test it. 0.024j
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 13, 2024, 10:42:53 pm
Yes, just by connecting a DC voltage and pressing autoset.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 13, 2024, 11:49:03 pm
No problem on firmware 0.024j. I have a question why offset on the second channel is 16 and on the first channel -2 after calibration? But the difference between the real voltage values is 0.8 volts. The real value is set to 14 volts, for example, and after pressing autoset the oscilloscope shows 13.2 volts.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 14, 2024, 08:35:47 am
During calibration, the offset should be 0, the offset changes only in DC mode after pressing autoset.  The max and min values ​​are measured, and the necessary signal shift is calculated from their difference.  You have a lot of interference on channel 2.  The fact that it has such a deviation must be due to that or a bad value in the program.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 14, 2024, 09:32:54 am
Maybe you can tell me how to reduce the interference on the second channel?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 14, 2024, 09:52:10 am
The 13.2V is the value measured by the V-cursor or a number in the measurements.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: _AVP_ on March 14, 2024, 02:44:54 pm
FW0.024J - not correct touchscreen coordinates for choose probe mode (1x,10x,100x). They are upper, at "V/A mode". I think video is unnesessary. Also temperature on calibration screen displays as 99*
But there are very good news! Device starts 10/10 times without "SD Error" like on any FWs 21 and older. Do you remember I posted videos? I only updated FW without any other actions! Respect!   
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 14, 2024, 04:29:38 pm
That's because it's a developed version.
The errors were important, so I preferred to fix them, even if the channel menu is not finished.

This firmware was not ready, and I forgot what modifications I had already made.  I fixed the detected error when measuring in DC mode, so I recorded it, later the error with the shift of channel 2 was detected and it was somehow corrected.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 15, 2024, 02:25:03 am
This is the value of Vrms
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 18, 2024, 03:02:31 pm
v0024j.
Calibration was carried out on the latest version (voltage source - battery):
300mV - 300.1
600mV - 600.2
1.5V      - 1.498
3V         - 3.001
7.5V      - 7.500
15V       - 15.04
-----------------------
I built a table and graph of the nonlinearity of an oscilloscope voltmeter. Maybe someone will be interested.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 18, 2024, 04:05:00 pm
Yes, DC voltage calibration is done to the Vavg value.  For the elimination of jumping values ​​from the AD converter.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 20, 2024, 10:48:54 pm
Fixed menu switching 1x - 100x
And some graphical improvements to the appearance. v0.024k
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on March 21, 2024, 05:39:57 am
It would be great to display the value in amperes in the cursor menu when switching to current mode.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 21, 2024, 07:30:09 am
V/A is not functional.  DO NOT USE.  There are still many things to be done.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 21, 2024, 10:07:45 am
https://youtu.be/q6wImOeBrfY (https://youtu.be/q6wImOeBrfY)
The autoset does not work correctly when selecting the operating frequency and period.
In the video the frequency is 1MHZ, you can see collisions and incorrect frequency meter readings.
This happens at any frequency and signal shape.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 21, 2024, 11:18:58 am
If peak to peak is less than 1V (rms 350mV) then it does not work.  I'll look into it. 
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 21, 2024, 12:49:19 pm
I applied a 2v RMS square wave signal, the situation did not change.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 21, 2024, 04:47:34 pm
I found the problem.  I'll have to figure out how to fix it.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 22, 2024, 05:54:39 am
Yes, indeed, with a 1:1 divider and a signal above 350 mV RMS, auto-tuning in frequency and period begins to work more or less stably. Thanks to Atlan for the tips and improvements.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 22, 2024, 07:30:52 am
Hello!
Please don't swear, I'm a beginner, I use a translator.
I need help. I bought Fnirsi-1013D, the device is working fine, I wanted to update the firmware.
1. When connected to a computer, the computer writes "the device is not recognized", the cable checked on other devices everything is "ok", checked on several computers Win7, Win10, the same, maybe someone has encountered? At the same time, everything is saved to the SD card, if you remove the SD card from the device and insert it into the card reader, everything is also readable, there is data on the card.
2. I bought a new SD card to download the new firmware onto it. I inserted the SD card into the card reader built into my monoblock, the loader does not see the SD card, if you insert a USB flash drive, then the loader sees it. Do I understand correctly that you need to use an external card reader connected to USB?
Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 22, 2024, 08:43:35 am
1. What is the volume of the purchased micro-SD? Preferably 8-16GB.
Format it to FAT32 and insert it into your device. Turn on. The native firmware should load by default.
It’s better to put the included card aside as a backup

2. On the oscilloscope, select "Menu" > "USB connection". Run the FNIRSI_Firmware_Loader program on your computer. Wait for a device named “F1C100S...” to appear in the “USB storage device” field. In the "Binary File" field, specify the path to the firmware file. Click "Write to device". Turn off - turn on the device. Enjoy the new firmware.  The latest firmware at the moment is 0024k.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 22, 2024, 09:06:01 am
1 Did so, micro SD 16 GB. FAT32. I inserted it into the device, turned it on, the native firmware loads well, the device works with a new card. but when connected to a computer, the computer does not see the device.
2. On the oscilloscope, select the "Menu" "USB connection". Started FNIRSI_Firmware_Loader. In the "USB drive" field, a device named "F1C100S..." does not appear.
Thanks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 22, 2024, 10:17:13 am
Does something appear in the device manager in the "disk devices" and "USB devices" fields when you connect and select USB connection in the menu? Have you tried connecting to a computer with a different OS? Run the loader with administrator rights?
PS
You can write the firmware without using a bootloader. Take DmDe, WinHEX or something similar and insert (with replacement) FW, starting from sector 16.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 22, 2024, 01:23:05 pm
Please tell me version 0024k  is working stably. Personally, replacing the cable helped me for the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 22, 2024, 02:17:54 pm
I figured out how to download the firmware to the SD card, you need to insert the card not into the built-in monoblock of the card reader into an external USB. I downloaded the firmware, everything is fine, I will test it!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 22, 2024, 02:49:19 pm
I still have one problem, when connecting to a PC, the PC device does not see.
In the "device manager" "USB controllers" when connected and selected in the USB connection menu, "Unknown device" appears, I tried it on different operating systems, the result is the same, maybe this is a problem with my device, It does not apply to this topic, please tell me which topic? Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 22, 2024, 03:19:18 pm
...the cable checked on other devices everything is "ok"...
Change the cable for complete clarity.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 22, 2024, 04:03:03 pm
The native charging cable does not work well. Try on another cable. It helped me personally in solving the issue. And the firmware went well.
...the cable checked on other devices everything is "ok"...
Change the cable for complete clarity.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 23, 2024, 08:43:29 pm
See
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 23, 2024, 09:39:50 pm
Thank you very much for developing this device. Is it possible to apply 20X? It would be just what you need. Thank you again for your hard work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 23, 2024, 10:01:23 pm
Where did the sensitivity go (V/div)?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 24, 2024, 04:37:11 am
Friend, I tried different cables, on different computers, different OS, Win7, Win 10, the result is the same, so the problem is in my device, I'll try to solder it once, if it doesn't help.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 24, 2024, 06:14:54 am
For some, this device was not visible on a 64-bit OS, but was detected perfectly on a 32-bit OS. Try it.  If it doesn’t work, then look for a fault in USB D+, D-.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 24, 2024, 02:44:30 pm
I tried to connect to Win7 32-bit, it didn't help, the same error, the device is not defined.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 24, 2024, 03:11:46 pm
Working on it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 24, 2024, 04:42:48 pm
Friend, that's cool, thank you so much for the work you've done
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: bffargo on March 24, 2024, 04:47:30 pm
Friend, I tried different cables, on different computers, different OS, Win7, Win 10, the result is the same, so the problem is in my device, I'll try to solder it once, if it doesn't help.

I have had no problems on any 64 bit Windows device from 2 to 11 years old, USB 2 or 3.

Dumb question, but something I messed up with initially. Are you going into the USB connection menu on the scope before trying to connect to your PC? It won't connect and do updates if just sitting on the main trace screen.

Also be sure your cables are not just simple charging cables but actual data cables by checking their pinout with a USB tester or with another device (tablet/phone/game) that you can test data transfer.

Finally there was talk about a month ago in the thread about very slow connection times on certain builds of the custom firmware (and maybe original too) to some windows devices. Once you get to a good build then things are good after that.

You might want to do what I did. Image a new micro SD card directly with the most recent build with a SD card reader and replace the one in the scope with that. Then afterwards try connecting via USB and it should work.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 24, 2024, 06:57:08 pm
Only it doesn't work for him even with fnirsi firmware.  I'm typing a cold connection either on the usb connector or uP feet.  He will want to look at the connections under a microscope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 25, 2024, 04:04:17 pm
 :popcorn: Need to add some value X for probe?

https://www.youtube.com/watch?v=bpSKR0FYphY (https://www.youtube.com/watch?v=bpSKR0FYphY)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 25, 2024, 04:54:04 pm
Friend, it turned out very well. Thank you very much for your hard work. :-+
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Gennady111 on March 25, 2024, 06:32:02 pm
Friends, thank you all! The problem was the cable. Strangely, I used 3 different cables, they all worked well with the phone, the phone connected to all computers. Today I received a new magnetic cable from Aliexpress, I decided to check it, and connected it and everything works fine! I'll buy another new cable tomorrow, in reserve. Thanks!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 25, 2024, 06:55:56 pm
Fixed display of 0 before decimal point.
Add divider 0.5-1-10-20-50-100-1000 and mode for measuring volts and amperes.

Beta version: v0.024o download again
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: rossano on March 25, 2024, 09:10:52 pm
Hi, first of all I want to thank you for the amazing work. I have a current clamp with 1 mV/1 A coversion. It's not really precise but it's good for big currents and this clamp is also cheap. The conversion is in the 1x, 10x, 100x etc?[attachimg=1]
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 25, 2024, 10:03:50 pm
Thank you so much for such a great job. You are a genius and a miracle worker. You turn from a simple oscilloscope into a pro. Or maybe these oscilloscope files will help you. If only we could take ready-made preset settings from there. For example, injectors, ignition and so on. And to embed them in this oscilloscope, in general, would be super. I attached the files.https://drive.google.com/file/d/1FF634-UiKT6iGMONAH68AHNmDZ_gfGDl/view?usp=sharing (https://drive.google.com/file/d/1FF634-UiKT6iGMONAH68AHNmDZ_gfGDl/view?usp=sharing)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 26, 2024, 07:05:40 am
After updating from v0024k to v0024o, a message appeared about resetting to default and the need for calibration. When you press the button, there is a calibration error. After requesting 300 mV, always switches to 0.5X, even if set to 1X. Reducing the calibration voltage from 300mV to 150mV does not solve the problem.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 26, 2024, 07:14:29 am
Thank you so much for such a great job. You are a genius and a miracle worker. You turn from a simple oscilloscope into a pro. Or maybe these oscilloscope files will help you. If only we could take ready-made preset settings from there. For example, injectors, ignition and so on. And to embed them in this oscilloscope, in general, would be super. I attached the files.https://drive.google.com/file/d/1FF634-UiKT6iGMONAH68AHNmDZ_gfGDl/view?usp=sharing (https://drive.google.com/file/d/1FF634-UiKT6iGMONAH68AHNmDZ_gfGDl/view?usp=sharing)
upload picture, video, or text. no apk thank you
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 26, 2024, 07:28:58 am
You are a good tester. Fixed? Test it
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 26, 2024, 01:59:51 pm
Yes, calibration was successful. Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on March 26, 2024, 05:42:51 pm
I tried to show in detail how the oscilloscope for diagnostics from the Launcher works. If it were possible to embed even a little bit into this oscilloscope, it would be just a cannon.
https://youtu.be/WFJdXIk3_98
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Anty_94 on March 28, 2024, 10:07:12 am
Hello, I would like to know if I calibrated the oscilloscope correctly, the calibration was with batteries and alternating resist, and I think the temperature does not show correctly, thanks in advance for the answer!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 28, 2024, 12:14:18 pm
If a clock module is installed, then turn it on in the menu, and then it will show the normal temperature.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 28, 2024, 01:43:57 pm
Manual, this topic page 82.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: madori on March 28, 2024, 06:01:52 pm
Hi, yes would be nice to make some presets, like for current clamp hantek cc65 / cc650, etc .
many people use this scope like second on field for automotive use..

Just bought this scope and install last 24x version, and is great, just waiting for power source 0-30v to calibrate ,,
seams that without calibration wont work, as should.

Why this scope don't have at least on one side grid with voltage, for easier signal orientation ?

Do You have some donation account, about this scope development  ?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 29, 2024, 08:34:40 am
Hello, Temperature sensor does not work on firmware 0.024p
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 29, 2024, 09:30:59 am
Works.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 29, 2024, 05:38:39 pm
Why doesn't it work on my oscilloscope? 0.024l was working!
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 29, 2024, 06:01:59 pm
Read messages 2156, 2157 on this page (87).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 30, 2024, 12:05:52 pm
Could you please advise me why when I press autoset offset on the calibration screen it shows a value of 486 on both channels? And the voltage goes from actual 15 volts to 14.6 volts
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 30, 2024, 02:26:42 pm
Picture and video

I didn't have time to deal with the exact numbers. I will come back to it when I have more time.

If a DC signal is measured and there is an offset, the offset is shifted on the AD converter. The value for the displacement is not linear with the value of the AD converter. This pad requires a recalculation of the value.

The obtained value from the AD converter in AC mode is recalculated to the display size on the screen, further calculated to display the measured values, and calculated for the trigger value to match what is on the display.

in DC mode it is more complicated. Based on the DC shift, the values for the trigger, the measured values, the size of the displayed value and the size of the signal shift relative to the center of the AD converter are adjusted.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 30, 2024, 05:54:21 pm
Transfer of inputs calibration data to sector 708. If they are not damaged, calibration will not be required. It can be called from the menu as before. I don't have time to try if it works, we'll find out when someone new tries to install the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: kaa on March 30, 2024, 06:22:54 pm
Hello everyone. Atlan, my big thanks for the great firmware!
But I have small issue.
I got v0.024p and successfully calibrated using car batteries and 5 kOhm potentiometer.
Unfortunately, the channels show the different values, the second one is ok but the first one less by 0.15-0.3V dependent on a value.
I tried to swap the probes but with no effect, the same.
Can it be fixed or is this my oscilloscope's specific?
Thank you.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 30, 2024, 06:39:07 pm
ADC comp 0 - very suspicious :D

try to calibrate again and use the 0.024q version
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on March 30, 2024, 08:02:55 pm
On the video I have provided the situation after the first calibration, offset is zero, also the actual voltage corresponds to the actual, but after pressing autoset, the reading decreases by 0.316 and on the calibration page appears offset 0.316.  There is also a problem with pressing on the touchscreen when entering the calibration parameters window
https://youtu.be/BnFcEQA-VC0
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: kaa on March 30, 2024, 08:43:18 pm
ADC comp 0 - very suspicious :D

try to calibrate again and use the 0.024q version

Unfortunately, the same. :(
ADc is not equal zero now but there is the same effect: the 1st channel's readings is less by 0.2V than the 2nd one's.

Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on March 30, 2024, 09:01:47 pm
... Can it be fixed or is this my oscilloscope's specific?
...
v0024p. You are not alone.  On my device the situation is the same.
https://youtu.be/EEqrGyuzqL4?feature=shared (https://youtu.be/EEqrGyuzqL4?feature=shared)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on March 31, 2024, 01:36:15 pm
v0.024r Stores the position of the horizontal trigger. Adjusted coefficients for offset.

Are you testing it?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 01, 2024, 01:38:11 pm
Averaging mode v0.024s
I don't know why it's good, but someone wanted it.

https://www.youtube.com/watch?v=mvsRI2udZkI (https://www.youtube.com/watch?v=mvsRI2udZkI)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: facekim on April 01, 2024, 04:15:21 pm
This is a good idea....I use the osciloscope for automotive too
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 01, 2024, 04:45:05 pm
Beta version, modified AUTOSETUP, needs to be tested, works from 300mV even at 3Mhz
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on April 01, 2024, 06:12:26 pm
fnirsi_1013d.bin v0.024t
https://youtu.be/zgjDdCJl8MA?si=q-_W7qOnZ31SKzlc (https://youtu.be/zgjDdCJl8MA?si=q-_W7qOnZ31SKzlc)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on April 02, 2024, 05:34:50 am
Good afternoon! The firmware is fnirsi_1013d_v0.024t. There are problems with saving waveforms in ACQ Long mode. I save the waveform on the video and false steps and a further continuation of the signal appear in the save done.
https://youtu.be/vl45CdwSL7U?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on April 02, 2024, 10:31:22 am
In firmware 0.024t after pressing autoset the actual value is still different from the measured oscilloscope, also confirm it is not possible to view the recorded image and video oscillogram.
https://youtu.be/2Tv0On6prPk
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: stedivid on April 02, 2024, 02:27:17 pm
Good afternoon, everyone. Please share the factory firmware of the oscilloscope. accidentally deleted the firmware.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: pcprogrammer on April 02, 2024, 02:39:30 pm
Good afternoon, everyone. Please share the factory firmware of the oscilloscope. accidentally deleted the firmware.

You can find a couple versions here (https://github.com/pecostm32/FNIRSI-1013D-1014D-Hack/tree/main/Binaries/Original%20files).
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 02, 2024, 04:05:51 pm
In firmware 0.024t after pressing autoset the actual value is still different from the measured oscilloscope, also confirm it is not possible to view the recorded image and video oscillogram.
https://youtu.be/2Tv0On6prPk

set 7.5V, connect DC voltage, press autoset. Check the AVG value and write it here. Open the channel menu, highlight AC and then back to DC (don't leave the channel menu). Exit the channel menu, and check the AVG value again and write it here. or video.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 02, 2024, 04:07:03 pm
Good afternoon, everyone. Please share the factory firmware of the oscilloscope. accidentally deleted the firmware.
Did you make a flash backup? then you have a problem. You will not have a calibrated oscilloscope.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 02, 2024, 04:10:09 pm
fnirsi_1013d.bin v0.024t
https://youtu.be/zgjDdCJl8MA?si=q-_W7qOnZ31SKzlc (https://youtu.be/zgjDdCJl8MA?si=q-_W7qOnZ31SKzlc)
fnirsi_1013d.bin v0.024u
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on April 02, 2024, 05:25:28 pm
fnirsi_1013d.bin v0.024u
The problem is probably something else
https://youtu.be/-bo5IEjTrlA (https://youtu.be/-bo5IEjTrlA)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on April 02, 2024, 05:56:37 pm
https://youtu.be/-bo5IEjTrlA (https://youtu.be/-bo5IEjTrlA)
YouTube :  This is a restricted video
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on April 03, 2024, 05:21:23 am
There is a departure of the zero position of the beam after pressing the autoset button.
https://youtu.be/RiFy97TEnFI?feature=shared
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: tokar on April 03, 2024, 07:32:44 am
On the original firmware in DC mode it works exactly like this: shifting the marker “0” to make maximum use of the screen size along the Y axis. When you press the Autoset button, it makes it possible to observe the DC+AC signal, with maximum amplitude, without additional settings.
https://youtu.be/PvyyLhLGvew (https://youtu.be/PvyyLhLGvew)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Magua on April 03, 2024, 08:57:46 am
https://youtu.be/-bo5IEjTrlA (https://youtu.be/-bo5IEjTrlA)
YouTube :  This is a restricted video
corrected
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: engineer.r152 on April 03, 2024, 10:41:07 am
A proposal to modernize the program. You can add a button that will return the beam to the zero position. On other oscilloscopes, this happens by pressing the beam displacement encoder. For example, you could click on the zone between V+ and V-
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: madori on April 03, 2024, 06:20:25 pm
Hi,
-Way lose Measure on long mode.
-have calibrated with good source and good multimeter, still have doubt,
-rpm calculation, during relative compresion start  (1000 / T) x 60= rpm/min   (have used hantek c650)

Is it there some shorted how and what, just get through all this forum pages. but..
-original firmware backup
-Improving hardware advice if needed
Using tricks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: gadak on April 03, 2024, 06:43:25 pm
"set 7.5V, connect DC voltage, press autoset. Check the AVG value and write it here. Open the channel menu, highlight AC and then back to DC (don't leave the channel menu). Exit the channel menu, and check the AVG value again and write it here. or video."

I did as you wrote. I also noticed that the voltage drops by 0.3 volts when I connect the dipstick.
https://youtu.be/Hx_uuO6MV24
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: madori on April 08, 2024, 05:30:33 pm
https://youtu.be/pAHYxCXhiyA?si=nX7pqmRBsiu7Y2nP
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 11, 2024, 06:42:29 am
What should we learn from the video? 

Otherwise, I thought about whether the problem with the DC shift is also caused by the discharge of the battery.  Because pwm is fixed, but when the battery voltage is low, a different shift is made that does not match the calculation.  How many DC to 5V converter do you have?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 13, 2024, 03:39:57 pm
Hello everyone. Apologies if this question has been asked, but for the nature of it I find it difficult to search.
I have received my 1013D brand new, and immediately patched successfully with the latest alternative fw I found on github. If that matters, I only "prepared" everything and applied the fw "main" .bin file.

Now, I am not an expert but when turning on the original fw I had this screen as in OriginalFW.jpg.
After installing the new fw I had this screen as in CustomFW.jpg.

Is it normal?
I figured out that the Trigger symbol is placed higher, with the new fw there is new option set by default to have Trigger auto-placed at 50%.
But what about the offset between the 1> / 2> channel symbols and their respective "empty" signals?
Is it correct that they are not aligned anymore?

EDIT: I found that performing calibration (Menu -> System setting -> Baseline calibration) it gets back to 1> and signal level to be on the same page.
Was that "my problem"? That is, after fw changes the oscilloscope need to be recalibrated? Thanks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 13, 2024, 04:42:43 pm
You have the 0.006 version there and it is currently 0.024s, see the back page.  There is a huge difference between them.
0.024t and higer is beta verzia
Manual is on page 82
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 14, 2024, 08:17:09 am
You have the 0.006 version there and it is currently 0.024s, see the back page.  There is a huge difference between them.
0.024t and higer is beta verzia
Manual is on page 82

Oh! Wow! It's that I found a "FNIRSI alternative fw repository" on github and linked in a message from somebody here, so I assumed it was the most updated, thank you for the information.
However, I found the latest yesterday evening (if I'm not wrong it's 0.24s) and the manual you linked, and one thing that I can't really understand is this:

Quote
In the oscilloscope menu, click on the option Base line calibration.
The required calibration voltages for the ranges are:
   100mV/div 300mV
   200mV/div 600mV
   500mV/div 1.5V
   1V/div  3V
   2.5V/div 7.5V
   5V/div  15V
Use an analog voltage source, or battery voltage that has zero ripple.

Does this mean that the calibration process is no longer "self contained", and I need some "external tool" of some sort? If so, is there any more detailed explanation, in a document or video?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: csuhi17 on April 14, 2024, 08:46:07 am
Does this mean that the calibration process is no longer "self contained", and I need some "external tool" of some sort? If so, is there any more detailed explanation, in a document or video?


This is how you should do it.

Added possibility to reset calibration values. (if a bad calibration occurs) Added notification of a faulty calibration if the offset cannot be set (only if there is some hardware problem, bad ad converter, missing ad converter, problem with the offset voltage setting)

Input divider calibration is enabled when the oscilloscope is turned on for the first time and baseline calibration is used.

Calling up the calibration of the input divider is possible only through the menu by resetting the calibration values. (or by deleting the data on the sd card where the configuration data is located. NEED SDCART READER No It can be done with a card stored in the oscilloscope. )

After successful calibration of the input divider and switching off the oscilloscope, the data is written to the SD card. (Unless you change the burnt components on the input circuits, it will no longer be needed - that is, if you do not erase, do not replace the sd card)

If the calibration is started again, only the base level calibration will be performed. i.e. 0 is found. (What sometimes needs to be done)

By uploading the firmware, the calibration of the input divider DOES NOT CHANGE.
https://www.youtube.com/watch?v=KK51iftmdVU (https://www.youtube.com/watch?v=KK51iftmdVU)
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 14, 2024, 10:29:06 am


This is how you should do it.


Apologies, this is for sure entirely my fault but... "how"?
From the video I can understand there is a voltmeter attached, ok... but what is connected to what is not visibile. Plus, the label on the scope says "set to 300mv"... but in the voltmeter you "measure", you don't "set" anything; so, do I need a signal generator as well, or a variable power source that I can set to those values?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Atlan on April 14, 2024, 11:36:10 am
Yes
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 14, 2024, 12:09:45 pm
Yes

Thanks Atlan. This is it then. I am out of luck for now.  |O I have no variable power source.
Does this mean that if I flash the latest version of the fw it would give "wrong" figures unless I perform the calibration as described?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: csuhi17 on April 14, 2024, 12:30:29 pm
I don't know, after I installed it, I did the calibration afterwards, I didn't measure it before. After installation, it asks for calibration :-//
.
A couple of batteries connected in series and a high-value potentiometer with which you can divide the voltage. You also need a multimeter to adjust the voltage.
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 14, 2024, 12:35:00 pm
I don't know, after I installed it, I did the calibration afterwards, I didn't measure it before. After installation, it asks for calibration :-//
.
A couple of batteries connected in series and a high-value potentiometer with which you can divide the voltage. You also need a multimeter to adjust the voltage.

Ha! Right... I could connect two 9V batteries, a potentiometer and a voltmeter, right. Might try to setup this rig, thanks
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: Ruskie on April 14, 2024, 01:18:22 pm
I don't know, after I installed it, I did the calibration afterwards, I didn't measure it before. After installation, it asks for calibration :-//
.
A couple of batteries connected in series and a high-value potentiometer with which you can divide the voltage. You also need a multimeter to adjust the voltage.

Something like this, plugging the probe in g5 and its ground in g6 would work?
Title: Re: FNIRSI-1013D "100MHz" tablet oscilloscope
Post by: csuhi17 on April 14, 2024, 01:49:13 pm
Set the potentiometer to the middle position before connecting to avoid short-circuiting the battery.The input of the scope is 1MOhm, how could it be short-circuited? :wtf: im sleepy. :palm:
The potentiometer should be of the order of kOhm minimum, DO NOT load the batteries with a small resistance, and DO NOT short-circuit them through the potentiometer!
In the video you can see that the two channels CH1 and CH2 must be calibrated at the same time.
You have to set the measuring probes to 1x position, if I remember correctly.