Hola @Manuel_Angel, no worries take whatever time you need.
I have not used a Debug Probe. There is a setting in the CMake file to allow the USB-Serial Input/Output, and with that setting, you can create print commands in your code for debugging. This video is a good overview.
Note this project makes use of these settings
# Enable usb output, disable uart output
pico_enable_stdio_usb(${PROJECT_NAME} 1)
pico_enable_stdio_uart(${PROJECT_NAME} 0)
Not sure I understand what you are trying to do. The idea is to connect the flashed PICO usb to the USB of the RPi or PC.
If you already have a PICO, you can follow these steps for a quick test:
- Download the file PICO_USB2PED.uf2 at the flash folder in the repository.
- Press and hold the Bootsel button (button next to the usb connector) then connect the pico to the PC (while holding it pressed). After is connected, let go of the bootsel button. The pico will show in your PC or RPi as a storage device (similar to a usb-drive).
- Copy the file PICO_USB2PED.uf2 you downloaded to the storage device. That will flash the PICO.
- The storage device will then disappear, and the PICO is now programmed.
The PICO will now act as the USB2PED. Reconnecting the PICO (without pressing the Bootsel button), will add a Serial port to your PC or RPi. That’s the serial port you connect with.
To test manually, any serial terminal can communicate with the added Serial port (the Pico connected to a USB port).
Check what port was assigned by the PC or RPi. In the RPi 4B it typically is assigned /dev/ttyACM0.
For the Terminal program (I use Putty Serial) use the following settings to connect:
Port = /dev/ttyACM0
baudrate = 115200
bytesize = 8
stopbits = 1
parity = N
Once you are able to connect via the terminal program, typing the letter-command will allow you to see/test the results on the corresponding GPIO pins.
L - will make GP19 (Led) High.
l - will make GP19 (Led) Low.
E - will make GP18 (Enable) High.
e - will make GP18 (Enable) Low.
D - will make GP17 (Direction) High.
d - will make GP17 (Direction) Low.
And if you have something you can see pulses with (a scope or logic analyzer)
T - will send the default one-turn number of pulses out of GP16 (Pulse).
See the PICO_USBPED Documentation for all the commands available.
That’s a simple first test. Also note that commands are actually quite easy to follow L for LED, E enable, D direction, Caps → High, smallcap → Low.
If you have the above working, wiring the PICO to the stepper driver (via your PCB) would allow you to manually move the stepper.
To make a turn, the key sequence would be.
d or D (depending on the direction of turn)
E (to enable)
T (one turn at the current frequency and number of steps)
e (to disable driver).
Once you have the above working, then use the Python example in the documentation to get your program to send the commands for your software.
Let me know if the above is clear, happy to address any questions you may have.
EDIT: added baudrate to the settings.