scrapcomputing / MCEBlaster

A Pi Pico based MDA/CGA/EGA to VGA adapter
18 stars 2 forks source link

help with pico usb-c version #8

Open emilen72 opened 1 week ago

emilen72 commented 1 week ago

Hi, Is there any reason why the build doesn't work with USB-C Pico? Have you any experiences?

I have some Aliex picos... some with micro-usb and some with usb-c.

the USB-C version doesn't like this build. the pico usb-c version is working and is ok with other designs like Apple2VGA ( and Apple2VGA also works with the micro-USB version).

the pico micro-usb version instead is ok...

the usb-c and micro-usb version have same chip and same pinout.

Any ideas?

scrapcomputing commented 1 week ago

Sorry, I've never tried the usb-c ones. But if I where to guess, perhaps it doesn't work at 270MHz for some reason?

emilen72 commented 1 week ago

Reading on the net, I think is due to a slow flash chip used on many pi pcio, other project noted this and fix it adding code to CMakeLists or define custom board.

i.e. https://github.com/robinhedwards/A8PicoCart/tree/main/source/Pico%20VSCode%20Project/a8_pico_cart for fix it defines a custom board with a higher value for PICO_FLASH_SPI_CLKDIV so it supports the slower flash.

// myboard.h // setting first overrides the value in the default header //#define PICO_FLASH_SPI_CLKDIV 2 // use for winbond flash

define PICO_FLASH_SPI_CLKDIV 4 // use for slower flash (e.g. zbit)

// pick up the rest of the settings

include "boards/pico.h"

or in https://forums.raspberrypi.com/viewtopic.php?t=301902 they suggest this way

Re: Overclocking Pico with up to 270MHz works Tue Feb 02, 2021 3:49 pm

about about 270Mhz system clock you are probably out of range of the flash chip.

Do something like this in your CMakeLists.txt Code: Select all

pico_define_boot_stage2(slower_boot2 ${PICO_DEFAULT_BOOT_STAGE2_FILE}) target_compile_definitions(slower_boot2 PRIVATE PICO_FLASH_SPI_CLKDIV=4)

pico_set_boot_stage2(TARGET slower_boot2) to use a custom boot_stage2 which configures the flash slower (relative to system clock)

maybe this help to make the project more flexible

tnx

scrapcomputing commented 4 days ago

Thank you for looking into this! I have ordered a pico clone and I will try out your suggestions. Thanks!

emilen72 commented 2 days ago

it works! with Pi Pico clone purple (even without buffer as many other projects). at moment I test only MDA

the color is good on screen, text is white (instead the wrong color of the phots)

for now I mod the sdk for spiclkdiv=4 for that

IMG_6877 IMG_6879 IMG_6878