3217|8

1万

帖子

25

TA的资源

版主

楼主
 

64Mb PSRAM 的简单驱动 [复制链接]

  本帖最后由 dcexpert 于 2021-5-27 15:41 编辑

64Mbit(8兆字节)的PSRAM让人兴奋,虽然速度不是最快,但是却很有用。

 

游客,如果您要查看本帖隐藏内容请回复

 

example.py 显示了如何使用它,只需给它一个地址(范围0-8388607)和一个值(范围0-255),就可以将数据从 bytearray 转换为整数。

 

  
"""
mb_PSRAM_64Mb_SPI_example.py
Example MicroPython script for 64Mbit SPI PSRAM with RP2040 (Raspberry Pi Pico)
(Should work with other MicroPython-capable devices with hardware of software SPI)
Author: mark@marksbench.com
Version: 0.1, 2021-05-26
**NOTE: There is no guarantee that this software will work in the way you expect (or at all).
**Use at your own risk.
To use:
- Upload the mb_PSRAM_64Mb_SPI.py file to your board (the same location where your MicroPython scripts
  run from, or the /lib folder if applicable).
- Connect the PSRAM to the Pi Pico (RP2040), for testing (and to use this example script
  without modification) I suggest the following:
  
        PSRAM    |    Pi Pico
        1(/CE)   |    GP1 (Pin 2)
        2(SO)    | GP4, (SPI0 RX, Pin 6)
        3(SIO[2])|      NC
        4(Vss)   |    GND, (Pin 38)
        5(SI)    | GP7, (SPI0 TX, Pin 10)
        6(SCK)   | GP6, (SPI0 SCK, Pin 9)
        7(SIO[3])|      NC
        8(Vcc)   |   3V3 OUT, (Pin 36)
- To write a value: memory.write_byte(address, value)
- To read a value: value = memory.read_byte(address)
- You should get an error if the address or value is out of range.
"""

from machine import Pin, SPI
import mb_PSRAM_64Mb_SPI

# Set up SPI with the pinout arrangement listed above
spi = SPI(0, sck=Pin(6), mosi=Pin(7), miso=Pin(4), polarity=0, phase=0, baudrate=2000000)

# Set a GP pin to use for /CS
cs = 1

# Create constructor to use driver
memory = mb_PSRAM_64Mb_SPI.mb_PSRAM_64Mb_SPI(spi, cs)


# Simple write test. Writing value of 38 to address 8388607 (highest address of this device)
memory.write_byte(8388607, 38)

# Write value 255 to address 0 (lowest address of the 23LC1024)
memory.write_byte(0, 255)

# Simple read test. Read the value from address 131071 and print it
read_value = memory.read_byte(8388607)
print("Retrieved: ", read_value)

# Now read from address 0 and print it
read_value = memory.read_byte(0)
print("Retrieved: ", read_value)

 

最新回复

看一下   详情 回复 发表于 2025-1-16 15:54
点赞 关注
 
 

回复
举报

1942

帖子

2

TA的资源

版主

沙发
 

这个是用的什么芯片?

 
 
 

回复

1411

帖子

3

TA的资源

版主

板凳
 

一般应用在哪里?

个人签名

没有什么不可以,我就是我,不一样的烟火! 

 
 
 

回复

17

帖子

0

TA的资源

一粒金砂(初级)

4
 

这个好

 
 
 

回复

1

帖子

0

TA的资源

一粒金砂(初级)

5
 

不错哦,下载下来看看

 
 
 

回复

5

帖子

0

TA的资源

一粒金砂(初级)

6
 

RP2040就是引脚少了点

 
 
 

回复

2

帖子

1

TA的资源

一粒金砂(初级)

7
 
回复看看啊
 
 
 

回复

3

帖子

0

TA的资源

一粒金砂(初级)

8
 

学习学习

 
 
 

回复

78

帖子

0

TA的资源

一粒金砂(中级)

9
 

看一下

 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/9 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表