I am exploring STC 8051 MCU and writing up - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: October 26, 2016, 06:43:42 pm
content: STC 8051 MCUs are cheap (even their highest end chip costs less than a US dollar,) I believe someone here may be interested. I decided to explore it, despite my primary workhorse microcontroller is still AVR and ARM.So far I have done the follwoing explorations:Explore the STC product portfolioCheck if it is not the old school 12T coreSamples from STC and some not-so-trivial codeBug solvedTiming code rewrittenIf you have any ideas that I can look into for you please tell me.

author: obiwanjacobi
author_rank: Super Contributor
timestamp: October 26, 2016, 07:22:40 pm
content: Perhaps a post dedicated to the IDE and the compilers available?

author: miceuz
author_rank: Frequent Contributor
timestamp: October 26, 2016, 07:36:32 pm
content: Do you work under Linux? What toolchain do you use?Quote from: technix on October 26, 2016, 06:43:42 pm

author: eugenenine
author_rank: Frequent Contributor
timestamp: October 26, 2016, 07:41:29 pm
content: (link blocked at work) Are these the same as the old Intel 8051?

author: ebclr
author_rank: Super Contributor
timestamp: October 26, 2016, 07:57:17 pm
content: They are 8051You can chose from a lot of IDE'sKeil is the default option, but have a lot of options for any tastyhttp://www.keil.com/c51/c51.asphttp://www.mikroe.com/mikroc/8051/http://sdcc.sourceforge.net/http://www.rigelcorp.com/reads51.htmhttp://www.raisonance.com/8051-compiler.htmlhttp://www.crossware.com/i8051/CompilerOnly to show a few

author: wraper
author_rank: Unknown
timestamp: October 26, 2016, 09:47:34 pm
content: Quote from: eugenenine on October 26, 2016, 07:41:29 pm8051 instruction set but not the same at all.

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 01:27:38 am
content: Quote from: obiwanjacobi on October 26, 2016, 07:22:40 pmQuote from: miceuz on October 26, 2016, 07:36:32 pmI will have a dedicated part for this question, setting up development environment using SDCC under UNIX (I will be using Xcode or Eclipse CDT under macOS, but that should be a very similar situation under Linux.) For now I am using Keil under Windows as the ISP/OCD tools and header files are Keil-only from STC.

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 01:35:35 am
content: Quote from: eugenenine on October 26, 2016, 07:41:29 pmNo. They used a new core that is ISA-compatible with traditional 8051, but executes them in a variable cycle count.

author: sleemanj
author_rank: Super Contributor
timestamp: October 27, 2016, 01:40:02 am
content: Quote from: technix on October 27, 2016, 01:27:38 amYou might find this useful from Linux:https://github.com/grigorig/stcgal"stcgal is a command line flash programming tool for STC MCU Ltd. 8051 compatible microcontrollers. The name was inspired by avrdude (... ) STC only provide a (crude) Windows GUI application for programming (...) stcgal is a full-featured Open Source replacement for STC's Windows software; it supports a wide range of MCUs, it is very portable and suitable for automation."

author: ebclr
author_rank: Super Contributor
timestamp: October 27, 2016, 01:45:46 am
content: I would suggest that on your studies you compare againstEFM8BB10andC8051F320Both from silabs, those are the fastest 8051 I know, STC is also a option but more on price than specs

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 05:33:50 am
content: Quote from: sleemanj on October 27, 2016, 01:40:02 amI think I have this on my MacBook Pro. In the dedicated part I will be porting the STC15 headers to sdcc (maybe a rewrite?) and try to get the building and uploading work under either Xcode or Eclipse CDT.

author: westfw
author_rank: Super Contributor
timestamp: October 27, 2016, 09:48:02 am
content: So... can I get these in the USA? I expected to find them all over AliExpress, but they were uncommon, and rather expensive (compared to ST chips, for instance.)

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 11:45:21 am
content: Quote from: westfw on October 27, 2016, 09:48:02 amI don't know about that, as they don't even allow distributors in China. If you want some I can order them for you and send them your way though.If you are just playing around I would suggest IAP15W4K61S4-30I-PDIP40, which is the flagship of their entire product line, pin-to-pin compatible with other STC15 chips in DIP-40 package, supports on-chip debug, and have Von Newmann-connected internal ROM (through the use of EEPROM access registers)Or if you are okay with a bit less than the best, I can send you a IAP15L2K61S2-28I-PDIP40 - the extra I got from the sample order. That chip runs only at 3.3V (instead of 2.7-5.5V range for the STC15W variant,) have 2 UARTs instead of 4 and half the RAM.

author: Kalvin
author_rank: Super Contributor
timestamp: October 27, 2016, 11:48:20 am
content: The book "Patterns for Time-Triggered Embedded Systems: Building Reliable Applications with the 8051 Family of Microcontrollers" contains good information on how to use the 8051 with a simple [time triggered] scheduler and presents good information on embedded systems programming and useful patterns. The book is from 2001 but it is still valid. One can download the book from:http://www.safetty.net/publications/pttesThere is also a course material floating around "Programming Embedded Systems II. A 10-week course, using C and 8051 by Michael J. Pont" which complements the book mentioned above.One may also be interested in "Making Embedded Systems: Design Patterns for Great Software". by Elecia White. One can preview the book athttps://www.safaribooksonline.com/library/view/making-embedded-systems/9781449308889/

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 11:50:26 am
content: Quote from: Kalvin on October 27, 2016, 11:48:20 amThanks for the book list. I am just exploring their chips but those will not become my primary workhorse (that will still be AVR and ARM, depending on project scale.)

