Hi All,
I was wondering if anyone can help me.
I am using an ISR (Int0 & Int1) of a ATMega168 with Bascom AVR.
In this ISR�s I have to handle some code but now the ISR take too much time.
This code is for translating signals of the AD2S90 � resolver to digital converter
http://www.analog.com/static/imported-files/data_sheets/AD2S90.pdf
I already tried to write this ISR in assembler but I cann�t get it to work ok.
(new to assembler)
Is there some smart person who can help me to translate the ISR into assembler?
Thanks,
Pascal
�***************************
Channel_a Alias Pind.2 �Int0
Channel_b Alias Pind.3 �Int1
Dim Int1_flag As Byte
Dim Pulse_count As Word
Int0_isr:
If Int1_flag = 0 Then
If Channel_a = 1 Then
If Channel_b = 1 Then
If Pulse_count < 65535 Then Incr Pulse_count
Config Int1 = Falling
Else
If Pulse_count > 0 Then Decr Pulse_count
Config Int1 = Rising
End If
Config Int0 = Falling
Else
If Channel_b = 0 Then
If Pulse_count < 65535 Then Incr Pulse_count
Config Int1 = Rising
Else
If Pulse_count > 0 Then Decr Pulse_count
Config Int1 = Falling
End If
Config Int0 = Rising
End If
Int1_flag = 1
End If
Return
Int1_isr:
If Int1_flag = 1 Then
If Channel_b = 1 Then
If Channel_a = 0 Then
If Pulse_count < 65535 Then Incr Pulse_count
Config Int0 = Rising
Else
If Pulse_count > 0 Then Decr Pulse_count
Config Int0 = Falling
End If
Config Int1 = Falling
Else
If Channel_a = 1 Then
If Pulse_count < 65535 Then Incr Pulse_count
Config Int0 = Falling
Else
If Pulse_count > 0 Then Decr Pulse_count
Config Int0 = Rising
End If
Config Int1 = Rising
End If
Int1_flag = 0
End If
Return
_________________________________________________________________
Nieuw: nu ook chatten op je mobiel!
http://www.overaljevriendenbijje.nl/#superdeal
[Non-text portions of this message have been removed]Message
Converting Isr0 & Isr1 from BascomAVR to Assembler?
2009-02-12 by Q boll
Attachments
- No local attachments were found for this message.