![]() |
Forum Index : Microcontroller and PC projects : Quadrature multichannel decoder for PicoMite using PIO
![]() ![]() |
|||||
Author | Message | ||||
allie Regular Member ![]() Joined: 06/10/2018 Location: CanadaPosts: 43 |
|
||||
allie Regular Member ![]() Joined: 06/10/2018 Location: CanadaPosts: 43 |
I did what Volhout said and it seems to work. I have to hook up my cnc x,y,z and rotary table axis encoders to try. May be also modify my MMBasic code to select one of the axis and wait for the input signal. I'm baby sitting my two great granddaughters twins now so I'll try it later. Regards Allie |
||||
allie Regular Member ![]() Joined: 06/10/2018 Location: CanadaPosts: 43 |
I put in the input "Select sm0 to sm3";sm *** command in the main MMBasic code section in the main loop after do a$=inkey$ I not sure if it was before or after a$=inkey$ Now the program is stuck in a loop, asking for the input. I pressed Esc ** no affect. Then pressed Ctrl and Esc and the program stopped. The next time I ran the program with pressing F2 it went back to the input command asking to input "select sm0 to sm3 it is still in the loop. How do I reset the picomite with out losing the PIO program. I know you can use one of the pins on the 2040, but I want to make sure I don't lose the PIO program as I had to type all of the code in my self. I could not get the * copy to clipboard * to work right, the PIO program went into tera term terminal but not right. When I typed it in myself it was O.K. Regards Allie |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 4918 |
Hi Allie, When the pico is stuck, <CTRL>-C will stop the program. Then type SAVE "Quadrature.bas", and the program will be saved on the A:/ drive. The A:/ drive is flash, so it will remain stored, also without power. You can disconnect the pico from power, reset it, whatever... If you need to run the program again: LOAD "Quadrature.bas" RUN Volhout P.S. I think the program allows you to select a number of quadrature decoders, but just at start. You can not dynamically resize them during run. You select that you need 3, and then that is it. When you stop and RUN again, then you can select 4 (or 2)... But not change while the program is running. . Edited 2025-05-23 19:27 by Volhout PicomiteVGA PETSCII ROBOTS |
||||
allie Regular Member ![]() Joined: 06/10/2018 Location: CanadaPosts: 43 |
I had the picomite disconnected from the laptop and it did end the loop. thank you for the info. I have to go to work now so I'll try to work at it when I come home. I want to use the RP2040 PicoMite to count the milling machine x,y,and z encoders then send the count to the color MaxiMite 2 gen 2 which will be the main controller for my milling machine and lath setup. I thought I could put the MMBasic code in the MMBasic section of the main loop to select which axis to count with an input statement. Any thoughts on this? Regards Allie |
||||
![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |