cancel
Showing results for 
Search instead for 
Did you mean: 

STM8 fast output

Erik1
Associate

Hi,

I have a STM8s003 which I have already programmed with the Arduino IDE but the commands “digitalWrite” and “digitalRead” were too slow for me. I also found an alternative that works with the Arduino but not with the STM8: CLR(PORTA, 2); SET(PORTA, 2); I got these commands from the site:
https://electronics.stackexchange.com/questions/22585/arduino-faster-alternatives-to-digitalread-and-digitalwrite
When compiling for the STM8, the error message is: “Undefined identifier ‘PORTA’ ”
Do you have any idea how else the ports are addressed or something?

1 REPLY 1

Definitions would need to come for an include file, which you'd pull via #include "stm8s003.h" or something materially similar from an STM8 SPL or similar library.

Perhaps look at the variant code Arduino is using to support the part currently.

 

https://github.com/taoynkkx/STM8S_StdPeriph_Lib_V2.2.0/blob/master/Libraries/STM8S_StdPeriph_Driver/inc/stm8s_gpio.h

https://github.com/taoynkkx/STM8S_StdPeriph_Lib_V2.2.0/blob/869bd6b1bbb178fdc6430eef8b027b85d6660d51/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h#L2556

https://github.com/taoynkkx/STM8S_StdPeriph_Lib_V2.2.0/blob/869bd6b1bbb178fdc6430eef8b027b85d6660d51/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h#L2626

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..