DSO203 GCC APP - Community Edition (2.51+SmTech1.8+Fixes)

I think I’m using the “official” sys 1.51.

Can’t test it now, though.



Anyway, I don’t have a problem with the frequencies.

It’s, at least in marco’s sys.



See here: <LINK_TEXT text=“ftp://shodtech.net/DSO_Quad/marcosin_ch … ude/BIOS.h”>ftp://shodtech.net/DSO_Quad/marcosin_changes/source_V1.7/SYS1.6/include/BIOS.h</LINK_TEXT>

Yes I have the Bios.h which declares ANALOG_PSC. I am looking for the Sys package Bios.C which has the Set function. In the Sys1.51 files, there is no handler for the ANALOG_PSC case. Maybe that is causing the function to work on some DSO203? I want to backtrace and find the registers being manipulated so I can correct it.



Thanks for looking



This is from the file Bios.c from Sys1.51 here <LINK_TEXT text=“https://github.com/Seeed-Studio/DSOQuad … rce/BIOS.c”>https://github.com/Seeed-Studio/DSOQuad_SourceCode/blob/master/SYS_V1.50/source/BIOS.c</LINK_TEXT> No case for ANALOG_PSC as you can see.

[code]/*******************************************************************************
Set: 硬件控制设备设置
*******************************************************************************/
u32 Set(u8 Object, u32 Value)
{
switch (Object){
case CH_A_OFFSET: if(Value < 65536){
TIM5_ARR = 470; TIM5_CCR1 = 450 - Value; // Value = 0~200
} else {
TIM5_ARR = Value >>16; TIM5_CCR1 = Value & 0xFFFF;
} break;
case CH_B_OFFSET: if(Value < 65536){
TIM5_ARR = 470; TIM5_CCR2 = 450 - Value; // Value = 0~200
} else {
TIM5_ARR = Value >>16; TIM5_CCR2 = Value & 0xFFFF;
} break;
case BACKLIGHT: TIM8_CCR1 = Value; // Value = 0~100
break;
case BEEP_VOLUME: TIM8_CCR2 = 100 - Value/2; // Value = 0~50
break;
case BETTERY_DT: ADC3_CR2 |= (Value & 1)<<22; // Value = 1/0 ADC3_CR2 |=0x00400000;
break;
case ADC_MODE: if(Value == SEPARATE) FIFO_MODE_LOW();
else FIFO_MODE_HIGH(); break;
case FIFO_CLR: if(Value == W_PTR){FIFO_CLRW_HIGH(); FIFO_CLRW_LOW();}
if(Value == R_PTR){FIFO_CLRR_HIGH(); FIFO_CLRR_LOW();} break;
case T_BASE_PSC: TIM1_PSC = Value;
break;
case T_BASE_ARR: if(Value==0) {TIM1_CCER=0; RCC_CFGR=0x041D8402;} // MCO as SYSCLK
else if(Value==1) {TIM1_CCER=0; RCC_CFGR=0x071D8402;} // MCO as SYSCLK/2
else {RCC_CFGR=0x001D8402; TIM1_CCER=0x0003; // MCO as OC1
TIM1_ARR=Value; TIM1_CCR1=(Value+1)/2;}
break;
case CH_A_COUPLE: if(Value == AC ) AC_1(); else DC_1();
break;
case CH_B_COUPLE: if(Value == AC ) AC_2(); else DC_2();
break;
case CH_A_RANGE:
switch (Value){
case _50MV: Ax0_ON(); Ax1_ON(); Ax2_HIGH(); Ax5_HIGH();
break;
case _100MV: Ax0_ON(); Ax1_ON(); Ax2_LOW(); Ax5_HIGH();
break;
case _200MV: Ax0_ON(); Ax1_ON(); Ax2_HIGH(); Ax5_LOW();
break;
case _500MV: Ax0_ON(); Ax1_ON(); Ax2_LOW(); Ax5_LOW();
break;
case _1V: Ax0_OFF(); Ax1_OFF(); Ax2_HIGH(); Ax5_HIGH();
break;
case _2V: Ax0_OFF(); Ax1_OFF(); Ax2_LOW(); Ax5_HIGH();
break;
case _5V: Ax0_OFF(); Ax1_OFF(); Ax2_HIGH(); Ax5_LOW();
break;
case _10V: Ax0_OFF(); Ax1_OFF(); Ax2_LOW(); Ax5_LOW();
break;
case CH_B: Ax0_ON(); Ax1_OFF(); Ax2_LOW(); Ax5_LOW();
break;
} break;

case CH_B_RANGE:
switch (Value){
case _50MV: Bx0_ON(); Bx1_ON(); Bx2_HIGH(); Bx5_HIGH();
break;
case _100MV: Bx0_ON(); Bx1_ON(); Bx2_LOW(); Bx5_HIGH();
break;
case _200MV: Bx0_ON(); Bx1_ON(); Bx2_HIGH(); Bx5_LOW();
break;
case _500MV: Bx0_ON(); Bx1_ON(); Bx2_LOW(); Bx5_LOW();
break;
case _1V: Bx0_OFF(); Bx1_OFF(); Bx2_HIGH(); Bx5_HIGH();
break;
case _2V: Bx0_OFF(); Bx1_OFF(); Bx2_LOW(); Bx5_HIGH();
break;
case _5V: Bx0_OFF(); Bx1_OFF(); Bx2_HIGH(); Bx5_LOW();
break;
case _10V: Bx0_OFF(); Bx1_OFF(); Bx2_LOW(); Bx5_LOW();
break;
case CH_A: Bx0_ON(); Bx1_OFF(); Bx2_LOW(); Bx5_LOW();
break;
} break;

case ANALOG_ARR: GPIOB_CRL = 0x34BBB438; TIM4_CR1 = 0x0080; // SQR_OUT = Disnable
GPIOA_CRL = 0x111011BB; DAC_CR = 0x0001; // DAC = Ensable
TIM7_ARR = Value; TIM7_CR1 = 0x0085; break;// DAC_CLK = Enable
case ANALOG_PTR: DMA2_CMAR4 = Value;
break;
case ANALOG_CNT: DMA2_CNDTR4 = Value; // Fout = (Cnt*(ARR+1)/72)KHz
break;
case DIGTAL_PSC: TIM4_PSC = Value; GPIOA_CRL |= 0x40000; // DAC_OUT = Disnable
TIM7_CR1 = 0x0084; DAC_CR = 0; break; // DAC = Disnable
case DIGTAL_ARR: TIM4_ARR = Value;
break;
case DIGTAL_CCR: GPIOB_CRL &= 0xF0FFFFFF; GPIOB_CRL |= 0x0B000000; // PORT_SQR = Enable
TIM4_CCR1 = Value; TIM4_CR1 = 0x0081; break; // SQR_OUT = Enable
case KEY_IF_RST: TIM3_SR = 0; //Clear TIM3 interrupt flag
break;
case STANDBY: if(Value == 1) { STB_EN();} else { STB_DN();}
break;

case FPGA_RST: GPIOB_CRH &= 0xF0FFFFFF; GPIOB_CRH |= 0x01000000; // 设PB14为输出状态
SPI_CRST_LOW(); Delayms(1); // SPI_CRST_LOW 1mS
SPI_SS_HIGH(); Delayms(1); // SPI_SS_HIGH 1mS
SPI_SS_LOW(); Delayms(1); // SPI_SS_LOW 1mS
SPI_CRST_HIGH(); Delayms(2); // SPI_CRST_HIGH 2mS
GPIOB_CRH &= 0xF0FFFFFF; GPIOB_CRH |= 0x08000000; break; // 设PB14为输入状态

case TRIGG_MODE: Set_Param(Object, Value);
break;
case V_THRESHOLD: Set_Param(Object, Value);
break;
case T_THRESHOLD: Set_Param(Object, Value & 0xFF);
Set_Param(Object +1, Value >> 8); break;
case ADC_CTRL: Set_Param(Object, Value);
break;
case A_POSITION: Set_Param(Object, Value);
break;
case B_POSITION: Set_Param(Object, Value);
break;
case REG_ADDR: Set_Param(Object, Value);
break;
}
return 0;
}[/code]

