Questions tagged [stm8]

Low-cost 8-bit microprocessor family with a stack pointer, and a unified address space Harvard architecture. Don't use for STM32!

Filter by
Sorted by
Tagged with
0 votes
1 answer
58 views

What mode does the stm8 switch to during EMC testing?

I'm running an EMC test. During the test my stm8l152c6 immediately goes into some mode where everything stops working (neither LEDs nor buttons react). Only turning ...
Arthas's user avatar
  • 3
0 votes
0 answers
15 views

STM8S001J3 not responding

I am using an STM8S001J3 in a project as shown in the above circuit. I am trying to program it using the below code using IAR and programming it using STVP. STVP gives successful message, but the ...
JSNerd01's user avatar
0 votes
0 answers
89 views

Why is this ST-link V2 not pairing with the STM8s MCU?

I had connected this circuit like in this schematic using the ST-LINK V2, however I made some changes, I connected the 2 and 3 pins (OSCIN, OSCOUT) to 12pf capacitors (I have no 20pf or higher) and ...
Hazardous Voltage's user avatar
1 vote
0 answers
195 views

STM8L DMA and ADC out of sync

I have STM8LDiscovery (with STM8L152C6T6 CPU). I need to continuously read 2 ADC channels with writing the data to the memory. I'm doing my project in IAR EW for STM8 v. 3.11.4. I run into the problem:...
Roman Matveev's user avatar
1 vote
2 answers
405 views

STM8S I2C - Stuck while generating START condition

I'm trying to make an i2c scanner (just like the arduino one) for the STM8S005K6 but I can't seem to even generate a start condition for the communication to begin. I have to say, I've never used STM8 ...
fpp's user avatar
  • 171
0 votes
0 answers
118 views

Multiple failed ST-LINK/V2

I have been using a ST-LINK/V2 for a project that uses a STM8 microcontroller. The ST-LINK is connected to the microcontroller using the 4 pin SWIM port. The microcontroller is powered from an ...
user2248702's user avatar
3 votes
1 answer
179 views

How to use the "ground-referenced" comparator on this microcontroller?

I chose to use an STM8L101F3P6 low power microcontroller for a sensor node. This microcontroller, however, lacks an ADC and instead implements 2 comparator units with a block diagram presented on its ...
Tirdad Sadri Nejad's user avatar
0 votes
1 answer
133 views

STM8S Custom Board Programming

I have designed a custom board for a STM8S105C6T6 microcontroller intended for commercial use. I have coded the program and tested it using the stm8s discovery board. Now I find myself not knowing ...
Daniel Gil's user avatar
1 vote
0 answers
42 views

Interfacing with BME280 via STM8L101F3 via SPI

I'm trying to use the BME280 via an STM8L101F3. However I cannot seem to get any data from the sensor. As a start I would like to read the chip ID to verify that everything is working. However, I have ...
Joris Gravesteijn's user avatar
1 vote
2 answers
389 views

STM8S ADC scan mode not reading all channels

I am using an STM8S105C6 MCU (user guide), specifically a discovery board, with Cosmic C and the standard peripheral library provided by STM. I have hooked up 2 signals to channels 0 and 1 of the ADC. ...
Daniel Gil's user avatar
4 votes
5 answers
1k views

Would writing to the same flash address reduce the lifespan of an MCU?

I am using an STM8 microcontroller. Since the vector table is in flash memory, I need to write to flash memory in order to create and use the vector table. Since addresses of vector tables are fixed, ...
Günkut Ağabeyoğlu's user avatar
0 votes
1 answer
163 views

STM8L ADC multiple channel read problem

I am using an STM8L151Cx with the Cosmic C compiler to develop a 3 phase ammeter. I rsn into an issue during my last stage of development. 3 phase current is connected to 3 channels in the controller ...
NINJA's user avatar
  • 21
1 vote
1 answer
596 views

How to suppress unused C library functions in SDCC compiler?

Previously I used the COSMIC compiler for STM8 development. In a cosmic compiler, there is an argument called 'SPLIT' which can be passed while using it on the command line. This allows the linker to ...
Vivekanand Dhakane's user avatar
1 vote
0 answers
670 views

STM8: How to make External Interrupt Handler firing only once

I have a external interrupt handler which is tied to a button which will be fired upon pressed. ...
Scarittagle's user avatar
0 votes
1 answer
231 views

STM8S: How to keep my functions from being interrupted by the delay function?

I was building a simple blink application on an STM8S. The LED on-off interval was controlled by the delay function using the TIM4 interrupt. A button event monitor is using another external ...
Scarittagle's user avatar
1 vote
1 answer
306 views

STM8 ADC does not use the whole conversion result buffer, despite the manual saying it does

I want to use the single buffering mode of the ADC on a STM8S003. As the reference manual describes, in this mode then 8 or 10 consecutive conversions (depending on the model) are carried out on a ...
Tirdad Sadri Nejad's user avatar
0 votes
2 answers
807 views

Vcap Pin on STM8S003F3

