![]() ![]() So the interrupt will not startet immediately at re- enabling the interrupt enable bit.īut the code is still not working properly.the interrupt is being enabled again and again. ![]() When enable this bits again write a logical 1 to the according interrupt flag. To lock an specific interrupt, it will be eaisier to reset the according interrupt enable bits. Thats not a Problem of CodeVision AVR, it appears at every Compiler Software, bacause it will be occoured by Hardware. In your interrupt routine this bit will be set:Īnd include the CLI command in the main routine - That will work To get your program running declare a global bit variable in declaration section: So the command #asm ("CLI") in an interrupt routine has no effect, because it will be set at the end of the interrupt routine again. When the interrupt routine ends ( RETI Command in Assembler ) this Bit will be set by Hardware again. The CLI Command will reset the Interrupt Enable Flag in the SREG Register.Īt start of an Interupt routine this Flag will be cleared automaticly by hardware without any user command.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |