DDZZ669 发表于 2022-11-20 15:47

玩转RP2040之开箱测评与上电运行

<p cid="n0" mdtype="paragraph">RP2040-LCD-1.28板子收到了,感谢EEWorld和微雪电子提供的测评机会。</p>

<h1 cid="n2" mdtype="heading">1 开发板介绍</h1>

<p cid="n3" mdtype="paragraph">RP2040-LCD-1.28是一款Waveshare设计的高性能的微控制器开发板, 微控制器芯片为Raspberry Pi研发的RP2040,搭载了双核 ARM Cortex M0 + 处理器,运行频率高达 133MHz。</p>

<h2 cid="n4" mdtype="heading">1.1 板子外观</h2>

<p cid="n5" mdtype="paragraph">板子的正反面以及侧视图如下所示:</p>

<p cid="n6" mdtype="paragraph"></p>

<p cid="n7" mdtype="paragraph">收到板子后的第一感受是,这个板子非常的小巧精致,圆形屏幕的外直径约35mm,和普通手表的表盘差不多。</p>

<h2 cid="n8" mdtype="heading">1.2 硬件资源介绍</h2>

<p cid="n9" mdtype="paragraph">RP2040-LCD-1.28的主要元器件与接口在板子的反面:</p>

<p cid="n10" mdtype="paragraph"></p>

<p cid="n11" mdtype="paragraph">1)USB供电与调试接口(Type-C),并支持USB1.1主机和从设备</p>

<p cid="n12" mdtype="paragraph">2)锂电池充电芯片ETA6096</p>

<p cid="n13" mdtype="paragraph">3)电池接口,MX1.25连接器,可用于接入3.7V锂电池,支持充放电</p>

<p cid="n14" mdtype="paragraph">4)六轴IMU(三轴加速度与三轴陀螺仪),型号为QMI8658C</p>

<p cid="n15" mdtype="paragraph">5)GPIO引出(共30个),间距1.27mm</p>

<p cid="n16" mdtype="paragraph">6)Flash芯片,2MB的W25Q16JVUXIQ</p>

<p cid="n17" mdtype="paragraph">7)RP2040处理器,频率高达133MHz</p>

<p cid="n18" mdtype="paragraph">8)复位按键</p>

<p cid="n19" mdtype="paragraph">9)BOOT按键,复位时按下,进行下载模式</p>

<p cid="n20" mdtype="paragraph">板子的正面是1.28inch LCD屏幕,控制芯片为GC9A01A,分辨率240x240</p>

<p cid="n21" mdtype="paragraph">此外,RP2040的内部资源还包括:</p>

<ul cid="n22" data-mark="-" mdtype="list">
        <li cid="n23" mdtype="list_item">
        <p cid="n24" mdtype="paragraph">内置了 264KB 的 SRAM</p>
        </li>
        <li cid="n25" mdtype="list_item">
        <p cid="n26" mdtype="paragraph">2 个 SPI,2 个 I2C,2 个 UART,4 个 12 位 ADC,16 个可控 PWM 通道</p>
        </li>
        <li cid="n27" mdtype="list_item">
        <p cid="n28" mdtype="paragraph">精确的片上时钟和定时器</p>
        </li>
</ul>

<h2 cid="n29" mdtype="heading">1.3 引脚分布</h2>

<p cid="n30" mdtype="paragraph">RP2040对引脚进行了引出,通过左右两个排母座子,可以进行IO口的外接使用。</p>

<p cid="n31" mdtype="paragraph"></p>

<p cid="n32" mdtype="paragraph">更多介绍见微雪官网:<a href="https://www.waveshare.net/wiki/RP2040-LCD-1.28">https://www.waveshare.net/wiki/RP2040-LCD-1.28</a></p>

<p cid="n33" mdtype="paragraph">以及pico官网:<a href="https://pico.wiki/">https://pico.wiki/</a></p>

