lnDSO150 icon indicating copy to clipboard operation
lnDSO150 copied to clipboard

Problem with Voltage range selection

Open mean00 opened this issue 1 year ago • 13 comments

This has been manually split from https://github.com/mean00/lnDSO150/issues/7

[marianomd] This is stopping me from using this great piece of software. Furthermore, I already rewired the encoder, so for the time being I have a paperweight. I'm on FNIRSI.

[mean00] BTW you can easily revert the rotary encoder change https://user-images.githubusercontent.com/8426909/243091951-295a699b-577f-48be-8f14-84da3012ba1d.png

Just connect the 2 modified pins of the rotary encoder to the bottom side of R5 and R6 You can then switch easily between the 2 configurations Also it would be interesting to get the voltage on the ASM117 chip It should be 3.3v Attached is a test fw for FNIRSI Could you report the number at the bottom right ? It should be around 3300.0

[marianomd] Measured voltage with multimeter on AMS1117: 3.316v

Run the binary, here is the shot:

[mean00] Thanks The VCCA is off by 5% much less than the error, so there's something else Could you take a picture of the analog board (the one with the BNC connector) to check the resistor values ?

[marionomd] Let me tell you my error: 3.31 are read as 3.25 - 3.27 (good!) 5.05 V are read as 4.95 - 5.06 (good!) 10V are read as 9.59V 20V are read as 9.59V 28V are read as 9.59V

It's like capped !

Seems to be not exactly the same problem as OP.

[mean00] Thanks for the image.

yes it looks like saturation I just tried on mine and i can go at least up to 18V without problem

Might be interesting to check the voltage on pin 9 10 and 11 of the 74HC4051 when you use 1v and 5v They are the command pins to select the input gain/attenuation

They are also available on the interboard connector, easier to check

[marianomd] It's always the same, tested with 1, 5 and 10V.

SENSE0: 0 SENSE1: 0 SENSE2: 3.3 SENSE3: 0

[mean00] Ok, that's the problem Let me double check on my end but i think it worked last time i checked tested on my FNRISI unit 1v : 0 0 1 0 2v : 0 1 1 0 5v: 1 1 1 0 So in your case it seems to be stuck at the 1v setting

[marianomd] What does that mean? Can it be corrected by software?

Could you try with the attached version ? Are the others voltage ranges working fine ? In particular 10mv, fnirsi_const.zip 20mv and 50mv/div ?

Thanks for the follow up.

Mode: DC 1 V: down to 100 mV range, reading is correct, less is wrong (50 mV reads 381 mV, 20 mV reads 191 mV, 10 and 5 mV read 96 mV) 2 V: down to 500 mV range, reading is correct, less is wrong (200 mV reads 1.42 V, 100 mV read 0.95 V, less ranges same as above) 5 V: exactly the same as 2 V. 10 V: reads OK down to 2V range. 1V and 500mV ranges give 9.50 V. 200mV and down, same as above) 20 V: reads OK (19.53-19.72) at 5V range. On 2V range it gives 19.01V, on 1V range it gives 9.50V (same as above all the way down)

Seems the reads are ok if the waveform is on screen. When it goes offscreen it is capped.

[mean00] It looks like the command signal to switch voltage range is not working These are the SENSL0...3 pins If it behaves the same without the analog board, it points to either a different board layout (unlikely) or a damaged chip (?)

Thanks a lot!

Now I know how to get a valid reading, by setting the correct range. It's not clear if this can be done on the official release, or only in the bin you sent me.

[mean00] You can check with any version, it's the way the hw is wired

mean00 avatar Jun 18 '23 15:06 mean00

@marianomd i'm unsure of the status so far. It looks like a hw issue with the board. Am i missing something ?

mean00 avatar Jun 18 '23 15:06 mean00

Hello, @mean00, I don't recall having that problem with the factory firmware. The problem is that the original firmware was wiped when I unlocked writing with ST-Link tool. I wrote to FNIRSI, and they sent me a firmware update. The problem is this binary requires a propietary bootloader, which also got wiped, and they won't send it to me. I thought about making a little bootloader that jumps to the firmware they sent, but I have no idea the offset to flash it/jump to it. Also the file structure could be arranged differently. The bootloader is acceded by powering on while pressing OK, and a windows tool sends the fw by UART.

marianomd avatar Jun 20 '23 02:06 marianomd