:slight_smile:



It’s in the same place Jerson: <LINK_TEXT text=“ftp://shodtech.net/DSO_Quad/marcosin_ch … rce/BIOS.c”>ftp://shodtech.net/DSO_Quad/marcosin_changes/source_V1.7/SYS1.6/source/BIOS.c</LINK_TEXT>

Just checked, and I’m actually using Marco’s SYS 1.50 1.6

Yes to run the signal generator in right mode, it’s necessary the sys 1.50 1.6 i don’t remember what i have changed but i remember that i’ve modified something.

I’ve just changed the readme.txt to reflect this.

Can’t reproduce this…

Pmos69, i have make some modify to Your old 1.18 version, this is a screenshoot.

-The FFT function and FFT source can be selected from the track4 menù, it’s possible select the ch A or ch B. They are displayed as track4 math results.

-I’ve changed some colors

-I’ve changed the FFT meter positions, the max meter moves along the peak position



There are stupid modify, but if you think that are interesting, i can send to You the code to integrate it in the next version. Maybe you first do it without my code!!! hehehe.

Thanks Marco, that looks much better. Great.

I didn’t do much more, because I’m leaving for Zurich tomorrow and I’ll be away for a week because of work.

But send the code and I’ll try to do it as soon as I can. (I’ll bring the dso with me :slight_smile: )



All the best,

Pedro

Hello Pedro



The sys was a problem. Updating from Marcos binary corrected the problem.



Now, my setup has

HW 2.60

SYS 1.50 SmTech 1.6



Thanks very much



Regards

Jerson

Here the modified files.

In the sources i have deleted the “interlace mode” because it’s never used in the software. In this mode we have more free memory.



Thanks

Marco

Here are the code modifications necessary to fix the trigger (they’re all on Process.c):

At the start of the file, declare:
</s>u8 HoldOnNext=0;<e>

In Synchro() change
[code] if((_Status == RUN)&&(__Get(FIFO_FULL)!=0))
{ // FIFO is full
__Set(FIFO_CLR, W_PTR); // FIFO write pointer reset
Wait_Cnt = Wait[_T_base];
JumpCnt =0;

if(_Mode == SGL)

{
_Status = HOLD; // one finished, enter the pause
_State.Flag |= UPDAT;
}
}[/code]
to
[code] if(HoldOnNext==1) {
_State.Value = HOLD; // one finished, enter the pause
_State.Flag |= UPDAT;
HoldOnNext=0;
return;
}

if((_Status == RUN)&&(__Get(FIFO_FULL)!=0)){ // FIFO is full
if((_Mode != SGL)) {
__Set(FIFO_CLR, W_PTR); // FIFO write pointer reset
}
Wait_Cnt = Wait[_T_base];
JumpCnt =0;
if(_Mode == SGL){
HoldOnNext=1;
}
}
[/code]
That should be all :smiley:

Thanks!

This is great.

A lot of contributions already from a lot of people.

It’s just a pitty I’m away and buried in work, but I’ll merge everything as soon as physically possible.



Thanks everybody.

Hi Pedro & Jack



I have used pmos69_app_v119 and merged the changes.



Following files have been modified and you can find the mods by searching for ‘Jerson’ in the code



E:\Download\DSO203\pmos69_app\App\src\Menu.c

179: {(char*)NumStr, (u16*)V_COLOR, 10-1, NUM2, 342, 152, 5, UPDAT}, // Class (Jerson was 11-1 now 10-1)

536: if(Title[i][j].Value >= Title[i][j].Limit){ // Jerson (was ==10, made >=Limit)

E:\Download\DSO203\pmos69_app\App\src\Function.c

390: /* removed by Jerson. Was causing selections to jump around (bounce) */



Attached file has the changes.



Thanks for helping me get into this Marco, Pedro, Gabriel and of course the original author Bure



Regards

[code]v1.20

  • Improvements in the FFT (Marco Sinatti):
    • The FFT function and FFT source can be selected from the track4 menù, it’s possible to select the ch A or ch B.
      They are displayed as track4 math results.
    • Changed some colors
    • Changed the FFT meter positions, the max meter moves along the peak position
  • Trigger fixes (JackTheVendicator)
  • Fixed volume control + selection bounce (Jerson)[/code]

Thanks everybody



Latest download: https://github.com/pmos69/dso203_gcc/zipball/master

As usual, I borked something up in the fix :oops: (I haven’t worked on it for months).

To correct it, remove line 579 (u8 HoldOnNext=0;) and place at the head of the file instead (before line 14 is fine). Then, go to line 353 and change from
</s>if((_T_base > 15)&&(_Status == RUN)) DataBuf[i] = __Read_FIFO(); // read into the 32-bit FIFO data reading pointer +1<e>
to
</s>if(((_T_base > 15)||(_Mode == SGL))&&(_Status == RUN)) DataBuf[i] = __Read_FIFO(); // read into the 32-bit FIFO data reading pointer +1<e>
(this adds a check that updates the screen in SGL mode just after the scope goes in HOLD status).



–EDIT–

FFT seems to work correctly even in single shot mode.

done:

[code]v1.21

  • SGL Trigger fix (JackTheVendicator)[/code]

First, thanks for your great work. Now DSO X is really usable. :slight_smile:

But there is a little problem in my dso.

I replaced the switcher regulator to a LDO, now most of the noise is reduced,but the display of RMS is not correct.



Maybe is a bug. can you check it? I’m good at hardware but not arm :wink:

Thanks