Secure your information with a quality DRAM memory
A
A
Hardware Overview
How does it work?
DRAM Click is based on the APS6404L-3SQR, a 64Mb PSRAM (Pseudo-SRAM) memory with an SPI/QPI interface from AP Memory. Organized as 8M x 8 bits each, this high-speed, high-performance memory has a page size of 1024 bytes. It also incorporates a seamless, self-managed refresh mechanism specially designed to maximize the performance of the memory read operation (it does not require the support of DRAM refresh from the system host). It is most suitable for low-power and low-cost portable applications.
The APS6404L-3SQR communicates with the MCU using an SPI serial interface that also supports Quad SPI and the two most common modes, SPI Mode 0 (QSPI Mode 1), with a maximum SPI frequency of 133MHz. The APS6404L-3SQR includes an on-chip voltage sensor used to start the self-initialization process. When the main power supply voltage reaches a stable level at or above the minimum supply voltage level, the device will require 150μs and user-issued RESET Operation to complete its self-initialization
process. The device powers up in SPI mode by default but can also switch to QPI mode. The CS pin must be set to high logic level before initiating any operations. This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.
![DRAM Click top side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edbe69b-3eac-6c3c-b640-0242ac120005/01-dram-click-front.png)
![DRAM Click lateral side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edbe69c-14ed-67c4-894e-0242ac120005/02-dram-click-side.png)
![DRAM Click bottom side image](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1edbe69c-e1db-6c68-b125-0242ac120005/03-dram-click-back.png)
Features overview
Development board
EasyAVR PRO v8 is a development board specially designed for the needs of rapid development of embedded applications. It supports a wide range of microcontrollers, such as different 8/16-bit AVR® MCUs from Microchip, regardless of their number of pins, and a broad set of unique functions, such as the first-ever embedded debugger/programmer over a WiFi network. The development board is well organized and designed so that the end-user has all the necessary elements, such as switches, buttons, indicators, connectors, and others, in one place. Thanks to innovative manufacturing technology, EasyAVR PRO v8 provides a fluid and immersive working experience, allowing access
anywhere and under any circumstances at any time. Each part of the EasyAVR PRO v8 development board contains the components necessary for the most efficient operation of the same board. An advanced integrated CODEGRIP programmer/debugger module offers many valuable programming/debugging options, including support for JTAG, SWD, and SWO Trace (Single Wire Output)), and seamless integration with the Mikroe software environment. Besides, it also includes a clean and regulated power supply module for the development board. It can use a wide range of external power sources, including a battery, an external 12V power supply, and a power source via
the USB Type-C (USB-C) connector. Communication options such as USB-UART and USB DEVICE are also included, alongside the well-established mikroBUS™ standard, a standardized socket for the MCU card (SiBRAIN standard), and two display options for the TFT board line of products and character-based LCD. EasyAVR PRO v8 is an integral part of the Mikroe ecosystem for rapid development. Natively supported by Mikroe software tools, it covers many aspects of prototyping and development thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.
Microcontroller Overview
MCU Card / MCU
![default](https://cdn.mikroe.com/rent-a-product/request-setup/mcu-cards/sibrain-for-atmega6450.png)
Type
8th Generation
Architecture
AVR
MCU Memory (KB)
64
Silicon Vendor
Microchip
Pin count
100
RAM (Bytes)
4096
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic
![DRAM Click Schematic schematic](https://dbp-cdn.mikroe.com/catalog/click-boards/resources/1ee79097-fe63-670e-81bf-0242ac120009/schematic.webp)
Step by step
Project assembly
Track your results in real time
Application Output
This Click board can be interfaced and monitored in two ways:
Application Output
- Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
UART Terminal
- Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.
Software Support
Library Description
This library contains API for DRAM Click driver.
Key functions:
dram_memory_write
This function writes a desired number of data bytes starting from the selected memory address.dram_memory_read
This function reads a desired number of data bytes starting from the selected memory address.dram_memory_read_fast
This function reads a desired number of data bytes starting from the selected memory address performing a fast read feature.
Open Source
Code example
The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.
/*!
* @file main.c
* @brief DRAM Click example
*
* # Description
* This example demonstrates the use of DRAM click board by writing specified data to
* the memory and reading it back.
*
* The demo application is composed of two sections :
*
* ## Application Init
* Initializes the driver, resets the device and checks the communication by reading
* and verifying the device ID.
*
* ## Application Task
* Writes a desired number of bytes to the memory and then verifies if it is written correctly
* by reading from the same memory location and displaying the memory content on the USB UART.
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "dram.h"
#define DEMO_TEXT_MESSAGE_1 "MikroE"
#define DEMO_TEXT_MESSAGE_2 "DRAM click"
#define STARTING_ADDRESS 0x012345ul
static dram_t dram;
static log_t logger;
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
dram_cfg_t dram_cfg; /**< Click config object. */
/**
* Logger initialization.
* Default baud rate: 115200
* Default log level: LOG_LEVEL_DEBUG
* @note If USB_UART_RX and USB_UART_TX
* are defined as HAL_PIN_NC, you will
* need to define them manually for log to work.
* See @b LOG_MAP_USB_UART macro definition for detailed explanation.
*/
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
dram_cfg_setup( &dram_cfg );
DRAM_MAP_MIKROBUS( dram_cfg, MIKROBUS_1 );
if ( SPI_MASTER_ERROR == dram_init( &dram, &dram_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
if ( DRAM_ERROR == dram_reset ( &dram ) )
{
log_error( &logger, " Reset device." );
for ( ; ; );
}
Delay_ms ( 100 );
if ( DRAM_ERROR == dram_check_communication ( &dram ) )
{
log_error( &logger, " Check communication." );
for ( ; ; );
}
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
uint8_t data_buf[ 128 ] = { 0 };
log_printf ( &logger, " Memory address: 0x%.6LX\r\n", ( uint32_t ) STARTING_ADDRESS );
memcpy ( data_buf, DEMO_TEXT_MESSAGE_1, strlen ( DEMO_TEXT_MESSAGE_1 ) );
if ( DRAM_OK == dram_memory_write ( &dram, STARTING_ADDRESS, data_buf, sizeof ( data_buf ) ) )
{
log_printf ( &logger, " Write data: %s\r\n", data_buf );
Delay_ms ( 100 );
}
memset ( data_buf, 0, sizeof ( data_buf ) );
if ( DRAM_OK == dram_memory_read ( &dram, STARTING_ADDRESS,
data_buf, sizeof ( data_buf ) ) )
{
log_printf ( &logger, " Read data: %s\r\n\n", data_buf );
Delay_ms ( 3000 );
}
log_printf ( &logger, " Memory address: 0x%.6LX\r\n", ( uint32_t ) STARTING_ADDRESS );
memcpy ( data_buf, DEMO_TEXT_MESSAGE_2, strlen ( DEMO_TEXT_MESSAGE_2 ) );
if ( DRAM_OK == dram_memory_write ( &dram, STARTING_ADDRESS, data_buf, sizeof ( data_buf ) ) )
{
log_printf ( &logger, " Write data: %s\r\n", data_buf );
Delay_ms ( 100 );
}
memset ( data_buf, 0, sizeof ( data_buf ) );
if ( DRAM_OK == dram_memory_read_fast ( &dram, STARTING_ADDRESS, data_buf, sizeof ( data_buf ) ) )
{
log_printf ( &logger, " Fast read data : %s\r\n\n", data_buf );
Delay_ms ( 3000 );
}
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
// ------------------------------------------------------------------------ END