If you hexdump the beginning it might give a hint

xxd -g1 yourbinfile | head -5

for example

mean00 avatar Jun 20 '23 04:06 mean00

Hello!

Here it is:

00000000: 78 4f 00 20 d5 41 00 08 e9 7f 00 08 cd 7f 00 08  xO. .A..........
00000010: e5 7f 00 08 f1 4c 00 08 91 de 00 08 00 00 00 00  .....L..........
00000020: 00 00 00 00 00 00 00 00 00 00 00 00 db c0 00 08  ................
00000030: a1 73 00 08 00 00 00 00 d9 c0 00 08 dd c0 00 08  .s..............
00000040: ef 41 00 08 ef 41 00 08 ef 41 00 08 ef 41 00 08  .A...A...A...A..

marianomd avatar Jun 23 '23 20:06 marianomd

The startup function is at address 0x08 00 41 d5 (+16 kB) I'd guess the bootloader is either 4kB or 8kB and the binary must be flashed at address 0x08 00 10 00 or 0x08 00 20 00 You'd have to look at offset 0x21d4 or 0x11d4 of the file to see if it is a stmia xxxx instruction arm-none-eabi-objdump can disassemble it for you

mean00 avatar Jun 24 '23 06:06 mean00

Thanks, I will try to boot into those addresses.

Regarding the disassembly, didn't find stmia instruction at those addresses.

$ arm-none-eabi-objdump -m arm -D -b binary DSO150V1.7_LOGO_7789.bin

DSO150V1.7_LOGO_7789.bin:     file format binary

Disassembly of section .data:

00000000 <.data>:
[...]
11d4:       2104fc73        tstcs   r4, r3, ror ip
[...]
21d4:       f00620a6                        ; <UNDEFINED> instruction: 0xf00620a6

marianomd avatar Jun 24 '23 18:06 marianomd

Could you attach the file ? I can probably make it work quickly

mean00 avatar Jun 24 '23 18:06 mean00

Sure!!

https://drive.google.com/drive/folders/1YdfN7OzDNaM9_O9hACfgNaMDqKOom2D4?usp=sharing

marianomd avatar Jun 24 '23 18:06 marianomd

fnirsi_loader.zip Confirmed, the offset is 0x4000 The attached loader works for me :

  • Flash the loader at address 0x8000000
  • Flash the fnirsi binary at address 0x80004000 then it works for me

mean00 avatar Jun 24 '23 18:06 mean00

It worked!

I will repeat the test I did before, with the stock firmware:

I take average voltage shown.

Seems very similar to the readings I made with your firmware, so I conclude the problem is my hardware :/

supply/range 20 10 5 2 1 500mV 200mV 100mV 50mV 20mV 10mV 5mV
1V 0.60 1 1 1 1 1 1 1 0.98 0.39 0.19 0.09
2V 1.20 1.80 2 2 2 2 1.47 1.47 0.98 0.39 0.19 0.09
5V 4.40 4.90 5 5 5 5 1.47 1.47 0.98 0.39 0.19 0.09
10V 9.80 9.90 10 10 10 9.86 1.47 1.47 0.98 0.39 0.19 0.09
20V 19.80 20 20 20 19.74 9.87 1.47 1.47 0.98 0.39 0.19 0.09

marianomd avatar Jun 24 '23 23:06 marianomd

probably the MCU ( CH32F103) It is a bit of a pain to replace but a STM32F103/CH32F103 or GD32F103/303 wil do the job

mean00 avatar Jun 25 '23 06:06 mean00

I've gone down to atmega 328p, but I think that without a hot air soldering station it won't be very easy. I will track the sense0..3 to the MCU pads to check the value there. Thanks a lot for everything.

marianomd avatar Jun 26 '23 02:06 marianomd

fnirsi_loader.zip Onaylandı, ofset 0x4000 Ekli yükleyici benim işimi görüyor:

  • 0x8000000 adresindeki yükleyiciyi flaş edin
  • fnirsi ikili dosyasını 0x80004000 adresine flaş edin, o zaman benim için çalışır

Hi,

Chip stm32f103 did not work for me. I uploaded the lnBMP_bootloader file to address 0x8000000. I also uploaded the Dso150v1.7_logo_7789.bin file to 0x8000400. but no screen came. my display has 7789 driver

hakan1498 avatar Jul 24 '24 07:07 hakan1498