CV1800B, reset sequence - Page 1
Forum section: electronics / general

author: bigendian
author_rank: Regular Contributor
timestamp: June 14, 2025, 09:41:43 pm
content: Hi all,i was looking on the simplest way (minor components as possible) to respect this reset sequence,One idea is by some capacitor of different value, but seems cannot satisfy both power on and off.Any suggestion is welcome, thanks

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 15, 2025, 12:06:56 am
content: I suggest looking at the schematic of the milkV duo: to implement the proper sequencing, they have used a power switch (Q2/Q3) for the 3V3 rail, enabled using the 1V8 rail. Simple and effective.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 15, 2025, 01:32:09 am
content: Yup. See the bottom right corner on page 3 in theDuo schematics (v1.2).The 3.3V line has a high-side switch based on CJ3139K, a P-channel MOSFET in SOT723 package: maximum current 660mA, about 0.550Ω on-state resistance (Vgs≃-3.3V). Its gate is pulled to ground through 10kΩ resistor using CJ3134K, a logic-level N-channel MOSFET in SOT723 package, which has over an ohm on-state resistance when its gate is pulled to +1.6V. (The 1k/10k resistor acts like a divider, so that the voltage at the gate is +1.8V×10k/(10k+11k) ≃ +1.6V.) The 10k resistor slows down the speed at which the P-MOSFET switches on, by limiting the peak current –– remember, MOSFET gates behave like capacitors.Essentially, the generated +3.3V rail is switched off (not provided to the CV1800B), until the +1.8V rail rises. Then, the +3.3V rail is switched on, using a P-channel MOSFET as a high-side switch, limiting its switching speed a bit. The circuit relies on the DC-DC converters reaching their target voltages at a known speed, and I believe the designers simulated this, then tested this part with an oscilloscope, just to be sure; it could be adjusted by changing the three resistors.Both MOSFETs are bog-standard jellybean parts that you can substitute with similar or better ones. The N-channel one does not pass much current, but it would be nice if its gate-source threshold was closer to +1.6V, at which point the resistance can be on the order of tens of ohms without any problems, so that the switch would wait for the 1.8V rail to get close before starting to switch the +3.3V rail on; relying less on the rate at which the DC-DC converters reach their target voltages.The P-channel one passes all the current (but less than 600mA), so the lower its on-state resistance the better; its gate will be pulled to -3.3V then.I do believe something like SIL2308, an N-MOSFET and P-MOSFET in a single SOT23-6L package (3.2mm × 3.1mm PCB area), or SSM6L14FE, similar in a single SOT-563-6 (1.6mm × 1.6mm PCB area), would work.I'd still simulate (in KiCAD) the 1.8V rail ramping on just to be sure, to see when the P-MOSFET switches the +3.3V rail to the CV1800B, adjusting the resistor divider to get a trigger point voltage I'd trust. I'd probably also add a 100k resistor between the P-MOSFET gate and source, to ensure the gate is pulled to source when the N-MOSFET does not conduct.I do believe the power-off sequence is controlled by turning of the 3.3V DC-DC converter, so it starts dropping first; the 1.8V and 0.9V converters use 3.3V as their input so they should drop out later, only after 3.3V has dropped below their output voltages, especially as they have plenty of capacitance (44µF on 0.9V, 20µF on 1.8V) on their outputs.

