{"id":262,"date":"2015-07-01T16:36:41","date_gmt":"2015-07-01T16:36:41","guid":{"rendered":"http:\/\/babel.isa.uma.es\/jafma\/?p=262"},"modified":"2023-03-03T11:06:15","modified_gmt":"2023-03-03T11:06:15","slug":"c-library-for-using-the-sram-microchip-23lc512-isn-from-the-atmega328p","status":"publish","type":"post","link":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/2015\/07\/01\/c-library-for-using-the-sram-microchip-23lc512-isn-from-the-atmega328p\/","title":{"rendered":"C library for using a SRAM Microchip 23LC512-I\/SN connected to an ATmega328P"},"content":{"rendered":"<p>The <a href=\"http:\/\/es.rs-online.com\/web\/p\/chips-de-memoria-sram\/7985208\/\" target=\"_blank\">SRAM Microchip 23LC512-I\/SN<\/a> is a very nice chip that can serve as external RAM (64KB) for the ATmega328P.\u00a0 This simple C  library deals with block writings and readings to that chip from the MCU, in a most efficient way (it can use assembler code internally, and some hard real-time techniques for reducing the execution time, if the user wishes to).<\/p>\n<p>It has been tested with the <a href=\"https:\/\/babel.isa.uma.es\/jafma\/index.php\/2014\/01\/02\/scripts-for-using-arduino-as-a-bare-microcontroller\/\">scripts<\/a> for bare programming the ATmega328P of an Arduino UNO, i.e., with the compiler that comes with the Arduino IDE.<\/p>\n<p><strong>Features:<\/strong><\/p>\n<ul>\n<li>It uses the SPI module of the ATmega328P, and therefore its associated MISO\/MOSI\/SCK pins, for communications.<\/li>\n<li>It always uses pin 2 of PORTB as output because otherwise the SPI module of the ATmega328P does not work properly. Nevertheless, the chip select for the SRAM can be B2 or D3.<\/li>\n<li>Including the call to the writing routine and without interrupts enabled, the transfer speed is around 5 microsecs per byte of the transmitted block (200KHz).<\/li>\n<li>Including the call to the reading routine and without interrupts enabled, the transfer speed is around 5.3 microsecs per byte of the transmitted block (190KHz).<\/li>\n<\/ul>\n<p><strong>Installation and usage:<\/strong><\/p>\n<ul>\n<li>Download the <a href=\"https:\/\/babel.isa.uma.es\/_utils\/downloads\/logdownloads.php?u=jafma&amp;t=zip&amp;f=downloads\/jafma\/docencia\/sram.zip\">library<\/a>.<\/li>\n<li>Just read the .h.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>The SRAM Microchip 23LC512-I\/SN is a very nice chip that can serve as external RAM (64KB) for the ATmega328P.\u00a0 This simple C library deals with block writings and readings to that chip from the MCU, in a most efficient way (it can use assembler code internally, and some hard real-time techniques for reducing the execution [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-262","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software"],"_links":{"self":[{"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/posts\/262"}],"collection":[{"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/comments?post=262"}],"version-history":[{"count":17,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions"}],"predecessor-version":[{"id":919,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/posts\/262\/revisions\/919"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/media\/4"}],"wp:attachment":[{"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/media?parent=262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/categories?post=262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/babel.isa.uma.es\/jafma\/index.php\/wp-json\/wp\/v2\/tags?post=262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}