PDA

View Full Version : Usart with Darrel Instant Interrupt



Pedro Pinto
- 16th February 2008, 19:44
Hello

I love the Instant Interrupts to. Is it possible to use it with Assynchron Usart
In my board i use a 18F452 connected to a RS485 driver circuit MAX487 and
want to function it with instant interrupt everytime data receibed via the RS485 Network
How can i do that with Darrel's Instant Interrupts? Have not see any sample code to explain how to do that

Thanks for help

Best regards

Pedro

Charles Linquis
- 16th February 2008, 20:00
I assume that you want to write your ISR in PBP -
So, use Darrel's list (part of which is shown below)
to pick the right interrupt and syntax.


' TX_INT -- USART Transmit
' TX1_INT -- USART1 Transmit
' TX2_INT -- USART2 Transmit
' RX_INT -- USART Receive
' RX1_INT -- USART1 Receive
' RX2_INT -- USART2 Receive
------------------------------------------------

Pick one, then include Instant Interrupts -


INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?

INT_Handler RX1_INT, _GetChar, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM


Goto OverInt

+++++++++++++++++++++++++++++++++++++++++
ISR goes here.....

GetChar:

HSERIN ...

@ INT_RETURN
+++++++++++++++++++++++++++++++++++++++++

OverInt:

@ INT_ENABLE RX1_INT - enable the interrupt

Main Program goes here...

Pedro Pinto
- 17th February 2008, 00:09
Thank you again Charles