How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler.
[url]https://https://github.com/MikroElektro ... ck.git[url]
Thank you
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler.
[url]https://https://github.com/MikroElektro ... ck.git[url]
Thank you
How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
I am using PIC16F1526 micro-controller. RC3,RC4 and GND pins of PIC16F1526 is connected to SCL, SDA, and GND pins of PCA9685 module.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler. Thank you
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
I am using PIC16F1526 micro-controller. RC3,RC4 and GND pins of PIC16F1526 is connected to SCL, SDA, and GND pins of PCA9685 module.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler. Thank you
Re: How to work with servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
I am using PIC16F1526 micro-controller. RC3,RC4 and GND pins of PIC16F1526 is connected to SCL, SDA, and GND pins of PCA9685 module.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler.
We want to work on pic16f1526 with Servo click library so when I trying to built the program I got error like so please any one help us to clear this issue.
Best regards,
Himanshu Kumar
I want to control servo motor using micro-controller (PIC16F1526). The micro-controllar is connected to PCA9685 module via I2C.
I have used servo library in mikroC pro for PIC compiler but it is not working to control the servo motor. I don't want to use mikrobus and development board an all things.
I am using PIC16F1526 micro-controller. RC3,RC4 and GND pins of PIC16F1526 is connected to SCL, SDA, and GND pins of PCA9685 module.
The below code I trying to compile but it is not working for PIC16F1526 miro-controller using PCA9685 module in mikroC for PIC compiler.
We want to work on pic16f1526 with Servo click library so when I trying to built the program I got error like so please any one help us to clear this issue.
Best regards,
Himanshu Kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
You do not have to use the MikroBUS, but there is no example written for it without the use of the MikroBUS library.
Basically you will have to rewrite the code to not use the MikroBUS library, so just define the pins that you are using.
Regards,
Ivan.
You do not have to use the MikroBUS, but there is no example written for it without the use of the MikroBUS library.
Basically you will have to rewrite the code to not use the MikroBUS library, so just define the pins that you are using.
Regards,
Ivan.
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
Could you explain it in more details, where i need to define the pins
I am using RC4,RC3 pins of micro-controller connected to sda, scl of of PCA9685 respectively.
Regards,
Himanshu Kumar
Could you explain it in more details, where i need to define the pins
I am using RC4,RC3 pins of micro-controller connected to sda, scl of of PCA9685 respectively.
Regards,
Himanshu Kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
Basically you just need to use TRIS register on the pins you are using, you can see LED blinking examples in the compiler and the datasheet of the MCU you are using for more information.
https://ww1.microchip.com/downloads/en/ ... 01458D.pdf
For I2C and LOG, look into I2C and UART libraries in the help section there are detailed explanations on how to use these libraries there.
Regards,
Ivan.
Basically you just need to use TRIS register on the pins you are using, you can see LED blinking examples in the compiler and the datasheet of the MCU you are using for more information.
https://ww1.microchip.com/downloads/en/ ... 01458D.pdf
For I2C and LOG, look into I2C and UART libraries in the help section there are detailed explanations on how to use these libraries there.
Regards,
Ivan.
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I want to use this function "servo_i2cDriverInit()" for PIC16F1526 micro-controller to configure the the pins RC3, RC4 is connected to scl, sda of PCA9685 module.
I don't know how to configure RC3, RC4 pins of micro-controller in "servo_i2cDriverInit()" function. This is the code I am trying. Regards,
Himanshu Kumar
I want to use this function "servo_i2cDriverInit()" for PIC16F1526 micro-controller to configure the the pins RC3, RC4 is connected to scl, sda of PCA9685 module.
I don't know how to configure RC3, RC4 pins of micro-controller in "servo_i2cDriverInit()" function. This is the code I am trying. Regards,
Himanshu Kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
Can you send me your project so i can try it out for myself?
Regards,
Ivan.
Can you send me your project so i can try it out for myself?
Regards,
Ivan.
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I am sending my code which I have tried on PIC16F1526 micro-controller and PCA9685 module on mikroC pro for PIC compiler. RC3, RC4 pins of micro-controller is connected to SCL, SDA pin of PCA9685 module respectively.
I don't want to use any development board mikroBus. I only want to configure my own pins. I am attaching my code. Regards,
Himanshu Kumar
I am sending my code which I have tried on PIC16F1526 micro-controller and PCA9685 module on mikroC pro for PIC compiler. RC3, RC4 pins of micro-controller is connected to SCL, SDA pin of PCA9685 module respectively.
I don't want to use any development board mikroBus. I only want to configure my own pins. I am attaching my code. Regards,
Himanshu Kumar
Re: How to configure servo click library for pic16f1526 micro-controller
Hi,
I am not able to configure this library for pic16f1526 micro-controller. I don't want to use microbus and development board. I want to configure my one gpio pins and i2c pins.
Regards,
Himanshu Kumar
I am not able to configure this library for pic16f1526 micro-controller. I don't want to use microbus and development board. I want to configure my one gpio pins and i2c pins.
servo_i2cDriverInit((T_SERVO_P)&_MIKROBUS1_GPIO, (T_SERVO_P)&_MIKROBUS1_I2C,0x40, 0x14 );
Regards,
Himanshu Kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I looked at your code, i don't have the MCU that you are using to try it out, but i can tell you that you do not need all of the stuff you placed in the code, to initialize I2C you just need to use the I2C library.
Connect your SERVO click to the I2C 1 pins and in the code use the I2C1_Init, and of course enable the I2 library in the library manager.
As for the OE pin, use TRIS on the SS pin.
Regards,
Ivan.
I looked at your code, i don't have the MCU that you are using to try it out, but i can tell you that you do not need all of the stuff you placed in the code, to initialize I2C you just need to use the I2C library.
Connect your SERVO click to the I2C 1 pins and in the code use the I2C1_Init, and of course enable the I2 library in the library manager.
As for the OE pin, use TRIS on the SS pin.
Regards,
Ivan.
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
I did whatever you told. The code is compiling and not giving any error but the problem is PCA9685 module channel is not getting any voltage or current. In the above code. I have used this function
In this function library proved these variables _MIKROBUS1_GPIO, _MIKROBUS1_I2C, what should be the values to initialize the pins.
Regards,
Himanshu Kumar
I did whatever you told. The code is compiling and not giving any error but the problem is PCA9685 module channel is not getting any voltage or current. In the above code. I have used this function
servo_i2cDriverInit((T_SERVO_P)&_MIKROBUS1_GPIO,(T_SERVO_P)&_MIKROBUS1_I2C,0x40, 0x14 );
In this function library proved these variables _MIKROBUS1_GPIO, _MIKROBUS1_I2C, what should be the values to initialize the pins.
Regards,
Himanshu Kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
The _MIKROBUS1_GPIO is the SS pin and the _MIKROBUS1_I2C is the SDA and SCL pins of I2C.
0x40 and 0x14 are slave addresses of the two modules the click uses PCA9685 and LTC2497.
The code seems fine, are you certain that the clock scheme for your MCU is ok?
Regards,
Ivan.
The _MIKROBUS1_GPIO is the SS pin and the _MIKROBUS1_I2C is the SDA and SCL pins of I2C.
0x40 and 0x14 are slave addresses of the two modules the click uses PCA9685 and LTC2497.
The code seems fine, are you certain that the clock scheme for your MCU is ok?
Regards,
Ivan.
How to use own pins instead of mikrobus1_i2c
Hi,
I am using this piece of code . In this code they are using mikrobus_i2c for configuring i2c pins, but I don't want to use mikrobus_i2c, I want to use my pins to configure SDA, SCL pins.
They are using mikrobus_i2c from this github
https://github.com/MikroElektronika/mik ... _generic.h
I don't know how to use my own pins instead of mirkobus_i2c.
Regards,
Himanshu kumar
I am using this piece of code . In this code they are using mikrobus_i2c for configuring i2c pins, but I don't want to use mikrobus_i2c, I want to use my pins to configure SDA, SCL pins.
They are using mikrobus_i2c from this github
https://github.com/MikroElektronika/mik ... _generic.h
I don't know how to use my own pins instead of mirkobus_i2c.
Regards,
Himanshu kumar
- IvanJeremic
- mikroElektronika team
- Posts: 316
- Joined: 05 Sep 2022 14:32
Re: How to use servo click library in pic16f1526 microcontroller to control the servo motor using PCA9685 module
Hi,
You can change what pins are used inside the MikroBUS definition files.
You can find the definitions by selecting one of the pins and clicking Ctrl+D. Select one of the pins in this file and again click Ctrl+D. And here you can change the pin mapping to the ones you are using. Regards,
Ivan.
You can change what pins are used inside the MikroBUS definition files.
You can find the definitions by selecting one of the pins and clicking Ctrl+D. Select one of the pins in this file and again click Ctrl+D. And here you can change the pin mapping to the ones you are using. Regards,
Ivan.