I am working with stm32F100 and I want to calculate the time in hours when some GPIO is on
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-16 7:21 AM
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-16 8:25 AM
Poll the pin periodically, perhaps every ms, and increment a counter when it's on.
Depends how precise you need to be, but for "hours", polling should be fine.
You can edit your post to add additional details.
If you feel a post has answered your question, please click "Accept as Solution".
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-03-16 9:07 AM
Or use EXTI an watch/time transitions.
Could use a milli-second time base, the RTC, or TIM / DWT->CYCNT, depending on the resolution you seek.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
