View previous topic :: View next topic |
Author |
Message |
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
|
Posted: Sun Apr 21, 2019 2:05 pm |
|
|
I understand. Does ex_encoder.c work? Also as circuit connection;
after I give a voltage, I will enter the A and B pins into my processor. You don't have another pin already. So I will now determine the position based on the number of pulses from A and B. There's nothing else I can do. I just want a sample code for this kind of engine. Is there no other example than ex_encoder.c ? Ttelmah wrote, I will write code with values for A, B. how can I write code ? _________________ Es |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9134 Location: Greensville,Ontario
|
|
Posted: Sun Apr 21, 2019 2:25 pm |
|
|
EX_ENCOD.c does work, did almost 20 years ago...
There are 1,000s of PIC based 'encoder' programs on the internet but why not just use what CCS freely supplies ? We can help as we all have that program.
With simple AB encoders, you normally powerup, drive the motor one way to a 'home' position, There a switch tells the PIC 'I'm home', shuts off the motor, resets the encoder position pulse counter variable to 0. After that you tell the motor to run and count pulses. How long to run and how many pulses can be determined on the bench. That 'R&D' is out of our control, you'll have to test.
Jay |
|
|
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
|
Posted: Mon Apr 22, 2019 12:50 am |
|
|
I understand, but I'm already using CCS C licensed software. I have version 5.085. I'm already trying to do with CCS C. _________________ Es |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19258
|
|
Posted: Mon Apr 22, 2019 1:40 am |
|
|
The point is if you have the compiler, you already have a program example
of how to read an encoder. It's with the compiler.....
In the examples directory. |
|
|
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
|
Posted: Mon Apr 22, 2019 2:40 am |
|
|
I was understand. There are 4 examples.
1- ex_encry.c
2- ex_encod.c
3- ex_sk_rotary_encoder_isr
4- ex_sk_rotary_encoder.c
I think, ex_encod.c of them, seems to benefit me. or do you have any other suggestions? _________________ Es |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9134 Location: Greensville,Ontario
|
|
Posted: Mon Apr 22, 2019 4:57 am |
|
|
#1 I think is for encryption..
#2 is what I suggest.. I know it works, simple to use.
#3, #4 I don't have, as I have a very old compiler version.
Jay |
|
|
ertansuluagac
Joined: 13 Jul 2017 Posts: 135 Location: IZMIR
|
|
Posted: Mon Apr 22, 2019 6:20 am |
|
|
I understand. I'll try ex_encod.c. I will write the result. Thanks everyone. _________________ Es |
|
|
|