Questions about the Generic STM8S103

Arduino on the STM8 (8 bit processor)
Post Reply
ElDominio
Posts: 12
Joined: Wed Feb 28, 2018 9:32 pm

Questions about the Generic STM8S103

Post by ElDominio » Wed Feb 28, 2018 11:59 pm

I'm using the pinout provided on the page: https://tenbaht.github.io/sduino/hardware/stm8blue/

but I don't know which pins are interrupt capable? are they all capable? I don't know too much of the STM8 and it's not too well documented so I haven't been able to find anything; which pins are interrupts? I have some ATMega328 on which I used the EnableInterrupt library, but that one isn't compatible with the STM8. I'm a bit of a beginner when it comes to this so any assistance would be great!

Thanks beforehand!

User avatar
mrburnette
Posts: 3001
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: Questions about the Generic STM8S103

Post by mrburnette » Thu Mar 01, 2018 1:06 am

Probably bite-the-bullet and download the Reference Msnual... you'll need it sooner or later:
https://www.google.com/url?sa=t&source= ... aIavjIJg2c

This should be most helpful:
http://embedded-lab.com/blog/starting-s ... ollers/10/
In STM8s, almost all GPIO pins have independent external interrupt capability with input Schmitt triggers. Additionally, there’s interrupt controller to set interrupt priority.
Image
You’ll find this table not in the reference manual but in the device’s datasheet. This table varies with devices and so be sure of correct datasheet. The DISCO board’s button is connected to PB7 and so clearly, we will need IRQ4, i.e. EXTI1 or PORTB external interrupts. All external interrupts on GPIOB pin are masked in this vector address.

Please note that codes that use peripheral interrupts need stm8s_it.h and stm8s_it.c files. Therefore, add them if you are to use interrupts.

Ray

ElDominio
Posts: 12
Joined: Wed Feb 28, 2018 9:32 pm

Re: Questions about the Generic STM8S103

Post by ElDominio » Fri Mar 02, 2018 3:13 am

Thanks a million for the info sir!
I'll make sure to keep those handy!

dannyf
Posts: 331
Joined: Wed May 11, 2016 4:29 pm

Re: Questions about the Generic STM8S103

Post by dannyf » Sun Mar 04, 2018 10:16 pm

in case you didn't notice it, only one of any PAn/PBn/PCn/PDn/... can be active for gpio interrupt at a given time. So if you use PB1, PA1/PC1/PD1/... etc cannot be used to generate gpio interrupt.

Thank ST for that brilliant design.

Post Reply