avr-gcc dziwna konstrukcja

Mar 21, 2010 3 Replies

;************************************************************************* ; delay half period ; For I2C in normal mode (100kHz), use T/2 > 5us ; For I2C in fast mode (400kHz), use T/2 > 1.3us ;************************************************************************* .stabs "",100,0,0,i2c_delay_T2 .stabs "i2cmaster.S",100,0,0,i2c_delay_T2 .func i2c_delay_T2 ; delay 5.0 microsec with 4 Mhz crystal i2c_delay_T2: ; 4 cycles rjmp 1f ; 2 "



1: rjmp 2f ; 2 "
2: rjmp 3f ; 2 "
3: rjmp 4f ; 2 "
4: rjmp 5f ; 2 "
5: rjmp 6f ; 2 "
6: nop ; 1 " ret ; 3 " .endfunc ; total 20 cyles = 5.0 microsec with 4 Mhz crystal

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required