2010-08-29 02:50 AM
Dear comunty,
I'm a older Microcontrollers programer. Well my question I think is easy for you. I know program microcontrollers with machine lenguage I mean: Lda ... Sta... Txa.. I don't know use C Program lenguage. Is possible to program STM8S Discovery with Mahcine lenguage? Where i can write the program In source screen where is? Thank you2010-10-05 05:41 AM
Hello,
You can program STM8x by using assembler language which is described in STM8 CPU programming manual (PM0044) available at /index.html but you need at least STVD environment. You can find all related information by installing STVD on your computer and read the included technical documentation on how to start developping your application step by step with STVD. Regards.2010-10-10 08:22 AM
Hello Angus,
Thanks, I've 4.2.0 St Visual devolop Where I can write my source code. Do you know if I need a new workspace and a new empty project Thank you for you help2010-10-12 08:56 AM
Hello,
The best way is to create a workspace by the menu File\New Workspace. Then choose Create workspace icon, validate by OK. Enter a name in the dialog Box as for intance MyProject and browse the workspace location. Enter a Project Filename as for intance, Mytest. Select the Toolchain (if you select ST Assembler Linker, your file must be written in assembler only, or Raisonance/Cosmic if you want to mix C code and ASM). Select the MCU, validate by Select then OK. You can start editing the asm file or c file with your own code. Regards.2010-10-14 11:50 AM
2010-10-15 05:48 AM
Hello,
Yes, you have to write your program in the main.asm file. You can delete lines that initializes RAM which are not mandatory. Otherwise, other method (where you can mix C and asm...) if you select STM8 Cosmic as toolchain (during project creation), you can edit the main.c file directly in assembler by adding the following directives: main() { #asm ..........your code in assembler here.......... #endasm while (1); } Regards.2010-12-28 06:20 PM
you'll find something interesting here. stm8s discovery folder file
8: init.stm8s ( 0357 AE 07 CF ) X=7CF ( 035A 94 ) SP=X ( 035B BF 24 ) r24=X ( 035D AE 07 80 ) X=780 ( 0360 BF 22 ) r22=X ( 0362 35 01 50 11 ) r5011=1 ( 0366 35 03 50 12 ) r5012=3 ( 036A 35 01 50 13 ) r5013=1 ( 036E 72 12 50 C5 ) r50C5.1=1 ( 0372 35 B4 50 C4 ) r50C4=0B4 ( 0376 72 07 50 C5 FB ) 0376 r50C5.3=0? ( 037B 72 17 50 C5 ) r50C5.3=0 ( 037F 35 02 52 43 ) r5243=2 ( 0383 35 68 52 42 ) r5242=68 ( 0387 35 00 52 44 ) r5244=0 ( 038B 35 00 52 46 ) r5246=0 ( 038F 35 0C 52 45 ) r5245=0C ( 0393 81 ) RET