author: Kalvin
author_rank: Super Contributor
timestamp: October 27, 2016, 11:57:11 am
content: Quote from: technix on October 27, 2016, 11:50:26 amThe ideas presented in the books are easily reusable also with any other microcontroller, including AVR and ARM. Of course the book targeted for 8051 is somewhat 8051 specific, but the concepts and the ideas presented are pretty much universal, architecture independent.

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 12:19:18 pm
content: Quote from: Kalvin on October 27, 2016, 11:57:11 amI think I have a similar one too, although mine targets old-school ARM7.

author: ebclr
author_rank: Super Contributor
timestamp: October 27, 2016, 01:03:31 pm
content: For people interestedhttp://www.stcmicro.com/stcmcu.htmlRemember in China they speak Chinese, you are the one that is the foreign therehttps://world.taobao.com/search/search.htm?sort=price&_ksTS=1477573346341_425&spm=a21bp.7806943.20151106.1&json=on&cna=Fb46ECHjIXICAbrne69e0gIM&module=sortList&_input_charset=utf-8&navigator=all&s=0&q=stc%20mcu&callback=__jsonp_cb&abtest=_AB-LR517-LR854-LR895-PR517-PR854-PR895

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 05:18:17 pm
content: Quote from: ebclr on October 27, 2016, 01:03:31 pmFrom my experience in exploring those chips sofar, I think that for tinkerers it is better to go straight for IAP15W4K61S4 or IAP15W4K58S4, the two flagship models from STC (although a better line, STC8, is announced but not manufactured en masse.)

author: technix
author_rank: Super Contributor
timestamp: October 27, 2016, 06:28:55 pm
content: Quote from: ebclr on October 27, 2016, 01:45:46 amNeither part is easy to be hand soldered or breadboarded, and C8051F320costs more than IAP15F4K61S4.

author: wraper
author_rank: Unknown
timestamp: October 27, 2016, 06:38:01 pm
content: Quote from: technix on October 27, 2016, 06:28:55 pmI guess DIP adapter boards are not a problem in China.

author: danadak
author_rank: Super Contributor
timestamp: October 27, 2016, 07:32:46 pm
content: Cypress, mixed signal 8051 or ARM -For me what stands out is -1) Routability2) Fast 12 bit SAR A/D and slow 20 bit DelSig3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFBcan be used as a GP fast processor block, sililiar to RISC block4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGAlike capability5) Onboard Vref6) DAC, IDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....7) LCDCOM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE9) Custom components capability10) DMA to offload processes like filters11) ARM M0 or M3 or 8051 core12) Extensive clock generation capabilitieshttps://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=truehttp://www.cypress.com/documentation/code-examples/psoc-345-code-examplesGreat video libraryAttached component list. A component is an onchip HW resource.Free GUI design tool with schematic capture, "Creator". Components have rich API library attachedto each componentThis is low end of family, consider 5LP parts as well. PSOC also has arduino footprint boards (pioneer) as wellhttps://www.elektormagazine.com/labs/robot-build-with-cypress-psochttp://www.cypress.com/products/32-bit-arm-cortex-m-psocContact the local sales office, "RSM", regional sales manager, and FAE as well, maybe they can give you some stuff as well.Never be afraid to ask. Even contact the Manufacturers Rep, sometimes they can have some boards laying around not beingused.Regards, Dana.

author: ebclr
author_rank: Super Contributor
timestamp: October 27, 2016, 08:06:05 pm
content: Cypress psoc is a "state of art" product, nothing to compete

author: technix
author_rank: Super Contributor
timestamp: October 28, 2016, 04:12:15 am
content: Quote from: wraper on October 27, 2016, 06:38:01 pmYou still need to solder the chips onto the DIP adapter, so the hand soldering problem is not bypassed.

author: technix
author_rank: Super Contributor
timestamp: October 28, 2016, 04:40:09 am
content: Quote from: danadak on October 27, 2016, 07:32:46 pmI appreciate the PSoC line, but I just cannot afford it yet.

author: ebclr
author_rank: Super Contributor
timestamp: October 28, 2016, 05:28:12 am
content: Are you sure ?https://world.tmall.com/item/539649031832.htm?spm=a312a.7700714.0.0.mJrRTa

author: technix
author_rank: Super Contributor
timestamp: October 28, 2016, 12:53:47 pm
content: Quote from: ebclr on October 28, 2016, 05:28:12 amArduino Due clones are a bit cheaper than this, so might as well pass on to something that is slightly better supported.

author: dannyf
author_rank: Super Contributor
timestamp: October 28, 2016, 02:45:09 pm
content: QuoteIf you are interested in mixed signal work - measurement instrumentation for example, F350 is a god sent.

author: technix
author_rank: Super Contributor
timestamp: October 28, 2016, 03:20:48 pm
content: Quote from: dannyf on October 28, 2016, 02:45:09 pmBack when I was planning on making my own multimeter I was thinking about using the MCP3911 ADC with whatever MCU ended up being appropriate for the code.

author: technix
author_rank: Super Contributor
timestamp: November 01, 2016, 03:12:23 pm
content: So are you guys still interested in this?

author: grantb5
author_rank: Regular Contributor
timestamp: February 29, 2024, 04:38:42 pm
content: Quote from: ebclr on October 27, 2016, 01:45:46 amI have used the C8051F380 and EFM8UB20F64G (same chip by a different name) and it's excellent. I would also highly recommend Nuvoton's Flash 8051 parts. Both SILabs and Nuvoton have real debugging (single-step, breakpoint, watch variables, etc) rather then burn and learn. Both are available in stock at normal distributors (Digikey and/or Mouser and probably more).