932 views|2 replies

336

Posts

2

Resources
The OP
 

[Digi-Key Follow Me Issue 4] Getting Started Tasks [Copy link]

 
[Digi-Key Follow Me Issue 4 ] Getting Started Tasks: Development Environment Setup, BLINK , and LCD Display Driver

Hardware Environment

According to the requirements of the 4th phase of Digi-Key's Follow me program, we purchased two boards: W5500-EVB-PICO (hereinafter referred to as the main control module) and AdafruitSharp Memory Display (hereinafter referred to as the display module).
Figure 1 Activity requirements for purchasing boards
Figure 2 W5500-EVB-PICO board
Figure 3 AdafruitSharp Memory Display module
The display module is operated through the SPI interface, so the main control module needs to select a suitable pin to complete the drive.
Figure 4: Pin connection relationship between display module and main control module
Figure 5 Module
Currently used IO pin assignment relationship table:
I/O Pin Name describe
I GP16 Connect to MISO of W5500
O GP17 CSn connected to W5500
O GP18 Connect to SCLK of W5500
O GP19 MOSI connected to W5500
O GP20 Connect to RSTn of W5500
I GP21 Connect to INTn of W5500
I GP24 VBUS sense - high if VBUS is present, else low
O GP25 User LEDs
I GP29 Used in ADC mode (ADC3) to measure VSYS/3
O GP15 Connect to display module DI
O GP14 Connect to display module CLK
O GP13 Connect to display module CS

Software Environment

After multiple comparisons, CircuitPython was chosen as the basic software platform for this test.
Figure 6 CircuitPython firmware download
Firmware installation:
There are many online tutorials on the firmware installation process, so I won’t go into details here.
Download the Adafruit library:
It should be noted that we should choose the library that corresponds to the CircuitPython version. For example, if we chose version 8.2.9, we should choose the library circled in red. The library is on GitHub and is difficult to download. You can still succeed after trying a few times.
Figure 7 Library download
Installation of the library:
After we successfully burn CircuitPython to the main control module, reconnect the USB cable or reset the module, you can see that there will be an additional drive letter named CIRCUITPY in the system. The drive letter contains a folder named "lib". If it does not exist, we need to create it ourselves.
Unzip the compressed library file downloaded earlier. The extension of the library file may be mpy. It doesn't matter. The system can recognize it correctly. We select the library files we need in the library and copy them to the lib folder for future use. After installing the library files, it will be as shown in the figure below.
Figure 8 Directory after library file installation

Test code

The test program is edited, uploaded, and run debugged using Tonny software. The code is as follows:
# 测试任务1 入门任务

import time
import board
import busio
import digitalio

import adafruit_sharpmemorydisplay

def led_flush():
    led.value = not led.value
    time.sleep(0.5)

def clear_disp():
    # Clear the display.  Always call show after changing pixels to make the display
    # update visible!
    display.fill(1)
    display.show()

def disp_helloworld():
    print("hello world")
    display.fill(1)
    display.text(" hello world!", 30, 50, 0)
    display.show()

if __name__ == '__main__':
    led = digitalio.DigitalInOut(board.GP25)
    led.direction = digitalio.Direction.OUTPUT

    # Initialize SPI bus and control pins
    spi = busio.SPI(board.GP14, MOSI=board.GP15)
    scs = digitalio.DigitalInOut(board.GP13)  # inverted chip select

    # pass in the display size, width and height, as well
    # display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 96, 96)
    display = adafruit_sharpmemorydisplay.SharpMemoryDisplay(spi, scs, 144, 168)

    clear_disp()
    disp_helloworld()
    while True:
        led_flush()


Run Output

After the program runs, a line of text "hello world" is displayed in the middle of the display module, and the small light flashes, indicating that the requirements of the entry-level task have been met.

This post is from DigiKey Technology Zone

Latest reply

Salute to the boss   Details Published on 2024-2-26 22:20
 
 

141

Posts

4

Resources
2
 

Learn from the thighs

This post is from DigiKey Technology Zone
 
 
 

19

Posts

0

Resources
3
 

Salute to the boss

This post is from DigiKey Technology Zone
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list