PDA

View Full Version : DT_INTS-14.bas Reset Flag



Larryd
- 8th April 2013, 19:54
Question,
When using Darrel Taylor's
"DT_INTS-14.bas"
What does the Reset Flag Do?
When using with PIC 16F877
HSERIN
I have seen examples both ways, and did not understand how what it was used for.

Thanks
LarryD

ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler RX_INT, _Getbytes, PBP, no
endm
INT_CREATE ; Creates the interrupt processor
ENDASM

HenrikOlsson
- 8th April 2013, 21:15
Hi,
When the the ResetFlag "switch" in the interrupt declaration is set to YES it tells the interrupt system to clear the interrupt request flag when returning from the interrupt service routine.

However, the interrupt request flag for the USART RX is automatically cleared by the hardware when you read the FIFO buffer (which is what happens when HSERIN execute) so there's no need to have the software to clear it as well.
I can't say if it's valid for all devices but on the 16F1825 for example the RCIF is read only and can't BE cleared by software so having the ResetFlag "switch" set to yes makes no sense.

/Henrik.

Larryd
- 8th April 2013, 22:44
Henrik,
Thank you so much.
I have been trying to understand how to use with HSERIN, and had seen it both ways,
and wanted to understand how it works.
Thanks again.

Larryd