4:09 AM
Now I am setting up Pico's uart0 and uart1 to config the two tmc2225 drivers. The first thing I always do is to do uart loopback, to make sure that the uart port and setup and initialized correctly. The test function and sample outputs are listed below.
# *** UART Test Functions *** printProgramName() testUartLoopBack(uartPortNum = 0, writeBytes = 'uart0 Hello World') testUartLoopBack(uartPortNum = 1, writeBytes = 'uart1 Hello World') # *** Sample output *** ''' >>> %Run -c $EDITOR_CONTENT *** Program Name = tmc2225test60.py Programmer = tlfong01 Date = 2022feb17 *** Begin testUartLoopBack(), ... uartPortNum = 0 writeBytes = uart0 Hello World readBytes = b'uart0 Hello World' End testUartLoopBack().
4:27 AM
2 hours later…
6:13 AM
6:29 AM
"UART Mode" is used when the MPU is write only, using one wire, the Tx wire to talk or broadcast all (can be as many as 4, 8, or 16, say) the tmc2225 modules at the same time, configuring all modules alike.
If the mpu wants to config different modules with different config, or wants to read the status (diagnostics) of an individual module, address by the m1, m1 hardware pins for up to 4 modules (or more than 4 with external address decoding hardware), using both Tx and Rx wires (with 1k resistor connected TxD to Rxd) Jumper R3 at the lower left corner of the bottom side of the PCB), as shown in Fig 4.1 above, or the photo below.
6:58 AM
2 hours later…
8:30 AM
2 hours later…
10:28 AM
But I need to first use Pico to move mother, then perhaps then use pico uart to change m1, m1, microstepping resolution, to see if motor speed changes. I also forgot to mention that I don't need to use any Pico PWM pin to replace xy-lpwm sig gen, I can just toggle/blink a GPIO pin as step pulse, to move the motor. The following code is an example. One thing I am not sure is that if I can use very low step rate, such as 10pps, as the OP's demo code.
Rpi Pico MicroPythpn Controlling TMC2208 / TMC2209 / TMC2225 Stepper Motor Driver Problem - Asked 2021dec27, Viewed 553 times raspberrypi.stackexchange.com/questions/135191/… from machine import Pin import utime direction = Pin(14, Pin.OUT) step = Pin(15, Pin.OUT) enable = Pin(13, Pin.OUT) enable.low() direction.high() def stepOne(): step.high() utime.sleep(0.001) step.low() while True: stepOne() utime.sleep(0.1)
13 hours later…
« first day (8 days earlier) ← previous day next day → last day (22 days later) »
Transcript for
Feb16
Feb '2217
Feb18
Discussion between tlfong01 and kyrpav
Imported from a comment discussion on electronics.stackexchang...