Giter Club home page Giter Club logo

b3603's Introduction

B3603

This project is about reverse engineering the B3603 control board and figuring out how it works, then it should be possible to create an alternative firmware. Either by driving it with another board on the same control points or by replacing the original firmware with one of my own.

Current state: Working, it is functioning and serially controllable.

Components needed:

  • B3603 -- The unit being reprogrammed
  • CP2102 -- A usb-to-serial TTL-level
  • STLink V2 -- programmer for the STM8S microcontroller

Schematics

These were done by flex, the discussion can be seen in the EEVBlog forum (link at the bottom).

B3603 Board Schematics in PDF (top and bottom)

Bottom board schematics:

B3603 Bottom Board Schematics

Top board schematics:

B3603 Top Board Schematics

Regulator Board (bottom)

Bottom Board Side 1

Bottom Board Side 2

Control Board (top)

Top Board Side 1

Top Board Side 2

MCU

The MCU is an STM8S003F3. It is the TSSOP-20 package.

Pinouts

Lets name the different pinout components, left and right are as seen looking at the top board with the 7-segment display up:

  • MCU
  • Left connector -- 8 pins left side
  • Right connector -- 8 pins right side
  • Serial connector -- 4 pins at left most side
  • SWIM connector -- 4 pins at the bottom, just left of the buttons
  • 74HC595 #1 -- The one closest to the MCU
  • 74HC595 #2 -- The one furthest from the MCU

Pinout from MCU

![STM8S003F3 TSSOP20 pins](docs/STM8S003F3 pinout.png)

MCU pin MCU Function Board Connector Board Connector Pin Board Connector Name
Pin 1 UART1_CK/TIM2_CH1/BEEP/(HS) PD4 74HC595 Pin 3 DS
Pin 2 UART1_TX Serial connector Pin 2 TX
Pin 3 UART1_RX Serial connector Pin 4 RX
Pin 4 NRST SWIM Pin 1 SWIM NRST
Pin 5 OSCIN/PA1 74HC595 Pin 11 SHCP
Pin 6 OSCOUT/PA2 74HC595 Pin 12 STCP
Pin 7 Vss (GND)
Pin 8 Vcap
Pin 9 Vdd
Pin 10 SPI_NSS / TIM2_CH3 / PA3 (HS) CV/CC leds CV/CC leds
Pin 11 PB5 (T) / I2C_SDA / TIM1_BKIN Left connector Pin 7 CV/CC status
Pin 12 PB4 (T) / I2C_SCL / ADC_ETR Left connector Pin 6 Enable Output + Red (ON) led
Pin 13 PC3 (HS) / TIM1_CH3 [TLI] [TIM1_CH1N] Left Connector Pin 8 Not connected
Pin 14 PC4 (HS) / TIM1_CH4 / CLK_CCO / AIN2 / TIM1_CH2N Left connector Pin 1 Iout sense 16*(0.01V + Iout*0.05)
Pin 15 PC5 (HS) / SPI_SCK / TIM2_CH1 Left connector Pin 5 Vout set
Pin 16 PC6 (HS) / SPI_MOSI / TIM1_CH1 Left connector Pin 4 Iout set
Pin 17 PC7 (HS) / SPI_MISO / TIM1_CH2 Button Buttons
Pin 18 PD1 (HS) / SWIM SWIM Pin 3 SWIM & Buttons
Pin 19 PD2 (HS) / AIN3 / TIM2_CH3 Left connector Pin 2 Vout sense
Pin 20 PD3 (HS) / AIN4 / TIM2_CH2 / ADC_ETR Left connector Pin 3 Vin sense (Vin/16)

The buttons are connected in a strange setup where all four are on two pins.

The CV/CC leds are in serial with a lead between them throuh a 10K resistor to pin PA3, by changing the pin between Output HIGH, Output LOW and Input it is possible to make one of them on or both off.

Bottom Board Interface

The below was decoded by bal00.

Control pinouts

Right side:

  • Top four (1-4) pins are GND
  • Next two (5-6) are Vcc +5V (seems wrong)
  • 7 is connected to MCU UART RX
  • 8 is connected to MCU UART TX

Left side (Top to bottom):

  • Pin 1: Iout sense, 970mV/A + 140mV
  • Pin 2: Vout sense, 72mV/V + 42mV
  • Pin 3: Vin sense, 62mV/V
  • Pin 4: Iout control, 970mV/A + 140mV (PWM controlled, off when output off)
  • Pin 5: Vout control, 72mV/V + 42mV (PWM controlled, off when output off)
  • Pin 6: Enable control, 0V = output on, 5V = output off (Digitally controlled)
  • Pin 7: CC/CV sense, CV = 0.47V, CC = 2.5V
  • Pin 8: Connected to MCU pin 13 (PC3), unknown function

Pinouts of 74HC595 chips

There are two 74HC595 TSSOP16, these control the 4 digit 7 segment display, and possibly the leds as well. The 7 segment display has 12 pins and is controlled constantly to create a persistence-of-vision effect.

74HC595 pinout

Links

Components needed:

  • B3603 -- The unit being reprogrammed
  • CP2102 -- A usb-to-serial TTL-level
  • STLink V2 -- programmer for the STM8S microcontroller

b3603's People

Contributors

baruch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

b3603's Issues

How are the 74HC595 wired?

