Regarding the Z80 - it's a great thing! My first PC was a ZX Spectrum 48 KB. It was this device that got me interested in digital electronics. YES, nostalgia...
But there are other compilers that support this microprocessor. for example this site: https://www.oshonsoft.com/
I don't think Z80 relevant now. Maybe as a training project to train your brain. But I can't even estimate the amount of time that needs to be invested in it!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
To load the firmware into STC, I made a converter with galvanic isolation. With its help, you can load the code, as well as debug via UART. There is also a converter to RS-485 on the board - sometimes it helps me out...
Unfortunately for some, I do not use KiCAD, I bought DipTrace a long time ago and am happy with it. I can post Gerber files and a list of components for self-ordering the product.
Unfortunately, my knowledge of assembler is superficial and I can not help with advice. By the way, I try not to use assembler for portability of programs between different platforms.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My new version of USB-TTL with conversion to RS485. You can not solder the right chip MAX485 and use only for loading firmware into chips. But power is applied from the chip, the programmer has galvanic isolation!
I want to make a new programmer, with power supply to the board with the chip.
The fact is that the bootloader built into the chip is activated only by power supply!
Please note: The download program has built-in help and examples for all cases! Select the chip type, and get a catalog of tips, utilities for calculating UART, CAN, port operating modes, timers and delays. There is also a built-in terminal for debugging...
Also this program can make a program for loading your firmware into the chip with hints for your buyer. You do not need to do encryption - it happens automatically.
You get a single file for Windows
You can open ODS with Excel or LibreOffice. There are also a lot of other information about STC 8051 at the same place: https://codeberg.org/20-100/Awesome_STC
👍
1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
oh! yes, I remember this program! I wrote articles and books in it in 2002-2003 )) I downloaded it, I'll try to read your notes. 30 years ago I tried to learn Bulgarian, Serbian and Czech. But I forgot almost everything.
Děkuji!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attention! Only version "B" has USB bootloader!
I bought several of these chips and they do not have USB bootloader. At the moment I do not know how to distinguish these versions: there is no marking on the chip.
This is also stated in the documentation for this series.
ps
I had a need to test a USB bootloader of STC8H8K64U and at the same time I had an order to develop a device. I implemented the project on these chips, connected the signals to the connector (top). But I still couldn't apply boot via USB... My version of the chip has only UART boot, unfortunately.
as above said all stc8 have build in bootloader fixed from factory and non removable you not nothing more than a serial TTL adaptor,
the ONLY advantage of their own serial adaptor is that powercycle during programing, otherwise you must manually power off/on device to enter bootloader mode
as for toolchain both alexander and i use ONLY basic, we used bascom, bascom has a free 4kb limited version but does NOT export asm , if that your point
however if you are looking for asm output i may suggest mikrobasic 8051, who also has a 2kb demo and produces asm output , so maybe some help is what you are looking for
aka basic to asm adaptor, where I (And alexander) are not able to help :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Made a programmer for STC with power management via the /RTS signal of the CH330N converter chip. I took the usb-rs485 converter board as a basis.
As you can see, it is possible to make it with improvised means. I used a P-Channel MOSFET transistor - irlml6402, but you can use others, preferably with a logical control level.
Be sure to make a common minus using a jumper on the back of the board! This programmer does not have galvanic isolation of signals and power supply! Remember this!
hi!
I have an idea how to help you with creating a compiler.
Bascom only outputs a HEX and BIN files, but does not output a file with assembler code.
But it outputs a file for the debugger - NOI. This file contains the line number of the program code in BASIC and the start address in the bin file.
I have a good disassembler, which I configured to work correctly with the STC registers.
You can write a program to process these text files in order to combine this data from several files.
I don't know about the quality of the generated code for MikroElektronika-8051, but the quality of the code for AVR and PIС versions was terrible!
I helped the authors of this product 20 years ago, and had a free key for their products.
At that time I wrote for PIС and knew this assembler quite well. The code they generated was very strange! That's why I never used their products in my commercial projects...
Last edit: Aleksandr Danilin 2025-02-12
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
yes but FAstAVR was for AVR, and also author has complete DISAPPEAR from earth's face :)
anyway i am not claiming about MikroE, quality, i am just saying is maybe a nice "hint" to work at beginning. at any case MikroeBasic is an abandonware product so...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Giving the example of FastAVR, I spoke about the principle, and not AVR as a chip to follow ;-)
At first I communicated with the author of FastAVR, but I did not know how to pay outside the country. Later such an opportunity appeared, but the author stopped answering. I asked a friend from Serbia to call him, but the number was not in service...
By the way, on the forum Bascom the first messages and examples of programs for Bascom were written by him, judging by the nickname.
The author of Bascom immediately deleted all my questions about this 8-)
This gives me some ideas.
But why remember the past?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding the Z80 - it's a great thing! My first PC was a ZX Spectrum 48 KB. It was this device that got me interested in digital electronics. YES, nostalgia...
But there are other compilers that support this microprocessor. for example this site: https://www.oshonsoft.com/
I don't think Z80 relevant now. Maybe as a training project to train your brain. But I can't even estimate the amount of time that needs to be invested in it!
To load the firmware into STC, I made a converter with galvanic isolation. With its help, you can load the code, as well as debug via UART. There is also a converter to RS-485 on the board - sometimes it helps me out...
Unfortunately for some, I do not use KiCAD, I bought DipTrace a long time ago and am happy with it. I can post Gerber files and a list of components for self-ordering the product.
Last edit: Aleksandr Danilin 2025-02-07
Thank you for these posts and insights.
Very good.
Which specfic 8051 are you using?
And, post the GERBERs... I will need programmer.
To create the file I used the description of the entire series. http://www.stcmicro.com/datasheet/STC8H-en.pdf
To load the firmware into the chip, a program is used: https://www.stcmicro.com/rjxz.html
after it is launched, it loads the update
Over the course of a year I posted the results of my studies of this chip on a Russian forum, you can take everything there: http://bascomavr.bbok.ru/viewforum.php?id=58
for example, DAT-files for the compiler with a description of registers and chip parameters. I think this can help to you in creating a new compiler.
STC8H1K28.DAT http://bascomavr.bbok.ru/viewtopic.php?id=2395#p34628
STC8H1K08.DAT http://bascomavr.bbok.ru/viewtopic.php?id=2395#p34398
Unfortunately, my knowledge of assembler is superficial and I can not help with advice. By the way, I try not to use assembler for portability of programs between different platforms.
the programmer can be made from any available usb-com converter!
You can find it in stores by the words:** USB to TTL 4-pin Wire **
My new version of USB-TTL with conversion to RS485. You can not solder the right chip MAX485 and use only for loading firmware into chips. But power is applied from the chip, the programmer has galvanic isolation!
I want to make a new programmer, with power supply to the board with the chip.
The fact is that the bootloader built into the chip is activated only by power supply!
high-speed optocouplers PC410L SOIC5-6P
converter CH340N SOP8
connector angular USB-B 292304-1
Last edit: Aleksandr Danilin 2025-02-08
dat-files
8H1K08.DAT
8H1K28.DAT
STC8.DAT
15W105.DAT
Please note: The download program has built-in help and examples for all cases! Select the chip type, and get a catalog of tips, utilities for calculating UART, CAN, port operating modes, timers and delays. There is also a built-in terminal for debugging...
Also this program can make a program for loading your firmware into the chip with hints for your buyer. You do not need to do encryption - it happens automatically.
You get a single file for Windows
Last edit: Aleksandr Danilin 2025-02-08
STC8H8K64U also have USB bootloader (HID) so no need for any programmer or USB-TTL converter.
instructions and development board (expand "Description" section):
https://aliexpress.com/item/1005005144706171.html
other development boards (DIP ZIF included) and bare chips:
https://aliexpress.com/item/1005006439568251.html
STC8H8K64U-45I is available in SOP16, TSSOP20, QFP32, QFP48, QFP64 and DIP40 package.
Other STC 8051 USB chips:
STC8H2K08U-45I (SOP16, TSSOP20)
STC8H2K17U-45I (SOP16, TSSOP20, QFN20)
STC8H2K32U-45I (TSSOP32, LQFP32, QFN32)
STC8H8K32U-45I (LQFP32, LQFP48, LQFP64)
Full selection table:
https://codeberg.org/20-100/Awesome_STC/src/branch/master/STC_MCU_features.ods
how can i open this ODS format?
You can open ODS with Excel or LibreOffice. There are also a lot of other information about STC 8051 at the same place: https://codeberg.org/20-100/Awesome_STC
oh! yes, I remember this program! I wrote articles and books in it in 2002-2003 )) I downloaded it, I'll try to read your notes. 30 years ago I tried to learn Bulgarian, Serbian and Czech. But I forgot almost everything.
Děkuji!
Attention! Only version "B" has USB bootloader!
I bought several of these chips and they do not have USB bootloader. At the moment I do not know how to distinguish these versions: there is no marking on the chip.
This is also stated in the documentation for this series.
ps
I had a need to test a USB bootloader of STC8H8K64U and at the same time I had an order to develop a device. I implemented the project on these chips, connected the signals to the connector (top). But I still couldn't apply boot via USB... My version of the chip has only UART boot, unfortunately.
Last edit: Aleksandr Danilin 2025-02-08
as above said all stc8 have build in bootloader fixed from factory and non removable you not nothing more than a serial TTL adaptor,
the ONLY advantage of their own serial adaptor is that powercycle during programing, otherwise you must manually power off/on device to enter bootloader mode
as for toolchain both alexander and i use ONLY basic, we used bascom, bascom has a free 4kb limited version but does NOT export asm , if that your point
however if you are looking for asm output i may suggest mikrobasic 8051, who also has a 2kb demo and produces asm output , so maybe some help is what you are looking for
aka basic to asm adaptor, where I (And alexander) are not able to help :)
Made a programmer for STC with power management via the /RTS signal of the CH330N converter chip. I took the usb-rs485 converter board as a basis.
As you can see, it is possible to make it with improvised means. I used a P-Channel MOSFET transistor - irlml6402, but you can use others, preferably with a logical control level.
Be sure to make a common minus using a jumper on the back of the board!
This programmer does not have galvanic isolation of signals and power supply! Remember this!
Last edit: Aleksandr Danilin 2025-02-09
I have order the parts. This will be a project for me after I have completed the current backlog. This is something I want to do.
Be patient as I am already fully booked until late March!
No problem :-)
I'm here at a friend's request.
I bought and use another compiler.
If my experience with STC is useful, I'll try to help everyone.
Would you send me a Personal Message with email address? I may want to contact you when I get started.
hi!
I have an idea how to help you with creating a compiler.
Bascom only outputs a HEX and BIN files, but does not output a file with assembler code.
But it outputs a file for the debugger - NOI. This file contains the line number of the program code in BASIC and the start address in the bin file.
I have a good disassembler, which I configured to work correctly with the STC registers.
You can write a program to process these text files in order to combine this data from several files.
Last edit: Aleksandr Danilin 2025-02-12
hoewever it is much simpler to use mikroe Basic, demo , which outpute normal asm :)
I don't know about the quality of the generated code for MikroElektronika-8051, but the quality of the code for AVR and PIС versions was terrible!
I helped the authors of this product 20 years ago, and had a free key for their products.
At that time I wrote for PIС and knew this assembler quite well. The code they generated was very strange! That's why I never used their products in my commercial projects...
Last edit: Aleksandr Danilin 2025-02-12
the FastAVR compiler had a very convenient method of informing ...
it simultaneously showed BASIC code and assembler code
yes but FAstAVR was for AVR, and also author has complete DISAPPEAR from earth's face :)
anyway i am not claiming about MikroE, quality, i am just saying is maybe a nice "hint" to work at beginning. at any case MikroeBasic is an abandonware product so...
Giving the example of FastAVR, I spoke about the principle, and not AVR as a chip to follow ;-)
At first I communicated with the author of FastAVR, but I did not know how to pay outside the country. Later such an opportunity appeared, but the author stopped answering. I asked a friend from Serbia to call him, but the number was not in service...
By the way, on the forum Bascom the first messages and examples of programs for Bascom were written by him, judging by the nickname.
The author of Bascom immediately deleted all my questions about this 8-)
This gives me some ideas.
But why remember the past?