86 questions
2
votes
1
answer
60
views
Assistance with inline Assembly porting to SDCC
I am porting the GetCurrentMicro function in the Arduino Core STM8 to my SDCC code and I noticed the Cosmic C Compiler _asm function allows me to return a result as well as an input in a C var.
Is ...
2
votes
0
answers
115
views
External Interrupt on Port A is affecting functionality of my other Button Inputs on STM8S103F3P6 microcontroller
I've been working on a IR based light controller using STM8S microcontroller. Using this blog as reference text I've got the IR to work on pin PA1, according to my use case.
The issue I'm facing is ...
1
vote
1
answer
66
views
STM8 Timer1 glitch or stalling issue
Timer error 1 in STM8S003F3P
I am writing code to create overflow 1s = Timer 1 to reduce the remaining_sec variable from 60 to 1. But the Timer often hangs for a while at random times.
For example, ...
1
vote
1
answer
54
views
STM8L152R8 board LED not turning on
I have been working with the STM8L152R8 development board, but it does not seem to let me blink LD2 (which should be mapped to PB5) or really change any value at all. Here is my code. Thanks!
#include ...
0
votes
2
answers
246
views
SWIM on STM8 does not respond on activation sequence by synchronization frame
I'm trying to work make SWIM activation sequence for STM8 by external microcontroller of another company.
I use timing diagram from UM0470
In phase 4 STM8 should respond to host by keeping swim pin ...
2
votes
0
answers
64
views
Unmasking SPI Interrupt for both TXE and RXNE on STM8S105
I am writing some firmware for an STM8S, and I want to have my SPI transmissions and receptions be handled in an ISR rather than polling.
According to pg. 284 of the reference manual, I should be ...
1
vote
1
answer
464
views
How to import STM8S/A Standard peripheral library in a STM8 project (ST Visual Develop)?
I'm new to STM8 programming and I'm using the STM8S/A Standard peripheral library without importing it, that is, copying and pasting the files into my src and inc folders, which I don't think is the ...
1
vote
1
answer
280
views
Evaluation if conditional statement on ST Visual Developer with Cosmic for STM8
I am using STVD IDE to write code for STM8 the compiler I am using is Cosmic STM8 C compiler and the standard peripheral library provided for STM8.
The problem I have is while evaluating an if ...
1
vote
0
answers
154
views
Stm8l mcu RTC calibration problem using RTC_SmoothCalibConfig()
stm8l151k4 mcu
rtc external crystal works stably but returns error when I want to write calibration value.
"RTC_SmoothCalibConfig(RTC_SmoothCalibPeriod_32sec, RTC_SmoothCalibPlusPulses_Reset,50);&...
1
vote
1
answer
264
views
STM8 Assembly startup code: Access Core registers to initialize stack pointer
I am currently trying to write startup code in assembly for an STM8 without any vendor libraries. More specifically, I am using an STM8S103f3p6. I am still inexperienced in assembly and with startup ...
1
vote
0
answers
73
views
stm8s003 timer1 channel2 capture doesn't work
this doesn't work:
TIM1_CCMR2 = 0b01; //its default input channel
TIM1_IER = 0b100; //channel 2 capture interrupt
TIM1_CCER2 = 0b1; //channel 2 capture
TIM1_CR1 = 0b1; //start counter
...
0
votes
0
answers
148
views
Will IAR complier optimization causing trouble on code running?
the code is using IAR High Level optimization with STM8L151G3, and I observed some problems on the production unit.
In each loop, the code will execute the code below:
__IO uint8_t ColorSwapFlag = 0;
...
0
votes
1
answer
872
views
Stm8 Option Byte Programming
I want to program "Option Byte" on STM8S005k6 without stvp. I do it by programming its code on Option Byte area but this makes it write protected only, not read protected:
void ...
0
votes
1
answer
246
views
STM8S003F3 tim2 configuration
I am using STM8S Cosmic C compiler, and I am trying to configure tim2 for 350 µs (350 µs should be the pulse width).
As per the reference manual, tim4 is a 16-bit with a prescaler factor of 32768. I ...
0
votes
1
answer
322
views
Stm8 assembly instructions
I am trying to learn some basic fw reverse engineering but I need some help. I am complete novice when it comes to asm but I do have some background on other languages.
What does the following line do?...