stm8 | A Collection of examples such as GPIO , UART , I2C
kandi X-RAY | stm8 Summary
kandi X-RAY | stm8 Summary
For compatibility with other STM8X (e.g. L) series of MCU's make sure the registers in the "include/stm8s.h" are compatible with your own MCU. Just make a copy of this file and apply changes according to the datasheet of the chip you have at hand. For tutorial on programming these examples on your MCU, please check the guide to flashing stm8 on linux.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of stm8
stm8 Key Features
stm8 Examples and Code Snippets
Community Discussions
Trending Discussions on stm8
QUESTION
I am new to STM32. I have recently installed STM32CUBEIDE. I have written basic code . connected ST-Link v2 (STM8 & STM32) to my laptop and pressed F11 (to debug). I get the following error
...ANSWER
Answered 2022-Feb-15 at 18:57I hate the same problem a while a go. In my chase the debugger it self (st/linkv2) was broken and I tried to upload it with a other dongle and it worked fine. So it could be just be a broken dongle.
QUESTION
I have build a prototype board with a STM8L, and I want it to be used and configured as a SPI slave. I am testing it with a raspberry pi as master.
I use the lib provided by ST called "STM8 Standard Peripherals Library" for this, but the documentation is very poor and doesn't expain how to do this...
I can send data from the Raspberry Pi with no issue and receive it on the STM8 but I can't send back any data to the raspberry from the STM8 on MISO.
Is anybody known how I can send back some data to the Raspberry Pi master? Where is my mistake?
Here is the main code:
...ANSWER
Answered 2021-Sep-26 at 19:14SPI requires the master to provide the clock. If you want the slave to send something - your master has to send some dummuy data to generate the clock for the slave.
QUESTION
I recently got a STM8 MCU and it has the built in function LCD_GLASS_DisplayString("STRING")
The problem with that function is, as you can see below, that I cannot directly display an integer on it:
...ANSWER
Answered 2021-Aug-20 at 11:17You're not far off with "0" + integer%10
- but you need to treat it as a character - '0' + integer%10
- and you need to pass LCD_GLASS_WriteChar
a pointer to this character.
One way to do this is:
QUESTION
I'm using SDCC to compile for a STM8 microcontroller. Compiling the following file results in a seemingly unnecessary div
instruction - which is very slow on the STM8.
ANSWER
Answered 2021-May-05 at 13:42Looks like that's a bug somewhere in the compiler because if b = c >> 0
is changed to b = c << 0
, b = c + 0
, b = a[0]
... then no such thing happens. The behavior is observed on both optimized and unoptimized code. But if you optimize for size (--opt-code-size
) then only the div
is there, the clr
instruction isn't emitted. You might want to report that to the developers
QUESTION
on my STM8 Disco Board with Cosmic Compiler I tried follwoing code and expected 'ptr_a' and 'ptr_aLocal' to be the same:
...ANSWER
Answered 2020-Oct-27 at 14:12Various older versions of misc embedded compilers tended to optimize code somewhat even when optimizations were supposedly disabled. Particularly Cosmic and Codewarrior had such quirks in older versions. Since the local variable isn't used, it is optimized away.
You can see this for yourself by viewing the generated assembler - any half-decent debugger will support assembly step debugging. If there is no stack push or index register store instruction there, then it was optimized away.
You can force the variable to get used with volatile int *ptr_aLocal
.
Unrelated to your question, you should use uint8_t
as far as possible nad not int
, when programming 8 bit microcontrollers.
QUESTION
I am attempting to write values directly to the eeprom space on a stm8 micro controller. I don't want to write a program that does this that I flash onto the chip. But i want to write directly to it. The command to do this is in unix is such:
...ANSWER
Answered 2020-Apr-09 at 22:17The easiest thing to do was to first read the file like so:
QUESTION
ANSWER
Answered 2020-Jan-17 at 14:35If you want to program uCs from your C application just use openOCD (free) and send commands to it. Works with almost every popular debug probe.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install stm8
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page