Author Topic: B3603 DC/DC Buck Converter mini review and how the SET key could be fatal...  (Read 172507 times)

0 Members and 1 Guest are viewing this topic.

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I've created a project on github to attempt documenting what I (we) found and maybe get some code going, either for the STM8 or even if just for an external Arduino: https://github.com/baruch/b3603
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
Great!
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
My logic analyzer seems to pick something on almost all of the right pins (9-16) and pin 16 which should be UART TX doesn't seem to have any meaningful serial data on it. I'm quite baffled there.

My logic analyzer wasn't connected to the ground of the system, it was random noise I was seeing  |O
 

Offline Rick LawTopic starter

  • Super Contributor
  • ***
  • Posts: 3487
  • Country: us
My logic analyzer seems to pick something on almost all of the right pins (9-16) and pin 16 which should be UART TX doesn't seem to have any meaningful serial data on it. I'm quite baffled there.

My logic analyzer wasn't connected to the ground of the system, it was random noise I was seeing  |O

Haha...  That is funny.  I thought I was the only one who would do something like that.  Oh, well...

I looked at 15 and 16 on the controller board very closely and I can't see it going anywhere else [edit- added ELSE, because they do go to the RxTx headers].  But I do consistently pick up a "pppx" or "ppp" on power down.  So there is some consistent noise there that looks a little like TTL UART at 38400 baud.

The thing I don't like about the control voltage is the negative part.  It will complicate ADC conversion for the read, and the DAC for the write.

I was going to decode the pins later, but with that link, it got me started sooner than expected.  What does surprise me is the lack of a pin for Power Source V- and/or not using that V- as controller board ground.  The PowerOut V- seats 0.00x to 0.3xxxVolts (or perhaps more) above PowerSource V-.  Using that as ground would have kept all the control voltage positive making ADC/DAC conversions a lot easier.
« Last Edit: February 12, 2015, 09:36:28 am by Rick Law »
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
A curious thing I just read is that if the offset on the measured value is the same as the offset for the Vref of the ADC we should be fine. So if the ground of the MCU is the same as that of the Vout than the offset we are seeing externally will not be seen by the STM8 MCU.
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I erased the firmware on the STM8 now (I have another one and bought a third now, I managed to blow the 7-segment display by feeding it 17V input instead of 5V).

I managed to program the STM8 and got it to blink the red led by toggling pin 11 (PB5) of the MCU. Once I'll have full UART communication it will be possible to probe all pins to check behavior and effect of the simple features (leds and output pins).
 

Offline ticpu

  • Newbie
  • Posts: 5
  • Country: 00
From Github I could read:
Pin 4: Iout control, 970mV/A + 140mV
Pin 5: Vout control, 72mV/V + 42mV

In fact, the STM8 chip outputs 2 square waves for control:


Minimum ~20/1000 µsec for pin 4
Minimum ~7/1000 µsec for pin 5

Maximum ~800/1000 µsec for pin 4
Maximum ~840/1000 µsec for pin 5

Oscilloscope: https://drive.google.com/open?id=0B8iQKMsmBSa1d1J6aVFPNHVOOHM&authuser=0

This is most likely what is adjusted in the calibration menus.

Edit: What I said for maximum was completely wrong.
« Last Edit: February 14, 2015, 06:32:00 pm by ticpu »
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I would assume that they use PWM and feed it to a capacitor for integration to generate the actual voltage feed to the opamp network.

Thanks for looking into this!
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
Now I'm truly baffled... The initial mappings of MCU pins to left connector pins were done by probing with a continuity tester. I'm not trying to validate that with some code running on the STM8S003F3 chip and it doesn't check out. The strange thing is that I toggle PB6 and it turns on pin 7 on the left connector, the odd part being that according to STM8 specs there is no PB6 pin on this chip in the first place.

EDIT: I had an off-by-one on the ports. Add this to my account of bugs on the road. But at least things seem to check out now.
« Last Edit: February 14, 2015, 09:46:50 pm by baruch »
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
ticpu, can you see what happens on pin 8 of the left connector? we have no decoding for it and it is wired to the MCU so I wonder what can be picked up from it, if it is a PWM or some other signal. Especially helpful would be to know if it changes in any normal mode of operation.
 

Offline bal00

  • Newbie
  • Posts: 2
Hi. I'm the person who did the basic pin mapping that was posted here earlier. Happy to see that someone is doing something with this module. Seems like a useful little board.

Just to clear up a possible point of confusion:

The thing I don't like about the control voltage is the negative part.  It will complicate ADC conversion for the read, and the DAC for the write.

I was going to decode the pins later, but with that link, it got me started sooner than expected.  What does surprise me is the lack of a pin for Power Source V- and/or not using that V- as controller board ground.  The PowerOut V- seats 0.00x to 0.3xxxVolts (or perhaps more) above PowerSource V-.  Using that as ground would have kept all the control voltage positive making ADC/DAC conversions a lot easier.

The control and sense voltages are all positive. Might be hard to read on the image, but it says ~0.97V/A, not -0.97V/A. Wasn't able to nail down a more precise constant, possibly because there's some non-linearity involved (due to the shunt temperature perhaps?).

Pin 15 and 16 are indeed only connected to RxD and TxD as far as I can tell, and pin 8 is a mystery to me as well. Note that the manufacturer uses the same controller board on different DC-DC converters (B3603, B3008, BST400), so maybe pin 8 is only used on the boost converter module, or maybe they just had an extra pin and wanted to future-proof the design for other products.
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I found two of the buttons are connected to PC7 and PD1, I believe the other two are connected to the UART pins PD6 and PD7 which will make them useless for my needs since I want the serial port more than the buttons.

Ideas for UX with only two buttons would be appreciated :-)

Also, ideas for the power supply itself are welcome as well. I'm starting to work on the code for the alternative STM8 firmware and have put a serial protocol definition at https://github.com/baruch/b3603/blob/master/stm8/PROTOCOL.md and my feature wishlist in the wiki at https://github.com/baruch/b3603/wiki

Still haven't done the actual power supply control as I need to learn exactly how to do the PWM controls yet on the STM8. There are examples around so it shouldn't be hard to get it working, making it work good enough and the power supply stable enough would be the real challenge.
 

Offline ticpu

  • Newbie
  • Posts: 5
  • Country: 00
ticpu, can you see what happens on pin 8 of the left connector? we have no decoding for it and it is wired to the MCU so I wonder what can be picked up from it, if it is a PWM or some other signal. Especially helpful would be to know if it changes in any normal mode of operation.

After trying many operations, it just acts as a "Power Good" always-on pin. It does not seem to be mapped anywhere on the bottom board, am I right on this?

It is always on except when power goes below the CPU threshold and the display shows "0     " with output disabled.
Operations tried:
- Bootloader menu
- Switching all 3 bootloaders options on or off
- Switching the output on or off
- Switching the output from CV to CC and vice-versa
- Going in calibration menu
 

Offline ticpu

  • Newbie
  • Posts: 5
  • Country: 00
I found two of the buttons are connected to PC7 and PD1, I believe the other two are connected to the UART pins PD6 and PD7 which will make them useless for my needs since I want the serial port more than the buttons.

I know that this will be a completely new program but let's immagine we would be modifying the current program for this example.

I'd suggest having the 4 button operationnal like the current program. I would add an option in the boot menu, the one accessible by holding OK on boot, an option to start automatically oin serial controlled mode. In this mode, pressing the OK or Set button (or those which are not mapped to serial) would return to button controlled mode and to return to serial controlled mode you would press and hold Set and OK.

In this way, it would be possible to modify the settings both from the serial mode and button controlled mode.

Also, ideas for the power supply itself are welcome as well. I'm starting to work on the code for the alternative STM8 firmware and have put a serial protocol definition at https://github.com/baruch/b3603/blob/master/stm8/PROTOCOL.md and my feature wishlist in the wiki at https://github.com/baruch/b3603/wiki

What would you think of having the protocol supporting GET/SET/SHOW in parallel with action keywords? I think it would made interfacing with other device a bit easier since you would not have to parse the output as much.

Then having aliases/shortcuts for case-insensitive fast to type commands like "seti 0.33" would be a piece of cake. Plus, having GET/SET interface could allow a COMMIT command if someone implements this. SHOW would be a listing of all available settings and HELP a list of all available actions.

Example session, all lines terminated by \r\n, < and > represent serial data direction.

> SET max_voltage=10.1
> SET max_amperage=0.41
> SET output_enabled=1
> GET max_voltage
< 10.10
> GET max_amperage
> 0.410
> GET output_voltage
> 9.231
> SHOW
< max_voltage=10.10
< max_amperage=0.410
< output_enabled=1
< output_voltage=9.231
< other_settings=...
< \r\n (empty line)


I'm willing to be writing some code to implement this; if it makes sense! :)

Maybe I missed it, but right, how do you upload code to the STM8 device? I don't have a dev environment set-up for those devices at the moment.

Edit: I forgot about read only variables, they could just be prefixed with something so the user know they are read only/status data.
« Last Edit: February 15, 2015, 09:54:34 pm by ticpu »
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
After trying many operations, it just acts as a "Power Good" always-on pin. It does not seem to be mapped anywhere on the bottom board, am I right on this?

I've so far failed to trace the bottom board so I can't tell much, it does seem to be generated by something in one of the boards as it is there even when the STM8 MCU doesn't generate anything on it. I tried to use it now as a power good signal in the code but I can't seem to manage to output even one character before the board loses power. Will have to check this when I can actually output power from the board.

It does sound like a good option for it to be a power good signal.
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I found two of the buttons are connected to PC7 and PD1, I believe the other two are connected to the UART pins PD6 and PD7 which will make them useless for my needs since I want the serial port more than the buttons.

I know that this will be a completely new program but let's immagine we would be modifying the current program for this example.

I'd suggest having the 4 button operationnal like the current program. I would add an option in the boot menu, the one accessible by holding OK on boot, an option to start automatically oin serial controlled mode. In this mode, pressing the OK or Set button (or those which are not mapped to serial) would return to button controlled mode and to return to serial controlled mode you would press and hold Set and OK.