author: bigendian
author_rank: Regular Contributor
timestamp: June 15, 2025, 08:12:41 pm
content: Quote from: Nominal Animal on June 15, 2025, 01:32:09 amThanks a lot,so, 2 mosfet the circuit manages properly the power up sequence only.So i am wondering: could the circuit be simplified by an RC on 1.8, with a proper C in a way that 1.8 reach target value _before_ 3.3 ?

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 16, 2025, 01:14:06 am
content: I don't think so, for the simple reason that the 1.8V and 0.9V rails carry a LOT of current; the schematics say up to 2A.They draw their current from the 3.3V rail (3.3V) before the dual-MOSFET high-side switch, which is why the high-side switch only needs to pass < 0.6A or so to 3.3V_PREI rail; 3.3V_PREI is only used for the CV1800B, and probably only for its peripherals like I/O pin drivers, USB, SDIO, and so on. Internally, CV1800B probably draws most of its power from the 1.8V and 0.9V rails.I'd love to do my own CV1800B or SG2002, but me just hobbyist scared by BGA. (I have some Milk-V Duos and Milk-V Duo 256's, though.) I personally might even use the high-side dual-MOSFET circuit twice: in the 1.8V rail so it only comes on after the 0.9V rail is high enough, and on the 3.3V rail so it comes on after the 1.8V rail is high enough. It's just four MOSFETs and some passives, after all.In my own use cases, I'd have just the USB (2.0 HS device), 40-pin and 50-pin 0.5mm pitch FPC connector footprints for BuyDisplay displays using ILI9341, ILI9488, and ST7789 variant controllers, a step-down current-mode backlight controller with PWM control at > 60kHz (these displays tend to have backlight white LEDs in parallel, so around 3V forward voltage, and 40mA to 120mA current), a microSD socket, perhaps the 10/100 Ethernet, and whatever GPIO pins left over for a few buttons or rotary encoders. They'd make forreallynice human-machine displays and Linux USB-controlled auxiliary displays. Since these are at least palm-sized, there is no need to cram everything in minimal area; there'd be plenty of PCB space.(In other threads, I've described some of theprogramming shenanigansI like to do to generate the output graphics for up to 320×480-pixel panels at 16-bit color, including alpha blending and indexed color techniques I do on 32-bit architectures. CV1800B and SG2002 are RV64GC, or 64-bit RISC-V, so they might let me do even more of those, perhaps up my game to 30-bit RGB with 18-bit RGB666 output.)

