Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Job Specific MCU Clock Counter

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here
View previous topic :: View next topic  
Author Message
MichaelB.

Bascom Member



Joined: 04 May 2017
Posts: 58

germany.gif
PostPosted: Tue Sep 03, 2019 5:20 pm    Post subject: Job Specific MCU Clock Counter Reply with quote

Hi, i wanna share my very first SUB Function. Smile

This Function basicly counts the MCU cycles of a Specific Job between two Statements.
Examples:

Code:
MCUcycle 16000000                                        ' The LCD should shown a 3. For 3 clock cycles of the MCU between these two Statements
ByteA = 1 + 2
MCUcycle 16000000

or
Code:
MCUcycle 16000000                                        ' The LCD should shown a 10. For 10 clock cycles of the MCU between these two Statements
ByteA = 1 + 2
ByteA = ByteA + 7
MCUcycle 16000000

or
Code:
MCUcycle 16000000                                       ' The LCD should shown a 13. For 13 clock cycles of the MCU between these two Statements
ByteA = 1 + 2
ByteA = ByteA + 7
ByteB = 1 + 2
MCUcycle 16000000




I dont know if it usefull to somebody..... ^^ maybe to debug some timings under real Dataloads or kinda like that Very Happy
Have Fun!
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 6198
Location: Holland

blank.gif
PostPosted: Sun Sep 29, 2019 2:58 pm    Post subject: Reply with quote

very nice idea !
Thank you for sharing. indeed this can be useful.

_________________
Mark
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> Share your working BASCOM-AVR code here All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum