{"id":10142,"date":"2013-06-14T09:09:18","date_gmt":"2019-07-04T23:19:42","guid":{"rendered":""},"modified":"2023-05-25T13:20:25","modified_gmt":"2023-05-25T17:20:25","slug":"how-to-use-spm-for-flash-to-flash-programming-part-33-46","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/","title":{"rendered":"How to Use SPM for Flash to Flash Programming &#8211; (Part 33\/46)"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Self-Programming Mode<\/span><\/span><\/span><\/strong><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\"> (SPM) is a feature of the AVR microcontroller which enables the microcontroller to program its own flash memory. Only the code running on the BLS can make use of this SPM feature. The microcontroller can be made to start executing from the BLS from there the code can access the application flash area. The BLS can read or write the content of the entire flash including the BLS itself.<\/span> <\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; text-align: justify; line-height: 200%;\"><img decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"Block Diagram of SPM with BLS in AVR\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Block-Diagram-of-SPM-with-BLS-in-AVR.jpg\" alt=\"Block Diagram of SPM with BLS in AVR\" \/><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig. 2: Block Diagram of SPM with BLS in AVR<\/em><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; text-align: justify; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The task of writing the BLS code with SPM has been made simple by the APIs available in the header file &lt;avr\/boot.h&gt;. The following are the important APIs available in the header file which helps in the SPM.<\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<table class=\"MsoTableGrid\" style=\"width: 6.7in; border-style: none;\" border=\"1\" width=\"643\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 180.9pt; border: 1pt solid windowtext; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">FUNCTION<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">DESCRIPTION<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">PARAMETER<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_is_spm_interrupt \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ( )<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Check if the SPM interrupt is enabled.<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_lock_bits_set (lock_bits)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Set the Boot-Loader lock bits<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">A mask of which Boot Loader Lock Bits to set<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_lock_bits_set_safe (lock_bits) <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Waits for EEPROM and SPM operations to complete before setting lock bits<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">A mask of which Boot Loader Lock Bits to set<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_lock_fuse_bits_get (address) <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Read the lock or fuse bits at the given address. Returns 0 or 1 according to the fuse bit is programmed or not<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The address to be read<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_erase (address)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Erase the flash page that is referred by address<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">A byte address in flash<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_erase_safe (address) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">waits for EEPROM and SPM operations to complete before erasing the page<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">A byte address in flash<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_fill \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (address, data) \u00a0\u00a0 <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Fill the Boot-Loader temporary page buffer for flash address with data word<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The address is a byte address. The data is a word<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_fill_safe (address, data) <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">waits for EEPROM and SPM operations to complete before filling the page<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The address is a byte address. The data is a word<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_write (address)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Write the Boot-Loader temporary page buffer to flash page that contains address<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Byte address in flash<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_page_write_safe \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (address)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">waits for EEPROM and SPM operations to complete before writing the page<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Byte address in flash<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_rww_busy ( )<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Check if the RWW section is busy<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_rww_enable ( ) \u00a0 <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Enable the Read-While-Write memory section.<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_rww_enable_safe ( ) \u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">waits for EEPROM and SPM operations to complete before enabling the RWW memory<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_signature_byte_get (address)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Returns the Signature Row byte at the given address<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Parameter address can be 0 to 0x1F<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_spm_busy ( )<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Check if the SPM instruction is busy<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_spm_busy_wait ( ) \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Wait while the SPM instruction is busy<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_spm_interrupt_disable ( )<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Disable the SPM interrupt<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 180.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"241\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">boot_spm_interrupt_enable ( )<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 184.5pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"246\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Enable the SPM interrupt<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 117pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"156\">\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em><span style=\"line-height: 200%;\">Fig. 3:\u00a0<\/span>Important APIs in AVR&#8217;s header file for SPM\u00a0<\/em><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Using the above APIs one can write a code for SPM in an AVR microcontroller provided that the code should follow certain steps in the order. In this project code which has been programmed from the beginning of the flash memory is re-programmed into another region of the flash memory as such. The task of programming one region of flash memory with the binary taken from the other region can be done in the following three major steps.<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormal\" style=\"margin-bottom: .0001pt; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><u><span style=\"line-height: 200%;\">Step: 1 Erase the flash page which is about to write into<\/span><\/u><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The first step is to erase the flash page which is about to be written with the new values. The API which helps in executing this step is;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><i><span style=\"line-height: 200%;\">Boot_page_erase (address)<\/span><\/i><\/b><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; text-align: justify; line-height: 200%;\"><b><i><\/i><\/b><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">This API can erase an entire page in the flash which the parameter addresses. In the code the address of the page erased is 256. The following image shows the status of the temporary page buffer and the flash memory at the step 1. The temporary page buffer is a buffer in which an entire page can be stored before it is flashed into a page in the flash memory.<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><img decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"Figure represents Status of temporary page buffer and flash memory in SPM of AVR\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Figure-represents-Status-of-temporary-page-buffer-and-flash-memory-in-SPM-of-AVR.jpg\" alt=\"Figure represents Status of temporary page buffer and flash memory in SPM of AVR\" \/><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig. 4:\u00a0 Figure represents Status of temporary page buffer and flash memory in SPM of AVR<\/em><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><u><span style=\"line-height: 200%;\">Step: 2 Store the values in a temporary buffer before write into a flash page<\/span><\/u><\/span><\/span><u><\/u><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">This is the second step in which one should store the required binary in a temporary buffer, before writing to any of the flash memory page. The API that can be used for this purpose is;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><i><span style=\"line-height: 200%;\">boot_page_fill \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 (address, data)<\/span><\/i><\/b><\/span><\/span><b><i><\/i><\/b><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">This API f<\/span><span style=\"line-height: 200%;\">ills the Boot-Loader temporary page buffer byte by byte before flashing the data in the temporary page buffer into a page as such. The parameter data represents each byte in the buffer and the parameter address represents the page address + offset of the buffer location where the data byte need to be stored.<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The following figure represents the operation in which the temporary page buffer is filled byte by byte using the API boot_page_fill (address, data).<\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<p><img decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"Operation of Data Transfer to temporary page buffer using AVR's API boot_page_fill\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Operation-of-Data-Transfer-to-temporary-page-buffer-using-AVRs-API-boot_page_fill.jpg\" alt=\"Operation of Data Transfer to temporary page buffer using AVR's API boot_page_fill\" \/><\/p>\n<p style=\"text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig. 5:\u00a0Operation of Data Transfer to temporary page buffer using AVR&#8217;s API boot_page_fill<\/em><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: justify;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">The parameter data in the API boot_page_fill (address, data) is actually read from the first location of the flash memory itself with the help of another API which is available in the header file &lt;avr\/pgmspace.h&gt;.<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">pgm_read_byte (address)<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<table class=\"MsoTableGrid\" style=\"border-style: none;\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td style=\"width: 126.9pt; border: 1pt solid windowtext; padding: 0in 5.4pt;\" valign=\"top\" width=\"169\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">FUNCTION<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<td style=\"width: 192.3pt; border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"256\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">DESCRIPTION<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<td style=\"width: 159.6pt; border-style: solid solid solid none; border-top-color: windowtext; border-right-color: windowtext; border-bottom-color: windowtext; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"213\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><span style=\"line-height: 200%;\">PARAMETER<\/span><\/b><\/span><\/span><b><\/b><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 126.9pt; border-style: none solid solid; border-right-color: windowtext; border-bottom-color: windowtext; border-left-color: windowtext; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"169\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">pgm_read_byte (address)<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 192.3pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"256\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">This function returns the byte which it reads from the flash memory referred by the parameter \u2018address\u2019<\/span><\/span><\/span><\/p>\n<\/td>\n<td style=\"width: 159.6pt; border-style: none solid solid none; border-bottom-color: windowtext; border-bottom-width: 1pt; border-right-color: windowtext; border-right-width: 1pt; padding: 0in 5.4pt;\" valign=\"top\" width=\"213\">\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Refers the location of the flash memory from which the byte need to be read<\/span><\/span><\/span><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">\u00a0<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><u><span style=\"line-height: 200%;\">Step: 3 Program the filled temporary buffer into the already erased flash page<\/span><\/u><\/span><\/span><u><\/u><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">This is the final step in which the filled temporary buffer is flashed using an API into already erased page of the flash memory. The API which helps in this step is;<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; text-align: center; line-height: 200%;\" align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><b><i><span style=\"line-height: 200%;\">boot_page_write (address)<\/span><\/i><\/b><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; text-align: justify; line-height: 200%;\"><img decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"Temporary Buffer Data transferred in AVR's Flash Memory using API\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Temporary-Buffer-Data-transferred-in-AVRs-Flash-Memory-using-API.jpg\" alt=\"Temporary Buffer Data transferred in AVR's Flash Memory using API\" \/><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig. 6:\u00a0Temporary Buffer Data transferred in AVR&#8217;s Flash Memory using API<\/em><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; text-align: justify; line-height: 200%;\"><span style=\"font-size: 13px; line-height: 200%;\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\">The code in this project which is written for the BLS can copy 300bytes from the flash memory into the temporary buffer starting from the address 0x0000. These bytes are then flashed into the flash memory page starting from the address 0x0100. After doing this the code from the BLS will make a jump to the address 0x0100 so that the re-written binary can be executed next.\u00a0<\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">With this boot loader code, whatever program we flash into the address starting from 0x0000 will get rewritten at ox 0x0100 and executed. A simple LED blinking test application can be written into the flash memory starting from 0x0000 to test the working.\u00a0<\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">Flash the code for the BLS first and then the LED application code using the steps explained in the previous project on <\/span><\/span><\/span><span style=\"font-size: 12.0pt; line-height: 200%; font-family: 'Times New Roman','serif'; mso-fareast-font-family: 'Times New Roman';\"><span style=\"font-size: small;\"><span style=\"font-family: Arial;\">LED blinking from BLS of AVR<\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">. <\/span><\/span><\/span><span style=\"font-size: small;\"><span style=\"font-family: Arial;\"><span style=\"line-height: 200%;\">When the led blinks, it means that the code has been re-written from one section of the flash memory to another and is executing from there.<\/span><\/span><\/span><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: .0001pt; mso-add-space: auto; line-height: 200%;\"><img decoding=\"async\" style=\"display: block; margin-left: auto; margin-right: auto;\" title=\"LED Blinking using SPM of AVR circuit set up on breadboard\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/LED-Blinking-using-SPM-of-AVR-circuit-set-up-on-breadboard.png\" alt=\"LED Blinking using SPM of AVR circuit set up on breadboard\" \/><\/p>\n<p class=\"MsoNormalCxSpMiddle\" style=\"margin-bottom: 0.0001pt; line-height: 200%; text-align: center;\"><span style=\"font-size: 12px;\"><span style=\"font-family: verdana,geneva,sans-serif;\"><em>Fig. 7:\u00a0LED Blinking using SPM of AVR circuit set up on breadboard<\/em><\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Self Programming Mode (SPM) is a feature which enables a microcontroller to program its own flash memory. Using the SPM a microcontroller can program itself  with an SPM code. The SPM is commonly used with the microcontroller Boot-Loader codes which help to program the microcontroller serially.&nbsp;In AVR microcontroller the SPM is available only for the code running in the BLS of the flash memory. With the help of the SPM a code in BLS can rewrite the application flash memory entirely or a part of it. It can even rewrite its own code in the BLS section.&nbsp;The SPM is a key factor of the Boot-Loader code since the major function of the Boot-Loader is to load an application code into the application flash section. The Boot-Loader may receive the code binary from other memory chips, SD-cards or through the serial port of the microcontroller in case of serial programming.&nbsp;<\/p>\n","protected":false},"author":3,"featured_media":15856,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[4043,13],"tags":[744,429,1186,432,1185],"class_list":{"2":"type-post","14":"entry","15":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use SPM for Flash to Flash Programming - (Part 33\/46)<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use SPM for Flash to Flash Programming - (Part 33\/46)\" \/>\n<meta property=\"og:description\" content=\"The Self Programming Mode (SPM) is a feature which enables a microcontroller to program its own flash memory. Using the SPM a microcontroller can program itself with an SPM code. The SPM is commonly used with the microcontroller Boot-Loader codes which help to program the microcontroller serially.&nbsp;In AVR microcontroller the SPM is available only for the code running in the BLS of the flash memory. With the help of the SPM a code in BLS can rewrite the application flash memory entirely or a part of it. It can even rewrite its own code in the BLS section.&nbsp;The SPM is a key factor of the Boot-Loader code since the major function of the Boot-Loader is to load an application code into the application flash section. The Boot-Loader may receive the code binary from other memory chips, SD-cards or through the serial port of the microcontroller in case of serial programming.&nbsp;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"640\" \/>\n\t<meta property=\"og:image:height\" content=\"480\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ashutosh Bhatt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ashutosh Bhatt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\"},\"author\":{\"name\":\"Ashutosh Bhatt\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4e6dc417fdf33f6ce27c9ce2f9fd08d3\"},\"headline\":\"How to Use SPM for Flash to Flash Programming &#8211; (Part 33\/46)\",\"datePublished\":\"2019-07-04T23:19:42+00:00\",\"dateModified\":\"2023-05-25T17:20:25+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\"},\"wordCount\":1149,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg\",\"keywords\":[\"avr microcontroller\",\"circuit\",\"Flash Programming\",\"project\",\"SPM\"],\"articleSection\":[\"AVR\",\"Electronic Projects\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\",\"url\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\",\"name\":\"How to Use SPM for Flash to Flash Programming - (Part 33\/46)\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg\",\"datePublished\":\"2019-07-04T23:19:42+00:00\",\"dateModified\":\"2023-05-25T17:20:25+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg\",\"width\":640,\"height\":480,\"caption\":\"\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Use SPM for Flash to Flash Programming &#8211; (Part 33\/46)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4e6dc417fdf33f6ce27c9ce2f9fd08d3\",\"name\":\"Ashutosh Bhatt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/97ae33d7fb6f22daeba201f00355919e158689239cd6f0b5f1d55f00e0851241?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/97ae33d7fb6f22daeba201f00355919e158689239cd6f0b5f1d55f00e0851241?s=96&r=g\",\"caption\":\"Ashutosh Bhatt\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/dmiyares\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Use SPM for Flash to Flash Programming - (Part 33\/46)","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/","og_locale":"en_US","og_type":"article","og_title":"How to Use SPM for Flash to Flash Programming - (Part 33\/46)","og_description":"The Self Programming Mode (SPM) is a feature which enables a microcontroller to program its own flash memory. Using the SPM a microcontroller can program itself with an SPM code. The SPM is commonly used with the microcontroller Boot-Loader codes which help to program the microcontroller serially.&nbsp;In AVR microcontroller the SPM is available only for the code running in the BLS of the flash memory. With the help of the SPM a code in BLS can rewrite the application flash memory entirely or a part of it. It can even rewrite its own code in the BLS section.&nbsp;The SPM is a key factor of the Boot-Loader code since the major function of the Boot-Loader is to load an application code into the application flash section. The Boot-Loader may receive the code binary from other memory chips, SD-cards or through the serial port of the microcontroller in case of serial programming.&nbsp;","og_url":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":640,"height":480,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","type":"image\/jpeg"}],"author":"Ashutosh Bhatt","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Ashutosh Bhatt","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/"},"author":{"name":"Ashutosh Bhatt","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4e6dc417fdf33f6ce27c9ce2f9fd08d3"},"headline":"How to Use SPM for Flash to Flash Programming &#8211; (Part 33\/46)","datePublished":"2019-07-04T23:19:42+00:00","dateModified":"2023-05-25T17:20:25+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/"},"wordCount":1149,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","keywords":["avr microcontroller","circuit","Flash Programming","project","SPM"],"articleSection":["AVR","Electronic Projects"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/","url":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/","name":"How to Use SPM for Flash to Flash Programming - (Part 33\/46)","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","datePublished":"2019-07-04T23:19:42+00:00","dateModified":"2023-05-25T17:20:25+00:00","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","width":640,"height":480,"caption":""},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/how-to-use-spm-for-flash-to-flash-programming-part-33-46\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"How to Use SPM for Flash to Flash Programming &#8211; (Part 33\/46)"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/4e6dc417fdf33f6ce27c9ce2f9fd08d3","name":"Ashutosh Bhatt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/97ae33d7fb6f22daeba201f00355919e158689239cd6f0b5f1d55f00e0851241?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/97ae33d7fb6f22daeba201f00355919e158689239cd6f0b5f1d55f00e0851241?s=96&r=g","caption":"Ashutosh Bhatt"},"url":"https:\/\/www.engineersgarage.com\/author\/dmiyares\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/07\/Configuring-SPM-of-AVR-for-Flash-to-Flash-Programming-Circuit-Setp-up-on-breadboard.jpg","author_info":{"display_name":"Ashutosh Bhatt","author_link":"https:\/\/www.engineersgarage.com\/author\/dmiyares\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/10142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=10142"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/10142\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/15856"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=10142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=10142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=10142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}