Menu

encoder

Help
2024-01-12
2024-01-12
  • luisgoenaga

    luisgoenaga - 2024-01-12

    recibi el correo de como hacer la conversion de un encoder de 2048 impulsos a 10 impulsos
    pero com soy nuevo no puedo hacer el program o tengo alguna nersion vieja del programa
    quiero con RA0 entrada y RBO salida

    gracias

     
  • Anobium

    Anobium - 2024-01-12

    I received the email on how to convert an encoder from 2048 pulses to 10 pulses
    But since I'm new I can't do the program or I have some old nersion of the program
    I want with RA0 input and RBO output

    Thank you


    One of us has to translate. Please post in Italian and Google translated English.


    Your request is sort of odd.

    In you previous thread, see https://sourceforge.net/p/gcbasic/discussion/579126/thread/d712e6d69b/?limit=25#ddbf, you share the ask for the 2048 to 10 pulses, and, that the chip is a 16f84a.

    Now you state that you have some old version and you are new.

    So, how far have you got?
    What is the goal ? Some output to LCD, serial or what?
    What is the device that is generating the pulses ?
    What type of encoder ? ALPS encoder ? See https://sourceforge.net/p/gcbasic/discussion/search/?q=ALPS-EC11

    Have you searched the demos? See C:\GCstudio\gcbasic\demos\Mechanical_Rotary_Encoder_Solutions
    Why use such an old microcontroller ? The 16f84a is not recommended for new developments.

    **OR **

    La tua richiesta è un po' strana.

    Nel thread precedente, vedi https://sourceforge.net/p/gcbasic/discussion/579126/thread/d712e6d69b/?limit=25#ddbf, condividi la richiesta per gli impulsi da 2048 a 10 e che il chip è un 16f84a.

    Ora dichiari di avere una vecchia versione e di essere nuovo.

    Allora, a che punto sei?
    Qual è l'obiettivo? Qualche uscita su LCD, seriale o cosa?
    Qual è il dispositivo che genera gli impulsi?
    Che tipo di codificatore? Codificatore ALPS? Vedi https://sourceforge.net/p/gcbasic/discussion/search/?q=ALPS-EC11

    Hai cercato le demo? Vedi C:\GCstudio\gcbasic\demos\Mechanical_Rotary_Encoder_Solutions
    Perché utilizzare un microcontrollore così vecchio? Il 16f84a non è consigliato per nuovi sviluppi.

    Ti aiuterò sicuramente. Se si tratta di una richiesta commerciale, contattami e potremo discutere come contrattare i progetti commerciali.

     
    • Angel Mier

      Angel Mier - 2024-01-12

      Translation:

      Tu petición es un poco extraña.

      En tu post anterior, preguntaste: https://sourceforge.net/p/gcbasic/discussion/579126/thread/d712e6d69b/?limit=25#ddbf, compartiste la solicitud de 2048 a 10 pulsos y que el chip es un 16f84a.

      Ahora dices que tienes alguna versión antigua y que eres nuevo.

      Entonces, ¿Qué tan lejos has logrado llegado con este proyecto?
      ¿Cuál es el objetivo? ¿Alguna salida a pantalla LCD, salida serial o qué ocupas?
      ¿Cuál es el dispositivo que genera los pulsos?
      ¿Qué tipo de codificador? ¿Codificador ALPS? Ver: https://sourceforge.net/p/gcbasic/discussion/search/?q=ALPS-EC11

      ¿Has buscado o visto los demos de GCBasic? Ver: C:\GCstudio\gcbasic\demos\Mechanical_Rotary_Encoder_Solutions
      ¿Por qué utilizar un microcontrolador tan antiguo? El 16f84a no se recomienda para nuevos proyectos.

       

      Last edit: Angel Mier 2024-01-12
  • Angel Mier

    Angel Mier - 2024-01-12

    Translation:

    I received an e-mail of how to make the conversion of a 2048 pulses encoder to a 10 pulses, but how I’m new I cant do the program or I have a old version of the program, I want RA0 as input and RB0 as output.
    Thank you

     

    Last edit: Angel Mier 2024-01-12
  • Angel Mier

    Angel Mier - 2024-01-12

    Por lo que entiendo quieres simplemente convertir el encoder a 10 pulsos usando una salida del pic.
    Te sugiero que hagas un contador en el pin RB0 y aumentes el valor a +1 en una variable cada vez que tengas un pulso en la entrada:


    From what I understand you want to simply convert the encoder to 10 pulses using an output from the pic.
    I suggest you make a counter on the RB0 pin and increase the value to +1 in a variable every time you have a pulse on the input:

    PulsoEntrada += 1
    

    En el mismo ciclo o loop, revisa cuando la variable llegue a 205 y entonces vacía la variable y genera un pulso de salida en RA0:


    In the same loop, check when the variable reaches 205 then empty the variable and generate an output pulse at RA0:

    if PulsoEntrada >= 205 then
        PulsoEntrada = 0
        porta.0 =1
        wait 1 ms
        porta.0 =0
    end if
    

    De esta manera tendrás convertido de manera sencilla el encoder de 2048 pulsos (aprox) a 10 pulsos, con un código fácil de entender ahorita que eres nuevo con esta herramienta.
    Te recomiendo que veas los códigos de demostración, que experimentes y juegues con el código y que cuando pidas alguna ayuda agregues el código que tienes, no importa si no funciona o no es muy bueno, la mayoría de los usuarios del foro no están para hacerte los programas, pero si ven que lo intentas y estas dedicándole tiempo, habrá mas posibilidades de que te ayuden.


    This way you will have easily converted the encoder from 2048 pulses (approx.) to 10 pulses, with a code that is easy to understand now that you are new to this tool.
    I recommend that you look at the demo codes, that you experiment and play with the code and that when you ask for help you add the code that you have already, it doesn't matter if it doesn't work or it is'nt very good, most of the forum users are not there to make your programs, but if they see that you are trying and you are dedicating time to it, there will be a greater chance that they will help you.

    Saludos.
    Angel

     

    Last edit: Angel Mier 2024-01-12

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.