author: brucehoult
author_rank: Super Contributor
timestamp: June 16, 2025, 06:47:04 am
content: Quote from: Nominal Animal on June 16, 2025, 01:14:06 amDuo is similar size to a traditional 8 bit MCU in DIP :-)Boards with the BL808 (which also has C906 core, though only at 480 MHz) seem to be a bit smaller e.g. Sipeed M1s Module. The CV1800B seems better documented though.QuoteDon't forget the 128 bit vector unit.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 16, 2025, 07:18:34 am
content: SipeedLicheeRV Nano-B(SG2002) is just 23mm × 32mm!And SG2002 is not BGA, it is a 0.35mm pitch 9mm×9mm 88-pin QFN package; such a tiny pitch makes it outta my reach.Interestingly, it uses a TMI7003C power management IC for generating the 3.3V, 1.35V, and 0.9V rails for the SG2002, and a low-current linear regulator for the 1.8V rail for the SG2002. Obviously, its power requirements are different from CV1008B, but this power management IC has separate ENABLE lines (that only draw about a microamp) for each rail, andthesecan be sequenced using voltage dividers and RC low-pass filters, or even using CMOS logic.That suggests that another option for CV1800B power sequencing would be to use a triple switchmode IC like TMI7003C (from USB 5V to 3.3V, 1.8V, and 0.9V), and control the power-on/power-off sequencing via the three EN lines. Or, if one uses separate DC-DC switchers for the three rails, then use ICs with ENABLE output control.(In fact, if we look atTeensy 4.0schematic, it using NXP i.MX RT1062 cross-over processor with somewhat similar power sequencing issues explainedhereunder Power Up Sequence, U2/MKL02Z32VFG4, the proprietary bootloader helper MCU, handles both the correct power up sequence, as well as takes over the RT1062 via JTAG when the PROG button is pressed. This way, everything on the RT1062 is under developer control, but JTAG/SWD debugging is not available. When the programming button is pressed, the bootloader uploads the actual bootloader into RT1062's RAM, reconfiguring USB endpoints et cetera, making it a very nice development board for RT1062. Some dislike the lack of JTAG/SWD debugging interface, though. Anyway, if one has any kind of secondary MCU powered from the 5V rail with the CV1800B, even one of the ultra-cheap Padauks, those could definitely handle the DC-DC switcher EN sequencing – on, and off – too. Maybe add timer or temp measurements, to auto-power off the SoC if it gets too hot or draws too much current? I dunno, I always over-engineer my stuff.)

author: brucehoult
author_rank: Super Contributor
timestamp: June 16, 2025, 08:32:11 am
content: Quote from: Nominal Animal on June 16, 2025, 07:18:34 amOh yes, I'd forgotten that one.When a ready-made board solves all the problems and doesn't cost much more than the chip, and has a breadboard-friendly (or TH PCB) pinout, it's hard to see why you would not use them.Seeed Studio also has the very small Xiao series, from the original with SAMD21 (CM0+) to ones with ESP32-C3 (RISC-V) to RP2040 (CM0+) to nRF52840 (CM4F), though they're all pretty low clock speed.QuoteThe 3c ones are OTP. If you want flash they're no cheaper than a CH32V003 or PY32F002, but much much worse in every way -- 64 *bytes* of RAM, 1k instructions vs 2-3 KB RAM and 8000 (RV32 C) - 10000 (CM0) instructions.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 16, 2025, 03:46:01 pm
content: Neither the CV1800B nor the SG2002 are BGA packages, they are QFN. Although with a 0.35 mm pitch.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 17, 2025, 08:47:47 am
content: Another option would be to use aTI LM3881powered from the input 5V rail, with three P-channel high-side MOSFETs controlling the 0.9V, 1.8V, and 3.3V rails to the CV1008B.The reason I mentioned a Padauk, is that PFS122-S08 is ~ 0.08€ apiece, supported (beta) by the Free-PDK toolkit, has 12-bit ADC, 6 I/O pins in SOP-8, and can run from the 5V input rail. LM3881 is purely time-based, but with a much cheaper Padauk one could use one pin for power on/off control, three to control the P-channel high-side MOSFET gates directly –– make that one P-channel (for 3.3V), and two N-channel (for 1.8V and 0.9V), since the gate will be pulled close to 5V ––, and two to sense the voltage on the 0.9V and 1.8V rails, leaving one pin free for power on/off control. See attached schematic.R1, R2, and R3 ensure the gates are pulled to ground/5V, so that until the PFS122-S08 drives its outputs, the MOSFETs will not conduct. C1 is a supply bypass capacitor. R4 and R5 ensure that even in the case of a programming bug, PFS122-S08 won't source or sink more than half a milliamp to/from the 0.9V and 1.8V rails. C2 and C3 ensure the ADC can sample the rails properly.Since the ADC is ratiometric to the 5V line, it might make sense to use a low-dropout linear regulator to say 4V instead. The N-channel MOSFETs would have Vgs=2.2V (1.8V rail) and Vgs=3.1V (0.9V rail), and the P-channel MOSFET to Vgs=-3.3V (3.3V rail) or so.

author: brucehoult
author_rank: Super Contributor
timestamp: June 17, 2025, 09:16:38 am
content: Quote from: Nominal Animal on June 17, 2025, 08:47:47 amOMG it's got twice the RAM and code space of the famous 3c Padauk! And flash.System Features 2KW MTP program memory (programming cycle at least 1,000 times) 128 Bytes data SRAMBut it's still an awful 8 bit PIC ISA that is very compiler unfriendly, with a maximum 8 MHz clock speed.I don't get why anyone would voluntarily use it when there are both Arm and RISC-V 32 bit chips in the same package for essentially the same price, with 6x higher clock speed, 16x or 24x more RAM, 4x or 5x more program space (and much more powerful instructions), and with amazing compiler support from gcc and LLVM.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 17, 2025, 03:15:07 pm
content: Note that if even a 0.35mm-pitch QFN looks intimidating for hand soldering (and I wouldn't blame: I would actually take a 0.8mm BGA any day compared to a 0.35mm QFN...), you could consider using the Duo stamp-like module which has castellated holes, which should be much, much easier to hand solder. Of course, it's bigger than just the SoCs, but it contains a SG2000 (so with 512 MB of RAM), a WiFi/BT chip, and 8 GB of eMMC. For about $10-$12.You can have a look here:https://milkv.io/docs/duo/getting-started/duo-module-01

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 18, 2025, 05:18:02 am
content: Quote from: brucehoult on June 17, 2025, 09:16:38 amI can buyPFS122-S08 for $0.08 per IC in batches of per 5 at LCSC, that's all.As a voltage supply supervisor as shown in my schematic, running a power on sequence, staying quiet until told to shutdown, then doing the shut down sequence, then staying quiet until told to start up, and repeating this from the beginning ad infinitum, the code is really, really straightforward. I wouldn't mind having to write it in assembler, although C would be nicer. To work for this, the MCU does need ADC and to run from a 4V to 5V supply, and have 6 or 7 I/Os (because it would be nice to have separate inputs for "please be on" and "please be off").Thinking further, a CH32V003F4U6 (RV32EmC) is just $0.28 apiece at LCSC in batches of 5, and would fit even better (easier control lines, optional outputs for error indicators, maybe some I²C/TWI for temp sensors for shutdown due to overheating, or perhaps some kind of battery control with poweroff notification to the SoC before running out). The package is QFN20 (0.5mm pitch), so would be a pretty good practice for hot plate + hot air soldering practice as well. I do have a cheap hot plate (56mm×56mm, 65W USB PD) and a JCD 8898 hot air gun, and LCSC does sell cheap MCUs in QFN packages with 0.5mm pitch I can find OSHW dev boards for, so this might actually be within my reach. With BGAs like NXP MIMXRT1062 (and the SG2000 chip used in the Duo Module), it's not just the soldering, it's also the 6+ -layer PCB design those need that makes me doubt myself.For the 4.0V–4.2V LDO (to make the ADC readings "absolute"), something like Toshiba TCR2EF41 4.1V LDO in SOT23-5 only cost 0.11€ in singles at Mouser. TI TPS7A2042PDBVR 4.2V LDO costs about 0.32€ at Mouser and $0.24 at LCSC in singles. Both only need ceramic caps (2×1µF, third one for MCU).For the P-ch MOSFET, PMV30XPEAR in SOT23 is 0.14€ in singles at Mouser, $0.19 in sets of 5 at LCSC: Rds(on) ≃ 40mΩ at Vgs=-3V, and can handle over 3A of current.For the N-ch MOSFETs, DMG2302UKQ-7 in SOT23 is 0.14€ in sets of 10 at Mouser, $0.14 in sets of 5 at LCSC: Rds(on) ≲ 70mΩ at Vgs=+2.3V, and can handle over 2A of current.Samsung CL10B105KB8NQNC = 1µF X7R 50V 0603 are something like 0.03€ – 0.06€ apiece, so throw in something like 0.40€ for the passives needed.By my count, this amounts to a BOM of around 1€ in batches of five or less. Above, I limited myself to SOT23 MOSFETs, because to find the actual Rds(on) at the Vgs used, one has to check the datasheet. I'm sure there are even better+cheaper MOSFETs in other packages.Is it utter overkill for power sequencing a 6€ – 10€ SoC? I dunno. I like to overengineer things, and relying on timing only (as in LM3881) "feels" iffy to me. Being just a hobbyist, I don't have the sense of what is appropriate/warranted at all.At Aliexpress, Chipboard Development Store sellsfive CV1800B QFN chips for under 30€including shipping and VAT, so that'd be 6€ apiece.Quote from: SiliconWizard on June 17, 2025, 03:15:07 pmNice! And there are variants without WiFi/BT or eMMC (which I don't really need). I can find these at AliExpress for 22€ – 24€ including shipping and VAT 25.5%, too.Unless I'm mistaken, the module only requires 3.3V, and handles all the power sequencing and 0.9V and 1.8V rail voltage generation itself within the can.(I know Arace is cheaper, and I've bought from them, but for some reason the customs here keeps the packages for weeks without telling anyone, even with prior customs declarations and so on (easy to do online here in Finland with the information Arace provides). I do blame Finnish/EU customs/post policies myself.)TheDuo module 01pinout says thatXGPIOC[0..21]are exposed (and theSG2000 does not expose 22..31), which means the full XGPIOC port is aneminentlyDMA'ble GPIO port. Theoretically, even for a 22-channel logic analyzer: let the weaker RISC-V core DMA the GPIO pin states at high frequency to a small ring buffer, copying that data while combining duplicates with a counter in the high 10 bits to another buffer for the faster core to consume. I wonder how fast this could sample the pins? Testing this with some NXU0104 dual-supply voltage translators (fast, 0.9V to 5.5V) could be interesting, if one had such needs.. Thus far, I've managed with my el-cheapo Sigrok Pulseview Ez-USB FX2 (8-ch 20 MHz sampling) doodad.I need to do a LibreOffice Calc sheet of the pins the module and QFN ICs expose, and their alternate functionalities. For example, I already noticed that pin 29 on the Duo Module, SD_PWR_EN, is actually also XGPIOA, even though it is not listed in the Milk-V pinout.

author: brucehoult
author_rank: Super Contributor
timestamp: June 18, 2025, 08:34:11 am
content: Quote from: Nominal Animal on June 18, 2025, 05:18:02 amThe 003 (2k RAM, 16k flash) is original QingKe V2A core which is RV32EC. For "m" which is multiply but no divide (so like Cortex M0) you need the 002 (4k RAM, 16k flash) or 004 (6k RAM, 32k flash) with Qingke V2C core which also has upgraded ADC (12 bit).The 002 and 004 are pin-compatible with the 003. They run on nominally 2V-5V, whereas the original 003 was only 3.3V to 5V (actually 2.7-5.5, though the datasheet says ADC performance declines under 2.9V)There are also other newer models, but it looks like the 002 and 004, which were announced in May 2024, are now available in volume production.Some discussion from a year ago when the 002 and 004 (and 006) were announced:https://www.eevblog.com/forum/microcontrollers/new-low-end-ch32v-microcontrollers-from-wch/

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 18, 2025, 03:15:15 pm
content: Quote from: Nominal Animal on June 18, 2025, 05:18:02 amYes, this module is currently 7.95 EUR only on Arace. Too bad about the customs issue.OTOH, they are out of stock for the SG2000 and SG2002 themselves but the CV1800B is available.

author: SiliconWizard
author_rank: Super Contributor
timestamp: June 18, 2025, 03:34:49 pm
content: Just a quick note on power sequencing for these chips: milkV's implementation on the Duo board is like so, as we discussed:VIN -> 3.3V buck -> (1.8V buck, 0.9V buck, 3.3V power switch -> 3V3_PREI)The 3.3V power switch is controlled from the 1.8V rail with a threshold, basically. Not very accurate, but does the job.They may have cascaded the 1.8V and 0.9V bucks from the 3.3V buck for VIN(max) reasons: didn't check the datasheets (yet), but it's likely that the two bucks they used for 1.8V and 0.9V have a more limited VIN(max) than the 3.3V buck, so that makes the design more flexible in terms of VIN (you can power the board with an external VIN). If not the reason, maybe they calculated that the overall efficiency would be higher this way - which is not all that obvious, again, need to check out the datasheets and see if the cascaded efficiency of the 3.3V buck with each of the two other bucks is higher than using all 3 bucks from VIN directly (given that efficiency will be higher if (Vin - Vout), of each buck is smaller).If the Vin(max) of all 3 bucks allows, I would rather not cascade them and power them all from VIN directly.To simplify things further, I would not use an extra power switch, but would select a buck converter with an enable pin and a power good output pin, and control the enable of the 3.3V with the power good of the 1.8V one.Not all buck converters have a power good output, but most of at least an enable input. Then if every cent matters, one can analyze the BOM cost of picking an appropriate buck with a power good output compared to adding 2 MOSFETs and a few passives, taking also more PCB area.Using a MCU to do this would be completely overkill, but for more intricate power sequencing needs, that could be an option. There are dedicated chips with a number of integrated buck converters and sequencing abilities, but those tend to be a bit expensive.

author: brucehoult
author_rank: Super Contributor
timestamp: June 19, 2025, 01:06:21 am
content: Quote from: SiliconWizard on June 18, 2025, 03:34:49 pmOverkill is the 'merican way.But seriously, with MCU prices like these, a 16 or 20 pin MCU could replace pretty much any 7400-series chip as long as you're ok with µs propagation delay instead of 10ns. Just keep a draw of one kind of chip (and a library of binaries or source code ready to flash) instead of a couple of dozen different drawers of chips you seldom use.It would be easy to make a driver library/framework that just let you enter in a file...Code:pin4 = pin1 ^ pin2 ^ pin3;pin5 = (pin1 & pin2) | (pin1 & pin3) | (pin2 & pin3);... or for that matter ...t = pin1 + pin2 + pin3;pin4 = t & 1;pin5 = t > 1;You could mix & match the logic functions as much as you wanted, just like an FPGA.Actual small FPGAs would be even better, as you don't even sacrifice propagation time much, but even tiny PLDs like ATF16V8B (15ns) don't seem to have dropped under about a dollar.

author: Nominal Animal
author_rank: Super Contributor
timestamp: June 19, 2025, 09:51:53 am
content: Me no 'murican! I only overkill when it comes science or engineering. I'm actually very soft and squishy otherwise.Quote from: SiliconWizard on June 18, 2025, 03:34:49 pmProper soft and hard shutdown, with the SoC getting a shutdown request via I/O, doing OS-level shutdown, and just before halting using I/O to indicate it is ready for poweroff, is the thing I like most here. (With an external MCU, I like the idea of using an UART for this, at some relatively high baudrate if the PCB traces allow, with power on and power off buttons purely soft and connected to the MCU. That allows the keep-pressed-for-5-secs style forced poweroff, too.)CV1800B, SG2002, and SG2000, also have a DesignWare 8051 core running in the RTCSYS power domain, including 8k of SRAM, but after reading some of the datasheets, I don't think there is any sensible/robust way of using it for power sequencing. Even timing-based power sequencing is better solution in my opinion. (I do find the 8051 core very useful for other stuff, though; I've always been comfortable using multiple asymmetric cores in a system.)CV1800B only needs 0.9V, 1.8V, and 3.3V rails, whereas SG200x also use a 1.35V rail (for DRAM). I misread the budgeted currents in the Milk-V Duo schematics I listed earlier; apologies!The total power budget is 2.5W to suit standard USB 500mA @ 5V on the Milk-V Duo (CV1800B), with1220mA budget for 0.9V; ENABLE has a 4.7kΩ+1µF (fc≃34 Hz) RC filter from 3.3V20mA + 20mA + 20mA + 60mA + 150mA = 270mA budget 1.8V; ENABLE has a 20kΩ+1µF (fc≃8 Hz) RC filter from 3.3V40mA + 20mA + 55mA + 100mA = 215mA budget 3.3VThe problem with this in my opinion is that while the 0.9V rises some 10ms before 1.8V (based on quick simulation, the ENABLE threshold being 1.2V or so), the 0.9V is also disabled some 14ms before 1.8V is! I don't like it, but it obviously seems to work, since it is what Milk-V Duo does. (Edit: The datasheet says the sequence between 0.9V and 1.8V isn't critical.)There are triple switching controllers likeTI TPS65261-1that can do time-based power sequencing internally; that one uses a fixed 1024-cycle delay for the beginning of the ramps, and if MODE, EN1, and EN2 are all tied high, first rail will be brought up first and taken down last, third rail brought up last and taken down first, and the second rail in the middle. Since the frequency is set using a single resistor, the delay varies from 0.5ms (2 MHz) to 4ms (250 kHz). As I know zero about switchmode design, I do not know whether it would be a good choice for this particular use case, but at least such triple-rail switching regulators do exist. At Mouser, they cost about 1.86€ apiece in sets of ten. I suppose the inductor and inductor choice has a big impact on the total BOM price, though, looking at just the switching regulator price isn't that useful.