Hi Martin
I though his issues were simulating the examples?
Regards
Quad encoder
-
- Valued Contributor
- Posts: 1528
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
-
- Matrix Staff
- Posts: 1913
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 619 times
- Been thanked: 644 times
Re: Quad encoder
Yes, but the 360 edges if that is not the same as the hardware, it will make it look the the encoder is not rotating, especially if the repeat rate is set to slow.
Martin
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Quad encoder
Hi
Why would his HW affect a downloaded example file, or am I missing something (probably)?
I thought he was having issue with simulating the example file.
I can probably play with HW tomorrow and see what I find.
Regards
Why would his HW affect a downloaded example file, or am I missing something (probably)?
I thought he was having issue with simulating the example file.
I can probably play with HW tomorrow and see what I find.
Regards
Re: Quad encoder
The issue is with simulating the example file. I haven't programmed the example into hardware. My own circuit and program has the issue but with out the example simulating I don't have a starting point to reference. I have tried every setting including those mentioned and the simulation still jumps but I will continue to test
Re: Quad encoder
Ok so I've change the repeat rate to slow and it seems to simulate with only minor jumping. It misses the odd click with the mouse.
Hardware is different. There appears to be 20 detents (or is it 19). I'd already determined this. But its difficult to tell if the device is mechanically accurate - i.e. is the A and B outputs placed accurately between the detents. More testing required and I'll figure out what sim settings is best to allow me to carry on with the hardware side
Hardware is different. There appears to be 20 detents (or is it 19). I'd already determined this. But its difficult to tell if the device is mechanically accurate - i.e. is the A and B outputs placed accurately between the detents. More testing required and I'll figure out what sim settings is best to allow me to carry on with the hardware side
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Quad encoder
Hi
I connected a decoder to a logic analyser and this one seems to have little bounce if rotated smoothly (but it does suffer if not)
Clockwise two clicks
Anticlockwise two clicks
I downloaded the example Quad_Encoder_Timer file from the WiKi, changed the chip / ports to suit, and set the component postcaler from 1:1 to 1:4. As each "click" creates four transitions having the scaler set to 1:4 returns "click count". Note I'm using a KY040, other modules may differ)
https://www.flowcode.co.uk/wiki/index.p ... ral_Input)
I'd no problem using it. I didn't try IOC as my chip has them on Port-B, which my combo uses as LCD so.....
Regards
I connected a decoder to a logic analyser and this one seems to have little bounce if rotated smoothly (but it does suffer if not)
Clockwise two clicks
Anticlockwise two clicks
I downloaded the example Quad_Encoder_Timer file from the WiKi, changed the chip / ports to suit, and set the component postcaler from 1:1 to 1:4. As each "click" creates four transitions having the scaler set to 1:4 returns "click count". Note I'm using a KY040, other modules may differ)
https://www.flowcode.co.uk/wiki/index.p ... ral_Input)
I'd no problem using it. I didn't try IOC as my chip has them on Port-B, which my combo uses as LCD so.....
Regards
Re: Quad encoder
I agree that in hardware if you rotate the knob slowly you could see the counter go up and down by one. And thats not using my analyser just a pure observation. So theres probably a set up and filtering hardware issue to fix. But the simulation of the example for me jumps and I don't know whay. Thanks for taking the time chipfryer
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: Quad encoder
Hi
Does it make any difference if you slow your simulation speed down at all? Extra "clicks" sounds perhaps your PC is reading too quickly. Is it the same for IOC?
Regards
Does it make any difference if you slow your simulation speed down at all? Extra "clicks" sounds perhaps your PC is reading too quickly. Is it the same for IOC?
Regards
Re: Quad encoder
The best I can get is 20 edges 1:1 post scaler, slow repeat rate and a pause between clicks. But even then it skips a count. Odd as can be. Think I'll focus on the hardware but its hard to develop a program without the simulation running correctly. Not tried the IOC or timer interrupt as the interrupt isnt a reliable simulation anywaay