This is needed to be able to drive the screen, we need to know both how the '595 is wired to the MCU and how it is wired to the 7-segment 4-digit display.

Output glitch at startup

The output pin means enabled at 0V, when the unit comes online its default for the output control pin is LOW 0V so the output is enabled until the MCU boots up sufficiently to turn the output off, assuming the default is to be off.

This is an inherent limitation of the hardware and there is very little that can be done about it. The best that can be done is to optimize the software such that this glitch is as small as possible and that the output pin is configured and set as per the definition as soon as possible.

Limit number of updates to the 7-segment display

When the display is updated much faster than the persistence-of-vision rate the digits simply seem blurry especially if the numbers change back and forth. What is needed is to have a schedule to the updates and to not update the data to be displayed except on those boundaries.

The most responsive solution would be to have a timer run after an update to count 1/10th of a second and only change the data after that timer expires. This will allow changing at a maximum rate of 10 times per second but if there was no change for some time than a new change will take effect immediately.

Implement a watchdog

To prevent the case that the unit is stuck and keeps on going we need to have a watchdog reboot the unit and reset it in case the MCU is stuck either due to a software or a hardware issue.

Alert when the unit is fed below 6V

Accurate will suffer considerably if the unit is fed less than 6V and it gets pretty inaccurate once you go below 5V. The device should alert about this, it should allow operation but give a warning to let the user know he is outside bounds.

Board not responding to serial commands

I've programmed a fresh STM8S with provided code, but it looks like there is no response from board when it starts or when I write to it through serial port. CC (yellow) LED is always on.
I've tested my USB-SERIAL adapter and Intel Galileo serial port. Both working.
STM was programmed using stm8flash/STVP and ST-LINK/V2 mini.

Implement calibration

Need to calibrate:

  • Vin ADC
  • Vout ADC & Vout PWM
  • Iout ADC & Iout PWM

For the Vin a single data point is needed (no offset), but maybe using two points would help find an offset in the ADC itself

For the Vout and Iout two points are a must since the basic formula has an offset in it for both sense and control.

UART can't handle high speeds

When I tried to communicate with the unit through a script I had to put sleeps between characters being written or data was lost. The polling rate of the unit is too slow to handle the required speeds.

We need to either speed up the polling loop or slow down the uart rate to avoid such overruns.

Cannot control voltage, current, output state

The board responds correctly to setting voltage, current, etc., but there is almost no physical reaction. The only thing that changes is CC/CV/OUT LED state.
It happens not because power source, laboratory power supply is far better than cheap inverter and it still goes on with full input voltage on output.

I hope that this is the last time I submit an issue :)

How are the leds wired?

The CC/CV signal seems to come from the bottom board, how is it then relayed to the leds? How/who lights up the active led?

Manual - How to program STM8

Hello,
Can you provide some how to about the "byte options" to flash the the *.ihx hex?
I flash the STM8 with ST-LINK with ST Visual Programmer, but in the display only shows random digit from 6 to 8 in B3603 module.
I also try with your old *.ihx hex file with same results.
Please point me in the right path.
Thank you.

Use the buttons

Find how to make use of the buttons and integrate them into a UI that doesn't necessarily depend on the serial port.

Code is too large to fit STM8

After running make I get this:

CC main.c
CC display.c
CC uart.c
CC eeprom.c
CC outputs.c
CC config.c
CC fixedpoint.c
CC parse.c
CC adc.c
LINK b3603.ihx
Code is too large, it is 8570 bytes
Makefile:12: commands for 'check_size' object failed
make: *** [check_size] error 1

Set the OPT2 AFR0 bit from the code

To make everything work we need the OPT2 AFR0 to be enabled so that PWM will work on the Timer1 Channel1 and Timer2 Channel1. To make installation easier it would be nice if the application took care of that at startup rather than rely on the programmer who may have forgotten it.

At the very least we need to read it and alert if it is turned off.

Save settings to EEPROM

Currently settings are temporal and not saved, they should be saved in EEPROM so that if the unit comes back online it comes with the last common used setting. This is especially important for auto-on semantics.

It is also critical for calibration (Issue #8) or otherwise calibration will be needed every time the unit is turned on which is rather tedious.

Handle case of top board inserted in reverse

The top board can be inserted reversed and it seems to work. The ADC shows up saturated with a raw reading of 1023 and this can be detected and maybe some action taken to avoid damage in this case.

The unit was trying to feed out about 5V, nothing good can happen with that setting...

Any update on this project ?

Hi,
I received this power supply just a few days ago and it's a great little first lab bench power supply. I quite also like the DPS style power supply but they have several points that I don't really like. (One encoder instead of multiple potentiometer, user interface, button etc)
As a first step for the recommended noobs project "building a power supply from scratch" I would like to focus on the software side (how to limit current, pid loop etc). I think that making a replacement sheild for my nice B3603 cloud be a great exercise.
I see that in the readme you are talking about making a replacement sheild, still an ongoing project ? Seems like not to me on the github insights.
So Yeah, I'm french, only knew how to code with arduino and basic python3. If anyone is interested to help say hello !

When driving a current limited load CC led is not turned on

When using five 100ohm resistors in parallel I tried to set the voltage to 7V and the current to 0.01A, the voltage was at around 1V and the current at 0.04A (the PWM is not calibrated yet) but it is definitely a constant current situation. The CC led didn't turn on as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.