Requesting sample code to test the 70V28L dual port sram

Hello team,
we have connected dpram to the verdin base board through the gpio pins which are free to use. we have connected D0 to D7 data pins and A0 A15 pins. we want to perform write and read operations. Can you please provide me the any sample code (like to wrire the data continously to the three or more address and after have to those data.)

Thanks in Advance,

surya.

  • Hi Surya,

    I understand you want to perform write and read operations with your DPRAM (Dual-Port RAM) connected to the Verdin base board. Here's a simple example of how you could accomplish this using Python and GPIO libraries. This example assumes you have a basic understanding of Python and GPIO pin control.

    ```python
    import RPi.GPIO as GPIO
    import time

    # Define GPIO pins for Data and Address
    data_pins = [2, 3, 4, 5, 6, 7, 8, 9] # D0 to D7
    address_pins = [10, 11, 12, 13, 14, 15, 16, 17] # A0 to A7 (add more if needed)
    we_pin = 18 # Write Enable
    oe_pin = 19 # Output Enable

    # Setup GPIO
    GPIO.setmode(GPIO.BCM)
    for pin in data_pins + address_pins + [we_pin, oe_pin]:
    GPIO.setup(pin, GPIO.OUT)

    # Function to set data on data pins
    def set_data(data):
    for i in range(len(data_pins)):
    GPIO.output(data_pins[i], (data >> i) & 1)

    # Function to set address on address pins
    def set_address(address):
    for i in range(len(address_pins)):
    GPIO.output(address_pins[i], (address >> i) & 1)

    # Function to write data to a specific address
    def write_data(address, data):
    set_address(address)
    set_data(data)
    GPIO.output(we_pin, GPIO.LOW)
    time.sleep(0.01) # Small delay for write operation
    GPIO.output(we_pin, GPIO.HIGH)

    # Function to read data from a specific address
    def read_data(address):
    set_address(address)
    GPIO.output(oe_pin, GPIO.LOW)
    time.sleep(0.01) # Small delay for read operation
    data = 0
    for i in range(len(data_pins)):
    data |= (GPIO.input(data_pins[i]) << i)
    GPIO.output(oe_pin, GPIO.HIGH)
    return data

    # Example Usage
    # Write data to multiple addresses
    write_data(0x00, 0xA5)
    write_data(0x01, 0x5A)
    write_data(0x02, 0xFF)

    # Read data from those addresses
    data0 = read_data(0x00)
    data1 = read_data(0x01)
    data2 = read_data(0x02)

    print(f"Data at address 0x00: {data0}")
    print(f"Data at address 0x01: {data1}")
    print(f"Data at address 0x02: {data2}")

    # Cleanup GPIO
    GPIO.cleanup()
    ```

    This code sets up the GPIO pins for data and address lines, and provides functions to write to and read from specific addresses in the DPRAM. It also includes example usage, writing data to three addresses and then reading from them.

    Remember to install the `RPi.GPIO` library if you haven't already. You can install it using pip:

    ```bash
    pip install RPi.GPIO
    ```

    Please adapt the pin numbers and address range as per your specific requirements. This is a basic example and might need adjustments based on your hardware setup and specific DPRAM module.

    Feel free to ask if you have any further questions. Happy coding! 

    Best regards,
    Victoria
    kia motor finance

  • Hi Surya,

    Thank you for posting your question online and apologies for the delay.

    Can you please provide me the any sample code (like to wrire the data continously to the three or more address and after have to those data.)

    Unfortunately, we do not provide any sample code or drivers for our Memory products.
    Please refer on 70V28 - 64K x 16 3.3V Dual-Port RAM | Renesas for all the available documentation. 

    Best Regards,
    OV_Renesas