I am using STM8S003F3P6 to drive a relay and control 4 LEDs using a switch. However, my programmer is not able to detect the chip and am not able to program it. I think it might have to do with the ...
Amorphous's user avatar
  • 169
0 votes
1 answer
548 views

using stm8s003f3p6 for frequency counter

I want to use Sm8s003f3p6 as a frequency counter , My program is as described in stm8s reference manual 17.4.3 External clock source mode 1 and pulse counting is done in pin PC7 using HSI 16 Mhz ...
Ali's user avatar
  • 5
0 votes
0 answers
1k views

STM8 Programming Error using STVD

I am using a STM8S105C6T6 in one of my application and I am facing problem while programming it. Software used: STVD version 4.3.12 Compiler: Cosmic CXSTM8 Special Edition 4.5.1 (Free 1yr License ...
Rajat Ahuja's user avatar
0 votes
2 answers
161 views

I'm trying to communicate through I2C with a temperature sensor (STS21) using interrupts on STM8S003F3 board but i can't manage to make it work

I've been trying for some days to make this code work but I can't manage to do it. The variable in which I try to store the the temperature (which should be around 20-22 degrees Celsius), contains the ...
Dan Hotico's user avatar
0 votes
1 answer
332 views

STM8 - Micro SD Card [closed]

I have a STM8S003F3 and a Arduino Micro SD Card Module. I want to create a file inside the Micro SD card. How can I do it? Can you help me? Thank you in advance.
Ademola Lookman's user avatar
0 votes
0 answers
91 views

STM8S Discovery : Button Logic Issue

I am making a project where in I am connecting few LEDs with my STM8 Discovery Board (PA3, PD3, PD4) and setting the mode using the on-board button (PB7). The issue I am facing is that I am able to ...
Amorphous's user avatar
  • 169
1 vote
1 answer
294 views

STM8 ST-Link high power consuption & unable to connect

I have a ST-Link V2 and I am trying to connect with SWIM. So, i simply connect the pins, but the power consuption is very high (80 mA!), so high that che voltage regulator gets warn. In ...
max_s's user avatar
  • 31
1 vote
1 answer
258 views

Removing noise from ADC for STM8S 8-bit microcontroller

I have implemented ADC for STM8S1003, but looking for a way to reduce the noise on he signal. There's no offset but the ADC varies 50 digital levels for each analog voltage input. I'm reading a DC ...
Muhammad Alam's user avatar
0 votes
1 answer
725 views

How to program stm8s003f3p6 using UART?

I am new to stm8s series of microcontroller. I want to program stm8s003f3p6 via UART but there is no inbuilt bootloader in it. So is it possible to burn custom bootloader? How should I start? Is there ...
Vivekanand Dhakane's user avatar
0 votes
0 answers
141 views

stm mcu with built in lcd controller

I am planning to buy an LCD display which has been customised as per my needs and it will comprise of 128 segment. I was planning to buy a stm MCU which will contain an LCD driver inside it while ...
Ouroboros's user avatar
  • 233
1 vote
1 answer
124 views

Capacitive medium range sensor with STM8

I am trying to replicate the behaviour of this library: https://playground.arduino.cc/Main/CapacitiveSensor/ with an STM8, but I am not able to do it. I want to detect the proximity of the human hand ...
max_s's user avatar
  • 31
-1 votes
1 answer
329 views

STM8 alarm firing shortly after resetting time

I'm using an STM8L151F3 with the SPL, compiled with SDCC. I'm trying to generate an alarm interrupt after n seconds, then another after m seconds. To do that, I reset the time to 0, then set the alarm ...
Jackson Seal's user avatar
0 votes
0 answers
101 views

Solar high voltage regulator & power logger circuit - design review

I was wondering whether someone could give me some feedback on a circuit I have been throwing together. The circuit is supposed to act as an voltage regulator and power logger for my high voltage ...
MeMyselfAndI's user avatar
0 votes
1 answer
238 views

Custom STM8L dev board not working

I designed a dev board for the STM8L151F2, and even using an external programmer and external power the STM8 has only been able to be programmed twice. Here's the schematic, everything done in eagle. ...
Connor Redding's user avatar
0 votes
1 answer
595 views

STM8 USART question

I am trying to set up UART on a STM8L controller, and I have a code which works only on PC3. But I want to transmit on PA2, but I don't know why is it not working like this. I don't even initialize ...
huistbor's user avatar
0 votes
1 answer
307 views

STM8L151 UART software [closed]

I am new in STM programming and I want to do a simple UART communication but I don't know where to start.Can somebody send a tutorial for stm8l or a full code would be better so I can examine it. Thx....
huistbor's user avatar
2 votes
1 answer
844 views

STM8 TIM2 interrupt not taking place. What am I missing?

I've just started using STM8 microcontrollers, specifically the STM8S003F3P6 chip, in my own custom test board. The board works and I am able to blink an LED on PA3 without using an interrupt. However,...
dynamag's user avatar
  • 127
22 votes
10 answers
10k views

STM Microcontroller burns every time

I have some experience working with stm32 but I only ever used them on dev boards. I recently tried to solder stm32 and stm8 on a simple break-out board and program them with my st-linkv2 clone. On ...
NXP's user avatar
  • 391
0 votes
2 answers
1k views

Can I read flash from an MCU?

I have two ICs with STM8S005C6 MCUs. Is it possible to read flash from MCU of the first IC and write it to the other one? I checked the STMZ website for tools to read/write to MCU but they seem to ...
Ali Erdem's user avatar
  • 101
1 vote
1 answer
165 views

A question about the Clock control register high of I2C bus

While reading the part about I2C bus of reference manual of STM8L MCUs, I found that there is this register named Clock control register high (I2C_CCRH). Its 6-th bit, referred as "DUTY", can be used ...
John Z. Li's user avatar
0 votes
1 answer
76 views

Unable to resolve ADC conversion error in stm8s105s6

I'm trying to learn ADC on stm8s105s6. But not getting proper adc result. I shorted VCC to analog pin 3 and expected conversion value near 1023 as stm8 has a 10 ...
Pujit's user avatar
  • 21
0 votes
1 answer
106 views

STM32/STM8: How do I come from evaluation board to my design? [closed]

I'm a kind of a newbie to STM32/STM8 controllers. All my experience was with 8051, PIC and AVR controllers. And the typical development chain was like this: Make PCB Debug this PCB with my program. ...
Roman Matveev's user avatar
0 votes
1 answer
186 views

Translate from AVR pgm_read_byte to normal C array manipulation in STM8

I am trying to translate a couple of lines of code from AVR space data to STM8 normal C data manipulation. As you should know, AVR has a program space which can storage data for read only operation, ...
Jefferson Alexis's user avatar
0 votes
1 answer
6k views

STM8 SWIM interface connection problem

I am trying to connect STM8L052C6T6 microcontroller using SWIM interface (STM8 port) on ST-Link/V2 programmer and it just doesn't connect. Power comes from outside power source (target is powered) ...
user505160's user avatar
  • 1,020
0 votes
2 answers
260 views

RTC time advancing

I'm working in some projects with an RTC. I'm using the PCF85063A. The problem is: the RTC counter is advancing from real time about 2 minutes per week. I searched for hardware and firmware errors, ...
Maurício Tochetto's user avatar
1 vote
1 answer
113 views

How to power STM8(S105C4) chip? Is decoupling needed?

I have a MCU STM8(S105C4) with which I need to design a PCB to power from a USB. But I don't know how to power it. I've tried searching the specification for this MCU but all that I could find is that ...
Nazar Gaman's user avatar
0 votes
1 answer
98 views

Could STM32 Discovery boards debug STM8 chip?

I know that STM32 discovery boards could debug another STM32 chip. But could it debug STM8 chip too? Is STM8's debugging interface compatible with SWD?
Misaz's user avatar
  • 365
0 votes
4 answers
652 views

Sensing +12V signal using ST STM8AF5288 microcontroller digital input [duplicate]

I am using an ST STM8AF5288 microcontroller powered by 5V in one of my projects (STM8AF5288 home, datasheet). Is it possible to directly sense a +12V signal input by port pins? I am using a current ...
Joseph's user avatar
  • 9
-1 votes
2 answers
2k views

How to get STM8 unique device ID?

I'm working with a STM8S003F3P6 microcontroller and I need to know an unique ID for each device I will use. I know that PIC microcontrollers has an unique device ID that can be acessed by the user. My ...
Maurício Tochetto's user avatar
1 vote
2 answers
3k views

How to use TIMER 2 as simple counter in STM8S103F3?

I am new to STM8S and not yet that good at microcontroller programming in general. I am trying to learn about timers/counters in microcontrollers. I wrote following code to toggle an LED in each ...
Junaid's user avatar
  • 303
4 votes
0 answers
569 views

STM8 nested interrupt bug, not described in current errata sheet ES019

If main process execute WFI with AL bit set in CFG_GCR, changing I1/I0 priority bits in the ISR cause CPU stalled when nested IRQ occured. Preconditions: all ITC_SPR1 registers has default value 0xFF....
Igor  Nikolaev's user avatar
1 vote
0 answers
660 views

Can I generate two PWM with 90°phase shift from stm8 microcontroller?

I am using stm8 microcontroller(STM8AF288) to generate a PWM of 1KHz frequency with timer-1(16bit) . I am giving this as input to a circuit, which generates two PWMs with 90° phase shift. But ...
GShaik's user avatar
  • 167
-1 votes
1 answer
3k views

STM8S - Why does my Timer4 Overflow Interrupt not work?

This is my timer 4 init: ...
binaryBigInt's user avatar
4 votes
1 answer
5k views

Is it possible to communicate single SPI slave with Two SPI masters

I am using two STM8 micro-controllers as SPI masters. Master-1 is configured in full duplex mode. And the Master-2 is configured ...
GShaik's user avatar
  • 167