Alternative Version









January 15, 2024

F-Pico


Raspberry Pi Pico






July 30, 2022, I bought a Raspberry Pi Pico which is the smallest device for the Raspberry Pi models but I didn't get a chance to try so I played with that during the recent winter break.

Here are the specs and key features:

- RP2040 microcontroller with 2MB Flash

- Micro-USB B port for power and data (and for reprogramming the Flash)

- Dual ARM Cortex-M0+ @ 133MHz

- 264kB on-chip SRAM in six independent banks

- DMA controller, interpolator and integer divider peripherals, ...

This is a tiny microcontroller but highly performance even with no integrated graphics hardware (GPU).

Next parts will be some tests I did with this device.


Tests






By default, there are not a lot of options, a button and a led so I tested the input and blinked the led when I pressed the button.

For the output, you can use Putty and connect with your computer through usb cable. The better way I found was to use "Serial Monitor" inside Visual Studio Code which will detect automatically which port (e.g. COM1, COM3) to use:.






Afterwards, I added a LCD screen with a resolution of 160 x 128 with 65K RGB color (16 bits).
I created this pattern which you may recognize (if you already tried cryptography / encryption).







Datasheets






If you don't get the meme above, just type "dennis ritchie java meme" in your search engine to get more info.

Dennis Ritchie was the creator of the C programming language which is the language I used for my tests on this device.

I like more low level languages like C and C++ than high level languages like Java, C# or Typescript / Javascript. Low level languages are useful to get powerful features like the one I found when I read the datasheets for the Raspberry PI Pico.






Above is the Interpolators schema. From the Datasheet:

"Each core is equipped with two interpolators (INTERP0 and INTERP1) which can accelerate tasks by combining certain pre- configured operations into a single processor cycle. Intended for cases where the pre-configured operation is repeated many times, this results in code which uses both fewer CPU cycles and fewer CPU registers in the time-critical sections of the code.

The interpolators are used to accelerate audio operations within the SDK, but their flexible configuration makes it possible to optimize many other tasks such as quantization and dithering, table lookup address generation, affine texture mapping, decompression and linear feedback"


The datasheet PDF file shows a couple of examples but the more interesting part is the note section:

"Note: By sheer coincidence, the interpolators are extremely well suited to SNES MODE7-style graphics routines. For example, on each core, INTERP0 can provide a stream of tile lookups for some affine transform, and INTERP1 can provide offsets into the tiles for the same transform"

The Mode 7 on SNES was a feature where we can apply affine transformation (e.g. translation, scaling, rotation, shearing) on a single layer. One of the first games I saw that and boughted was F-Zero so I decided to do a tiny F-Zero alike demo.


Mode 7



I used the F-Zero assets (e.g. map, background) but the title screen effect I added looks more like that Megaman X intro style.

The SNES resolution is 256 x 224 compared to this LCD at 160 x 128 (36% of the SNES resolution) but I didn't rescale the map (I should).

I used the one button to rotate the camera.

The demo has been done in C but the tools are in C++: auto-tile map generator, palettes and images color conversion, compression, ...

It was fun to do. I have one project in mind but I need a similar Raspberry Pi but with one more feature where I will target this year to do this project.

Thanks for reading,

JS.