External interruption of STM8 button recognition related content

STM8 common interrupt instruction

Total interruption

_asm("rim");

Disable interrupts

_asm("sim");

Enter stop mode

_asm("halt");

Interrupt return

_asm("iret");

Wait for interrupt

_asm("wfi");

Software interruption

_asm("trap");

STM8S common interrupt mapping

External interruption of STM8 button recognition related content

If you use the interrupt function, you can find the corresponding interrupt vector number in the above figure, and the name of the interrupt function can be customized

External interruption of STM8 button recognition related content

External interruption of STM8 button recognition related content

External interrupt long key recognition related configuration

? ? The STM8S specifically allocates five interrupt vectors for external interrupt events:

Five pins of PortA: PA[6:2]

8 pins of port B: PB[7:0]

Eight PortC Port Pins: PC[7:0]

7 pins of port D: PD[6:0]

Eight PortE port pins: PE[7:0]

PD7 is the highest priority interrupt source (TLI);

Interrupt IO settings

Select EXTI2 here (port C external interrupt). Then, it is necessary to set the interrupt initiated IO (PC5) as a pull-up input or an interrupt pull-up input, and the floating input is easily disturbed.

/*PC5 is set to pull-up input */

Void Init_EXTI2_GPIO(void)

{

PC_DDR &= 0XDF;

PC_CR1 &= 0XDF;

PC_CR2 |= 0x20;

}

External interrupt register configuration

CPU CC register interrupt bit:

I0 cannot be written directly. It can only be written by interrupt or interrupt. The power-on default is 11. When interrupt is enabled by instruction (_asm(“rim”);), it is 00. When an interrupt occurs, the current interrupt ( ITC_SPRx) Load I[1:0], which is mainly used to do interrupt priority; the exit interrupt is cleared automatically; therefore, to write EXTI_CR1, it is necessary to configure ITC_SPRx to 11 or add an interrupt disable instruction.

EXTI_CR1:

? ? Configuration promotion method;

Test code

External interruption of STM8 button recognition related content

External interruption of STM8 button recognition related content

External interruption of STM8 button recognition related content

See also Long press key recognition without external interrupt: Long press without external interrupt recognition

Dazzle 1000 Puffs TPD Version Vape

RandM Dazzle 1000 Puffs Disposable Vape Wholesale or White Label
More Popular Disposable Vapes for Wholesale and White Label
White/Private Label Service – MOQ 2000pcs each flavor
Please don`t contact for a custom order if you can`t meet our MOQ request.
Nicotine Salt Strength: 5% / 50mg
Disposable,rechargeable & non-refillable
All-in-one system
Draw activated firing mechanism
Juice Capacity:3.5ml
Battery Capacity: 550mAh
Approx 1000 puffs per device
Approximately equivalent to 200 real cigarettes per vape
Color: Same as pictures

Reference Resistance: 1.6 ohm

1 1

Dazzle 1000 Puffs Tpd Version Va,1700 Puffs Randm Max,Randm Max Disposable Vape,Cartoon Randm Max

Shenzhen Kester Technology Co., Ltd , https://www.kesterpuff.com

Posted on