In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Jean Brunet wrote: Peter, Your mail is very interressant. Y am appy that it'is possible to transmit two frames (a start bit, 8 bits of data, and a stop bit, I confirm ) in a little space of time. 1/38400 = .000026041. Yes, of course ! Also the pulse is 1/4 of 26 us = 6.5 us. My interrupt code is a 1 us int period. 7 us is also good. Look my interrupt code, with two timer : sb tf_square ; if set jmp :st inc Sq_freq ; time square pulse 26 us snz jmp :tf_end ; finish sb Ir_set ; if set jmp :no setb IrPin ; bit Tx Irda inc Freq_Tir ; time pulse 7 us sz jmp :st ; end of pulse :no clrb IrPin ; pulse 7 us terminate clrb Ir_set ; flag end of pulse mov Freq_Tir,#Freq_BitIr ; time pulse jmp :st :tf_end clrb tf_square ; end of square pulse mov Sq_freq,#Freq_SqIr ; time square pulse :st The same code permit a bit set or a bit clear if Ir_set flag is true or false. In a main code Ir_NoModulate clrb Ir_set ; signal off / or On if Ir_set is set. setb tf_square ; :I2 snb tf_square ; when interrupt code is finish.... jmp :I2 ret And the trame : trame call Ir_Modulate ; start bit mov idx,#8 :t0 sb temp0.0 jmp :no call Ir_NoModulate ; if bit set, no modulation skip :no call Ir_Modulate clc rr temp0 decsz idx jmp :t0 clc call Ir_NoModulate ' stop bit ret Thank's Jean ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=96647#m97531 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2005 (http://www.dotNetBB.com)