Author Topic: FNIRSI-1013D "100MHz" tablet oscilloscope  (Read 407679 times)

engineer.r152, Sleo, Atlan and 5 Guests are viewing this topic.

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1050 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
« Last Edit: October 04, 2021, 02:28:04 pm by pcprogrammer »
 
The following users thanked this post: frenky, wolfy007

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1051 on: October 05, 2021, 01:09:57 am »
Do you think that the original programmer took off half way through?
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1052 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.


Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1053 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:
  • When there is a high frequency signal (>43MHz) present, some, to be determined, processing is done on the signal.
  • Otherwise the signal is up sampled with the x10 function for the 25nS/div or what I think is x25 up sampling for the 10nS/div

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

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1054 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...
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1055 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.

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1056 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. :-+
 
The following users thanked this post: pcprogrammer

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1057 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.

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1058 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"  :(
« Last Edit: October 15, 2021, 05:34:14 pm by pcprogrammer »
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1059 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  ::)
« Last Edit: October 15, 2021, 05:45:54 pm by pcprogrammer »
 

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1060 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.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1061 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

Offline pickle9000

  • Super Contributor
  • ***
  • Posts: 2439
  • Country: ca
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1062 on: October 15, 2021, 06:51:13 pm »
Well....... at least a documented reason.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1063 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

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1064 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

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. :)

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1065 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

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1066 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...
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1067 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.

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1068 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.
 

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1069 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"
« Last Edit: October 18, 2021, 09:34:46 am by pcprogrammer »
 

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1070 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...
 
The following users thanked this post: pcprogrammer

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1071 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

Offline pcprogrammer

  • Super Contributor
  • ***
  • Posts: 3690
  • Country: nl
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1072 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))

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1073 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:

 

Offline frenky

  • Supporter
  • ****
  • Posts: 1003
  • Country: si
    • Frenki.net
Re: FNIRSI-1013D "100MHz" tablet oscilloscope
« Reply #1074 on: October 18, 2021, 06:00:44 pm »
And on the big flex cable there is no IC on top or bottom side:
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf