This reminds me of the early days of STM8, ESP8266 and a few others Community making better HALs, figuring out all of the little quarks, even making better compilers, i very much live for this
What is stm8 community HAL? Never heard. Arduino? Haha. I program stm8 from 2012. In that time stm8/stm32 programmers used only registers and never used SPL and and not accepted ST HAL monster at all. I still use programming on registers ever with stm32. It is more easy for me to open pdf uc manual to see registers that I don't still know and to write what I need. Instead of to understand some HAL with huge overhead of size and and function calls (prepare call stack, jump, take apart call stack and so on instead of one uc command :))). And I have fast and size efficient firmware )). Now playing with HC32V. Some copy of stm32 (who doubted?) same registers just renamed and stm32 SPL. You can take 10 years old info about stm32f103 and SPL and you are HC32V programmer what you see in this video. It is stm32 SPL in this video. Same toolchain gcc (just riscv version) and openocd. Nothing new and interesting to discuss.
I just don't get what the "excitement" is about with this. I DO understand why chip makers want to use RISC V, that's obvious, since it's "free" (open-source) IP. They neither have to develop it themselves, nor license it from someone who did. But why excitement from end users? There shouldn't be. It's just ppl like this guy in the video, who seems to be an excitable type (easily gets excited about ANYTHING). END USERS are f__ed, because they now have to find a way to program it, and figure out all the little quirks. Wow, another new IDE?! Oh, boy, can't wait. I "get" to learn a whole new IDE.... And buy (separately) a "programmer / debugger" that isn't, no it's just a USB to serial converter. No debugger. So this "exciting" new uC can do what? Uh, well, it can blink a single LED. So what? Can it run a FreeRTOS? Doubtful, and who wants to put all the time & work into that for a quirky little uC? Not me. I'll stick with an "expensive" ESP32 or something that has many uses, it's well-documented, fast, has lots of onboard peripherals, and has LOTS of uses for actual things besides blinking one LED. When I develop something for a uC I want it to be functional, flexible, and esp do more than one thing. (Ok, I know that's not fair, it can prolly do more, but we'll have to wait to find out. Someone else will have to figure it all out after uncovering all the quirkies. I know.)
@@jeffro. good for you i guess. not every project needs Wifi, bluetooth or huge amounts of peripherals. If it did, these cheap and small MCUs would not even exist.
On some microcontrollers you just have to write to one 8-bit wide right to an address to toggle a bit in a register. Such as in PIC32 or in STM32. The code becomes something like loop: st r0,toggleaddr; jmp loop with a few load immediates and stores before to enable the port, map it to pins and then setup the port ddr. Oh and a little bit of fiddling with clock registers beforehand too, to select the clock source and turn off dividers etc. Nothing too involved, all you need is load register immed, store register mem and jump unconditionally. If you don't have the toggle location built in the hardware, you need to do a little bit more. Maybe there are bit manipulation instructions, maybe you're going to have to keep the toggle value in a register and use a xor instruction. However it is, you don't need to know very much about RISC-V architecture, or any other architecture to do this yourself. Probably the instruction summary is enough. And really it's more of a question what amenities there are in the hardware of that microcontroller than the instruction set of whatever core.
WCH-LinkE is not a generic USB to serial interface. It is a CH32V305 microcontroller implementing the single wire debug protocol used on the V003. Yes, technically that is serial, but it isn’t just a pass through buffer.
@@donvukovic7440 No. We’ve been asking WCH for specs for a while. If there were open specs I would have implemented an open programmer by now. My goal until specs are released is to reverse engineer the wire protocol and implement my own debugger. I just haven’t had time to do it yet.
Since it's using an external toolchain, it cannot build something that is not saved to disk. Therefore, you need to save the file before build. The hex file not being rebuilt is either you forgetting to save the source code or a bug in the vendor SDK ("make" target dependency missing).
But why doesn't it save all the currently opened files whenever a project build is started by default like most proper IDEs do? Is it just another strange Eclipse quirk or is there some reasoning behind that?
@@Kirillissimus I set every IDE I use to query if files are unsaved before building, as opposed to saving automatically. I find it useful as a guard against accidentally fat-fingering the build key and having it automatically save files before I'm ready for it.
@@zoobab28 the issue here is that they probably didn't fully documented the chip or the API or the programming interface to allow to just completely avoid their IDE.
@@PainterVierax it's all fully documented, their (very minor and not needed) patch to gcc and custom OpenOCD are released, the protocol is documented etc. And the chip manual is very good.
Something like 5000x to 6000x the speed of ENIAC. About 50x the RAM capacity of early ENIAC (which had only the 20 registers), and 10x the capacity of ENIAC near the end of its life after some core memory was added. Program size is very hard to compare as ENIAC used plugboards to control it.
MounRiver is the short for mountain and river, it means 天圆地方,山河相依。If you translate it directly, it means, round sky and square earth, mountains and rivers depend on each other.
Chinese is a fascinating language. I really want to learn. It is becoming a must for hardware and software developers anyways. But I’m not able to find good resources on the internet.
@@ozdemirsalik no, all software people know that china does not include software as the 7 industries that it will take over the world with... software is for stealing copyrights and exploiting.
WCH is one of the only chinese electronic companies that I like. They make a lot of niche but useful to hobbyist components like a USB host that uses parallel Intel bus.
Wrote around Christmas a riscv emulator for Python, 32bit CPU, RV32i ISA and RV32M extension support. The base instruction set(RV32i) is comparable with something like the older AVR attiny instruction sets, very barebone, but it does the trick. For example it doens't have MUL or DIV in the base set(RV32I), that is in the RV32M extension. So yes it can be made very cheap,
Well, adding multiply to a hardware alu immediately complicates the design. You end up with probably a doubled data buss and logic to handle it in the registers, definitely multi clock operations because of the timing delays and logic to handle it. And a 32bit multiply circuit is rather big on it's own (you can pack in more memory or features if you ignore it). For a tiny entry level chip like this, not including multiply is probably the right way to go.
I like these part selection/catalogue shopping videos. Honestly I find it to be one of the most annoying and time consuming parts of building a project sometimes. There's just so many options lol Great stuff, keep it up!
They've made it just so easy compared to my old school days of using to burn a UV EPROM and plug it into a socket on the PC board. Back in those days too, you had no sample code and had to create the include files yourself... oh joy!.... pre internet days as well, so you had to get a printed reference manual.... oh.. and you had to write your code in assembler (machine code)... without any debugger!
Did a fun project back when I was in 8th grade; decided to build a cross assembler for the NEC uPD78C10 on the BBC micro... the biggest challenge was actually understanding the "japlish" manual for the thing, it being written in a rather tedious language (not sure if not being a native English speaker myself was a hindrance or helpful!).
I started with the 4004 which we paid $480 for and another $100 for the translation chips (4001 & 4002) from Pmos to Cmos or ttl. It's amazing they sell them for sub $1. Obviously they will go broke in a real economy as the FAB can't be paid off with no profit. I would start with buying the hardware and writing a stand alone compiler for the RISC V using my PC. Sounds like a good project for me in the future. Cheers - great Blog -
Every time you were building the project, it was building the two (or more) projects you had open at the time, so taking longer. It's quite annoying that Eclipse comes with Ctrl-B set as "Build all projects" instead of "Build current project". It's one of the first things I change when using a newly installed Eclipse based IDE.
As usual, software support is king. AFAICT, the easy part is making the silicon, the hard part is building the community support, tool chain, software experience, etc.
@@asm_nopI just used Arduino IDE for my Pi Pico project (filter wheel changer for a telescope), there was nothing difficult about it I just followed the Pi foundations instructions.
Very interesting, Dave. I have a couple generations of SiFive RISC-V SBC's. Nice to see micro-controllers appearing at a good price point. Do a SRCH for "cnlohr on risc-v" here. He wrote an RISC-V emulator in C and used buildroot to get the 400-500 lines of RISC-V C emulator to boot linux and give you a command prompt right on you linux PC. It is freaking amazing.
BTW, he provides all the material and I was able to download. build and run everything myself relatively quickly. Building the Linux kernel and other stuff with the emulator took a little time.
I love Eclipse, mostly because I can rightclick almost any identifier in a project and hit 'show call hierarchy', 'go to declaration', or other neat code-parsing tricks.
I ordered the evaluation kit and finally received it. Only issue I had was to get the MounRiver IDE to generate a hex file. I dug into the Settings an found the setting under "GNU RISC-V Cross Create Flash Image/General. I selected Intel HEX in the drop down and all is well. Thanks for the Video I was looking for a device that did not require the investment of the Keil development software. Thanks to you and WCH!
It's crazy how far things have come in the last 10-15 years. The last time I programmed a micro in anger was an AT90S2313 with all of 2K flash and a whopping 128 bytes of SRAM, you practically *had* to use assembler in order to cram all you needed into that space, it's nice to have the luxury of a high level language for a chip at an affordable price. I can imagine there are some old grackles on here that will be rolling their eyes and going "Baaah! back in my day we had to write everything in ones and zeroes, and before that we didn't even have zeros and had to use the letter 'O'" (to paraphrase a Dilbert cartoon)
hope many manufacturers move on to this cheaper hardware. thank you dave for showcasing this. might as well jump to this risc-v bandwagon if it becomes easily available for cheap
This IDE takes me back to the Codewarrior times when you had a slick win98 Style environment, before the migration to Eclipse. There was a P&E IDE for the QT8 microcontrollers that were a breeze to use, I still have the Cyclone. Now back to my grave.
that hardware abstraction API looks like what I had to work with when I did STM32 work. the first RISCV cores I saw were placed in STM32 clones. makes sense that they stick with established APIs and aren't just pin-compatible physically but also register-compatible to existing devices.
The prices is completely crazy. I teach EE131 (first year Digital Electronics) at a local university and basic digital ICs cost more than that. It is important they understand digital logic; but, the only place they are likely to ever use it is in an FPGA design. I recently helped someone debug a Space Invaders Arcade Game and most of it is done with MSI logic (counters, etc.) and only one Microprocessor (which probably cost more than all the other ICs combined). Things have certainly changed.
Yeah with microcontrollers and to some extent FPGAs becoming as cheap and small as they are it doesn’t make a lot of sense build something up using digital logic chips. Microcontrollers are just that versatile now, you can use them for implementing a single gate or you can implement a complex control system. Their only downside really is speed, they are usually quite a lot slower than the propagation delay of a gate but most common applications now aren’t relying or dependant on the speed of individual gates unless it is in a very high performance or high speed system, in which case you probably have more going on than just a single gate and you are probably better then just using an FPGA.
When I at college learning electronic engineering we had to buy pic16f877A wich was the stronger part less prone to burn on our hands, it was 8-12$ then now should be about 25$ thanks prices are relatively cheaper now, but said parts on 10c even having free ide (i learn with proprietary pic ask and PICC both pain in the ass and expensive for non educational projects) kudos
I took digital logic twice, once at a small university where it was part of CS, but actually offered by the physics department (and I TA'ed that course for a couple of years after I took it) using discrete 7400 logic chips. I took it once again after I transferred to another larger university to switch to COMPE from CS (and in eningeering they wouldn't transfer any courses beyond 1st year courses), where it was all FPGA based. The discrete logic chips in the breadboard was more memorable and fun, but took hours of plugging wires into the breadboard, and troubleshooting if you made a mistake. The FPGA version was way faster, but less memorable and less fun, and less "hands-on" - I always did the labs the night before at home, simulated it, and basically loaded it up on the FPGA board and demo'ed it to the lab instructor in the first 5 minutes and left for the afternoon (to go work on the endless stream of homework from other courses).
I was browsing these guys a few wees ago and I thought they had quite the nice selection of low cost MCUs. BLE, networking, motor or display driving. Basically if your main MCU is missing a feature or you need something very low power they have something that will fit your needs.
Amazing. I think that the expression "cheap as chips" now more accurately refers to integrated circuit chips, not potato chips - potato chips now sell for about $5-$7 per bag here in the US.
The STM8 standard I/O library was fairly incomplete. i re-wrote much of the library before fiding someone else had done exactly the same. ST (like AMD) are great at making silicon, but not so good with software. So I wouldn't be too surprised to see ST make a RiscV implemementation, as they need not worry about software. The kings of the MCU software have been PIC, but from what you show me, this isn't too far from PIC in terms of ease of use. This architecture (looking at Mhz) perhaps sits between STM8 and STM32. The STM32 is ARM based, and ST could save money on licencing costs, so we could see a merge in those low and mid-end MCU offerings in a Risc V product line. A scalar lower speed to replace STM8 and a higher clock and instruction pipelining and other logic trick superscalar basic instruction set RiscV to replace STM32 with the same tool chain accross the product line.
Yes, please do a video regarding the debug options! Really hope there is a way to debug it line by line, but not really optimistic since a lot of the more expensive chips don't have it either.
The build system probably doesn't have the hex file as a dependency. How to fix that depends on what build system eclipse is using for your project .. its own, make, or maybe something else.
Damn, that's a *lot* of value for just 10 cents! I'm already even somewhat familiar with the Eclipse IDE, since I like to use STM32 MCUs, so it should be a breeze for me to start using these as well.
Where do you source parts ? I need whole tape of STM32s and there is none on the market right now. Do you think that big manufactures are getting special priority lead times? Last time I checked the lead time for ANY STM32Fs was 500days.
@@webkar Currently nowhere. They are basically all overpriced and/or completely unavailable everywhere I look. I'm just biding my time and keeping an eye on worthy alternatives.
@@JamilKhan-hk1wl almost every MCU manufacturers, even the historical survivors, are jumping to RV cores. There are some pin compatible replacements of chips like the STM32F103 for years but the issue right now is availability.
Hi, Dave. Long time Eclipse user here 😊I haven't done development in C programming language for some time, but the general M.O. of IDEs is to automate some (or most) of the complex software process/workflow. But the assumption is that the developer using an IDE is aware of (at least most of) the steps in the workflow. To save the time it takes to build the actual binary (compiling, linking, optimizations, etc.) most IDEs support incremental compilation where only the modified files are compiled and then linked with a previously compiled/built pieces that were cached. But given the number of moving parts the build workflow has, even without the incremental features, the "Project >> Clean" action is there to take care of the famous "my tool is stuck" issues. An IDE can be configured to automatically save any modified editors before actually performing the build, so you might opt-in for that one. Or even to automatically save modifications to a file when the keyboard input "stops long enough". Also, "automatically compile/build on save" is an opt-in feature of some IDEs. But if one considers these automation features and the complexity of the workflow, one could conclude there is no "incremental build" - building the actual deliverable binary involves much more CPU/RAM/DISK intensive activities compared to compilation, so it doesn't make sense to start-and-clean-up-on-cancelation every couple minutes on auto-save. That is most likely the reason you didn't always get the HEX file after "incremental build". The Eclipse itself is a customizable and modular software platform, i.e. for creating any kind of desktop software, but it is most widely known as a Java/C/C++/PHP IDE thanks to the modularity. Years ago I watched a National Geographic documentary on NASA Mars rovers where it was explained how NASA plans a rover's route, and the software they were using was Eclipse with custom plugins 😁
Bit of a mangled RISC-V explanation there. It's indeed just an ISA, which means that you either get an open source core that implements this ISA, or you pay someone else (like SiFive) for the core, which means that you still pay license costs, especially for any IP blocks that are likely to be added to the processor.
Well yes of course, you could pay a license fee to use someone elses pre-built core, but that's not really the point of a major manufacturer for example making a RISC V chip, they'd do it in-house so they never have to pay a license fee.
This mc is 32bit replacement for stm8s003, has same pinout. stm8s003 cult microcontroller. Nuvoton did it's x51 N76E003 pinout compatible, now ch32v003.
I'd love to see how good (or bad) the ADC is. There are some absolutely brain-dead examples of ADC uC implementations (be that design, software implementation or hardware). I reckon you can tell a lot about build quality by how well or poorly the ADC performs because it's one of the hardest things to implement with good results.
I've used the Espressif ESP32-S2, (RISC-V) and the ADC was TERRIBLE -- and the serial UART was problematic. I ran the same code on a SAMD-51 (ARM4F), and everything worked beautifully. It was impossible to lineraize the ESP-32's ADC, even with a lookup table, whereas the SAMD-51's was quite linear without any correction. Also, I had to stuff a byte out at start-up on the ESP32-S2, or it would always eat the first byte, throwing everything off by 1 byte.
I just redesigned my little LED controller around a ESP32-C3, that variant is also based on Risc-V. Definitely gonna check these out too, not only is it cool that Risc-V is an open architecture, availability of Chinese parts seems to be a lot less variable than western parts have been recently (one of the reasons I switched my design from a SAMD to the ESP32C3..."supply chain").
I used the ESP32-S2, and the peripherals (particularly the ADC, DAC, and UART) were terrible. On the S2, there was no way to linearize the ADC, even with a look-up table. The SAMD-51, running the same code, worked perfectly, no tweaking needed (though you can actually tweak offset and linearity in registers on the SAMD-51's ADCs. The RP-2040 has a wonderful manual, though the chip has some bugs (the manual writer apologized profusely for one of them). The SAMD-51 has a decent manual. The ESP32-S2 has a pretty lousy manual (unless they've redone it recently).
@@Johnny.Fedora Yeah I've used the ADC on the original ESP32 and wasn't impressed, but for this device the only thing I'm using ADC for is measuring the battery and that can be pretty rough. I'd expect it to be the same IP block/fab process on the C3 so probably no better. C3 doesn't even have the DAC, and the UART is fairly tertiary for what I'm using it for, I expose the pins on an expansion header but for the most part I just use these things for making small lamps/simulated candles from turned wood (board is round and fits in a 30mm forstner bit pocket). The USB serial emulation seems to work well enough on the dev boards I picked up, and that's mainly what I wanted. Overall, ESP32 is a cheap low-end chip for low-end applications, and that's exactly what I'm using it for.
@@treelineresearch3387, that makes sense. In fact, one of the peripheral part choices had an on-board ADC, which mean I'd only have needed the SPI port. In any case, I wound up going with the nRF52840. It's not cheap, but it has the necessary memory/processing power, so it's all good. When RISC-V is more competitive for that niche, that's what I'd like to go with, on principal.
This video really highlight the magic of Arduino, taking care of all the unnecessary fluff you need to think about just to put the MCU into a sane state to flash a led.
As the STM8/32 is often using external IP for IO (and in the32-case also for the cpu), it is easy to make replacements. The accused „counterfeit“ STM32F103 are such cases. They just licensed what ST licensed before. No legal issue. And the same is happening here. The IO is what needs experience, the cpu is handled by the compiler. BTW, this is the result of threatening customers to sanction them. They then try to build it on their own. Never get a customer to look for alternatives. And on toggle: Pretty sure you can just use the io registers directly. They might look very familiar for STM experts. Assembler might not be needed. Some time ago, in a German forum an AVR assembler expert was burnt down by GCC and someone able to write good C++ code. The metric was flash size.
@@BrianG61UK no. It will save automatically when you enable "save before build". Otherwise it will build from what is currently on disk, and this mode (silently ignoring changed editors) is actually pretty useless IMHO. This was on of the first things I configured years ago. If I press Ctrl b it will now first save and then build.
@8:31 The peripheral clock enable function on line 35: This looks similar to how peripherals function on STM32 chips, each peripheral (i.e a GPIO port/timer etc.) has a clock enable to it allowing the peripheral to be completely powered down. By default all peripherals have the clock disabled and have to be enabled one by one, so that only the peripherals you need consume power. It's likely the peripheral design on this chip follows a similar pattern to STM32 chips (and potentially other 32 bit ARM micros).
It's always exciting to see cheap Chinese micros! Thanks for sharing Dave! The lack of public source code of openocd is a bummer. If you want source code access, you need to email them.
I just took apart yet another dead led edison bulb and started knocking the led chips off. I was thinking about hooking up 4 of them in a (physical not electrical) line to a ESP8266 to see like back and forth light tricks, pwm dimming etc. Will be hard to solder. I was hoping I could solder them to a header of some sort and plug it into a breadboard with the ESP8266. It works about the same as an Arduino using the Arduino IDE.
I think this is the equivalent to the STM32F030F4P6 with I intend to use in one of my new projects. This was below 50 cent before the semiconductor shortage maybe as low as 30 cent but it is not at this time. But this RISC V is also not available not even at higher price so not an option probably but will keep an eye out for it. I still have to get the larger STMS32 microcontroller that I ordered in February 2021 so about two years ago.
STM32G030 series is under 50 cents@qty30 on LCSC. They released an even lower budget line recently, the C0 series, but that doesn't seem to be available yet.
@@teslatrooper It is strange that the G0 series is less than F0 series as it seems as it has more memory (double) higher operating frequency and M0+ instead of M0 so double the compute capability.
@@EEVblog It was less before the semiconductor shortage I think as low as 30 cent in thousand volume. Just noticed that the 10 cent risc-v has just a 10bit ADC vs the 12bit on the ST parts. I need those 12bit ADC's and there may be some other differences. When you designed a product in relative low volume a few thousand pcs then 10 cent or 50 cent will not make any sort of difference. Even a few hours of working on the software because something is not well documented or not working as expected will cost more. This things are good for very large volumes super low cost products or super simple designs where you do not need most of the peripherals. It is still interesting and I will check more risc-v variants.
The RISC V is open source but you still have to pay a 100k for them to allow you to get the technology. You may not have to pay royalties but still have to drop a huge amount of cash to begin with. Not really open source like the linux distributions that just hand you the code at no cost, you just have to share any modifications you made to the code.
It is pretty cool, I found some 64k flash 48 pin MCUs in their offering that are on lcsc for about $1, but then let's say one spends a month developing a real product and then they dissappear unless you buy 100k units from the manufacturer... The chip I found lscs has 64 of them. That is not much. I also looked at other wch chips. Some have better availability (half a roll or so), most are out of stock, many have like a dozen available. Until it says something like 10k in stock it doesn't inspire much confidence.
I just got my rp2040 controllers for a split keyboard I'm building, but it would be fun to go through the whole PCB design around one of these micro controllers
@@johndododoe1411 That only matters if your code fits into the tiny flash (you meant flash right not ROM?) on $1 controllers (current RP2040 price on JLC), if you end up needing an external flash anyway it doesn't matter. You can get 32mb of flash for 60c. You need to select the correct components for your projects, slapping in a $4 controller to flash an LED on/off just because "ItS ThE BeSt ESP32 FoR ThE WiN" is stupid.
@@andymouse From sdcc: "conditional flow changed by optimizer: so said EVELYN the modified DOG" and that is a a Zappa quote. Basically sdcc is a very bad compiler.
Of course you can. You use the function call already provide for you, as then the code will be more portable across its family of mcu's as the function uses multiple #ifdef to recompile based on family mcu.
The nice thing about the RISC-V situation is, the barrier for a vendor to just let you use an unmodified standard toolchain is very low. Making a source-compatible (with the competing STM product) library would be the last mile (and at first glance it looks very similar). Under all of that Eclipse goo, it's just running GNU make, and the problem with the "build" command is probably to do with an incorrectly written Makefile. No doubt a chip like this if it gains popularity will get an Arduino port.
Does it have Arduino support? It is very important for hobbyists in general, specially because of the large library base available. If not, soon there will be, as was the case with the ESP8266, ESP32, etc.
It probably doesn't flash the LED on the dev board by default as there are likely various dev boards, with LEDs etc on other pins I guess? This is really interesting though - I've used the STM8 part this copies on some small boards just doing multi-LED PWM animations and they've been reliable after months of service.
I am a HARDCORE FORTH PROGRAMMER and constructor / designer , talking about "C" may make me re-read the unix haters handbook ... but yea HOW MUCH FUN CAN YOU HAVE ...wow that was cool . FORTH ! IS THE ONLY WAY KIDS ...
Most ide / compilers don't build off of what you see in the editor but what you've saved / written to the filesystem because usually the ide integration is just the ide asking your operating system to run the compiler with some arguments set, it wouldn't have access to your ide's text editors running memory. So yeah, ctrl+s regularly. The confusing thing I've run into are projects that copy their source files over to the "build" for reference when debugging, then you're sat there making edits to fix a silly bug that only get overwritten when you build again.
Awesome. Looks like a great alternative for the currently hard to find and overpriced STM8S003 mcu’s. But, as I can’t even buy these at the moment, I guess it remains just a potential alternative. :(
Not only is the ISA unencumbered with licenses and agreements, but RISC-V micros are inherently less complex than equivalent performing ARM micros, and require less area (or can be made on cheaper processes), and beyond that manufacturers are incentivized to actually get involved with core design, and even then if they don't care, the open core designs are always improving. On these three fronts, the cost of everything except packaging will drive downward for RISC-V parts.
Cool to have something like that. I personally haven't played enough with my ESP32 and RP2040 µCs and don't really need these (especially while there's no IDE-free open build system yet, seems like), but maybe at some point… Thanks for showcasing the thing!
People developed an open system for the Padauk micro very quickly, same thign might happen here. It's all there really, nothing stopping someone taking all the dependencies and just usign the commend line GNU compiler without the IDE. Why not just use Ecplise though?
@@EEVblog I think I heard most of it in the video after submitting the comment, I'm only not in that hurry of verifying it for myself. If I was a good specialist and really needed them, I would participate and invest my efforts into doing this; yet, I'm a silly curious viewer of your interesting videos. I didn't really like Eclipse back when I tried it, prefer a lightweight text editor and make or cmake myself.
@@EEVblog Espressif are leading the way in migrating their powerful and now very mature stack. While they are still mostly relying on ESP32 with Tensilica cores, they are now so big and pervasive in the IoT market they stand to benefit immensely by moving across to RISC V by using the same SDK they have been developing for ages and are now at version 5.0
@Janus Kobain what are you saying? The log shows it uses makefiles just like so many other controllers out there. IDE is irrelevant. You could easily build that without the IDE, just using open source tools. As for the flasher, it's probably just a bunch of uart command that you could write into a Python script. Probably, less than a day's work.
Also, there are tons of eclipse based IDEs out there from the leading microcontroller manufacturers. They aren't pretty but really powerful once you get over the learning curve. But yes, they are a mixed bag. Some do implement really well, and others are really bad and slow, where a text editor like notepad++ is better.
Dave, if you do more review of this kit please dive into live debugging and breakpoint operation. PIC and TI chips both support it, it saves a lot of time.
We are testing this to add an automatic closing function to the bathroom ventilation fan. About 40% cheaper than comparable MCUs. Compared to the STM8, it's almost free.😁😁😁 My only concern is that if they don't last long and discontinue the product, the STM8 won't be a cost-effective alternative.
Good explanation and demo. Eclipse, Netbeans et al have many peculiarities, sometimes you have to save, sometimes not, sometimes you have to double click to highlight / 'select' the project in the explorer window. A common gotcha is a work / temporary folder which stores the running file, a copy of the one you are viewing. On many occasions the view and work files 'lose connection' resulting in all sorts of oddities. You can test this by copying an older backup file into the Eclipse workspace, it will be ignored unless you open the file and edit it (just add a blank new line) and then save it. It could be much, much worse, have you ever tried the Arduino IDE, especially when trying to burn the bootloader or load a sketch into other IC's?
Can't wait for a mesh net to be available using this. Going to be super cheap to wire up a home. Near endlessly updateable. Right now it's a thousand bucks.
@@robertsmith2956 8 channels, not 8 ADCs as far as I know, so they will be multiplexed, so the more channels you use the slower the sampling rate. This is very common for microcontrollers. Loads of other microcontrollers like STM32 have more than 8 ADC channels and some even have multiple ADCs.
Saw a review of a RISC V sbc. Software support was lacking, but speed wise it was somewhere between a Raspberry Pi3 & 4. Coming along in leaps and bounds.
Thirty plus years of software development taught me that Ctrl-S is your friend.
I have it mapped to a button on my mouse. Hit it constantly
Until your jerk practical joker friend installs a keyboard mapping on your PC and maps ctrl-S to DEL... 😬
Unless you're using Vim
$ CTRL-z; bg;
$ jobs
That's why I just use Intelij I am sooo spoiled
This reminds me of the early days of STM8, ESP8266 and a few others
Community making better HALs, figuring out all of the little quarks, even making better compilers, i very much live for this
What is stm8 community HAL? Never heard. Arduino? Haha. I program stm8 from 2012. In that time stm8/stm32 programmers used only registers and never used SPL and and not accepted ST HAL monster at all.
I still use programming on registers ever with stm32. It is more easy for me to open pdf uc manual to see registers that I don't still know and to write what I need. Instead of to understand some HAL with huge overhead of size and and function calls (prepare call stack, jump, take apart call stack and so on instead of one uc command :))). And I have fast and size efficient firmware )).
Now playing with HC32V. Some copy of stm32 (who doubted?) same registers just renamed and stm32 SPL. You can take 10 years old info about stm32f103 and SPL and you are HC32V programmer what you see in this video. It is stm32 SPL in this video. Same toolchain gcc (just riscv version) and openocd. Nothing new and interesting to discuss.
What are some of their quirks? Also real curious about the community made compilers
@@anonymouseniller6688 Most likely we are talking about SDCC?
I just don't get what the "excitement" is about with this.
I DO understand why chip makers want to use RISC V, that's obvious, since it's "free" (open-source) IP. They neither have to develop it themselves, nor license it from someone who did.
But why excitement from end users?
There shouldn't be.
It's just ppl like this guy in the video, who seems to be an excitable type (easily gets excited about ANYTHING).
END USERS are f__ed, because they now have to find a way to program it, and figure out all the little quirks.
Wow, another new IDE?!
Oh, boy, can't wait. I "get" to learn a whole new IDE....
And buy (separately) a "programmer / debugger" that isn't, no it's just a USB to serial converter. No debugger.
So this "exciting" new uC can do what?
Uh, well, it can blink a single LED. So what?
Can it run a FreeRTOS?
Doubtful, and who wants to put all the time & work into that for a quirky little uC?
Not me. I'll stick with an "expensive" ESP32 or something that has many uses, it's well-documented, fast, has lots of onboard peripherals, and has LOTS of uses for actual things besides blinking one LED.
When I develop something for a uC I want it to be functional, flexible, and esp do more than one thing.
(Ok, I know that's not fair, it can prolly do more, but we'll have to wait to find out. Someone else will have to figure it all out after uncovering all the quirkies. I know.)
@@jeffro. good for you i guess. not every project needs Wifi, bluetooth or huge amounts of peripherals. If it did, these cheap and small MCUs would not even exist.
An introduction to RISC-V assembly with Dave trying to toggle a pin as fast as possible would be fantastic!
That would be interesting
I would love to see that, too!
I would love to see that too !
@@EEVblog Make it so !..............(Pls)
On some microcontrollers you just have to write to one 8-bit wide right to an address to toggle a bit in a register. Such as in PIC32 or in STM32. The code becomes something like loop: st r0,toggleaddr; jmp loop with a few load immediates and stores before to enable the port, map it to pins and then setup the port ddr. Oh and a little bit of fiddling with clock registers beforehand too, to select the clock source and turn off dividers etc. Nothing too involved, all you need is load register immed, store register mem and jump unconditionally. If you don't have the toggle location built in the hardware, you need to do a little bit more. Maybe there are bit manipulation instructions, maybe you're going to have to keep the toggle value in a register and use a xor instruction. However it is, you don't need to know very much about RISC-V architecture, or any other architecture to do this yourself. Probably the instruction summary is enough. And really it's more of a question what amenities there are in the hardware of that microcontroller than the instruction set of whatever core.
WCH-LinkE is not a generic USB to serial interface. It is a CH32V305 microcontroller implementing the single wire debug protocol used on the V003. Yes, technically that is serial, but it isn’t just a pass through buffer.
so like jtag? that is a game changer on these things.
Is there any specifications about how to build a programmer with an FTDI+logic ??
@@donvukovic7440 No. We’ve been asking WCH for specs for a while. If there were open specs I would have implemented an open programmer by now.
My goal until specs are released is to reverse engineer the wire protocol and implement my own debugger. I just haven’t had time to do it yet.
@@truectl Thanks, I look forward ti it.
@@truectl both the specs and WCH's code implementing them have been released.
Since it's using an external toolchain, it cannot build something that is not saved to disk. Therefore, you need to save the file before build. The hex file not being rebuilt is either you forgetting to save the source code or a bug in the vendor SDK ("make" target dependency missing).
Yes, I doubt it's a bug, it just needs the file to be saved for as you said, the external compiler that doesn't know the IDE exists.
@@EEVblog you can set Eclipse to autosave before build
@@teslatrooper Yep, I figured you'd be able to do that.
But why doesn't it save all the currently opened files whenever a project build is started by default like most proper IDEs do? Is it just another strange Eclipse quirk or is there some reasoning behind that?
@@Kirillissimus I set every IDE I use to query if files are unsaved before building, as opposed to saving automatically. I find it useful as a guard against accidentally fat-fingering the build key and having it automatically save files before I'm ready for it.
Great to see them using a normal GCC compiler and not some obscure proprietary stuff
That's the beauty in this. The momentum of the standard tool chains is so great that nothing else should cross their mind.
Gcc and makefiles, i never use IDEs.
@@zoobab28 the issue here is that they probably didn't fully documented the chip or the API or the programming interface to allow to just completely avoid their IDE.
@@PainterVierax it's all fully documented, their (very minor and not needed) patch to gcc and custom OpenOCD are released, the protocol is documented etc. And the chip manual is very good.
10¢ RISCV - truly a milestone in the cost-value proposition of 1000x ENIAC on a chip for 10¢ 😳 thx for keeping us up-to-date!
Its not a milestone, its the chn government subsidizing the product to compete with western companies
Plus it doesn't need an army of engineers, technicians and programmers to keep it running!
Build you own Connection Machine for under 10,000$
Something like 5000x to 6000x the speed of ENIAC. About 50x the RAM capacity of early ENIAC (which had only the 20 registers), and 10x the capacity of ENIAC near the end of its life after some core memory was added. Program size is very hard to compare as ENIAC used plugboards to control it.
How much the speed of that special FX prop looking CRAY supercomputer?
MounRiver is the short for mountain and river, it means 天圆地方,山河相依。If you translate it directly, it means, round sky and square earth, mountains and rivers depend on each other.
Thank you for this insight.
You mean like flat earth with spherical atmosphere? :D
Thanks for the translation in full, such a complex and beautiful culture. .
Chinese is a fascinating language. I really want to learn. It is becoming a must for hardware and software developers anyways. But I’m not able to find good resources on the internet.
@@ozdemirsalik no, all software people know that china does not include software as the 7 industries that it will take over the world with... software is for stealing copyrights and exploiting.
WCH is one of the only chinese electronic companies that I like. They make a lot of niche but useful to hobbyist components like a USB host that uses parallel Intel bus.
Not to mention Patrick being active on Twitter and responsive and friendly 👍
Wrote around Christmas a riscv emulator for Python, 32bit CPU, RV32i ISA and RV32M extension support. The base instruction set(RV32i) is comparable with something like the older AVR attiny instruction sets, very barebone, but it does the trick. For example it doens't have MUL or DIV in the base set(RV32I), that is in the RV32M extension. So yes it can be made very cheap,
Cool. Can people download this?
that's great job, will it be opened for use?
Well, adding multiply to a hardware alu immediately complicates the design. You end up with probably a doubled data buss and logic to handle it in the registers, definitely multi clock operations because of the timing delays and logic to handle it. And a 32bit multiply circuit is rather big on it's own (you can pack in more memory or features if you ignore it).
For a tiny entry level chip like this, not including multiply is probably the right way to go.
I like these part selection/catalogue shopping videos. Honestly I find it to be one of the most annoying and time consuming parts of building a project sometimes. There's just so many options lol
Great stuff, keep it up!
I love how they describe their logo, they must be *really* proud of their design 😀
It's Scanimation for the vision-impaired.
Printing the 'Getting to blinky" document would be more expensive that the microcontroller itself :) Nice demo!
They've made it just so easy compared to my old school days of using to burn a UV EPROM and plug it into a socket on the PC board. Back in those days too, you had no sample code and had to create the include files yourself... oh joy!.... pre internet days as well, so you had to get a printed reference manual.... oh.. and you had to write your code in assembler (machine code)... without any debugger!
Did a fun project back when I was in 8th grade; decided to build a cross assembler for the NEC uPD78C10 on the BBC micro... the biggest challenge was actually understanding the "japlish" manual for the thing, it being written in a rather tedious language (not sure if not being a native English speaker myself was a hindrance or helpful!).
In 1987 I worked in an industrial automation company, I had to burn about 200 UV EEPROMS.
Torture.
... and it was uphill... BOTH WAYS!
I started with the 4004 which we paid $480 for and another $100 for the translation chips (4001 & 4002) from Pmos to Cmos or ttl. It's amazing they sell them for sub $1. Obviously they will go broke in a real economy as the FAB can't be paid off with no profit.
I would start with buying the hardware and writing a stand alone compiler for the RISC V using my PC. Sounds like a good project for me in the future. Cheers - great Blog -
RISC-V is easy to write a compiler for, but why bother when there is already gcc and llvm?
One of the very few companies that actually reply your email and support the customer!
Every time you were building the project, it was building the two (or more) projects you had open at the time, so taking longer. It's quite annoying that Eclipse comes with Ctrl-B set as "Build all projects" instead of "Build current project". It's one of the first things I change when using a newly installed Eclipse based IDE.
As usual, software support is king. AFAICT, the easy part is making the silicon, the hard part is building the community support, tool chain, software experience, etc.
I think that's one of the big parts around spark fun and raspberry pis.
Setting up a Pi Pico environment is agonizing for Windows users that want to use C/C++.
@@asm_nop Most development tasks like that on Windows tend to be agonizing in my experience.
@@RobertHancock1 i agree i usually match and mix msys2 and msvc compiled stuff
@@asm_nopI just used Arduino IDE for my Pi Pico project (filter wheel changer for a telescope), there was nothing difficult about it I just followed the Pi foundations instructions.
Very interesting, Dave. I have a couple generations of SiFive RISC-V SBC's. Nice to see micro-controllers appearing at a good price point. Do a SRCH for "cnlohr on risc-v" here. He wrote an RISC-V emulator in C and used buildroot to get the 400-500 lines of RISC-V C emulator to boot linux and give you a command prompt right on you linux PC. It is freaking amazing.
BTW, he provides all the material and I was able to download. build and run everything myself relatively quickly. Building the Linux kernel and other stuff with the emulator took a little time.
I love Eclipse, mostly because I can rightclick almost any identifier in a project and hit 'show call hierarchy', 'go to declaration', or other neat code-parsing tricks.
I hate eclipse because they make dumb decisions for everything in the UI and force them upon you.
That's how ANY modern IDE works.
Also all of them, except Eclipse, save files before build by default.
@@RustedCroaker Visual Studio Code does not, NetBeans - nope. Yes IntelliJ does. It can though be toggled on in all of them
Both Eclipse and NetBeans are ancient software by now. They can't compete with modern IDEs.
I'm thrilled to see more on this, probably testing basic features like uart, timers, i2c etc....
I ordered the evaluation kit and finally received it. Only issue I had was to get the MounRiver IDE to generate a hex file. I dug into the Settings an found the setting under "GNU RISC-V Cross Create Flash Image/General. I selected Intel HEX in the drop down and all is well.
Thanks for the Video I was looking for a device that did not require the investment of the Keil development software. Thanks to you and WCH!
It's crazy how far things have come in the last 10-15 years. The last time I programmed a micro in anger was an AT90S2313 with all of 2K flash and a whopping 128 bytes of SRAM, you practically *had* to use assembler in order to cram all you needed into that space, it's nice to have the luxury of a high level language for a chip at an affordable price. I can imagine there are some old grackles on here that will be rolling their eyes and going "Baaah! back in my day we had to write everything in ones and zeroes, and before that we didn't even have zeros and had to use the letter 'O'" (to paraphrase a Dilbert cartoon)
That's actually a really cool little chip. Might have to look into it at some point. Love the open source toolchain!
hope many manufacturers move on to this cheaper hardware. thank you dave for showcasing this. might as well jump to this risc-v bandwagon if it becomes easily available for cheap
This IDE takes me back to the Codewarrior times when you had a slick win98 Style environment, before the migration to Eclipse. There was a P&E IDE for the QT8 microcontrollers that were a breeze to use, I still have the Cyclone. Now back to my grave.
that hardware abstraction API looks like what I had to work with when I did STM32 work.
the first RISCV cores I saw were placed in STM32 clones. makes sense that they stick with established APIs and aren't just pin-compatible physically but also register-compatible to existing devices.
The prices is completely crazy.
I teach EE131 (first year Digital Electronics) at a local university and basic digital ICs cost more than that. It is important they understand digital logic; but, the only place they are likely to ever use it is in an FPGA design.
I recently helped someone debug a Space Invaders Arcade Game and most of it is done with MSI logic (counters, etc.) and only one Microprocessor (which probably cost more than all the other ICs combined). Things have certainly changed.
Yeah with microcontrollers and to some extent FPGAs becoming as cheap and small as they are it doesn’t make a lot of sense build something up using digital logic chips. Microcontrollers are just that versatile now, you can use them for implementing a single gate or you can implement a complex control system. Their only downside really is speed, they are usually quite a lot slower than the propagation delay of a gate but most common applications now aren’t relying or dependant on the speed of individual gates unless it is in a very high performance or high speed system, in which case you probably have more going on than just a single gate and you are probably better then just using an FPGA.
When I at college learning electronic engineering we had to buy pic16f877A wich was the stronger part less prone to burn on our hands, it was 8-12$ then now should be about 25$ thanks prices are relatively cheaper now, but said parts on 10c even having free ide (i learn with proprietary pic ask and PICC both pain in the ass and expensive for non educational projects) kudos
I took digital logic twice, once at a small university where it was part of CS, but actually offered by the physics department (and I TA'ed that course for a couple of years after I took it) using discrete 7400 logic chips. I took it once again after I transferred to another larger university to switch to COMPE from CS (and in eningeering they wouldn't transfer any courses beyond 1st year courses), where it was all FPGA based. The discrete logic chips in the breadboard was more memorable and fun, but took hours of plugging wires into the breadboard, and troubleshooting if you made a mistake. The FPGA version was way faster, but less memorable and less fun, and less "hands-on" - I always did the labs the night before at home, simulated it, and basically loaded it up on the FPGA board and demo'ed it to the lab instructor in the first 5 minutes and left for the afternoon (to go work on the endless stream of homework from other courses).
eevblog right on top of the techno curve!!
-10,000,000 points for not asking ChatGPT to write code for you.
I remember prototyping with the PIC 16F54 in the mid 2000s with
In mid 2000s I programmed not PICs but OTP Z86E04. Made controllers for lights flashing on buildings.
back in 1800 we only had candles, those were the days
I was browsing these guys a few wees ago and I thought they had quite the nice selection of low cost MCUs. BLE, networking, motor or display driving. Basically if your main MCU is missing a feature or you need something very low power they have something that will fit your needs.
Amazing. I think that the expression "cheap as chips" now more accurately refers to integrated circuit chips, not potato chips - potato chips now sell for about $5-$7 per bag here in the US.
$5 for half a bag.
@@deltaray3 True, mostly air!
The STM8 standard I/O library was fairly incomplete. i re-wrote much of the library before fiding someone else had done exactly the same. ST (like AMD) are great at making silicon, but not so good with software. So I wouldn't be too surprised to see ST make a RiscV implemementation, as they need not worry about software. The kings of the MCU software have been PIC, but from what you show me, this isn't too far from PIC in terms of ease of use.
This architecture (looking at Mhz) perhaps sits between STM8 and STM32. The STM32 is ARM based, and ST could save money on licencing costs, so we could see a merge in those low and mid-end MCU offerings in a Risc V product line. A scalar lower speed to replace STM8 and a higher clock and instruction pipelining and other logic trick superscalar basic instruction set RiscV to replace STM32 with the same tool chain accross the product line.
There should be an option in eclipse that saves automatically when you build.
I can't Imagine it's able to build without saving it somewhere. I suppose it lets you test a change without saving... Is it a bug or feature?
Yes, please do a video regarding the debug options! Really hope there is a way to debug it line by line, but not really optimistic since a lot of the more expensive chips don't have it either.
I tried to debug it on VSCode, it is awesome.
The build system probably doesn't have the hex file as a dependency. How to fix that depends on what build system eclipse is using for your project .. its own, make, or maybe something else.
Ah, so it's flexible, interesting. I did see all sorts of options for setting up dependencies, but was easier to just save it for this video. Thanks.
Kids these days need RISC-V to blink a LED, back in my day we only use flip-flop circuit
Damn, that's a *lot* of value for just 10 cents! I'm already even somewhat familiar with the Eclipse IDE, since I like to use STM32 MCUs, so it should be a breeze for me to start using these as well.
Where do you source parts ? I need whole tape of STM32s and there is none on the market right now. Do you think that big manufactures are getting special priority lead times? Last time I checked the lead time for ANY STM32Fs was 500days.
@@webkar Currently nowhere. They are basically all overpriced and/or completely unavailable everywhere I look. I'm just biding my time and keeping an eye on worthy alternatives.
@@webkar we might be seeing more and more risc v drop in replacements.
@@JamilKhan-hk1wl almost every MCU manufacturers, even the historical survivors, are jumping to RV cores. There are some pin compatible replacements of chips like the STM32F103 for years but the issue right now is availability.
Hi, Dave.
Long time Eclipse user here 😊I haven't done development in C programming language for some time, but the general M.O. of IDEs is to automate some (or most) of the complex software process/workflow. But the assumption is that the developer using an IDE is aware of (at least most of) the steps in the workflow.
To save the time it takes to build the actual binary (compiling, linking, optimizations, etc.) most IDEs support incremental compilation where only the modified files are compiled and then linked with a previously compiled/built pieces that were cached. But given the number of moving parts the build workflow has, even without the incremental features, the "Project >> Clean" action is there to take care of the famous "my tool is stuck" issues.
An IDE can be configured to automatically save any modified editors before actually performing the build, so you might opt-in for that one. Or even to automatically save modifications to a file when the keyboard input "stops long enough". Also, "automatically compile/build on save" is an opt-in feature of some IDEs. But if one considers these automation features and the complexity of the workflow, one could conclude there is no "incremental build" - building the actual deliverable binary involves much more CPU/RAM/DISK intensive activities compared to compilation, so it doesn't make sense to start-and-clean-up-on-cancelation every couple minutes on auto-save. That is most likely the reason you didn't always get the HEX file after "incremental build".
The Eclipse itself is a customizable and modular software platform, i.e. for creating any kind of desktop software, but it is most widely known as a Java/C/C++/PHP IDE thanks to the modularity. Years ago I watched a National Geographic documentary on NASA Mars rovers where it was explained how NASA plans a rover's route, and the software they were using was Eclipse with custom plugins 😁
Bit of a mangled RISC-V explanation there. It's indeed just an ISA, which means that you either get an open source core that implements this ISA, or you pay someone else (like SiFive) for the core, which means that you still pay license costs, especially for any IP blocks that are likely to be added to the processor.
Well yes of course, you could pay a license fee to use someone elses pre-built core, but that's not really the point of a major manufacturer for example making a RISC V chip, they'd do it in-house so they never have to pay a license fee.
@@EEVblog Yep opencores has open cores for RISC-V e.g. the NEORV32
Interesting idea, Dave. It's nice to see that microcontrollers are coming at a good price.
This mc is 32bit replacement for stm8s003, has same pinout. stm8s003 cult microcontroller. Nuvoton did it's x51 N76E003 pinout compatible, now ch32v003.
I'd love to see how good (or bad) the ADC is. There are some absolutely brain-dead examples of ADC uC implementations (be that design, software implementation or hardware). I reckon you can tell a lot about build quality by how well or poorly the ADC performs because it's one of the hardest things to implement with good results.
I've used the Espressif ESP32-S2, (RISC-V) and the ADC was TERRIBLE -- and the serial UART was problematic. I ran the same code on a SAMD-51 (ARM4F), and everything worked beautifully. It was impossible to lineraize the ESP-32's ADC, even with a lookup table, whereas the SAMD-51's was quite linear without any correction. Also, I had to stuff a byte out at start-up on the ESP32-S2, or it would always eat the first byte, throwing everything off by 1 byte.
I just redesigned my little LED controller around a ESP32-C3, that variant is also based on Risc-V. Definitely gonna check these out too, not only is it cool that Risc-V is an open architecture, availability of Chinese parts seems to be a lot less variable than western parts have been recently (one of the reasons I switched my design from a SAMD to the ESP32C3..."supply chain").
I used the ESP32-S2, and the peripherals (particularly the ADC, DAC, and UART) were terrible. On the S2, there was no way to linearize the ADC, even with a look-up table. The SAMD-51, running the same code, worked perfectly, no tweaking needed (though you can actually tweak offset and linearity in registers on the SAMD-51's ADCs.
The RP-2040 has a wonderful manual, though the chip has some bugs (the manual writer apologized profusely for one of them). The SAMD-51 has a decent manual. The ESP32-S2 has a pretty lousy manual (unless they've redone it recently).
@@Johnny.Fedora Yeah I've used the ADC on the original ESP32 and wasn't impressed, but for this device the only thing I'm using ADC for is measuring the battery and that can be pretty rough. I'd expect it to be the same IP block/fab process on the C3 so probably no better. C3 doesn't even have the DAC, and the UART is fairly tertiary for what I'm using it for, I expose the pins on an expansion header but for the most part I just use these things for making small lamps/simulated candles from turned wood (board is round and fits in a 30mm forstner bit pocket). The USB serial emulation seems to work well enough on the dev boards I picked up, and that's mainly what I wanted. Overall, ESP32 is a cheap low-end chip for low-end applications, and that's exactly what I'm using it for.
@@treelineresearch3387, that makes sense. In fact, one of the peripheral part choices had an on-board ADC, which mean I'd only have needed the SPI port. In any case, I wound up going with the nRF52840. It's not cheap, but it has the necessary memory/processing power, so it's all good. When RISC-V is more competitive for that niche, that's what I'd like to go with, on principal.
This video really highlight the magic of Arduino, taking care of all the unnecessary fluff you need to think about just to put the MCU into a sane state to flash a led.
Haha how right you are.
The "save thing" is an Eclipse quirk. Its always the first thing i change when i work with Eclipse, because i've been bitten too many times.
would be great to have a video breaking down the fundaments of adcs. The types, error sources, input signal conditioning and such.
As the STM8/32 is often using external IP for IO (and in the32-case also for the cpu), it is easy to make replacements. The accused „counterfeit“ STM32F103 are such cases. They just licensed what ST licensed before. No legal issue.
And the same is happening here. The IO is what needs experience, the cpu is handled by the compiler.
BTW, this is the result of threatening customers to sanction them. They then try to build it on their own.
Never get a customer to look for alternatives.
And on toggle:
Pretty sure you can just use the io registers directly. They might look very familiar for STM experts. Assembler might not be needed. Some time ago, in a German forum an AVR assembler expert was burnt down by GCC and someone able to write good C++ code. The metric was flash size.
I never ever knew an IDE where you don't have to save after you edit a source file.
Arduino IDE does not need to save before compiling/linking. VSC does not need manual saving, it's automatic.
@@donvukovic7440 VSC only if you enable autosave - it is not on by default. Yes Arduino IDE has autosave on by default.
In Eclipse it can be configured whether to auto save before build or not. You can even configure auto build on save.
@@foo2332 But if you build without saving does it still build from the edited file? I doubt it.
@@BrianG61UK no. It will save automatically when you enable "save before build". Otherwise it will build from what is currently on disk, and this mode (silently ignoring changed editors) is actually pretty useless IMHO. This was on of the first things I configured years ago. If I press Ctrl b it will now first save and then build.
@8:31 The peripheral clock enable function on line 35: This looks similar to how peripherals function on STM32 chips, each peripheral (i.e a GPIO port/timer etc.) has a clock enable to it allowing the peripheral to be completely powered down. By default all peripherals have the clock disabled and have to be enabled one by one, so that only the peripherals you need consume power. It's likely the peripheral design on this chip follows a similar pattern to STM32 chips (and potentially other 32 bit ARM micros).
This needs to be the future: how small, simple, and lightweight can we make our tech?
Wish I had one of these in High School in 1982. Amazing!
The RISC-V 1-wire debugging protocol of CH32V003 will be released soon :)
Sweet, we will be giving that a try. Have a great day everyone.
It's always exciting to see cheap Chinese micros! Thanks for sharing Dave! The lack of public source code of openocd is a bummer. If you want source code access, you need to email them.
Pay them and watch as Chinese communists invade democratic Taiwan. Arsehol
ARM is toast. Long live RISC-V!
Who knows, maybe someday they will make their licensing policy more liberal in terms of instruction sets and core specifications as well.
The new Pinecel soldering iron is using a RISC V with the same Iron OS. First one I’ve seen in the wild.
I just took apart yet another dead led edison bulb and started knocking the led chips off. I was thinking about hooking up 4 of them in a (physical not electrical) line to a ESP8266 to see like back and forth light tricks, pwm dimming etc. Will be hard to solder. I was hoping I could solder them to a header of some sort and plug it into a breadboard with the ESP8266. It works about the same as an Arduino using the Arduino IDE.
Very excited for the partridge in the pear tree!
I think this is the equivalent to the STM32F030F4P6 with I intend to use in one of my new projects. This was below 50 cent before the semiconductor shortage maybe as low as 30 cent but it is not at this time.
But this RISC V is also not available not even at higher price so not an option probably but will keep an eye out for it.
I still have to get the larger STMS32 microcontroller that I ordered in February 2021 so about two years ago.
Yeah I could not find the ST part for under 50 cents.
STM32G030 series is under 50 cents@qty30 on LCSC. They released an even lower budget line recently, the C0 series, but that doesn't seem to be available yet.
@@teslatrooper It is strange that the G0 series is less than F0 series as it seems as it has more memory (double) higher operating frequency and M0+ instead of M0 so double the compute capability.
@@EEVblog It was less before the semiconductor shortage I think as low as 30 cent in thousand volume. Just noticed that the 10 cent risc-v has just a 10bit ADC vs the 12bit on the ST parts. I need those 12bit ADC's and there may be some other differences. When you designed a product in relative low volume a few thousand pcs then 10 cent or 50 cent will not make any sort of difference. Even a few hours of working on the software because something is not well documented or not working as expected will cost more. This things are good for very large volumes super low cost products or super simple designs where you do not need most of the peripherals. It is still interesting and I will check more risc-v variants.
Bob is your Auntie... Pretty neat processor and IDE! Good find!
Now we need Rust toolchain for this IC and I would call it a day :)
Sooooo, download the IDE, plug in the RISC V Processor to the programer, flash it, and... Bob's your Uncle!!! 💪
The HAL looks like a 1:1 copy of STM.
Looking forward to using this chip!
Obviously they borrowed the terminology and a lot of the specs from the STM32F0 line (not the STM8).
The RISC V is open source but you still have to pay a 100k for them to allow you to get the technology. You may not have to pay royalties but still have to drop a huge amount of cash to begin with. Not really open source like the linux distributions that just hand you the code at no cost, you just have to share any modifications you made to the code.
It is pretty cool, I found some 64k flash 48 pin MCUs in their offering that are on lcsc for about $1, but then let's say one spends a month developing a real product and then they dissappear unless you buy 100k units from the manufacturer... The chip I found lscs has 64 of them. That is not much. I also looked at other wch chips. Some have better availability (half a roll or so), most are out of stock, many have like a dozen available. Until it says something like 10k in stock it doesn't inspire much confidence.
I very much enjoy these microcontroller videos. :)
I just got my rp2040 controllers for a split keyboard I'm building, but it would be fun to go through the whole PCB design around one of these micro controllers
Isn't RP2040 the joke that requires external ROM?
@@johndododoe1411 That only matters if your code fits into the tiny flash (you meant flash right not ROM?) on $1 controllers (current RP2040 price on JLC), if you end up needing an external flash anyway it doesn't matter. You can get 32mb of flash for 60c.
You need to select the correct components for your projects, slapping in a $4 controller to flash an LED on/off just because "ItS ThE BeSt ESP32 FoR ThE WiN" is stupid.
@@backgammonbacon flash ROM, EEPROM, EPROM, PROM, it's all ROM.
Forgot to say "Great video, Dave!" previously 🤦♂
Keep up the good work. Cheers.
I can not wait to use this with gcc. Now I am using stm with sdcc and the main feature of sdcc is that it quotes Frank Zappa.
?
@@andymouse From sdcc: "conditional flow changed by optimizer: so said EVELYN the modified DOG" and that is a a Zappa quote. Basically sdcc is a very bad compiler.
Blink (LED Flasher) FTW - nice job Dave!
12:35 Maybe they put D0 as diode suffix, in this case, D0 is Diode 0 or LED 0
You can write to the GPIO output register directly in C without using assembly. This should be as fast as assembly but easier to program.
Of course you can. You use the function call already provide for you, as then the code will be more portable across its family of mcu's
as the function uses multiple #ifdef to recompile based on family mcu.
Man do i love the open source community
The nice thing about the RISC-V situation is, the barrier for a vendor to just let you use an unmodified standard toolchain is very low.
Making a source-compatible (with the competing STM product) library would be the last mile (and at first glance it looks very similar). Under all of that Eclipse goo, it's just running GNU make, and the problem with the "build" command is probably to do with an incorrectly written Makefile.
No doubt a chip like this if it gains popularity will get an Arduino port.
It still amazes me that you can get an esp32 for $2
That's a full board with a wifi stack and USB power input.
I would love to some more stuff with this chip:)
I've seen chips from that company before. I think they make USB to serial chips used on Arduino clones.
Does it have Arduino support? It is very important for hobbyists in general, specially because of the large library base available. If not, soon there will be, as was the case with the ESP8266, ESP32, etc.
It probably doesn't flash the LED on the dev board by default as there are likely various dev boards, with LEDs etc on other pins I guess? This is really interesting though - I've used the STM8 part this copies on some small boards just doing multi-LED PWM animations and they've been reliable after months of service.
saving is necessary in order for make (or any other dependency tool) to pick up on the fact something is changed and need re-compilation.
I am a HARDCORE FORTH PROGRAMMER and constructor / designer , talking about "C" may make me re-read the unix haters handbook ... but yea HOW MUCH FUN CAN YOU HAVE ...wow that was cool . FORTH ! IS THE ONLY WAY KIDS ...
Most ide / compilers don't build off of what you see in the editor but what you've saved / written to the filesystem because usually the ide integration is just the ide asking your operating system to run the compiler with some arguments set, it wouldn't have access to your ide's text editors running memory. So yeah, ctrl+s regularly. The confusing thing I've run into are projects that copy their source files over to the "build" for reference when debugging, then you're sat there making edits to fix a silly bug that only get overwritten when you build again.
Now imagine the potential of those super little beasts in 10 years or so!
Awesome. Looks like a great alternative for the currently hard to find and overpriced STM8S003 mcu’s. But, as I can’t even buy these at the moment, I guess it remains just a potential alternative. :(
For all you 5V fanboys out there, these take 2.7-5.5V Vcc and have true rail-to-rail IOs. That's not so common among Western 32-bit offerings.
Not only is the ISA unencumbered with licenses and agreements, but RISC-V micros are inherently less complex than equivalent performing ARM micros, and require less area (or can be made on cheaper processes), and beyond that manufacturers are incentivized to actually get involved with core design, and even then if they don't care, the open core designs are always improving.
On these three fronts, the cost of everything except packaging will drive downward for RISC-V parts.
thanks for highlighting it and where to find it.
Cool to have something like that. I personally haven't played enough with my ESP32 and RP2040 µCs and don't really need these (especially while there's no IDE-free open build system yet, seems like), but maybe at some point… Thanks for showcasing the thing!
People developed an open system for the Padauk micro very quickly, same thign might happen here. It's all there really, nothing stopping someone taking all the dependencies and just usign the commend line GNU compiler without the IDE. Why not just use Ecplise though?
@@EEVblog I think I heard most of it in the video after submitting the comment, I'm only not in that hurry of verifying it for myself.
If I was a good specialist and really needed them, I would participate and invest my efforts into doing this; yet, I'm a silly curious viewer of your interesting videos.
I didn't really like Eclipse back when I tried it, prefer a lightweight text editor and make or cmake myself.
@@EEVblog Espressif are leading the way in migrating their powerful and now very mature stack. While they are still mostly relying on ESP32 with Tensilica cores, they are now so big and pervasive in the IoT market they stand to benefit immensely by moving across to RISC V by using the same SDK they have been developing for ages and are now at version 5.0
@Janus Kobain what are you saying? The log shows it uses makefiles just like so many other controllers out there. IDE is irrelevant. You could easily build that without the IDE, just using open source tools. As for the flasher, it's probably just a bunch of uart command that you could write into a Python script. Probably, less than a day's work.
Also, there are tons of eclipse based IDEs out there from the leading microcontroller manufacturers. They aren't pretty but really powerful once you get over the learning curve. But yes, they are a mixed bag. Some do implement really well, and others are really bad and slow, where a text editor like notepad++ is better.
Great video Dave!
Dave, if you do more review of this kit please dive into live debugging and breakpoint operation. PIC and TI chips both support it, it saves a lot of time.
We are testing this to add an automatic closing function to the bathroom ventilation fan. About 40% cheaper than comparable MCUs. Compared to the STM8, it's almost free.😁😁😁 My only concern is that if they don't last long and discontinue the product, the STM8 won't be a cost-effective alternative.
If I'm not totally wrong, Eclipse has an option to auto-save before build. That should do the trick...
The 10 CENT RISC V Processor! CH32V003 - Almost ready for prime time!
You do get in-depth.. But you should explain more about *WHAT* exactly the chip can do? use cases? what can it run?
Anything any other microcontroller with 4 KB RAM, 16 KB flash for the program, and N gpios and M ADCs and a C/C++ compiler can do?
Good explanation and demo. Eclipse, Netbeans et al have many peculiarities, sometimes you have to save, sometimes not, sometimes you have to double click to highlight / 'select' the project in the explorer window. A common gotcha is a work / temporary folder which stores the running file, a copy of the one you are viewing. On many occasions the view and work files 'lose connection' resulting in all sorts of oddities. You can test this by copying an older backup file into the Eclipse workspace, it will be ignored unless you open the file and edit it (just add a blank new line) and then save it. It could be much, much worse, have you ever tried the Arduino IDE, especially when trying to burn the bootloader or load a sketch into other IC's?
I lost it at the "partridge in a pear tree" part 😆
Can't wait for a mesh net to be available using this. Going to be super cheap to wire up a home. Near endlessly updateable. Right now it's a thousand bucks.
That was my first thought. network routing.
But 8 ADC's can be useful as well. It could run an 8 channel mixing board.
@@robertsmith2956 8 channels, not 8 ADCs as far as I know, so they will be multiplexed, so the more channels you use the slower the sampling rate. This is very common for microcontrollers. Loads of other microcontrollers like STM32 have more than 8 ADC channels and some even have multiple ADCs.
Saw a review of a RISC V sbc. Software support was lacking, but speed wise it was somewhere between a Raspberry Pi3 & 4. Coming along in leaps and bounds.
This one won't be that fast 😂
@@landspide I know. Just musing on the progress made.