The main pinout is identical, but the placement of the aerial required the debug pins be moved.
CircuitPython and MicroPython have many similarities, but there are some major differences.
One of the most fundamental are the names of the files executed when the board is powered up.
MIcroPython looks for two files in a set order in the root of its filesystem.
CircuitPython looks for the following files in this order:
https://github.com/adafruit/circuitpython#differences-from-micropython
https://docs.circuitpython.org/en/latest/README.html#differences-from-micropython
The W5100S-EVB-Pico microcontroller board is pin compatible with the Raspberry Pi Pico and uses the same RP2040 microcontroller. It is integrated with the WIZnet W5100S ethernet controller.
There are examples in Circuit Python and C/C++.
As an exercise I decided to first try using C/C++ as the development language and a Windows 10 machine as the development machine (cross compiling to the ARM based RP2040).
I followed the instructions to install CMAKE, however there is an ongoing issue with CMAKE version 3.21+ that causes a
AR10B2~1.EXE: error: n++CMakeFiles/blink.dir/blink.c.obj: No such file or directory
error when executing the nmake line of the instructions.
It is suggested that an earlier version of the CMAKE tool is installed. Version 3.20 seems to work.
https://datasheets.raspberrypi.com/pico/getting-started-with-pico.pdf
https://forums.raspberrypi.com/viewtopic.php?f=145&t=316310
https://github.com/Wiznet/RP2040-HAT-C/blob/main/getting_started.md
https://en.wikipedia.org/wiki/IP_address#Private_addresses
message("Start from scratch")cmake_minimum_required(VERSION 3.10)#include(rp2040_hat_c-patch.cmake)include(pico_sdk_import.cmake)include(rp2040_hat_c_sdk_version.cmake)project(blink C CXX ASM)set(CMAKE_C_STANDARD 11)set(CMAKE_CXX_STANDARD 17)set(PICO_EXAMPLES_PATH ${PROJECT_SOURCE_DIR})pico_sdk_init()if(NOT DEFINED WIZNET_DIR)set(WIZNET_DIR ${CMAKE_SOURCE_DIR}/libraries/ioLibrary_Driver)message(STATUS "WIZNET_DIR = ${WIZNET_DIR}")endif()if(NOT DEFINED MBEDTLS_LIB_DIR)set(MBEDTLS_LIB_DIR ${CMAKE_SOURCE_DIR}/libraries/mbedtls)message(STATUS "MBEDTLS_LIB_DIR = ${MBEDTLS_LIB_DIR}")endif()if(NOT DEFINED PORT_DIR)set(PORT_DIR ${CMAKE_SOURCE_DIR}/port)message(STATUS "PORT_DIR = ${PORT_DIR}")endif()# Turn off mbedtls test modeset(ENABLE_PROGRAMS OFF CACHE BOOL "Build mbedtls programs")set(ENABLE_TESTING OFF CACHE BOOL "Build mbedtls testing")add_definitions(-DMBEDTLS_CONFIG_FILE="${PORT_DIR}/mbedtls/inc/ssl_config.h")add_definitions(-DSET_TRUSTED_CERT_IN_SAMPLES)add_subdirectory(server)# Add libraries in subdirectoriesadd_subdirectory(${CMAKE_SOURCE_DIR}/libraries)add_subdirectory(${MBEDTLS_LIB_DIR})add_subdirectory(${PORT_DIR})include(example_auto_set_url.cmake)add_compile_options(-Wall-Wno-format # int != int32_t as far as the compiler is concerned because gcc has int32_t as long int-Wno-unused-function # we have some for the docs that aren't called-Wno-maybe-uninitialized)message("PICO SDK: ${PICO_SDK_VERSION_STRING}")
So I ordered a Raspberry Pi Pico from Pimoroni (before picking one up on the cover of Hackspace).
It came in its own little box from a reel.
Here are the two Picos.Raspberry Pi have just released a new product into a new market for them a low cost microcontroller. And not just a microcontroller using an existing piece of silicon, no, this is a in-house custom designed processor.
As you can see, it is much smaller than even the Raspberry Pi Zero (a WH example above).
Out of the box it has only limited built in semsors and outputs, this is not a Circuit Playground Express.
Basically it has a green LED on GPIO pin 25 and a chip temperature sensor.
There is a full description of the RP2040 here, but these are the highlights:
The eight PIO state machines are a particular innovation - they are programmable in a simple assembly language to perform tasks at set rates. Each instruction takes one cycle and is independent of the two main cores. This allows you to set up time sensitive operations at known speeds, irrespective of what the main processor is doing. Most microcontrollers would require bit-banging, using the processor to transmit or receive data by changing/reading the state of an input. The PIO allows this to be offloaded to a PIO with full control of the process. All the processor has to do is ensure that it is kept fed or emptied in time.
The chip is called an RP204 based on a naming system:
Cores: 2
CPU type: 0 ~ M0 - this is a loose description of the CPU type.
RAM: 4 = floor(log2(ram / 16k))
Flash: 0 = floor(log2(nonvolatile / 16k)) or zero in this case (the host board provides the Flash storage).
foreach (string port in ports)
{
Console.WriteLine(port);
}
using (var sp = new System.IO.Ports.SerialPort("COM5", 115200, System.IO.Ports.Parity.None, 8, System.IO.Ports.StopBits.One))
{
Console.WriteLine("Reading serial port");
sp.Open();
while (true)
{
var readData = sp.ReadLine();
Console.WriteLine($"[{readData}]");
}
}
from microbit import *import osimport utimemenuitem = 0if 'choice.opt' in os.listdir():with open('choice.opt') as choice:menuitem = int(choice.read())display.scroll("Menu item" + str(menuitem))start = utime.ticks_ms()+6000interval = 2000while True:now = utime.ticks_ms()if start > now or now - start > interval:if menuitem == 0:temp = temperature()interval = 2000display.scroll(str(temp) + 'C', delay=100, wait=False)elif menuitem == 1:temp = temperature()interval = 2000display.scroll(str(temp + 273.15) + 'K', delay=100, wait=False)elif menuitem == 2:level = display.read_light_level()interval = 2000display.scroll(str(level) + ' light', delay=100, wait=False)elif menuitem == 3:level = compass.get_field_strength()interval = 6000display.scroll(str(level) + ' nTesla', delay=100, wait=False)elif menuitem == 4:display.scroll("Menu test")start = nowif button_a.is_pressed():display.scroll("Menu", delay = 100)sleep(50)while not button_a.is_pressed():display.set_pixel(4,menuitem,5)if button_b.is_pressed():display.set_pixel(4,menuitem,0)menuitem = menuitem + 1if menuitem > 4:menuitem = 0with open('choice.opt','w') as choice:choice.write(str(menuitem))display.scroll("Menu item" + str(menuitem), delay = 100)sleep(100)display.set_pixel(4,menuitem,5)sleep(100)sleep(400)The persistent choice is handled by this code:
menuitem = 0
if 'choice.opt' in os.listdir():
with open('choice.opt') as choice:
menuitem = int(choice.read())The menu item is given a default value (0).
![]() |
| Add caption |