<h1 cid="n34" mdtype="heading">2 上电运行测试</h1>

<p cid="n35" mdtype="paragraph">板子中自带了一个例程,会先显示不同的颜色,然后显示六轴传感器的数值和供电电压,如下图:</p>

<p cid="n36" mdtype="paragraph"></p>

<p cid="n37" mdtype="paragraph">微雪官网中附带了这个例程,可以看下python版本的主程序:</p>

<pre style="background:#555; padding:10px; color:#ddd !important;">
if __name__==&#39;__main__&#39;:
&nbsp;
&nbsp; &nbsp;LCD = LCD_1inch28()
&nbsp; &nbsp;LCD.set_bl_pwm(65535)
&nbsp; &nbsp;qmi8658=QMI8658()
&nbsp; &nbsp;Vbat= ADC(Pin(Vbat_Pin)) &nbsp;
&nbsp; &nbsp;
&nbsp; &nbsp;while(True):
&nbsp; &nbsp; &nbsp; &nbsp;#read QMI8658
&nbsp; &nbsp; &nbsp; &nbsp;xyz=qmi8658.Read_XYZ()
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill(LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill_rect(0,0,240,40,LCD.red)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;RP2040-LCD-1.28&quot;,60,25,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill_rect(0,40,240,40,LCD.blue)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;Waveshare&quot;,80,57,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill_rect(0,80,120,120,0x1805)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;ACC_X={:+.2f}&quot;.format(xyz),20,100-3,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;ACC_Y={:+.2f}&quot;.format(xyz),20,140-3,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;ACC_Z={:+.2f}&quot;.format(xyz),20,180-3,LCD.white)

&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill_rect(120,80,120,120,0xF073)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;GYR_X={:+3.2f}&quot;.format(xyz),125,100-3,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;GYR_Y={:+3.2f}&quot;.format(xyz),125,140-3,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;GYR_Z={:+3.2f}&quot;.format(xyz),125,180-3,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.fill_rect(0,200,240,40,0x180f)
&nbsp; &nbsp; &nbsp; &nbsp;reading = Vbat.read_u16()*3.3/65535*2
&nbsp; &nbsp; &nbsp; &nbsp;LCD.text(&quot;Vbat={:.2f}&quot;.format(reading),80,215,LCD.white)
&nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp;LCD.show()
&nbsp; &nbsp; &nbsp; &nbsp;time.sleep(0.1)</pre>

<p cid="n39" mdtype="paragraph">电压的打印字符稍不一样(BAT与Vbat),可能板子的是C版本是程序,或是python版本的程序改过。</p>

<p cid="n40" mdtype="paragraph">另外,板子连接电脑后,会识别到一个串口,通过串口调试助手连接(波特率9600),可以看到六轴数值的打印信息:</p>

<p cid="n41" mdtype="paragraph"></p>

<h1 cid="n42" mdtype="heading">3 总结</h1>

<p cid="n43" mdtype="paragraph">本篇进行了RP2040-LCD-1.28板子的开箱测评与上电运行测试,板子整体小巧精制,圆形屏幕适合做一个表盘。</p>

<p cid="n44" mdtype="paragraph">下篇进行软件环境搭建与程序烧写测试,RP2040支持C语言开发和Python语言开发,打算先使用Python进行开发测试。</p>

tagetage 发表于 2022-11-20 20:54

<p>PCB设计的不错了。等待楼主的其他测评。</p>

秦天qintian0303 发表于 2022-11-21 11:54

<p>非常不错的小板子,功能齐全,页面刷新效果如何</p>

azcazc 发表于 2022-11-21 14:17

<table cellpadding="0" cellspacing="0">
        <tbody>
                <tr>
                        <td id="postmessage_3190319">
                        <p>PCB设计的不错了。等待楼主的其他测评。</p>
                        </td>
                </tr>
        </tbody>
</table>
页: [1]
查看完整版本: 玩转RP2040之开箱测评与上电运行