{"id":495,"date":"2014-09-05T14:42:39","date_gmt":"2014-09-05T14:42:39","guid":{"rendered":"https:\/\/ibex.tech\/embedded\/?p=495"},"modified":"2022-02-18T15:37:49","modified_gmt":"2022-02-18T15:37:49","slug":"interrupt-functions","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic18\/xc8-compiler\/converting-from-c18-projects-to-xc8\/interrupt-functions","title":{"rendered":"Interrupt Functions"},"content":{"rendered":"<h5>\nOld C18 Code<br \/>\n<\/h5>\n<pre>\r\n<code>\r\n\/\/**********************************************\r\n\/\/********** HIGH PRIORITY INTERRUPTS **********\r\n\/\/**********************************************\r\n#pragma code highVector=0x08\r\nvoid athighvector (void)\r\n{\r\n\t_asm \tGOTO\tinterruptisrh\t_endasm\r\n}\r\n#pragma code\r\n\r\n\/\/*********************************************\r\n\/\/********** LOW PRIORITY INTERRUPTS **********\r\n\/\/*********************************************\r\n#pragma code lowVector=0x18\r\nvoid atlowvector (void)\r\n{\r\n\t_asm\tgoto\tinterruptisrl\t_endasm\r\n}\r\n#pragma code \/\/ give back code control\r\n<\/code><\/pre>\n<h5>\nNew XC8 Code<br \/>\n<\/h5>\n<p>\nDont&#39; bother with the seperate functions to cause the jump as the specified program memory locations, just define your interrupt functions directly as follows and the compiler will take care of it.\n<\/p>\n<pre>\r\n<code>\r\n\/\/**********************************************\r\n\/\/********** HIGH PRIORITY INTERRUPTS **********\r\n\/\/**********************************************\r\nvoid interrupt interruptisrh (void)\r\n{\r\n\t\r\n}\t\r\n\r\n\r\n\/\/*********************************************\r\n\/\/********** LOW PRIORITY INTERRUPTS **********\r\n\/\/*********************************************\r\nvoid interrupt low_priority interruptisrl (void)\r\n{\r\n\t\r\n}\r\n\r\n<\/code><\/pre>\n<p>\n<em>(Remember to update the function definitions in your header fine to match).<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Old C18 Code \/\/********************************************** \/\/********** HIGH PRIORITY INTERRUPTS ********** \/\/********************************************** #pragma code highVector=0x08 void athighvector (void) { _asm GOTO interruptisrh _endasm } #pragma code \/\/********************************************* \/\/********** LOW PRIORITY INTERRUPTS ********** \/\/********************************************* #pragma code lowVector=0x18 void atlowvector (void) { _asm goto interruptisrl _endasm } #pragma code \/\/ give back code control New XC8 Code Dont&#39; bother [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[55,56],"tags":[],"class_list":["post-495","post","type-post","status-publish","format-standard","hentry","category-converting-from-c18-projects-to-xc8","category-basic-template-project-changes"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/comments?post=495"}],"version-history":[{"count":2,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/495\/revisions"}],"predecessor-version":[{"id":497,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/495\/revisions\/497"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}