Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : Rotary encoder interrupt issues
Page 2 of 2 | |||||
Author | Message | ||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4212 |
Hi Phenix, Don't count on that to work. It is not good practise to start a PIO program with registers in a unknown state. Therefore I am sure these will be reset to a known state, either by the SDK or by PM (Peter Mather), else by me. If you want that you will have to pre-load a value through FIFO. PicomiteVGA PETSCII ROBOTS |
||||
Andy-g0poy Regular Member Joined: 07/03/2023 Location: United KingdomPosts: 55 |
Yes, I have tried that same issue more or less. That code is a hangover from yet another test where I was trying a polling system rather than interrupt. I even cranked up the clock speed. That made a slight difference but not enough. I think it's going to be PIO code that solves the problem. At least it's looking easier every time I run through the code. I'll have a go at coding your examples in the explaining PIO series which should get me going. Thanks again, Andy |
||||
Andy-g0poy Regular Member Joined: 07/03/2023 Location: United KingdomPosts: 55 |
The 1000 pulse encoder has the same outputs as the control knob version in the image A , B and the complimentary outputs as well. The control knob version mentions a AM26LS31 which is an RS422 driver, I can't 100% confirm that as I did not take the encoder apart that far and of course the electronics were on the reverse side of the main PCB :-) It would not surprise me if the 1000 pulse shaft encoder used the same. There is no index pulse on either of the devices, so one less thing to worry about :-) The intended use for these things is tuning controls for radio use. SI5351 VCO etc. Andy |
||||
Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 4212 |
Andy, Since the start of the PIO series training, there has been one change in MMBasic that is important to remember: In this training PIO(EXECCTRL 0,a,b) is used. The 0 designated the GP0 pin, but that was inconsistent with the rest of MMBasic that use either pin numbers or GPx identification. To enforce the use of GP0 (or any other GP pin) with 5.08.00 and newer the "GP" is required. The user manual states correctly that you should use PIO(EXECCTRL GP0,a,b) But the early examples in the training may still use the "0" without "GP". This is only with PIO(EXECCTRL ) Volhout PicomiteVGA PETSCII ROBOTS |
||||
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 852 |
Some line receiver options: AM26LS32 SN75175 MC3486 |
||||
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 852 |
Yeah, not a good idea to take risks with axis positions Just been testing though; I set an encoder position register (12345), load and run a completely different program (no PIO stuff), re-load the quadrature program and interrogate the position register and it still holds the same value. I guess we could store the current value in a tempVar, load the other PIO code, read the position register and compare it with tempVar. |
||||
PhenixRising Guru Joined: 07/11/2023 Location: United KingdomPosts: 852 |
Hey Harm. I have this figured. If I configure this input as CIN, I don't need to worry about interrupt latency. When CIN > 0, I just slowly reverse until the CIN value doubles |
||||
Page 2 of 2 |
Print this page |