Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UART communication to set PID values with BTT Writer #61

Open
CKCMorgoth opened this issue Jan 11, 2023 · 1 comment
Open

UART communication to set PID values with BTT Writer #61

CKCMorgoth opened this issue Jan 11, 2023 · 1 comment

Comments

@CKCMorgoth
Copy link

Hello there
I added 2 S42C steppers to my printer and now I have the problem that my prints result in heavy ghosting, so I checked multiple posts in here and decided to try to set the PID values until the firmware for the S42C become opensource.
Since I dont have an arduino available right now, I decided to try the BTT writer I got for my Wifi modules, since it is basically a CH340G USB to Serial converter.
I set the level jumper to 3.3V, connected GND to GND, 3.3V to 3.3V, Receive from the CH340 went to PA2 and transmit of the CH340 went to PA3 which are the UART pins for the STM32G, and plugged it into my USB port.
Nothing went on fire and the display of the stepper display the normal menu, so I was happy for that :)
Now I wanted to read the current PID values, first attempt was putty, set it to the right COM port, baud rate set to 9600 (checked that on the OLED) and connected, which worked, but didnt give me any output.
Next try was the serial monitor of the arduino IDE, but this kept blank too.
Last try was to try realterm, which also seemd to connect to the interface, but still no output, and also realterm showed me no status info for the connection, everything stayed grey.
So in my opinion, either I misjudged the BTT writer of being capable of communicating by UART and I will need to get an Arduino, or I misswired something, or I didnt get into using UART right.

Can anyone tell me where to start to get this setup running?
Thanks in advance and greeting
Morgy

@CKCMorgoth
Copy link
Author

Okay with the help of some work colleagues I got it figured out, telling you how I did it so you dont need to wildly guess like me ^^

Connect the BTT writer with the S42C like mentioned above
Download HTerm
Connect the COM port
send binary 10101000 10000110 to read the PID values (change answer to ascii to get clear text)
write I value with 10101010 00000111 0000000 00000000 for I = 0 or 10101010 00000111 00000000 11111111 for I = 255
write D value with 10101010 00001001 00000000 00000000 for D = 0
and save with 10101010 00011000 00000000 00000000
You will receive a "S42C_V1.0" message

Congratulations, you successfully overwritten the (P)ID values of your S42C motor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant