Author Topic: I am exploring STC 8051 MCU and writing up  (Read 13792 times)

0 Members and 1 Guest are viewing this topic.

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
I am exploring STC 8051 MCU and writing up
« on: October 26, 2016, 06:43:42 pm »
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:


If you have any ideas that I can look into for you please tell me.
« Last Edit: October 27, 2016, 06:24:37 pm by technix »
 
The following users thanked this post: miceuz, laneboysrc

Offline obiwanjacobi

  • Frequent Contributor
  • **
  • Posts: 988
  • Country: nl
  • What's this yippee-yayoh pin you talk about!?
    • Marctronix Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #1 on: October 26, 2016, 07:22:40 pm »
Perhaps a post dedicated to the IDE and the compilers available?
Arduino Template Library | Zalt Z80 Computer
Wrong code should not compile!
 

Offline miceuz

  • Frequent Contributor
  • **
  • Posts: 387
  • Country: lt
    • chirp - a soil moisture meter / plant watering alarm
Re: I am exploring STC 8051 MCU and writing up
« Reply #2 on: October 26, 2016, 07:36:32 pm »
Do you work under Linux? What toolchain do you use?

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:


If you have any ideas that I can look into for you please tell me.

Offline eugenenine

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
Re: I am exploring STC 8051 MCU and writing up
« Reply #3 on: October 26, 2016, 07:41:29 pm »
(link blocked at work)  Are these the same as the old Intel 8051?
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: I am exploring STC 8051 MCU and writing up
« Reply #4 on: October 26, 2016, 07:57:17 pm »
« Last Edit: October 26, 2016, 08:03:33 pm by ebclr »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16847
  • Country: lv
Re: I am exploring STC 8051 MCU and writing up
« Reply #5 on: October 26, 2016, 09:47:34 pm »
(link blocked at work)  Are these the same as the old Intel 8051?
8051 instruction set but not the same at all.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #6 on: October 27, 2016, 01:27:38 am »
Perhaps a post dedicated to the IDE and the compilers available?
Do you work under Linux? What toolchain do you use?

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:


If you have any ideas that I can look into for you please tell me.
I 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.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #7 on: October 27, 2016, 01:35:35 am »
(link blocked at work)  Are these the same as the old Intel 8051?

No. They used a new core that is ISA-compatible with traditional 8051, but executes them in a variable cycle count.
 

Offline sleemanj

  • Super Contributor
  • ***
  • Posts: 3024
  • Country: nz
  • Professional tightwad.
    • The electronics hobby components I sell.
Re: I am exploring STC 8051 MCU and writing up
« Reply #8 on: October 27, 2016, 01:40:02 am »
I 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.

You 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."
~~~
EEVBlog Members - get yourself 10% discount off all my electronic components for sale just use the Buy Direct links and use Coupon Code "eevblog" during checkout.  Shipping from New Zealand, international orders welcome :-)
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: I am exploring STC 8051 MCU and writing up
« Reply #9 on: October 27, 2016, 01:45:46 am »
I would suggest that on your studies you compare against

EFM8BB10

and

C8051F320 

Both from silabs, those are the fastest 8051 I know, STC is also a option but more on price than specs
 
The following users thanked this post: grantb5

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #10 on: October 27, 2016, 05:33:50 am »
I 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.

You 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."

I 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.
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: I am exploring STC 8051 MCU and writing up
« Reply #11 on: October 27, 2016, 09:48:02 am »
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.)
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #12 on: October 27, 2016, 11:45:21 am »
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.)
I 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.
« Last Edit: October 27, 2016, 11:55:04 am by technix »
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: I am exploring STC 8051 MCU and writing up
« Reply #13 on: October 27, 2016, 11:48:20 am »
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/pttes

There 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 at https://www.safaribooksonline.com/library/view/making-embedded-systems/9781449308889/
« Last Edit: October 27, 2016, 11:49:57 am by Kalvin »
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #14 on: October 27, 2016, 11:50:26 am »
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. The book is from 2001 but it is still valid. One can download the book from: http://www.safetty.net/publications/pttes

There 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 at https://www.safaribooksonline.com/library/view/making-embedded-systems/9781449308889/

Thanks 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.)
 

Offline Kalvin

  • Super Contributor
  • ***
  • Posts: 2145
  • Country: fi
  • Embedded SW/HW.
Re: I am exploring STC 8051 MCU and writing up
« Reply #15 on: October 27, 2016, 11:57:11 am »
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. The book is from 2001 but it is still valid. One can download the book from: http://www.safetty.net/publications/pttes

There 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 at https://www.safaribooksonline.com/library/view/making-embedded-systems/9781449308889/

Thanks 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.)

The 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.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #16 on: October 27, 2016, 12:19:18 pm »
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. The book is from 2001 but it is still valid. One can download the book from: http://www.safetty.net/publications/pttes

There 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 at https://www.safaribooksonline.com/library/view/making-embedded-systems/9781449308889/

Thanks 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.)

The 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.
I think I have a similar one too, although mine targets old-school ARM7.
 


Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #18 on: October 27, 2016, 05:18:17 pm »
For people interested

http://www.stcmicro.com/stcmcu.html

Remember in China they speak Chinese, you are the one that is the foreign there

https://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
From 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.)
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #19 on: October 27, 2016, 06:28:55 pm »
I would suggest that on your studies you compare against

EFM8BB10

and

C8051F320 

Both from silabs, those are the fastest 8051 I know, STC is also a option but more on price than specs

Neither part is easy to be hand soldered or breadboarded, and C8051F320costs more than IAP15F4K61S4.
 

Offline wraper

  • Supporter
  • ****
  • Posts: 16847
  • Country: lv
Re: I am exploring STC 8051 MCU and writing up
« Reply #20 on: October 27, 2016, 06:38:01 pm »
I would suggest that on your studies you compare against

EFM8BB10

and

C8051F320 

Both from silabs, those are the fastest 8051 I know, STC is also a option but more on price than specs

Neither part is easy to be hand soldered or breadboarded, and C8051F320costs more than IAP15F4K61S4.
I guess  DIP adapter boards are not a problem in China.
 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: I am exploring STC 8051 MCU and writing up
« Reply #21 on: October 27, 2016, 07:32:46 pm »
Cypress, mixed signal 8051 or ARM -

For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, sililiar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) DAC, IDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD
  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE
9) Custom components capability
10) DMA to offload processes like filters
11) ARM M0 or M3 or 8051 core
12) Extensive clock generation capabilities

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an onchip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component

This is low end of family, consider 5LP parts as well. PSOC also has arduino footprint boards (pioneer) as well

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc


Contact 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 being
used.


Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: I am exploring STC 8051 MCU and writing up
« Reply #22 on: October 27, 2016, 08:06:05 pm »
Cypress psoc is a "state of art" product, nothing to compete
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #23 on: October 28, 2016, 04:12:15 am »
I would suggest that on your studies you compare against

EFM8BB10

and

C8051F320 

Both from silabs, those are the fastest 8051 I know, STC is also a option but more on price than specs

Neither part is easy to be hand soldered or breadboarded, and C8051F320costs more than IAP15F4K61S4.
I guess  DIP adapter boards are not a problem in China.
You still need to solder the chips onto the DIP adapter, so the hand soldering problem is not bypassed.
 

Offline technixTopic starter

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: I am exploring STC 8051 MCU and writing up
« Reply #24 on: October 28, 2016, 04:40:09 am »
Cypress, mixed signal 8051 or ARM -

For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, sililiar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) DAC, IDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD
  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE
9) Custom components capability
10) DMA to offload processes like filters
11) ARM M0 or M3 or 8051 core
12) Extensive clock generation capabilities

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an onchip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component

This is low end of family, consider 5LP parts as well. PSOC also has arduino footprint boards (pioneer) as well

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc


Contact 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 being
used.


Regards, Dana.
I appreciate the PSoC line, but I just cannot afford it yet.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf