If you found this video useful, please give it a thumbs up 👍 and subscribe to the channel. Also, let me know what topics you want me to cover in future videos by commenting below. By simply liking the video or a short comment like Thanks, helps this video in TH-cam algorithm to be found by others. It helps us a lot.
Thank you so very much. You are a great teacher. I have a pile of older pics and newer pics. I thought the best way to really learn something is to not use mcc and since i want to use my older pics first, these tutorials are so information rich for me. Thank you.
Since you are very knowledgeable with Proteus, is there any way to import a board layout (from a PDF schematic, or otherwise) to make the process of laying out a design faster?
Hi, Im using the latest version of xc8 (v1.36), and the file MPLAB_XC8_Peripheral_Libraries does not exist. Can I find resumed information on another folder or must I "read" all the datasheet ? In my case, I am surching information about CAN bus, but I want to see all your videos step by step. Maybe can I find this answer on your appropriated video. However, thank you for your videos, and thank your for your previous quick answer ;)
+Lisarios Hank' MPLAB is phasing out the PIC18F Peripheral Library which is no longer included in XC8 from version v1.35. If you are using XC8 compiler v1.35 or a later version, the Peripheral Libraries which include the LCD and other peripherals like ADC, SPI, I2C libraries are no longer included in the installation file as with previous versions. You can use MPLAB code configurator to configure your peripherals (www.studentcompanion.co.za/mplab-code-configurator/) or you can download the Peripheral Libraries as a separate download and install them. You can download them at microchip website under the MPLAB XC Compilers downloads tab. They are now called PIC18 Legacy Peripheral Libraries (www.microchip.com/mplab/compilers).
Very nice tutorial. What changes in the code will be needed to read more than 5 volts. I know it requires implementing voltage dividers. But in the end the ADC input shall be only within 5v. so how can we tell the MC that the range has changed . I suppose we need another input . But how ? thks a lot.
I have been working on a existing PCA designed where in the hardware is already fixed such as the no of pins and other hardware configuration.Truely speaking I had to change the logic alone which was done by a third party based on our requirements and inputs But this time I wanted to do it myself (coding alone) and I am accustomed to mikroC and proteus way of compiling based on the videos referred.Is there any pic model which can replace pic 12f510 but still be cheaper and compiled by mikroC and checked by proteus and used in the existing PCA.I have already modelled it in proteus.Only coding part is left. Once that is complete I have burn it in our existing PCA and check for it's functionality.
You can use Microchip Advanced Part Selector tool, enter all the features that you need equivalent to your existing PIC, like number of pins, memory, peripherals, etc. Then it will give you the PIC models that meet your criteria: www.microchip.com/maps/Microcontroller.aspx
I am trying to follow your course, in this case the ADC, I follow the example explicitly, but the '#include "LCD.h"', well, where is that? I'm using MPLabX with XC82.10.
Hi, in this tutorial we used the PIC18F peripheral libraries but it's no longer supported from XC8 v2.0. Because you are using XC8 2.10, it won't work, you can either download an older version of XC8 compiler older then XC8 2.0 or preferably use MPLAB Code Configurator which is the new tool Microchip introduced to replace those libraries. So it's better to use a new tool which has many advantages. Watch this video to learn more: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
Hi...this is regarding pic12f510 microcontroller that we were referring to from another account.Is this the way we have to comment on a video.?in the mikroC version I am using, there is 12f510 pic but it's not available in proteus.This is where we are facing difficulty.Is there any other compiler which can help us in programming pic 12f510 .
Yes. This is how you can comment, even though you commented on a MPLAB xc8 video, but it's fine. This PIC is available in Proteus but it's not available in mikroC. You must use a different PIC. That is supported or choose a different compiler. You can use MPLAB XC8 compiler, it's free and it suppport all PIC models. Is there a good reason to use this very old PIC while there are newer alternative which are cheaper and better with more features?
+Prasanna Routray Sorry we don't do assembly language. You can watch our Flowcode tutorial and convert the code into assembly. Flowcode has an option to convert code to C or assembly: th-cam.com/video/xHwmlEuQW5w/w-d-xo.html
you doing great job sir ! well i wanted to know what should i do if i am using pic 16f family microcontroller ? does xc8 supports thes mcs ? i could not find any peripharal library for that
hi, thank you for watching our videos. XC8 supports all PIC families including the PIC16F family but the peripheral libraries were created for the PIC18F family only.
Dear sir.. I plane to do a project digital weighing scale using load cell, accuracy is 10mg to 600g capacity load cell.i have little bit confusion which pic microcontroller using.. And also instrumentation amplifier need for load cell section? I need over all ideas about this project.. I learned microcontroller by student Companion tutorial. So now I ready to do a project by own. Although need your help to start this project. Thank you
pier shaw These tutorials we present in this playlist are only for 8-bit PIC Microcontrollers like the PIC16Fxxxx or PIC18Fxxxx. It is not for 32-bit PIC Microcontrollers like your PIC32mx170256b. This is a wrong forum for your question. At the moment, we are not dealing with 32-bit Tutorials. You cannot use our codes for these 32-Bit Microcontrollers, it will give you errors. Thanks
my questions are : Base on the three arg in the openADC() 1. please why did you use ADC_FOSC_2, why not ADC_FOSC_4? you said it divides the freq osc by 2 , please what is the effect of this division? 2. how does A/D justification works? 3.what is the importance of the A/D interupt inside this function as arg? Thanks in advance as you break them down for me.
Hi, All these configuration depend on the PIC used as a configuration of a particular PIC microcontroller will not yield the same desired effect if applied to a different PIC, you need to read your datasheet to make sense for your PIC. Other factors are: The chosen oscillator frequency, required accuracy, etc.
1. The ADC_FOSC_x is to select clock frequency used for internal synchronization of A/D converter. This depending on your oscillator frequency affects the duration of conversion. The clock is critical to produce the fastest but also accurate Analog to Digital Conversion. The time to complete one bit conversion is defined as TAD. One full 10-bit conversion requires 11 TAD periods. For correct conversion, the appropriate TAD specification must be met. Check your device datasheet to get the ADC conversion requirements, for PIC18F26K20 the min TAD is 0.7 uS and max 25 us and this is dependent on your oscillator frequency. 2. The A/D justification won't make any difference to you whether you choose left or right if you are using these libraries, but will have to be considered when you are accessing these registers yourself without libraries. If you receive a 10-bit A/D value and you need to store it in an 8-bit variable, you'll need to know how it's justified (the least significant bit) so you'll know which 2 values (least) to drop to fit in your 8-bit variable for example 3. You'll need interrupt to let you know when an A/D conversion has completed if in your application it's critical otherwise you can omit it. watch this video, it describes these terms graphically with MPLAB Code Configurator: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
What is the version of your XC8 compiler? It seems like you don't have the peripheral libraries installed in your compiler, they are now a separate installation.
@@nirindrainyjeraymond6248 Hi, you can't install the peripheral library with XC8 v2.05, it's no longer supported. The last supported version was XC8 v1.45 from v2.0.0 you can't use the peripheral library. either use MPLAB Code Configurator or install an old version of XC8 from this page: www.microchip.com/development-tools/pic-and-dspic-downloads-archive Please note if you install XC8 v1.34 you won't need to download and install the peripheral library, it's already included in the compiler. This is the last version that had it.
I'am Sami from North Africa. I want to say thank you very much for you amazingly you tube channel. I suppose to you why don't make to us virtual microcontroller course on your web site. And each student or electronic worker or any interested person pay that formation
+Sami Dhiab thank you for watching our videos and for your feedback. Much appreciated. At the moment our aim is to provide free tutorials as much as possible and rely kn donations to fund the tutorials. We hope people will appreciate and support us with any donation they can afford so that we can accelerate the tutorials.
Hi in my project I want to use an LCD but I want to connect it to the C-Ports I tried to change the Ports in the Header but in simulation the signals are sent to B-Ports Do you know how to fix this?? Thanks in advaced
Hi. If you are using PIC18F Peripheral libraries for your ADC, you'll have to recompile all the C files by including them into your project as well to be able to change the PORT. Watch this video we explained in detail how to do so: th-cam.com/video/RkDN2GW_SxU/w-d-xo.html
IF you are using a new PIC model supported by MPLAB Code Configurator (MCC), I will advice to use MCC to configure your ADC module, it's easy and quick. Watch this video, we explained in detail LCD and ADC with MCC. With this library, you can connect your LCD to any PORT of the PIC easily: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
I watch the video you recommended... ...now the C-Ports are putting out a signal but the LCD is not displaying anything have you any idea waht this could be?
I believe sprintf should work with C18 compiler as well. I don't see a reason why it shouldn't even though we don't use C18. You must be doing something else wrong.
sir which is this software to run code in computer(virtual simulation ) by configuring hardware (pic chip and display etc) . very nice topic covered .thanks
The clock source affects the duration of ADC conversion. Depending on your application you might want a shorter delay but also affect the accuracy. The TDA is the time to complete one conversion. For correct conversion the appropriate TDA speciation must be met. This is PIC model dependant. You must read your datasheet for more information.
can you demonstrate tutorial on how to record a voice speech and save different raws of voice and play as back through speaker as we wanted using pic microcontroller ?!
good day sir I watch your tutorial 6 which is Analog to Digital Converter because it is related to my project . I am using PIC 18F45K22 ,I follow all your video instruction and my program runs but I dont know what Pin of the microcontroller can I get the digital output can you help me? thank you.
+charlie arong hi. Thanks for watching our videos. Almost any pin of the microcontroller can be used as digital output pin. Watch our tutorial 1 and 2 to learn more. We usec digital output pins in those tutorials to connect an LED.
Hello, I am having a little problem with the project OpenADC (parameters); has to have ADC_"n"ANA as the third argument But when i write it in the code, instead of recognizing it as an argument, MPLAB takes it as a simple command and does not build the project successfully. Here is what I wrote OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST & ADC_2_TAD, ADC_CH0 & ADC_INT_ON & ADC_REF_VDD_VSS, ADC_1ANA); And here is what the error is: main.c:70: error: (192) undefined identifier "ADC_1ANA" PS: I have linked the peripheral library and included adc.h in the project
+Gray Fox why not use MCC as explained in this video: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html Microchip is phasing out The peripheral libraries . MCC is easy to use and supports new devices.
Hi. You can sample multiple channels in a loop. Read this article there's an example to read 3 ADC channels: www.studentcompanion.co.za/analog-to-digital-converter-in-pic-microcontroller-xc8/
Need more help sir. I have sampled the multiple ADC channels base on your example but i couldn't get their results separately. How do i get them seperated?
+Jayesh kumar p r description on how to download and link the peripheral libraries are explained in the beginning of this video: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html Don't forget to follow the peripheral libraries help document as explained in the video to see how many parameters you should use in each function. This might change from one PIC to the other.
I have some questions. I hope someone can assist. 1. Can mikroC be used to write a program of a design with 2 or more analog inputs? 2. Can the PICs from the 16F family work with two inputs that are required to work at the same time?
+Márk Domonkos from vesrion 1.34 the PIC18F peripheral libraries is no longer included in the compiler. You must download it separately and install it into your compiler. It's now called Legacy peripherals libraries. You can download it at the same place as compilers on Microchip website.
Hello. I need the code for PICF887 ,using Proteus and XC8 compiller. I need the code for dht11 connected at RC0 and the microcontroller is set to work on 20Mhz.Thank you in advance
Hi. We can't write the code and the schematic for you, we can't have time to write codes for every requests we receive. We can assist you with your own code. Do some research, read the datasheets and start the project yourself, there are plenty of resources online you can refer to. If yoi struggle with specific features of the project, or the code doesn't compile ot generate errors or doesn't work 100%, then post those problems here on TH-cam or preferably in the forum on our website because there you can even upload your code. Then we can look at it and do our best to assist
What do you mean it's not running? You must supply more info. Are you getting an error? What are you seing? As you can see from this video, our is working.
@@StudentCompanion i just know how to write an ir sensor program ... and i know how to write a program for display on lcd .... but i don't know how to write a program for it to count and keep show on lcd ..
Unfortunately you will have to formulate a routine to count depending on how those papers will be counted. You are the only one who knows how your system should work. Once you have a logic, then we might contribute where you get stuck. But we can't do the design for you.
If you found this video useful, please give it a thumbs up 👍 and subscribe to the channel. Also, let me know what topics you want me to cover in future videos by commenting below.
By simply liking the video or a short comment like Thanks, helps this video in TH-cam algorithm to be found by others. It helps us a lot.
Thank you so very much. You are a great teacher. I have a pile of older pics and newer pics. I thought the best way to really learn something is to not use mcc and since i want to use my older pics first, these tutorials are so information rich for me. Thank you.
Thanks for your feedback.
Great job on these videos! Well done!
+Shane Rolin thank you. We appreciate your feedback.
Since you are very knowledgeable with Proteus, is there any way to import a board layout (from a PDF schematic, or otherwise) to make the process of laying out a design faster?
+Shane Rolin i don't think Proteus has that option at the moment. Especially pdf.
Nice tutorial. It helped me a lot.
you are welcome! thanks your feedback.
Nice one. Thanks!
You are Welcome keshena naidu .
very nice.. thanks you for your tutorial.
You are welcome Ina skills Electronics !
+Ina skills Electronics Simplicity is the motto indeed!
Hi, Im using the latest version of xc8 (v1.36), and the file MPLAB_XC8_Peripheral_Libraries does not exist. Can I find resumed information on another folder or must I "read" all the datasheet ?
In my case, I am surching information about CAN bus, but I want to see all your videos step by step. Maybe can I find this answer on your appropriated video.
However, thank you for your videos, and thank your for your previous quick answer ;)
+Lisarios Hank' MPLAB is phasing out the PIC18F Peripheral Library which is no longer included in XC8 from version v1.35.
If you are using XC8 compiler v1.35 or a later version, the Peripheral Libraries which include the LCD and other peripherals like ADC, SPI, I2C libraries are no longer included in the installation file as with previous versions. You can use MPLAB code configurator to configure your peripherals (www.studentcompanion.co.za/mplab-code-configurator/) or you can download the Peripheral Libraries as a separate download and install them. You can download them at microchip website under the MPLAB XC Compilers downloads tab. They are now called PIC18 Legacy Peripheral Libraries (www.microchip.com/mplab/compilers).
Very nice tutorial. What changes in the code will be needed to read more than 5 volts. I know it requires implementing voltage dividers. But in the end the ADC input shall be only within 5v. so how can we tell the MC that the range has changed . I suppose we need another input . But how ? thks a lot.
I have been working on a existing PCA designed where in the hardware is already fixed such as the no of pins and other hardware configuration.Truely speaking I had to change the logic alone which was done by a third party based on our requirements and inputs But this time I wanted to do it myself (coding alone) and I am accustomed to mikroC and proteus way of compiling based on the videos referred.Is there any pic model which can replace pic 12f510 but still be cheaper and compiled by mikroC and checked by proteus and used in the existing PCA.I have already modelled it in proteus.Only coding part is left. Once that is complete I have burn it in our existing PCA and check for it's functionality.
You can use Microchip Advanced Part Selector tool, enter all the features that you need equivalent to your existing PIC, like number of pins, memory, peripherals, etc.
Then it will give you the PIC models that meet your criteria: www.microchip.com/maps/Microcontroller.aspx
I am trying to follow your course, in this case the ADC, I follow the example explicitly, but the '#include "LCD.h"', well, where is that? I'm using MPLabX with XC82.10.
Hi, in this tutorial we used the PIC18F peripheral libraries but it's no longer supported from XC8 v2.0.
Because you are using XC8 2.10, it won't work, you can either download an older version of XC8 compiler older then XC8 2.0 or preferably use MPLAB Code Configurator which is the new tool Microchip introduced to replace those libraries. So it's better to use a new tool which has many advantages. Watch this video to learn more: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
very nice!
Rusbel Hernandez Thanks
Hi...this is regarding pic12f510 microcontroller that we were referring to from another account.Is this the way we have to comment on a video.?in the mikroC version I am using, there is 12f510 pic but it's not available in proteus.This is where we are facing difficulty.Is there any other compiler which can help us in programming pic 12f510 .
Yes. This is how you can comment, even though you commented on a MPLAB xc8 video, but it's fine.
This PIC is available in Proteus but it's not available in mikroC. You must use a different PIC. That is supported or choose a different compiler.
You can use MPLAB XC8 compiler, it's free and it suppport all PIC models.
Is there a good reason to use this very old PIC while there are newer alternative which are cheaper and better with more features?
+Prasanna Routray Sorry we don't do assembly language. You can watch our Flowcode tutorial and convert the code into assembly. Flowcode has an option to convert code to C or assembly: th-cam.com/video/xHwmlEuQW5w/w-d-xo.html
you doing great job sir !
well i wanted to know what should i do if i am using pic 16f family microcontroller ?
does xc8 supports thes mcs ? i could not find any peripharal library for that
hi, thank you for watching our videos. XC8 supports all PIC families including the PIC16F family but the peripheral libraries were created for the PIC18F family only.
the easiest and the best is to use Mplab code configurator as this tool support pic16 pic18 and pi24 series. watch our tutorial 18 to learn more.
Dear sir.. I plane to do a project digital weighing scale using load cell, accuracy is 10mg to 600g capacity load cell.i have little bit confusion which pic microcontroller using.. And also instrumentation amplifier need for load cell section? I need over all ideas about this project.. I learned microcontroller by student Companion tutorial. So now I ready to do a project by own. Although need your help to start this project. Thank you
Almost any PIC can do that project.
question please i have a pic32mx170256b and xc32 __delay_ms () dose not compile :(
pier shaw These tutorials we present in this playlist are only for 8-bit PIC Microcontrollers like the PIC16Fxxxx or PIC18Fxxxx. It is not for 32-bit PIC Microcontrollers like your PIC32mx170256b. This is a wrong forum for your question. At the moment, we are not dealing with 32-bit Tutorials. You cannot use our codes for these 32-Bit Microcontrollers, it will give you errors.
Thanks
can you please tell me how to implement these idea's in PIC microcontroller using assembly language?
Thanks
my questions are : Base on the three arg in the openADC()
1. please
why did you use ADC_FOSC_2, why not ADC_FOSC_4? you said it divides the
freq osc by 2 , please what is the effect of this division?
2. how does A/D justification works?
3.what is the importance of the A/D interupt inside this function as arg?
Thanks in advance as you break them down for me.
Hi, All these configuration depend on the PIC used as a configuration of a particular PIC microcontroller will not yield the same desired effect if applied to a different PIC, you need to read your datasheet to make sense for your PIC. Other factors are: The chosen oscillator frequency, required accuracy, etc.
1. The ADC_FOSC_x is to select clock frequency used for internal synchronization of A/D converter. This depending on your oscillator frequency affects the duration of conversion. The clock is critical to produce the fastest but also accurate Analog to Digital Conversion.
The time to complete one bit conversion is defined as TAD. One full 10-bit conversion requires 11 TAD periods. For correct conversion, the appropriate TAD specification must be met. Check your device datasheet to get the ADC conversion requirements, for PIC18F26K20 the min TAD is 0.7 uS and max 25 us and this is dependent on your oscillator frequency.
2. The A/D justification won't make any difference to you whether you choose left or right if you are using these libraries, but will have to be considered when you are accessing these registers yourself without libraries. If you receive a 10-bit A/D value and you need to store it in an 8-bit variable, you'll need to know how it's justified (the least significant bit) so you'll know which 2 values (least) to drop to fit in your 8-bit variable for example
3. You'll need interrupt to let you know when an A/D conversion has completed if in your application it's critical otherwise you can omit it.
watch this video, it describes these terms graphically with MPLAB Code Configurator: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
Thanks so much...
You are welcome.
pls sir i need a tutorial on how to use pic-kit2 or 3 to load the code to the pic on breadboard......pickit2/3 which is better?
+adigun Orlami It's very easy to load the code into the pic. It's basically plug and play. you can read the help file.
Hi, actually i am using MPAB IDE v5.2 and i do not have "ADC.h"!? where can i get one? i'm working on PI18f45k20. Thanx for answer.
What is the version of your XC8 compiler? It seems like you don't have the peripheral libraries installed in your compiler, they are now a separate installation.
Watch this video to learn more: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
@@StudentCompanion Thnax, you understood what i need! i actually use XC8 v2.5
@@StudentCompanion Compiler XC8 v2.05 now i don't have the "Link in peripheral library"! in XC8 Linker.
@@nirindrainyjeraymond6248 Hi, you can't install the peripheral library with XC8 v2.05, it's no longer supported. The last supported version was XC8 v1.45 from v2.0.0 you can't use the peripheral library. either use MPLAB Code Configurator or install an old version of XC8 from this page: www.microchip.com/development-tools/pic-and-dspic-downloads-archive
Please note if you install XC8 v1.34 you won't need to download and install the peripheral library, it's already included in the compiler. This is the last version that had it.
Thanks!
You are welcome!
I'am Sami from North Africa. I want to say thank you very much for you amazingly you tube channel. I suppose to you why don't make to us virtual microcontroller course on your web site. And each student or electronic worker or any interested person pay that formation
+Sami Dhiab thank you for watching our videos and for your feedback. Much appreciated.
At the moment our aim is to provide free tutorials as much as possible and rely kn donations to fund the tutorials. We hope people will appreciate and support us with any donation they can afford so that we can accelerate the tutorials.
+Sami Dhiab we also have more tutorials on our website: www.studentcompanion.net
Thanks
Hello Sir, i wonder what programe your using to simulate the PIC and the outside peripherals.
+ahmed mbarak Hi. The simulation program is called Proteus.
its really nice..which website did you download it from?. and do you happen to have a tutorial on PIC microcontroller sleep mode?..
+ahmed mbarak you can download a demo version at Labcenter Web site: www.labcenter.com
+ahmed mbarak we don't have tutorials on sleep mode but we will in our future tutorials
Muito bom.
Alexandro Chagas Thank you.
Hi
in my project I want to use an LCD but I want to connect it to the C-Ports
I tried to change the Ports in the Header but in simulation the signals are sent to B-Ports
Do you know how to fix this??
Thanks in advaced
Hi. If you are using PIC18F Peripheral libraries for your ADC, you'll have to recompile all the C files by including them into your project as well to be able to change the PORT. Watch this video we explained in detail how to do so: th-cam.com/video/RkDN2GW_SxU/w-d-xo.html
IF you are using a new PIC model supported by MPLAB Code Configurator (MCC), I will advice to use MCC to configure your ADC module, it's easy and quick.
Watch this video, we explained in detail LCD and ADC with MCC. With this library, you can connect your LCD to any PORT of the PIC easily: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
I watch the video you recommended...
...now the C-Ports are putting out a signal but the LCD is not displaying anything
have you any idea waht this could be?
+Leto ausm Ghetto is your lcd wired correctly with pins of lcd to correct pins of PIC? Especially the RS, E and RW pins?
+Student Companion check those pins
Hello sir may I know how to transfer ADC float value without sprintf because in c18 compiler sprintf is not working for float value.
Can i know what is the reason of using the old C18 compiler while there is XC8?
I believe sprintf should work with C18 compiler as well. I don't see a reason why it shouldn't even though we don't use C18. You must be doing something else wrong.
Student Companion it's working only for "%d" not for "%f"
I'm not sure about that. But i think it should work. Unfortunately we don't support C18 compiler, only XC8
sir
which is this software to run code in computer(virtual simulation ) by configuring hardware (pic chip and display etc) . very nice topic covered .thanks
Thanks for your feedback. The software is called Proteus. It's from labcenter electronics
Why did u choose ADC_FOSC_2 why not ADC_FOSC_4 or 8.
And why did you choose 2tad as your aquisition time. Is there any specific calculation for them?
The clock source affects the duration of ADC conversion. Depending on your application you might want a shorter delay but also affect the accuracy.
The TDA is the time to complete one conversion. For correct conversion the appropriate TDA speciation must be met. This is PIC model dependant. You must read your datasheet for more information.
can you demonstrate tutorial on how to record a voice speech and save different raws of voice and play as back through speaker as we wanted using pic microcontroller ?!
thanks for watching our videos. we will think about it but not at the moment.
good day sir I watch your tutorial 6 which is Analog to Digital Converter because it is related to my project . I am using PIC 18F45K22 ,I follow all your video instruction and my program runs but I dont know what Pin of the microcontroller can I get the digital output can you help me? thank you.
+charlie arong hi. Thanks for watching our videos. Almost any pin of the microcontroller can be used as digital output pin. Watch our tutorial 1 and 2 to learn more. We usec digital output pins in those tutorials to connect an LED.
Hello, I am having a little problem with the project
OpenADC (parameters); has to have ADC_"n"ANA as the third argument
But when i write it in the code, instead of recognizing it as an argument, MPLAB takes it as a simple command and does not build the project successfully.
Here is what I wrote
OpenADC(ADC_FOSC_2 & ADC_RIGHT_JUST & ADC_2_TAD, ADC_CH0 & ADC_INT_ON & ADC_REF_VDD_VSS, ADC_1ANA);
And here is what the error is:
main.c:70: error: (192) undefined identifier "ADC_1ANA"
PS: I have linked the peripheral library and included adc.h in the project
+Gray Fox which PIC are you using? Which compiler version are you using?
MPLAB X IDE v3.45 xc8 v1.38
+Gray Fox which PIC are you using?
PIC 18f45k20
+Gray Fox why not use MCC as explained in this video: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html Microchip is phasing out The peripheral libraries .
MCC is easy to use and supports new devices.
what simulation software is the one hes using?
The name of the simulation software is: Proteus.
It's from www.labcenter.com
Please can i get any hints on how to read multiple ADC? Thanks
Hi. You can sample multiple channels in a loop. Read this article there's an example to read 3 ADC channels: www.studentcompanion.co.za/analog-to-digital-converter-in-pic-microcontroller-xc8/
really helpful thanks
You are welcome!
Need more help sir. I have sampled the multiple ADC channels base on your example but i couldn't get their results separately.
How do i get them seperated?
How are you sampling them? Because in that example we sampled them individually.
hi. sir, what changes need to be done if i use pic18f248.i used the same code .but its shows error
+Jayesh kumar p r what errors? You must post your code and all your error messages
#define _XTAL_FREQ 16000000
#include
#include
void init_XLCD(void); //Initialize LCD display
void DelayFor18TCY( void ); //18 cycles delay
void DelayPORXLCD (void); // Delay of 15ms
void DelayXLCD (void); // Delay of 5ms
void main(void)
{
init_XLCD(); //Call the Initialize LCD display function
putrsXLCD("Hello World"); //Display "Hello World"
SetDDRamAddr(0x40); //shift cursor to beginning of second line
putrsXLCD("LCD Display"); //Display "LCD display"
while(1)
{
}
}
void init_XLCD(void) //Initialize LCD display
{ OpenXLCD(FOUR_BIT&LINES_5X7); //configure LCD in 4-bit Data Interface mode
//and 5x7 characters, multiple line display
while(BusyXLCD()); //Check if the LCD controller is not busy
//before writing some commands?
WriteCmdXLCD(0x06); // move cursor right, don’t shift display
WriteCmdXLCD(0x0C); //turn display on without cursor
}
void DelayFor18TCY( void ) //18 cycles delay
{
Nop( ); Nop( ); Nop( ); Nop( ); // 18 cycle delay
Nop( ); Nop( ); Nop( ); Nop( );
Nop( ); Nop( ); Nop( ); Nop( );
Nop( ); Nop( );
return;
}
void DelayPORXLCD (void) // Delay of 15ms
{
Delay1KTCYx(30);
}
void DelayXLCD (void) // Delay of 5ms
{
Delay1KTCYx(10);
}
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory 'D:/jayesh/PIC C1/LCD INTERFACE/LCD INTERFACE.X'
make -f nbproject/Makefile-default.mk dist/default/production/LCD_INTERFACE.X.production.hex
make[2]: Entering directory 'D:/jayesh/PIC C1/LCD INTERFACE/LCD INTERFACE.X'
"C:\Program Files\Microchip\xc8\v1.45\bin\xc8.exe" --pass1 --chip=18F248 -Q -G --double=24 --float=24 --emi=wordwrite --opt=+asm,+asmfile,-speed,+space,-debug,-local --addrqual=ignore --mode=free -P -N255 --warn=-3 --asmlist -DXPRJ_default=default --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,-plib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%f:%l: error: (%n) %s" "--warnformat=%f:%l: warning: (%n) %s" "--msgformat=%f:%l: advisory: (%n) %s" -obuild/default/production/newmain.p1 newmain.c
make[2]: *** [build/default/production/newmain.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
newmain.c:20: warning: (361) function declared implicit int
newmain.c:21: warning: (361) function declared implicit int
newmain.c:28: warning: (361) function declared implicit int
newmain.c:28: error: (192) undefined identifier "FOUR_BIT"
newmain.c:28: error: (192) undefined identifier "LINES_5X7"
newmain.c:30: warning: (361) function declared implicit int
newmain.c:32: warning: (361) function declared implicit int
newmain.c:38: warning: (361) function declared implicit int
newmain.c:47: warning: (361) function declared implicit int
(908) exit status = 1
nbproject/Makefile-default.mk:106: recipe for target 'build/default/production/newmain.p1' failed
make[2]: Leaving directory 'D:/jayesh/PIC C1/LCD INTERFACE/LCD INTERFACE.X'
nbproject/Makefile-default.mk:90: recipe for target '.build-conf' failed
make[1]: Leaving directory 'D:/jayesh/PIC C1/LCD INTERFACE/LCD INTERFACE.X'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
BUILD FAILED (exit value 2, total time: 225ms)
+Jayesh kumar p r did you install and linked the peripheral libraries?
+Jayesh kumar p r description on how to download and link the peripheral libraries are explained in the beginning of this video: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
Don't forget to follow the peripheral libraries help document as explained in the video to see how many parameters you should use in each function. This might change from one PIC to the other.
I have some questions. I hope someone can assist.
1. Can mikroC be used to write a program of a design with 2 or more analog inputs?
2. Can the PICs from the 16F family work with two inputs that are required to work at the same time?
1. Yes mikroC can.
2. What do you mean by working at the same time? Can you give an example?
I cant find the docs... :( there isnt in the docs folder.... :(
+Márk Domonkos which version of the XC8 compiler are you using?
1.44
+Márk Domonkos from vesrion 1.34 the PIC18F peripheral libraries is no longer included in the compiler. You must download it separately and install it into your compiler. It's now called Legacy peripherals libraries. You can download it at the same place as compilers on Microchip website.
+Márk Domonkos Microchip is phasing out The peripheral libraries. You can use MCC as explained in this video: th-cam.com/video/4WaB_Lj8FnY/w-d-xo.html
well an is there any peripheral libraries of the 16F series? (anyway thanks for the answer :) )
Hello. I need the code for PICF887 ,using Proteus and XC8 compiller. I need the code for dht11 connected at RC0 and the microcontroller is set to work on 20Mhz.Thank you in advance
Hi. We can't write the code and the schematic for you, we can't have time to write codes for every requests we receive.
We can assist you with your own code. Do some research, read the datasheets and start the project yourself, there are plenty of resources online you can refer to.
If yoi struggle with specific features of the project, or the code doesn't compile ot generate errors or doesn't work 100%, then post those problems here on TH-cam or preferably in the forum on our website because there you can even upload your code. Then we can look at it and do our best to assist
But unfortunately we can't write everything for you, that's not what we do, we won't have time for everybody
Hi,
My Proteus is not running the simulation.I have even downloaded your project.
What do you mean it's not running? You must supply more info. Are you getting an error? What are you seing? As you can see from this video, our is working.
It shows Controller recieved data while busy
Is that all as error?
yes,If you could give me your email I could sent you my project
Upload the error screenshot, full zipped MPLAB and Proteus projects in the Forum: www.studentcompanion.co.za/forums/
hello i want to interface pic16f877a with imu i want a help
+Mostafa Eisa what is imu?
inertial measurent unit 3 accelrometer 3gyro
+Mostafa Eisa what errors are you getting?
i want to interface pic16f877a with mpu6050and get pitch roll yaw for conrtoling a uav
and i want to make simulation on proteus
You have enabled the interrupt but didnt call ISR.
Hi. Thanks for your feedback. We didn't use the interrupt in the code, that is why there is no ISR call. We should have switched OFF the ADC INT.
sir can I get the source code for this
You can download the source code from this link: www.studentcompanion.net/en/analog-to-digital-converter-in-pic-microcontroller-xc8/
Website not working
Haii..in my project..i want to count paper using ir sensor and display on lcd..so how to write the program...its very simple but i cnnot do this🤣
Im also using pic18f45k22
What have you done so far?
@@StudentCompanion
i just know how to write an ir sensor program ... and i know how to write a program for display on lcd .... but i don't know how to write a program for it to count and keep show on lcd ..
Unfortunately you will have to formulate a routine to count depending on how those papers will be counted. You are the only one who knows how your system should work. Once you have a logic, then we might contribute where you get stuck. But we can't do the design for you.
Hi,
Hi, how can we help you?