How to use timer?

Post here first, or if you can't find a relevant section!
Post Reply
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

How to use timer?

Post by saeed144 »

Hi every one.
How to use stm32f103 timers with Arduino IDE?
How to set prescaler and period?
by fpiSTM » Sat Nov 07, 2020 9:06 am Go to full post
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How to use timer?

Post by fpiSTM »

Which core?
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Re: How to use timer?

Post by saeed144 »

Official, Stm32Duino
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: How to use timer?

Post by fpiSTM »

saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Re: How to use timer?

Post by saeed144 »

Thank you so much.

One more question:
If we have access to all stm features in Arduino IDE with this huge libraries, why we use other compilers like keil at all?
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: How to use timer?

Post by GonzoG »

Arduino is not a "proper" programming IDE.
It's for ppl who don't want to go into all the details with MCU/board setup. It's much easier to start programming MCUs in Arduino IDE than in Attolic, Keil, etc, but you also don't get any additional tools (eg. debugger) and don't have all the options for compiler.
And I do not mention all the IDE features that "proper" IDEs have...
saeed144
Posts: 36
Joined: Mon Sep 21, 2020 10:11 am

Re: How to use timer?

Post by saeed144 »

Can you explain this: "all the details with MCU/board setup." ?
For example which details in stm32 we can't configure in Arduino IDE?
mlundin
Posts: 94
Joined: Wed Nov 04, 2020 1:20 pm
Answers: 6
Location: Sweden

Re: How to use timer?

Post by mlundin »

All registers in STM32 processors are available using Arduino IDE and the STM32 Core, so with careful reading of the processor manuals and lots of testing and googling for information there is not much you cannot do. Of course you must also not to get into conflict with the exiting code from the STM32 Core so you must study the HAL configuration usage and most probably get to know the Core code intimately. There are lots of hardware related, code HAL code, ready to be used from inside Arduino IDE but finding out what and how to use it is some work.

If Arduino is a 'proper' IDE or not has been endlessly discussed, but it is surely a most basic one and it does lack support for hardware debugging. Now even with a hardware debugger, finding problems can in many cases require you to learn all the internals of processor registers and HAL code layers as described above.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: How to use timer?

Post by GonzoG »

saeed144 wrote: Mon Nov 09, 2020 6:36 am Can you explain this: "all the details with MCU/board setup." ?
For example which details in stm32 we can't configure in Arduino IDE?
I didn't say you cannot. I said if you don't won't to go into all those settings.
In Arduino IDE you don't have to do anything as it has all default settings predefined.
With other IDEs you need to set everything by yourself and it's even hundreds of lines of code.
mrburnette
Posts: 633
Joined: Thu Dec 19, 2019 1:23 am
Answers: 7

Re: How to use timer?

Post by mrburnette »

saeed144 wrote: Sun Nov 08, 2020 10:17 am ...
One more question:
If we have access to all stm features in Arduino IDE with this huge libraries, why we use other compilers like keil at all?
From another of my forum answers:
Arduino-centric thinking and the ArduinoIDE are really only an environment. All pertinent board/uC files are scripts. Arduino is just a framework of JAVA code that manages the output from the ArduinoIDE editor (or other chosen editor.) There is no native compiler or native linker in Arduino-land. The link below explains what happens, pay special attention to automatic creation of prototypes as many users do not understand this process.
https://arduino.github.io/arduino-cli/s ... d-process/s/
GCC is open-source and "free": https://gcc.gnu.org/

Keil verses GCC: https://community.arm.com/developer/ip- ... c-does-not

Note: 12 years into retirement, I have lost contact with old acquaintances in commercial programming, but at one time, Open-Source (free) was an unacceptable option for corporate programming use. It literally came down to not being able to hold another company liable for "issues" (technical, legal, support) when in-house programmers screwed-up. Linux introduction into the corporate data centers was delayed for many years as the lawyers fought IT.
Eventually, a company rose to provide the indemnity corporate lawyers demanded: https://www.redhat.com/en/our-code-is-open


Ray
Post Reply

Return to “General discussion”