Skip to content

Commit

Permalink
Add double 250Mhz overclocking demo
Browse files Browse the repository at this point in the history
  • Loading branch information
UCTRONICS committed Dec 9, 2021
1 parent ddf7c4c commit 4d3ad60
Show file tree
Hide file tree
Showing 20 changed files with 3,214 additions and 0 deletions.
1 change: 1 addition & 0 deletions rp2040_hm01b0_st7735/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build/
32 changes: 32 additions & 0 deletions rp2040_hm01b0_st7735/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 3.12)

#include(pico-sdk/pico_sdk_init.cmake)
# Pull in PICO SDK (must be before project)
include(pico_sdk_import.cmake)

project(rp2040_arducam)

pico_sdk_init()

add_executable(arducam_firmware
arducam/arducam.c
main.c
lib/st7735.c
lib/fonts.c
lib/DEV_Config.c
)

pico_generate_pio_header(arducam_firmware ${CMAKE_CURRENT_LIST_DIR}/image.pio)

target_link_libraries(arducam_firmware
pico_stdlib
hardware_dma
hardware_i2c
hardware_pio
hardware_pwm
hardware_spi
pico_multicore
)
pico_enable_stdio_usb(arducam_firmware 1)

pico_add_extra_outputs(arducam_firmware)
60 changes: 60 additions & 0 deletions rp2040_hm01b0_st7735/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Pico4MLcbot hm01b0 camera and st7735 display demo


## Hardware Connection
![IMAGE ALT TEXT](photos/Pico4MLcbot.15pc.jpg)
```
int PIN_LED = 25;
int PIN_CAM_SIOC = 5; // I2C0 SCL
int PIN_CAM_SIOD = 4; // I2C0 SDA
int PIN_CAM_RESETB = 2;
int PIN_CAM_XCLK = 3;
int PIN_CAM_VSYNC = 16; //GP15 hsync GP14 pixel clock
int PIN_CAM_Y2_PIO_BASE = 6; // data GPIO6
int EPD_RST_PIN = 7; // st7735 display
int EPD_DC_PIN = 9;
int EPD_CS_PIN = 13;
int EPD_CLK_PIN = 10;
int EPD_MOSI_PIN = 11;
int DRV8833_AIN2 = 21; // forw left
int DRV8833_AIN1 = 20; // back left
int DRV8833_BIN1 = 19; // forw right
int DRV8833_BIN2 = 18; // back right
int ESP1_RX = 0; // ESP8285 for Wifi
int ESP1_TX = 1;
```

## Clone repo
```bash
git clone https://github.com/Hermann-SW/RPI-Pico-Cam.git
```
## Compile rp2040_hm01b0_st7735 demo
```bash
cd RPI-Pico-Cam/rp2040_hm01b0_st7735
mkdir build
cd build
cmake ..
cd build
make
```
## Copy the arducam_firmware.uf2 to pico
```bash
cp arducam_firmware.uf2 /media/pi/RPI-RP2/
```

## Comments

It turned out that "capture camera frame, then show on display" loop runs sqrt(2) times faster on core1 (higher processing framerate). In addition another factor 2 was achieved by going to the "safe" double frequency 250MHz overclocking. With that, now 15.6 frames per second get shown on 160x80 display.

## test
[https://www.youtube.com/watch?v=CXhm8GdwkNc](https://www.youtube.com/watch?v=CXhm8GdwkNc)
![IMAGE ALT TEXT](photos/Pico4ML-BLE.anim.gif)
![IMAGE ALT TEXT](photos/20211207_202449.part.50pc.jpg)
![IMAGE ALT TEXT](photos/20211207_220948.part.25pc.jpg)
![IMAGE ALT TEXT](photos/20211124_204656.part.20pc.jpg)

## Thanks
Special thanks to Hermann-SW for providing the code

0 comments on commit 4d3ad60

Please sign in to comment.