2- Flashing an LED | MPLAB XC8 for Beginners Tutorial

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ต.ค. 2024

ความคิดเห็น • 179

  • @StudentCompanion
    @StudentCompanion  3 ปีที่แล้ว +2

    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.

  • @compthing5656
    @compthing5656 2 ปีที่แล้ว +1

    What i really like about this is how timeless this is. I still can't believe this came out in 2014, was just a dumb kid back then and yet this tutorial is just as applicable in this time as it would have been in the early 2000s. Great work mate, really appreciate content with this quality.

  • @Project737NGX
    @Project737NGX 8 ปีที่แล้ว +8

    This is the best set of tutorials I have found. I really like how simple you make it for the new guys like myself. Also thanks for putting text at bottom as you speak, makes understanding much easier. I can just pause and still see what you said. Thank You very much!

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +3

      thank you for watching our videos. we appreciate your feedback.

  • @keshenanaidu7160
    @keshenanaidu7160 10 ปีที่แล้ว +5

    Great tutorial! Thanks. Keep it.

  • @risinghead5820
    @risinghead5820 6 ปีที่แล้ว +1

    I really like the quick answers.

  • @wilbersalazar2327
    @wilbersalazar2327 8 ปีที่แล้ว +3

    thanks for the video tutorial!

  • @ced_ak
    @ced_ak 9 ปีที่แล้ว +4

    Nicely done....I"ve watched the first 7 tutorial and learned a lot, but I think you should have explain in tutorial 1 all the details about the code as you did in tutorial 2. because I had difficulty to understand the first, until I watched the second.

    • @StudentCompanion
      @StudentCompanion  9 ปีที่แล้ว +3

      +Cedric Akilimali Thank you for your feedback. The reason we didn't explain the code more in tutorial 1, tutorial 1 was just an introductory and to learn how to create a new project using MPLAB XC8. That what we emphasized on, the tutorial could have been very long if we explained other things and people generally don't like long tutorials, it's kind of boring.
      Thnaks.

  • @studentcompanionsastudentc4850
    @studentcompanionsastudentc4850 8 ปีที่แล้ว +5

    We appreciate all your feedback guys. Thanks

  • @StudentCompanion
    @StudentCompanion  7 ปีที่แล้ว +1

    We appreciate all your feedback guys. Keep commenting with your suggestions for future tutorials. Thank you!

  • @yogeshbhoite4402
    @yogeshbhoite4402 9 ปีที่แล้ว +3

    thanks sir very helpful lecture

  • @ngocbaopham8127
    @ngocbaopham8127 9 ปีที่แล้ว +3

    Thank you very much.

  • @AnNguyen-pz7mb
    @AnNguyen-pz7mb 6 ปีที่แล้ว +1

    Thanks sir, This series very useful. But I want to learn ASM, could you make it in next video, please?

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว

      +An Nguyen unfortunately ASM is not part of our plan in the near future. Only C.

  • @TV-ib4lu
    @TV-ib4lu 6 ปีที่แล้ว +1

    Thank you very much) You saved me))
    ©Alpha

  • @ajsatuito
    @ajsatuito 10 ปีที่แล้ว +3

    how can i run JAL (just another language) program to proteus design suit 8.1? great tutorial by the way.

    • @StudentCompanion
      @StudentCompanion  10 ปีที่แล้ว +3

      ako ikaw As long as it can compile and generate an HEX file, then you can load the hex file to simulate your code. Proteus is not limited to MPLAB compilers only. Any compiler that can generate an HEX file, like MikroC pro for PIC, Flowcode, etc.
      Check our first tutorial to learn how to load an HEX file: th-cam.com/video/mUofSucHx_E/w-d-xo.html

  • @ivan868
    @ivan868 8 ปีที่แล้ว +5

    You set 0x76 - what exactly mean this value.
    Not clear about "complimenting" of LATbits - what is the function, how they work?
    And why second LED starting after delay from first LED? How is defined this delay?

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +6

      +try again 0x76 is a value loaded into the OSCCON register to select 8MHz internal oscillator. You can find this information in the datasheet.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +5

      +try again if you studied binary arithmetic, complimenting is basically to invert the value of a binary number. A compliment of 1 is 0 and of 0 is 1. To blink an LED this function can be used. If the value of LAT register was 1 (LED ON) it will be inverted to 0 (switch OFF the LED) and so on.

  • @SoftEngineeringSolutions
    @SoftEngineeringSolutions 9 ปีที่แล้ว +5

    Very Nice hank you

  • @ybpvin
    @ybpvin 9 ปีที่แล้ว +3

    Hi!
    In my example, the LEDs must light up in the place, but for some reason only one lit?
    M1:
    __delay_ms(100);
    RB1=1;
    PORTBbits.RB2=1;
    PORTBbits.RB3=1;
    __delay_ms(100);
    PORTBbits.RB1=0;
    PORTBbits.RB2=0;
    PORTBbits.RB3=0;
    goto M1;

    • @StudentCompanion
      @StudentCompanion  9 ปีที่แล้ว +2

      Flay Sorry we really can't understand your question. If you could try to elaborate more, we could see how to assist.
      Thanks.

    • @ybpvin
      @ybpvin 9 ปีที่แล้ว +3

      StudentCompanionSA I apologize! I translate the text the translator!
      In my program light-emitting diodes have to be lit in a place but why only one is lit?

    • @StudentCompanion
      @StudentCompanion  9 ปีที่แล้ว +3

      Flay It's difficult to tell from only that piece of code. can you write the full code?

  • @vaideshshankar9899
    @vaideshshankar9899 6 ปีที่แล้ว +1

    superb tuts....👌

  • @victorivanov9508
    @victorivanov9508 4 ปีที่แล้ว +1

    I have two questions: 1. On the diagram in Proteus there is an external generator, but in the program you use the OSCCON register for the internal generator. Why? 2. Where did you get the value 0x76? I didn't find this value in the table 3-1"Power Managed Mode" on page 29 for the OSCCON register?

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว +1

      Hi, thanks for your comment.
      1. This is an error on our part, we showed the external oscillator circuit just for explanation but we referred to tutorial 1 for configuration bits (header file), in tutorial 1, we used the internal oscillator, so just ignore the external oscillator circuit in this video.
      2. For OSCCON value of 0x76, refer to REGISTER 2-2: OSCCON REGISTER section in the datasheet on page 26.
      0x76 configure to use 8MHz internal oscillator, see the individual bits we enabled, 0x76 equals to 0b1110110 in binary.

    • @victorivanov9508
      @victorivanov9508 4 ปีที่แล้ว +1

      @@StudentCompanion Thank you very much. I got a very quick response. I'm happy.

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว +1

      You are welcome!

  • @solomonkojah2378
    @solomonkojah2378 8 ปีที่แล้ว +4

    hi, kindly help me make a code to make an led chaser. say three leds blinking in sequence . im using pic18f4550.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +5

      +Solomon Kojah here is an example of an led chaser:
      www.studentcompanion.net/en/connecting-light-emitting-diodes-led-to-a-pic-microcontroller-xc8/

  • @alekys07
    @alekys07 9 ปีที่แล้ว +3

    Obrigado pelo tutorial, tem me dado um caminho com o MPLAB XC, eu uso o PIC C compiler e estou tendo algumas dificuldades.

    • @StudentCompanion
      @StudentCompanion  9 ปีที่แล้ว +3

      Alexandro Chagas Thank you. We hope you will enjoy learning with MPLAB XC8.

  • @sobtzakengineeringtechnolo5767
    @sobtzakengineeringtechnolo5767 ปีที่แล้ว

    Hello. Your videos have been a great help! Got a question. I see you changed PICs throughout your series. I jus realized this. I was having trouble with memory limits on the PIC18F2220. I see you go to other PIC18F chips. Do you by chance have a recommendation on what chip is the newest or should I focus on with your tutorials? I appreciate any feedback!

  • @michaeligbojekwe6209
    @michaeligbojekwe6209 8 ปีที่แล้ว +4

    thanks a lot

  • @congha5338
    @congha5338 3 ปีที่แล้ว

    Hello mate. Is there any different between for ( int countDelay=0; countDelay

  • @rolandoaguilera3114
    @rolandoaguilera3114 7 ปีที่แล้ว +1

    What are the advantages or disadvantages of choosing an specific internal crystal frequency? Why did you choose 8MHZ?

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +2

      There are many considerations.
      The internal oscillator circuit is used to generate the device clock. The device clock is required for the device to execute instructions and for the peripherals to function. Every microcontroller needs a clock source. They govern the speed at which the processor executes instructions, the baud rate of serial-communication signals, the amount of time needed to perform an analog-to-digital conversion, type of application, battery powered, physical conditions and much more. So you have to carefully choose the best frequency available depending on your application.
      Usually the choice will depend on Power requirements and operating frequency.
      The lower the frequency the lower the power consumption which is very good for battery powered applications, the higher the frequency, the higher the power consumption.
      If your application does not require high speed in executing its instructions or does not have peripherals which require high speed such as high baud rate of serial-communication, USB, Ethernet, high speed conversion of ADC for example, a low speed can be the choice otherwise you might need high speed. For your information you'll need 48MHz (direct or through PLL) for full speed USB communication. The same goes for other peripherals.
      For high accuracy and stability you better consider an external crystal oscillator.

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +2

      You can read more from these Microchip documents:
      ww1.microchip.com/downloads/en/AppNotes/00849a.pdf and ww1.microchip.com/downloads/en/appnotes/00949a.pdf

  • @payravnusratov9021
    @payravnusratov9021 10 ปีที่แล้ว +3

    Hi. What is the programm allows to build different srtucture? I have builded my project but I can not to watch the result. How can I build my own structure? Can someone tells me?

    • @StudentCompanion
      @StudentCompanion  10 ปีที่แล้ว +2

      Hi Payrav Nusratov What do you mean by own structure? can you please be specific about your question because it's not clear. Do you mean Simulation?

    • @payravnusratov9021
      @payravnusratov9021 9 ปีที่แล้ว +3

      Hi, I mean how to watch the Simulation result? You debuged the c-code then built the structure of the circuit. Can you show any control circuit using dspic microcontroller? I do not use pic but I use dspic30f4011.

    • @StudentCompanion
      @StudentCompanion  9 ปีที่แล้ว +3

      Hi Payrav Nusratov​ if you are using Proteus software for simulation, there's no difference between the PIC or Dspic. The procedure is the same. Watch our videos to see how we simulated.

  • @GerardoR8
    @GerardoR8 7 ปีที่แล้ว +1

    U cant damage a LED in Proteus XD. Great tutorial.

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      If you mean the Proteus simulated LED then you are correct. You can't damage it even if you apply higher current or voltage.
      Thank you for watching our videos.

  • @michaelstoltzfus8014
    @michaelstoltzfus8014 7 ปีที่แล้ว +1

    Very educational and helpful. I am working with an older chip, a PIC16F716 and am getting an error: "undefined identifier "LATbits" " when I try to assign LAT4= 1. I am quite new at programming. Can you help?

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      +Michael Stoltzfus PIC16F series like your PIC16F716 don't have the LAT register, only PIC18F series and higher.
      You must use the PORT register to read and to write to outputs

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      +Michael Stoltzfus and the other thing, you cannot just say LAT4 = 4. LAT of what? You must specify the PORT like PORTB, PORTC etc.
      For your case you can write for example:
      PORTB = 4; // or
      PORTBbits.RB4=1; // for example to output a logic 1 to bit 4 of PORTB

    • @michaelstoltzfus8014
      @michaelstoltzfus8014 7 ปีที่แล้ว +1

      IT WORKS!!!! Thank you so much! =)

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      Michael Stoltzfus you are welcome!

  • @onemorescene_vid
    @onemorescene_vid 7 ปีที่แล้ว +1

    Best tutorial ever watched, but please, what if i want it to blink like a cylon making the light bouncing back
    and forth with 7 LEDs/ 7pins??

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      +Temitayo Abel Aaaahh! Why add a but....after such a great compliment...?

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      +Temitayo Abel you can make it blink the way you want. Can you explain more what you mean by light bouncing back? What is the rhythm/patterns of your blinking?

    • @onemorescene_vid
      @onemorescene_vid 7 ปีที่แล้ว +1

      like, make it blink.
      10000000
      01000000
      00100000
      00010000
      00001000
      00000100
      00000010
      00000001
      then go back again.. how do i code this to the port?

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      +Temitayo Abel you can send those values exactly as they are to the Port. line by line.: for example:
      LATB= 0b10000000;
      LATB =0b01000000;
      ....
      LATB =0b00000001

    • @onemorescene_vid
      @onemorescene_vid 7 ปีที่แล้ว +1

      Will try that.. Thanks.

  • @hakanozturk7442
    @hakanozturk7442 5 ปีที่แล้ว +1

    Does delay command take longer time than it that is written to source code?

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Your question is not clear. What do you mean? If you write a delay of 1 second, it should take 1 second to be executed. If it takes longer or shorter than there is something wrong in your code

    • @hakanozturk7442
      @hakanozturk7442 5 ปีที่แล้ว +1

      @@StudentCompanionSeems like the code that you write takes longer than 1 second in your proteus simulation. I havent written code yet.

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Did you look at the simulation execution time? When you run simulation at the bottom bar there is an execution time. Compare that clock with the code, not your PC clock as simulation speed can be effected by many parameters including your computer speed among others.

  • @mathewhabyarimana
    @mathewhabyarimana 5 ปีที่แล้ว

    I am sending the code to a microcontroller PIC18F45K22 mounted on Curiosity/starter kits (PKOB4)
    It is a pre-built project, I have hex code.
    when I send the code via usb the LED is not blinking not even coming on.
    I am using MPLAB X IDE v5.20
    What can be the reason?
    (I don't know if I have explained my question properly)
    Thanks

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Are you able to transfer without errors the hex file to your PIC?
      What are the build log of your code in Flowcode?

    • @mathewhabyarimana
      @mathewhabyarimana 5 ปีที่แล้ว

      @@StudentCompanion
      1. THis is the message I am getting as configuration error but I don't know how to sort it out
      error: Configuration "C32_PIC32MX795F512L" builds with "C32", but no toolchains of that type are installed.
      Errors have occurred while loading one or more configurations.
      If a specific error is not shown above, this may happen when you import a project from another computer.
      + You can add language tools in Tools->Options embedded tab.
      + You can change which language tool to use in the project properties dialog.
      2. the build log of code in Flowcode ( I am not sure about this) I have just compiled the hex code and it was showing success at the end.

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว

      It looks like you selected a wrong pic or compiler

  • @zahidfaheem3233
    @zahidfaheem3233 6 ปีที่แล้ว +1

    This is a great tutorial and thank you for the awesome videos. I have a question though. What is the difference between LATBbits.RB0 and LATBbits.LATB0?

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +2

      Hi. Thanks for watching our videos and for your feedback.
      When writing to a PORT like setting it High or Low, use the LAT register. It should be written like this: LATBbits.LATB0
      And when you are reading from a PORT, then you must use a PORT register. It should be written like this: PORTBbits.RB0
      So for LAT use .LATB0 and for PORT use RB0

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      You can also use MPLAB Code Configurator to generate code functions and configuration for you and it's easy to use. Watch this video: th-cam.com/video/JxSSVtTj_fA/w-d-xo.html

  • @SuperMrLello
    @SuperMrLello 4 ปีที่แล้ว +1

    Thank you for this tutorial, One question, where i can download the software that you use for simulate the circuit with PIC and LED?

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว +1

      Hi, you can download a free demo version from their website. For professional version, you will need to buy a license: www.labcenter.com/

  • @chengL10
    @chengL10 5 ปีที่แล้ว +1

    my pic16f87a doesn't have LAT register.

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Yes. It's an old PIC it does not have LAT register. Use the PORT register for both reading and writing.

  • @s10maniac80
    @s10maniac80 6 ปีที่แล้ว +1

    Dear Sir,
    Thank you very much for you tutorial.
    However Where can I download code for all xc8 tutorial ?.
    It look like the link to download page was dead.

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      Hi. Thanks for watching our videos and for your feedback. You can download the code for all our tutorials from our website:
      www.studentcompanion.co.za/category/tutorials/mplab-xc8/

  • @shahzadbhai63
    @shahzadbhai63 8 ปีที่แล้ว +5

    first of all very nice tutorial. And i like the teaching way of yours.
    bro i need all the the commands list like the some u showed (@4:37), like _delay_ms, TRISB, LAT etc etc.
    bro i want all this command , please share a link or whatever u have.
    once again thanks alot for this nice tutorials.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +3

      +Shahzad Bhai Hi, thanks for watching our tutorials. Each command depends on what we are trying to achieve in our examples. It will be difficult to tell you all the commands, you can read the datasheet of your PIC or watch more of our videos, or you can visit our website to learn more.

    • @shahzadbhai63
      @shahzadbhai63 8 ปีที่แล้ว +3

      +StudentCompanionSA
      Thanks for reply,
      now i understand every single step except the "OSCCON=0x76"
      how to find OSCCON value, i have seen pic18f2220 data sheet but i cant find its value.
      what is the purpose of this command?
      and what is the value of OSCCON on other pic's.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +3

      +Shahzad Bhai the OSCCON register is used to set the frequency when you are using the internal oscillator of the PIC. in our example we set it to use 8MHz internal oscillator.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +3

      +Shahzad Bhai check the PIC18F2220 datasheet on page 26 to learn more. convert this hex number to binary and you'll see the bits we enabled.

    • @StudentCompanion
      @StudentCompanion  8 ปีที่แล้ว +3

      +Shahzad Bhai if you still have more questions don't hesitate. it's just a comment away. ...

  • @LeonardCotrimFreundl
    @LeonardCotrimFreundl 10 หลายเดือนก่อน

    Where can I find the text u used in the Video?

  • @yeshecan7
    @yeshecan7 7 ปีที่แล้ว +1

    wonderful way of teaching for bignner like me......can you do a clip for jow to programm PIC18F2423? Please

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว

      +Tefera Ergoye what is for jow? I presume you meant to show. As we have said earlier on, you can program this chip exactly the same way as the chips in our tutorials.

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +2

      +Tefera Ergoye Thank you for watching our videos and we appreciate all your feedback and suggestions.

  • @pritikumari2626
    @pritikumari2626 6 ปีที่แล้ว +1

    my delay function is not working .I am getting the error "function without prototype"

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      Yous must post your full code and full error messages then we could be able to figure out what could be wrong.

  • @paulescobar8170
    @paulescobar8170 5 ปีที่แล้ว +1

    Hello! I was watching this series of videos and I found them really useful and clear! But unfortunately I couldn´t find your tutorials sequence chapter by chapter. Are those gone videos gonna be published again in a near future or are they gonna be missing forever? I have to know, please :c

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Hi. Thanks for watching our videos and for your feedback. Yes we will publish them again in the near future. Just subscribe to our TH-cam channel and you'll be notified when we upload new tutorials.

  • @maketheworldgreatagaindiew9233
    @maketheworldgreatagaindiew9233 7 ปีที่แล้ว +1

    hello! in what programming language do you program? C or C++?

  • @abdelkrimbelhaj5044
    @abdelkrimbelhaj5044 6 ปีที่แล้ว +1

    Hi this is greet thank you I have a question: how to use a multiple logical or gate?
    the pic 16f84a have 2 ports I want to use RA0 as output and the reset as input so any one (input) will activate the output(or gate)
    Thank

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      HI. We don't understand your question, what do you mean by logical or gate? Which pin you want as input?

    • @abdelkrimbelhaj5044
      @abdelkrimbelhaj5044 6 ปีที่แล้ว +1

      Hi Thank you all pins as input except the pin RA0 witch is the output

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      TRISB= 0xFF; //all PORTB pins as input
      TRISA= 0x1E; // All PORTA pins as input except RA0 as output

    • @abdelkrimbelhaj5044
      @abdelkrimbelhaj5044 6 ปีที่แล้ว +1

      Thank you i want the output to be activated when any one of the input is activated like the
      or gate (TTL 7432)

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      Please watch the rest of the videos and try to understand and learn. You are asking basic questions that are already covered in the videos. We can't answer to each and everyone line of your code when you are not doing any effort to learn.

  • @ignasmixer
    @ignasmixer 7 ปีที่แล้ว +1

    How to program that MCLR would reset PIC?

    • @StudentCompanion
      @StudentCompanion  7 ปีที่แล้ว +1

      1. Connect a push button to the MCLR pin using a pull-up resistor as in the circuit diagram in this tutorial: th-cam.com/video/mUofSucHx_E/w-d-xo.html Watch from 6:11
      2. Activate the MCLR function in the configuration bits as in this video: th-cam.com/video/mUofSucHx_E/w-d-xo.html watch from 9:51

  • @hichamredoine1817
    @hichamredoine1817 4 ปีที่แล้ว

    Hello when I majke the simulation in ISIS the message display (pic is not supported the program

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว

      Hi. Which PIC did you selected in MPLAB X IDE project? And which PIC did you use in Proteus simulation?

    • @hichamredoine1817
      @hichamredoine1817 4 ปีที่แล้ว

      @@StudentCompanion i select 16f84A in isis and in mplabx

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว

      @@hichamredoine1817 can you post the full error message you received not just a simplified version of the message. Did you use your generated Hex file from your project using poc16f84?

    • @hichamredoine1817
      @hichamredoine1817 4 ปีที่แล้ว

      @@StudentCompanionPic16 program filetype'X'
      Is not supported

    • @StudentCompanion
      @StudentCompanion  4 ปีที่แล้ว

      Post your mplab and proteus projects in our forum we will look at it: www.studentcompanion.co.za/forums

  • @risinghead5820
    @risinghead5820 6 ปีที่แล้ว +1

    Why we used the for loop with the delay_ms

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      In the earlier versions of XC8 compiler when we recorded that video, the delay function did not allow the use of a large number like 1000 for 1000ms. It generated errors. So we had to use a short delay and loop it several times to achieve the desired delay.
      But this has been fixed in the latest compiler version. You now don't need to use the loop.

    • @risinghead5820
      @risinghead5820 6 ปีที่แล้ว +1

      Got it. Thank you.
      Example , plz.

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      What example?

  • @DECIOALBUQUERQUE1
    @DECIOALBUQUERQUE1 6 ปีที่แล้ว +1

    what country is you?

  • @DECIOALBUQUERQUE1
    @DECIOALBUQUERQUE1 6 ปีที่แล้ว +1

    boa noite, vc faz programas por encomenda?

    • @DECIOALBUQUERQUE1
      @DECIOALBUQUERQUE1 6 ปีที่แล้ว +1

      ??

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      Good evening. Yes we do do.
      You can send us your specifications then we will send you a quotation .

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      What do you mean by ??

  • @miracleobiano1825
    @miracleobiano1825 5 ปีที่แล้ว +1

    Well understood but I want it to blink 3 times and it didn't work;
    Am using pic16f877a and this is the code
    #include
    #include
    #include
    #define _XTAL_FREQ 8000000
    /*
    *
    */
    int main(void) {
    TRISB=0x00;
    PORTB=0x00;
    int i=0;
    int n=1;
    while(n

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Hi. Why use int main()?
      In your code you are not looping 3 times that's why it's not working.

    • @miracleobiano1825
      @miracleobiano1825 5 ปีที่แล้ว +1

      Student Companion what's the problem?

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Try something like this:
      for (int i 0; i

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      You are incrementing the wrong counter

    • @miracleobiano1825
      @miracleobiano1825 5 ปีที่แล้ว +1

      Same issue, it's not working

  • @helloJobtech
    @helloJobtech 5 ปีที่แล้ว +1

    hi bro , thank you for your tutorial , can you give me MPLAB documentation

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Hi. Thanks for watching our videos and for your. What kind of documentation you are looking for? In your MPLAB and XC8 compiler installation folder there are documents.

    • @helloJobtech
      @helloJobtech 5 ปีที่แล้ว +1

      @@StudentCompanion i want to know about documentation which will explain statement in programming

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      You can read the datasheet of your PIC.

    • @helloJobtech
      @helloJobtech 5 ปีที่แล้ว

      @@StudentCompanion can you replay on facebook for me bro

    • @StudentCompanion
      @StudentCompanion  5 ปีที่แล้ว +1

      Please ask your questions here on TH-cam or in the Forum on our website. There you can also upload images or project files. We don't provide support in private messages on Facebook or emails

  • @DECIOALBUQUERQUE1
    @DECIOALBUQUERQUE1 6 ปีที่แล้ว +1

    do you use skype?

    • @StudentCompanion
      @StudentCompanion  6 ปีที่แล้ว +1

      Send us a message or call on WhatsApp: +27145945051

  • @admindsytes
    @admindsytes ปีที่แล้ว

    th-cam.com/video/SafkRe9MUkk/w-d-xo.html you say 10 amps, i think is 0.010A, if I'm not mistaking

  • @DECIOALBUQUERQUE1
    @DECIOALBUQUERQUE1 6 ปีที่แล้ว +1

    what country is you?