In this way, it would be possible to modify the settings both from the serial mode and button controlled mode.

Sounds likely, switching between serial enabled/disabled by the buttons could work I guess and make more sense than a mostly serial device.

Also, ideas for the power supply itself are welcome as well. I'm starting to work on the code for the alternative STM8 firmware and have put a serial protocol definition at https://github.com/baruch/b3603/blob/master/stm8/PROTOCOL.md and my feature wishlist in the wiki at https://github.com/baruch/b3603/wiki

What would you think of having the protocol supporting GET/SET/SHOW in parallel with action keywords? I think it would made interfacing with other device a bit easier since you would not have to parse the output as much.

Then having aliases/shortcuts for case-insensitive fast to type commands like "seti 0.33" would be a piece of cake. Plus, having GET/SET interface could allow a COMMIT command if someone implements this. SHOW would be a listing of all available settings and HELP a list of all available actions.

I'm trying to get something useful and was planning to do most of the serial control through an application (most likely sigrok) or custom scripts. I'd like to have something that is rather simple to parse and I quickly implemented most of that protocol today. I do like the idea of a COMMIT command.

Ofcourse, if you want to implement the code to do the parsing I don't really mind the protocol itself. I would even appreciate support for the arrow keys for completely serial control but don't find it important enough to implement it myself. I also hope the flash and ram will be sufficient but for now I don't see the space a real constraint.


Maybe I missed it, but right, how do you upload code to the STM8 device? I don't have a dev environment set-up for those devices at the moment.

I got myself an STLink V2 device from Aliexpress for $3.5 and a CP2302 serial to do the serial communications. I tried using stm8flash but it stopped working after I used once the STM official programmer, now I can only use the official programmer software which is a hassle but not too bad when it runs in a windows vm on my linux machine.

I do my compilation with sdcc and makefiles.
 

Offline flex

  • Contributor
  • Posts: 25
Just thought I'll leave that here. (can't guarantee correctness ;) )

Edit: There is a mistake, because of the 50mOhm resistor. Will post full schematic (of the bottom board) later.
« Last Edit: February 17, 2015, 01:35:19 pm by flex »
 

Offline plazma

  • Frequent Contributor
  • **
  • Posts: 474
  • Country: fi
    • Homepage
Is the original firmware protected? Can it be read and disassembled?
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
Is the original firmware protected? Can it be read and disassembled?

It is protected, that was the first thing I tried but the read-out-protection is enabled and nothing can be read in normal means. That's why I resorted to reverse engineering to write my own firmware.

 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
Just thought I'll leave that here. (can't guarantee correctness ;) )

Nice!

I can see from that the on/off signal goes directly to the LM2596, I can't find anything for pin 8 on the left connector which is still somewhat a mystery. As can be seen above we suspect it is a power good signal but in my attempts to read it to notice failure the MCU doesn't notice it soon enough to do anything with it.
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I got PWM to work on the STM8 now.

I'm somewhat fumbling on this topic but what would be the best way to control the PWM vs the voltage/current setting vs the output sense?

Should I do a feedback loop between the outputs and the pwm? Find some calibration and let it be?

Anyway, I've got all the road blocks removed to get serial control over the B3603. I still have no idea how to drive the display through the 74HC595, if someone can figure out the pinouts there I'd appreciate that a lot.
 

Offline DuckDaffy

  • Newbie
  • Posts: 1
Hi all! I'm new one here.
I was thinking about new software for B3603 too.
Great to find this topic. :)

I dream about:
* rotary encoder for setting U/I,
* auto-off function when overcurrent.

I hope I can help somehow, for ex. I have 2x B3606, 1x B3603 and also 1x BST400, so I can test SW with these HW. ;)
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
Maybe some of those use the pins that seems to be unused on the B3603?
 

Offline baruch

  • Regular Contributor
  • *
  • Posts: 78
  • Country: il
I dream about:
* rotary encoder for setting U/I,
* auto-off function when overcurrent.

I hope I can help somehow, for ex. I have 2x B3606, 1x B3603 and also 1x BST400, so I can test SW with these HW. ;)

I'm currently doing only software work for this, I can think of hardware modification for user interface work. Some people like the buttons and some prefer the rotary encoder, I can also think of an LCD but that's going to be a later modification. For now I want to get the software to work and I'm getting close :-)

Do you have an STLinkV2 programmer? If you will want to play out with the software you'll need one to program the devices.

I would appreciate it a lot if you can test the measurements we have for the B3603 on the other devices, presumably you have the B3606 and the BST400 which I don't have. What voltages do they show on the left connector pins for different settings? What is the PWM values for the control pins?
 

Offline neslekkim

  • Super Contributor
  • ***
  • Posts: 1305
  • Country: no
How do one read firmware from these chips?

I know that it was locked, but are we sure all of them are locked, if some did slip through, or have been updated in various versions?, it's lots of sellers of these, I have some of these versions also.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf