{"id":94,"date":"2012-05-24T08:45:56","date_gmt":"2012-05-24T08:45:56","guid":{"rendered":"http:\/\/www.electronic-products-development.com\/?p=94"},"modified":"2022-02-18T15:37:50","modified_gmt":"2022-02-18T15:37:50","slug":"locating-things-in-program-memory","status":"publish","type":"post","link":"https:\/\/ibex.tech\/embedded\/microchip\/pic24\/c30-compiler\/locating-things-in-program-memory","title":{"rendered":"Locating things in Program memory"},"content":{"rendered":"<h4>\nLocating things in Pogram memory<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\/\/----- CONSTANTS LOCATED IN PROGRAM MEMORY -----\r\n#ifdef FLASH_FIRMWARE_VALUES_LOCATION\r\n#ifndef __DEBUG                     \/\/Don&#39;t do in devel mode to reduce the programming time if these are being located at the end of the memory space\r\nconst unsigned int __attribute__ ((space(psv), address (FLASH_FIRMWARE_VALUES_LOCATION)))\r\n      firmware_upload_markers [2] = {OUR_PRODUCT_ID, OUR_FIRMWARE_REVISION};\r\n#endif\r\n#endif\r\n\r\n\/\/A function\r\nint __attribute__ ((address(0x8000))) PrintString (const char *s);\r\n\r\n<\/code><\/pre>\n<h4>\nReading Values From Program Memory<br \/>\n<\/h4>\n<pre>\r\n<code>\r\n\t#include &lt;libpic30.h&gt;\r\n\r\n\tchar prog_mem_value[2];\r\n\t_memcpy_p2d16(&amp;prog_mem_value[0], 0x003fe, 2);\t\t\t\/\/Dest, source, number of bytes to read\r\n<\/code><\/pre>\n<p>\n&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Locating things in Pogram memory \/\/&#8212;&#8211; CONSTANTS LOCATED IN PROGRAM MEMORY &#8212;&#8211; #ifdef FLASH_FIRMWARE_VALUES_LOCATION #ifndef __DEBUG \/\/Don&#39;t do in devel mode to reduce the programming time if these are being located at the end of the memory space const unsigned int __attribute__ ((space(psv), address (FLASH_FIRMWARE_VALUES_LOCATION))) firmware_upload_markers [2] = {OUR_PRODUCT_ID, OUR_FIRMWARE_REVISION}; #endif #endif \/\/A function int [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-94","post","type-post","status-publish","format-standard","hentry","category-c30-compiler"],"_links":{"self":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/94","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=94"}],"version-history":[{"count":5,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/94\/revisions"}],"predecessor-version":[{"id":374,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/posts\/94\/revisions\/374"}],"wp:attachment":[{"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/media?parent=94"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/categories?post=94"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ibex.tech\/embedded\/wp-json\/wp\/v2\/tags?post=94"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}