Author Topic: Generating exact delay in us IAR-STM8  (Read 4284 times)

0 Members and 1 Guest are viewing this topic.

Offline Vindhyachal.taknikiTopic starter

  • Frequent Contributor
  • **
  • Posts: 487
Generating exact delay in us IAR-STM8
« on: December 16, 2014, 05:13:43 am »
1. I am using IAR for STM8 V1.42.2
I have to generate some exact delay of us range like low as 25us to 100us.

2. Clearly that can be done using timer. But I don't want to use timer for this purpose. I have 2 timer running for different purpose.

3. I have used mplab & TI CCS. They have delay function which can generate exact delay like
__delay_us() , __delay_ms , or __delay_cycles()

is there any similiar function in IAR STM8?
 

Offline TKt48

  • Newbie
  • Posts: 6
Re: Generating exact delay in us IAR-STM8
« Reply #1 on: December 16, 2014, 11:29:50 am »
Delay functions, time functions usually use timers to work.
Other method is to use asembler and "dumb" function executions. Knowing how much clock cycles they take to execute and clock frequency you can generate precise "delay". But it works only for short delays and to generate fast changing outputs.
« Last Edit: December 16, 2014, 02:23:51 pm by TKt48 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf